function popupGallery(name, nextPrevLink, originalLink)
{
   myWindow = window.open("/components/gallery/show_gallery_image.jsp?src="+name+"&nextPrevLink="+nextPrevLink+"&originalLink="+originalLink, "galleryWindow", "toolbar=no,scrollbars=yes,resizable=yes,width=700,height=500;")
}

function popupGallerySetStyle(name, nextPrevLink, originalLink, styleName, sendCardLink, cyclicViewing)
{
   myWindow = window.open("/components/gallery/show_gallery_image.jsp?src="+name+"&nextPrevLink="+nextPrevLink+"&originalLink="+originalLink+"&styleName="+styleName+"&sendCardLink="+sendCardLink+"&cyclicViewing="+cyclicViewing, "galleryWindow", "toolbar=no,scrollbars=yes,resizable=yes,width=700,height=500;")
}

function popupGalleryRecursive(dir, index, nextPrevLink, originalLink, styleName, cyclicViewing, sendCardLink)
{
   myWindow = window.open("/components/gallery/show_gallery_image_recursive.jsp?dir="+dir+"&index="+index+"&nextPrevLink="+nextPrevLink+"&originalLink="+originalLink+"&styleName="+styleName+"&cyclicViewing="+cyclicViewing+"&sendCardLink="+sendCardLink, "galleryWindow", "toolbar=no,scrollbars=yes,resizable=yes,width=700,height=500;")
}

var ox=0;
var oy=0;

var IE = document.all?true:false;
if (!IE) document.captureEvents(Event.MOUSEMOVE);

function mouseMove(e)
{
   if (IE)
   {
      if (document.documentElement && document.documentElement.scrollTop)
      {
         ox = event.clientX + document.documentElement.scrollLeft;
         oy = event.clientY + document.documentElement.scrollTop;
      }
      else
      {
         ox = event.clientX + document.body.scrollLeft;
         oy = event.clientY + document.body.scrollTop;
      }
   }
   else
   {
      ox = e.pageX;
      oy = e.pageY;
   }

   if (ox < 10){ox = 10}
   if (oy < 10){oy = 10}
   return true
}

document.onmousemove=mouseMove;

function silentErrorHandler()
{
   return true
}
if (window.onError) window.onError=silentErrorHandler();

function showGalleryTooltip(text, desc)
{
   if (text=="" && desc=="") return;

   if (document.getElementById||document.all)
   {
      lnk = "galleryTooltipLayer";
      var curLnk = (document.getElementById)? document.getElementById(lnk): document.all[lnk];
      curLnk.style.visibility = "visible";
      curLnk.style.top=(oy+10)+"px";
      curLnk.style.left=(ox+10)+"px";
      if (desc!="")
      {
         if (text=="")
         {
            text = desc;
         }
         else
         {
            text = text + "<br><br>"+desc;
         }
      }
      curLnk.innerHTML = text;
      window.status = text;
   }
}

function hideGalleryTooltip()
{
   if (document.getElementById||document.all)
   {
      lnk = "galleryTooltipLayer";
      var curLnk = (document.getElementById)? document.getElementById(lnk): document.all[lnk];
      curLnk.style.visibility = "hidden";
      curLnk.style.posTop=oy+10;
      curLnk.style.posLeft=ox+10;
   }
}

function highlightGalleryTD(obj,on)
{
   if (document.getElementById||document.all)
   {
      if (on==1) obj.bgColor=highlightGalleryTDColor;
      else obj.bgColor="";
   }
}