
function buildArray(lgt) {// opret et array med lgt elementer
    for (var i=1; i<=lgt; i++) this[i]=0;
    this.length = lgt;
    return this;
};

function buildTnPic(thumbNail,fullPic) { // build objekt
    this.tn=thumbNail;
    this.pic=fullPic;
    this.length=2;
    return this;
};

img = new buildArray(10);  // create an arrray
                           // initialize the array
    img[1]= new buildTnPic('images/fishing-pics/10-120.jpg','images/fishing-pics/10-523.jpg');
    img[2]= new buildTnPic('images/fishing-pics/2-120.jpg','images/fishing-pics/2-523.jpg');
    img[3]= new buildTnPic('images/fishing-pics/3-120.jpg','images/fishing-pics/3-523.jpg');
    img[4]= new buildTnPic('images/fishing-pics/4-120.jpg','images/fishing-pics/4-523.jpg');
    img[5]= new buildTnPic('images/fishing-pics/5-120.jpg','images/fishing-pics/5-523.jpg');
    img[6]= new buildTnPic('images/fishing-pics/6-120.jpg','images/fishing-pics/6-523.jpg');
    img[7]= new buildTnPic('images/fishing-pics/7-120.jpg','images/fishing-pics/7-523.jpg');
    img[8]= new buildTnPic('images/fishing-pics/8-120.jpg','images/fishing-pics/8-523.jpg');
    img[9]= new buildTnPic('images/fishing-pics/9-120.jpg','images/fishing-pics/9-523.jpg');

picWidth  = 523;   // size of large picture
picHeight = 347;

tnWidth  = 120; 	// size of thumbnails
tnHeight =  80;	

trStart = "<tr>"; // tags for table rows
trStop = "</tr>";

function thTnField(i) {
  return "<th><a href='javascript:setpic("
       + i 
       + ")'><img src='"
       + img[i].tn
       + "' width="
       + tnWidth
       + " height="
       + tnHeight
       + " border=1></a></th>"
};

function thPicField() {
  return "<th colspan='4' rowspan='4'><img src='images/fishing-pics/1-523.jpg'"
       + " width="
       + picWidth
       + " height="
       + picHeight
       + " name='wpic'></th>"
}; 

function buildTable() {
  with (self.document) {	// now we build the table.
	  write(trStart);
  	for (var i=1; i<=5; i++) write(thTnField(i));
	  write(trStop+trStart);
  	i=6;
	  write(thTnField(i)+thPicField());
    write(trStop);
    for (i=7; i<=9; i++) {
	    write( trStart
	         + thTnField(i)
           + trStop );
	  }
  }
}
browserOk = false;
if ( (parseInt(navigator.appVersion)>=4 )
  || ( navigator.appName == "Netscape"  ) )
  browserOk = true;

function setpic(n) { // udskift det store billede
    if ( browserOk )    eval("self.document.images.wpic.src= img[n].pic")
    else
        alert ("Sorry IE3 cannot show pictures here")
}

function swapImages () {   this.rude = new Image(15,15)
   this.rude.src = "images/spacer.gif"
   this.smil = new Image(15,15)
   this.smil.src = "images/spacer.gif"
   this.blink = new Image(15,15)
   this.blink.src = "images/spacer.gif"
   this.cool = new Image(15,15)
   this.cool.src = "images/spacer.gif"
   return this;
   return this;
}
A1515 = 0;
if (browserOk)
  A1515 = new swapImages;

function showGif(navn, id) {
  if (browserOk)
    eval( "document.images." +navn +".src = A1515."+id+".src");
  return true;
}
function showRude(navn) {
  if (browserOk)
    eval( "document.images." +navn +".src = A1515.rude.src" );
  return true;
}

