/*--- Functions used for stepping through images ---*/
var idx=0;
var imgNameBig="imgBig";
var widthBig=0;
var heightBig=0;
function drawImage(pics) {
 idx=0;
 widthBig=eval('pic' + eval(idx+1) + '.width');
 heightBig=eval('pic' + eval(idx+1) + '.height');
 if (document.images) {
  document.write("<img src='"+pics[idx].src+"' border='0' width='"+widthBig+"' height='"+heightBig+"' name='imgBig' />\n");
  document.write("<b><p id='imgtxt'>"+pics[idx].alt+"</p></b>");
 }
 keeptrack();
}
function nextImage() {
 idx += 1;
 if (idx>pics.length-1) {
  idx=0;
 }
 widthBig=eval('pic' + eval(idx+1) + '.width');
 heightBig=eval('pic' + eval(idx+1) + '.height');
 document[imgNameBig].width=widthBig;
 document[imgNameBig].height=heightBig;
 document[imgNameBig].src=pics[idx].src;
 document.getElementById('imgtxt').firstChild.nodeValue=pics[idx].alt;
 keeptrack();
}
function prevImage() {
 idx -= 1;
 if (idx<0) {
  idx=pics.length-1;
 }
 widthBig=eval('pic' + eval(idx+1) + '.width');
 heightBig=eval('pic' + eval(idx+1) + '.height');
 document[imgNameBig].width=widthBig;
 document[imgNameBig].height=heightBig;
 document[imgNameBig].src=pics[idx].src;
 document.getElementById('imgtxt').firstChild.nodeValue=pics[idx].alt;
 keeptrack();
}
function keeptrack() {
 window.status="Bilde "+(idx+1)+" av "+pics.length;
}
/*--- Functions used for hiding/showing content ---*/
function toggle ( targetId ) {
 if (document.getElementById) {
  target = document.getElementById( targetId );
  if (target.style.display == "none") {
   target.style.display = "block";
  }
  else {
   target.style.display = "none";
  }
 }
}

