/* -------------- enlarge images script -------------- modified 20 June 2007 ------------ */

var previousImage=false, loadTimer=null, loadTxt=false; // global
// -- process click on image ----
 function clk(obj)
  {  if(loadTimer){ clearTimeout(loadTimer) }        // stops load text timer
     var ind=parseInt(obj.name);              // get P[] array index
//   determine image src
     var srcOut=obj.src.replace("sml","lg");
// write large image and caption
      document.getElementById("txtPix").innerHTML='<img border="0" onload="txtOff()" src="'+srcOut+'">\n';
// change border colour in selection box
     if(previousImage!=false) { previousImage.style.border="1px solid #000"  }
      obj.style.border="1px solid #0F0";
      previousImage=obj; 
// set loader timeout
   loadTimer=setTimeout("strobeTxt()",1000);     
   return false;
  }
// -------------
// displays loading text bar
 function strobeTxt()
  {  var showit;
     if( loadTxt==false)
       { showIt="visible";loadTxt=true }
     else
       {  showIt="hidden";loadTxt=false }
//
    document.getElementById("loader").style.visibility=showIt;
    loadTimer=setTimeout("strobeTxt()",1000);       
  }
// ------------------
// turns loader text off
  function txtOff()
    { clearTimeout(loadTimer);
      document.getElementById("loader").style.visibility="hidden";
      loadTimer=null;
      loadTxt=false;
    }
// ------------------     