
 //----------------------------------------------------------------!-->
 //-- This JavaScript-code is Copyright protected by Vedran A. 1999
 //-- You may not use it before asking me forst. Thanks!
 //----------------------------------------------------------------!-->

var base_url = "http://www.wedran.com/games/";
var ad_url = "";


//----------> prev1(form) is used by dropDown List & top10DropDownList

function prev1(form){
  var index=form.Lst.selectedIndex;
  var link1=form.Lst.options[index].value;
  var link='JavaScript: prev(' + link1 + ',' + form.Lst.options[index].value + ');';
  if(link1 != '-'){open(link, "_self");}
  else {form.Lst.selectedIndex = 0;}
}

//----------> shows description and preview image

function prev(nr,rng){
  document.frm2.comments.value=nam[nr] + " >> " + txt[nr];
  document.frm1.copyright.value=cop[nr];
  document.frm1.link.value=lnk[nr];
  document.img.src="images/" + nr +".gif";
  sel = nr;
  Rang2b();
  Rang3();
}


//----------> lists top10 for faster access

function top10(n1,n2,n3,n4,n5,n6,n7,n8,n9,n10){

 var n = new Array();
 n[1]=n1; n[2]=n2; n[3]=n3; n[4]=n4; n[5]=n5;
 n[6]=n6; n[7]=n7; n[8]=n8; n[9]=n9; n[10]=n10;

 document.write("<font class=list-small>");

 for (var i = 1; i <= 10; i++) {
  document.write("<A href=JavaScript:prev(" + n[i] + "," + rng[n[i]] + ")>");
  document.write(" ");
  document.write(" ");
  document.write(i + ". " + "</A>"); //----(i + ". " + nam[n[i]] + "</A>");
  document.write("<br>");
 }
 document.write("</font>");
}


//----------> list all games like in top10

function top5(n1,n2,n3,n4,n5) {

 var n = new Array();
 n[1]=n1; n[2]=n2; n[3]=n3; n[4]=n4; n[5]=n5;

 document.write("<TABLE width=350>");
 for (var i = 1; i <= 5; i++) {
  document.write("<TR><TD><A STYLE='font-size:14pt;' href='JavaScript:GoPlay(" + n[i] + ");'><B> ");
  document.write(nam[n[i]] + "</B></A></TD><TD align=right> Score: " + rng[n[i]] + "/5 - ");
  document.write("<IMG align=top src=images/s" + rng[n[i]] + "_2.gif border=0 align=absmiddle width=15 height=15 alt=''>");
  document.write("</TD><TR><TD valign=top><A href='JavaScript:GoPlay(" + n[i] + ");'><IMG SRC='images/" + n[i] + ".gif' WIDTH=70 HEIGHT=70 VSPACE=1 HSPACE=4 BORDER=0 ALT'Play Now!'></A></TD><TD>");
  document.write(txt[i] + "<BR><BR>by: <A HREF='" + lnk[n[i]] + "' TARGET=_new>" + cop[n[i]] + "</A></TD></TR>");
  document.write("<TR><TD colspan=2><HR STYLE='height:1px; color:silver;'></TD></TR>");
 }
 document.write("</TABLE>");
}


//----------> list all games like in top10

function listAll(){

 document.write("<TABLE width=100%>");
 for (var i = 1; i <= max; i++) {
  document.write("<TR><TD><A STYLE='font-size:14pt;' href='JavaScript:GoPlay(" + i + ");'><B> ");
  document.write(nam[i] + "</B></A></TD><TD align=right> Score: " + rng[i] + "/5 - ");
  document.write("<IMG align=top src=images/s" + rng[i] + "_2.gif border=0 align=absmiddle width=15 height=15 alt=''>");
  document.write("</TD><TR><TD valign=top><A href='JavaScript:GoPlay(" + i + ");'><IMG SRC='images/" + i + ".gif' WIDTH=70 HEIGHT=70 VSPACE=1 HSPACE=4 BORDER=0 ALT'Play Now!'></A></TD><TD>");
  document.write(txt[i] + "<BR><BR>by: <A HREF='" + lnk[i] + "' TARGET=_new>" + cop[i] + "</A></TD></TR>");
  document.write("<TR><TD colspan=2><HR STYLE='height:1px; color:silver;'></TD></TR>");
 }
 document.write("</TABLE>");
}

//----------> writes a dropDown list with all games

function dropDown(){
 document.write("<form NAME=frm_games>");
 document.write("<select class=list-small NAME=Lst SIZE=1 onChange=prev1(this.form)>");
 document.write("<option value=->ALL GAMES A-Z</option>");
 document.write("<option value=->=============</option>");

 for (var i = 1; i <= max; i++) { 
  document.write("<option value=" + i + ">" + i + ". " + nam[i] + "</option>");
 }

 document.write("</select></form>");
}

//----------> a DropDown list with 10 best games

function top10dropDown(n1,n2,n3,n4,n5,n6,n7,n8,n9,n10){

 var n = new Array();
 n[1]=n1; n[2]=n2; n[3]=n3; n[4]=n4; n[5]=n5;
 n[6]=n6; n[7]=n7; n[8]=n8; n[9]=n9; n[10]=n10;

 document.write("<form NAME=frm_top10>");
 document.write("<select class=list-small NAME=Lst SIZE=1 onChange=prev1(this.form)>");
 document.write("<option value=->TOP 10 GAMES</option>");
 document.write("<option value=->=============</option>");

 for (var i = 1; i <= 10; i++) {
  document.write("<option value=" + n[i] + ">" + i + ". " + nam[n[i]] + "</option>");
 }

 document.write("</select></form>");
}


//----------> selGame(nr); Selects a game, used by imagemap

function selGame(nr){
 if (nr != 0 & nr != max) {
  prev(nr, rng[nr]);
 }
}


//----------> GoPlay() opens the selected game in a new window

function GoPlay(what){

 var link;
 if (!what) { link = nam[sel]; } else { link = nam[what]; sel=what;}
 link = base_url + link + '/index.html';

 var w = hor[sel];
 var h = ver[sel];

 window.open(link, "GoPlay", 'width=' + h + ',height=' + w + ', toolbar=no,location=no,directories=no,status=yes,menubar=no,scrollbars=yes,resizable=yes,copyhistory=no');
}

//----------> various other small functions


function Rang(){
 for (var i = 1; i <= 5; i++) { 
  document.write("<IMG src=images/s3_1.gif name=sml" + i + " width=" + (15+i*4) + " height=" + (15+i*4) + "> ");
 }
 }
 function Rang2b(){
  var sml2 = new Array();   sml2[1] = document.sml1;
  sml2[2] = document.sml2;  sml2[3] = document.sml3;
  sml2[4] = document.sml4;  sml2[5] = document.sml5;

  for (var i = 1; i <= 5; i++) { sml2[i].src = "images/empty.gif"; }
  for (var i = 1; i <= rng[sel]; i++) { sml2[i].src = "images/s" + i + "_1.gif"; }
 }

