
// ------------------------------------
// process click of thumbnails
// ------------------------------------
function thumbClick(e)
{
   var sel = Math.floor((e.clientX - 190) / 63);
   loadArt(sel);

   return sel;
}

// ------------------------------------
// load the specified image and corresponding imagemap
// into the "art" element
// ------------------------------------
function loadArt(sel)
{

   if (sel >= 0 && sel < artImages.length)
   {
      currentIndex=sel;
      artid=document.getElementById("art");
      artid.src=artImages[sel];
      if (typeof(artMaps) != 'undefined' && sel < artMaps.length)
         artid.useMap=artMaps[sel];
   }
}

// ------------------------------------
// load the next art image to the left
// into the "art" element
// rollover to top if current image is index 0
// ------------------------------------
function artleft()
{
   currentIndex--;
   
   if (currentIndex < 0) {
      currentIndex = artImages.length-1;
   }

   loadArt(currentIndex);
}

// ------------------------------------
// load the next art image to the right
// into the "art" element
// rollo over to zero if current image is the rightmost one 
// ------------------------------------
function artright()
{
   currentIndex++;
   
   if (currentIndex >= artImages.length) {
      currentIndex = 0;
   }

   loadArt(currentIndex);
}

// ------------------------------------
// preload images in the specified array
// of file names
// ------------------------------------
function preloadImages(filenames)
{
   pic = new Array();

   for (i=1; i < filenames.length; i++) {
      pic[i]= new Image(); 
      pic[i].src=filenames[i];
   }

}
/*
// ------------------------------------
// load images specified in teh artImages array 
// ------------------------------------
function loadImages()
{
   preloadImages(artImages);

   pic = new Array();

   for (i=1; i < artImages.length; i++) {
      pic[i]= new Image(); 
      pic[i].src=artImages[i];
   }

}

*/

// ------------------------------------
// make the specified element invisible
// ------------------------------------
function hide(elid)
{
   var id = document.getElementById(elid);
   id.style.visibility="hidden";
}

// ------------------------------------
// make the specified element visible
// ------------------------------------
function show(elid)
{
   var id = document.getElementById(elid);
   id.style.visibility="visible";
}

// ------------------------------------
// change to rollover version of image
// ------------------------------------
function addro(el)
{
   // remove ".gif" from, and add "ro.gif" to the src name
   el.src = el.src.substr(0, el.src.length-4)+"ro.gif";
}

// ------------------------------------
// change to non-rollover version of image
// ------------------------------------
function remro(el)
{
   // remove "ro.gif" from, and add ".gif" to the src name
   el.src = el.src.substr(0, el.src.length-6)+".gif";
}

// ------------------------------------
// extract and return single parameter, if any from current url
// if no parameter return ""
// ------------------------------------
function getParameter()
{
   var parm = "";

   var loc1="x" + window.location;
   var qindex = loc1.indexOf("?");

   if (qindex > 0) 
      parm=loc1.substr(qindex+1);
  
   return parm;
}

// ------------------------------------
// show the logo popup & specify popup to display
// ------------------------------------
function logopop(logonum)
{    
   var address = "logopop.html?" + logonum ;   
             
   var option = "toolbar=0,location=0,directories=0" 
              + ",status=0,menubar=0,scrollbars=0"  
              + ",resizable=0,width=360,height=480"
              + ",screenX=30,screenY=30";


   setTimeout("logowin.focus();",100);
   logowin=window.open(address, "logopop", option);  


   return false ;  // so the link doesn't go anywhere!
}

// ------------------------------------
// show the art print popup & specify print to display
// ------------------------------------
function printpop(printnum)
{    

   var address = "printpop.html?" + printnum ;   
             
   var option = "toolbar=0,location=0,directories=" 
              + "0,status=0,menubar=0,scrollbars=0"  
              + ",resizable=0,width=432,height=480";

   setTimeout("printwin.focus();",100);
   printwin = window.open(address, "printpop", option);  

   return false ;  // so the link doesn't go anywhere!
}


