var ie=document.all
var ns6=document.getElementById&&!document.all

function ietruebody(){
return (document.compatMode && document.compatMode!="BackCompat" && !window.opera)? document.documentElement : document.body
}

function enlarge(which, e, position, imgwidth, imgheight, alttext){
if (ie||ns6){
crossobj=document.getElementById? document.getElementById("showimage") : document.all.showimage
if (position=="center"){
pgyoffset=ns6? parseInt(pageYOffset) : parseInt(ietruebody().scrollTop)
horzpos=ns6? pageXOffset+window.innerWidth/2-imgwidth/2 : ietruebody().scrollLeft+ietruebody().clientWidth/2-imgwidth/2
vertpos=ns6? pgyoffset+window.innerHeight/2-imgheight/2 : pgyoffset+ietruebody().clientHeight/2-imgheight/2
if (window.opera && window.innerHeight) 
vertpos=pgyoffset+window.innerHeight/2-imgheight/2
vertpos=Math.max(pgyoffset, vertpos)
}
else{
var horzpos=ns6? pageXOffset+e.clientX : ietruebody().scrollLeft+event.clientX
var vertpos=ns6? pageYOffset+e.clientY : ietruebody().scrollTop+event.clientY
}

crossobj.style.left=horzpos+"px"
crossobj.style.top=vertpos+"px"

crossobj.innerHTML='<img src="'+which+'" alt="'+alttext+'" title="'+alttext+'">'
crossobj.style.visibility="visible"

if (ie)
{
   //crossobj > var DivRef = document.getElementById('PopupDiv');
   var IfrRef = document.getElementById('showimageifr');
  
    crossobj.style.display = "block";
    IfrRef.style.width = crossobj.offsetWidth;
    IfrRef.style.height = crossobj.offsetHeight;
    IfrRef.style.top = crossobj.style.top;
    IfrRef.style.left = crossobj.style.left;
    IfrRef.style.zIndex = crossobj.style.zIndex - 1;
    IfrRef.style.display="block";  
    IfrRef.style.visibility="visible";  
}



return false

}
else 
return true
}

function closepreview(){
crossobj.style.visibility="hidden";
if (ie)
{
var IfrRef = document.getElementById('showimageifr');
IfrRef.style.display = "none";
}
}


