
// image swaps

function imgSwap(imgDocID,imgObjName) 
   {
   if (document.images) 
      { document.images[imgDocID].src = eval(imgObjName + ".src") }
   }

// launch Bucks County Artists feature

function launchBucksCo()
   {
   var knownres = 0;
   var x = 0;
   var y = 0;

   if (document.all)
      {
      // ie
      x = document.body.clientWidth;
      y = document.body.clientHeight;
      }

   if (document.layers)
      {
      // nn
      x = window.innerWidth;
      y = window.innerHeight;
      }

   var winheight = 550;
   if (y > 700) { winheight = 750; }

   buckscoWin = window.open('/exhibits/buckscounty/','bucksCo','width=700,height=' + winheight + ',status=no,scrollbars=no,resizable=yes,toolbar=no,left=50,screenX=50,top=1,screenY=1');
   }

   // display a zoomed image box

   function zoom(id,img,x,y)
   {
      // distance scrolled down

      var d = 0;

      if (window.pageYOffset)
      {
         d = window.pageYOffset
      }
      else if (document.documentElement && document.documentElement.scrollTop)
      {
         d = document.documentElement.scrollTop
      }
      else if (document.body)
      {
         d = document.body.scrollTop
      }

      // available window width

      var wx = 0;
      var wy = 0;
		
      if (window.innerWidth)
      {
         wx = window.innerWidth
         wy = window.innerHeight
      }
      else if (document.documentElement && document.documentElement.clientWidth)
      {
         wx = document.documentElement.clientWidth
         wy = document.documentElement.clientHeight
      }
      else if (document.body)
      {
         wx = document.body.clientWidth
         wy = document.body.clientHeight
      }

      // position and display box

      box = document.getElementById("zoom" + id);
      box.style.left = (wx - x)/2 - 10;
      box.style.top = (wy - y)/2 + d - 67;
      box.style.display = "block";

      big = document.getElementById("zoom" + id + "img");
      big.src = "images/enlarge/" + img;
   }

   // hide a zoomed image box

   function unzoom(id)
   {
      box = document.getElementById("zoom" + id);
      box.style.display = "none";
   }

