var MARKENSTORE = 0;
var FIGURE_CATALOGUE = 1;
var GERMAN_CASH4CLICKS = 2;
var PURETEC = 3;
var FIGUREN_JOURNAL = 4;

function show () {
  if (document.location.hostname == "www.toy-soldier-gallery.com") {
    var temp = Math.random () * 10;
    if (temp < 0) {
      showType (FIGURE_CATALOGUE);
    }
    else if (temp < 2) {
      showType (GERMAN_CASH4CLICKS);
    }
    else if (temp < 8) {
      showType (MARKENSTORE);
    }
    else if (temp < 10) {
      showType (FIGUREN_JOURNAL);
    }
    else {     // does not happen
      showType (PURETEC);
    }
  }
  else if (document.location.hostname == "localhost") {
    showType (FIGURE_CATALOGUE);
  }
  else {
    showType (FIGURE_CATALOGUE);
  }
}

function showType (type) {
  if (type == MARKENSTORE) {
    document.writeln ("<a href='http://www.markenstore.de/cgi-bin/ClickCount.pl?id=tsg' target='_top'>");
    document.writeln ("  <img src='/Images/Markenstore.gif' "); 
    document.writeln ("       alt='Markenstore' ");
    document.writeln ("       border='0' height='60' width='468'>");
    document.writeln ("</a>");
  }
  if (type == FIGURE_CATALOGUE) {
    document.writeln ("<a href='/Catalogues/CollectorGuides.html' target='_top'>");
    document.writeln ("  <img src='/Catalogues/CatalogueAd.gif' "); 
    document.writeln ("       alt='Collector Guide' ");
    document.writeln ("       border='0' height='60' width='468'>");
    document.writeln ("</a>");
  }
  if (type == GERMAN_CASH4CLICKS) {    // Beginn www.germancash4click.de Code
    document.writeln ("<table BORDER='0' CELLPADDING='0' CELLSPACING='0'> ");
    document.writeln ("  <TR><TDVALIGN=TOP> ");
    document.writeln ("    <A HREF='http://www.germancash4click.de/cgi-bin/germantop100.pl?sponsor=toysoldier' TARGET='_TOP'> ");
    document.writeln ("      <IMG SRC='http://www.germancash4click.de/cgi-bin/germantop100.pl?banner=toysoldier' ");
    document.writeln ("           BORDER='0' WIDTH='468' HEIGHT='60'>");
    document.writeln ("    </A> ");
    document.writeln ("  </td></TR> ");
    document.writeln ("  <TR><TD> ");
    document.writeln ("    <A HREF='http://www.germancash4click.de' TARGET='_TOP'> ");
    document.writeln ("      <IMG SRC='http://www.germancash4click.de/images/subbanner.gif' BORDER='0' WIDTH='468' HEIGHT='15'> ");
    document.writeln ("    </A> ");
    document.writeln ("  </td></TR> ");
    document.writeln ("</TABLE>");
  }
  if (type == PURETEC) {               // Puretec Code
    document.writeln ("<a href='http://www.puretec.de/kwk/index.php3?kdnr=2616041&g=0' target='_blank'> ");
    document.writeln ("  <img src='http://banner.puretec.de/banner/banner.php3?g=0' width='468' height='60'> ");
    document.writeln ("</a> ");
  }
  if (type == FIGUREN_JOURNAL) {
    document.writeln ("<a href='http://www.figuren-journal.com' target='_top'>");
    document.writeln ("  <img src='/WebLinks/FigurenJournal.gif' "); 
    document.writeln ("       alt='Figuren Journal' ");
    document.writeln ("       border='0' height='60' width='468'>");
    document.writeln ("</a>");
  }
}

function Advert () {
}

var advert = new Advert;

advert.show = show;