function Browser()
{
	var ua = ' ' + navigator.userAgent.toLowerCase();

	this.isWindows = navigator.appVersion.indexOf("Win") > 0;
	this.isMac = navigator.appVersion.indexOf("Mac") > 0;
	this.isID = (document.getElementById) ? true : false;
	this.isIE = ua.indexOf('msie') >= 0;
	this.isNN = (ua.indexOf('netscape') >= 0 || ua.indexOf('gecko') >= 0);
	this.isSafari = ua.indexOf('safari') >= 0;
	
	var iVersion = parseFloat(navigator.appVersion);
	if (this.isIE) 
	{
		var sInfo = navigator.appVersion.toLowerCase().indexOf('msie') + 5;
		iVersion = parseFloat(navigator.appVersion.substring(sInfo));
	} else if (this.isNN)
	{
		var sInfo = ua.lastIndexOf('/') + 1;
		iVersion = parseFloat(ua.substring(sInfo,ua.length));
	}
	this.version = iVersion;
}

var browser = new Browser();
var currentThumb, thumbX, thumbY, thumbWidth, thumbHeight, mouseX, mouseY, popX, popY, popWidth, popHeight, isLoaded, timeElapsed, popTimerId, waitTimerId, effectProgress, pop, shadowBox, shadowCell, loading;

var cS='W',tX,tY,tW,tH,mX,mY,pX,pY,pW,pH,pu,cT,nT,sB,sC,ms,pT,eP,eT;
function thumb_mouseover(e){var i=window.event?window.event.srcElement:e.target;switch(cS){case'W':case'L':case'I':case'D':I(i);break;default:nT=i;}}function oPT(){switch(cS){case'I':L();break;case'D':U();break;}}function comp_load(){switch(cS){case'I':D();break;case'L':U();break;}}function comp_click(){window.location=cT.parentNode.href;}function mousemove(e){mX=window.event.clientX+document.body.scrollLeft;mY=window.event.clientY+document.body.scrollTop;if(mX>tX+tW||mY>tY+tH||mX<tX||mY<tY)mO();}function I(image){cS='I';cT=image;nT=null;pu=document.getElementById("pu");sB=document.getElementById("sB");sC=document.getElementById("sC");ms=document.getElementById("ms");clearTimeout(pT);pT=setTimeout(oPT,500);pu.src=image.getAttribute("compsrc");pu.onload=comp_load;tX=tY=0;var offset=image;while(offset!=null){tX+=offset.offsetLeft;tY+=offset.offsetTop;offset=offset.offsetParent;}tW=image.offsetWidth;tH=image.offsetHeight;document.body.onmousemove=mousemove;}function L(){cS='L';cT.style.cursor="wait";ms.style.left=mX+10;ms.style.top=mY+10;ms.style.display="block";}function mO(){switch(cS){case'S':O();break;case'L':case'D':case'I':W();break;}}function D(){cS='D';}function U(){cS='U';pu.style.display="block";pW=pu.width;pH=pu.height;pX=tX+(tW/2)-(pW/2);pY=tY+(tH/2)-(pH/2);pX=Math.max(pX,document.body.scrollLeft);pY=Math.max(pY,document.body.scrollTop);pX=Math.min(pX,document.body.scrollLeft+document.body.clientWidth-pW);pY=Math.min(pY,document.body.scrollTop+document.body.clientHeight-pH);cT.style.cursor="auto";ms.style.display="none";pu.style.display="block";eP=0.2;itU();}function itU(){clearTimeout(eT);if(eP<1){eP+=0.2;sE();eT=setTimeout(itU,40);}if(eP==1)S();}function itO(){clearTimeout(eT);if(eP>.25){eP-=0.25;sE();eT=setTimeout(itO,40);}else W();}function sE(){pu.style.width=tW+(pW-tW)*eP;pu.style.height=tH+(pH-tH)*eP;pu.style.left=tX+(pX-tX)*eP;pu.style.top=tY+(pY-tY)*eP;}function S(){cS='S';sC.width=pW-40;sC.height=pH-47;sB.style.left=pu.style.left;sB.style.top=pu.style.top;sB.style.display="block";var ief=document.getElementById("ief");ief.style.width=sB.offsetWidth;ief.style.height=sB.offsetHeight;ief.style.left=pu.style.left;ief.style.top=pu.style.top;ief.style.display="block";}function O(){cS='O';document.getElementById("ief").style.display="none";sB.style.display="none";itO();}function W(){cS='W';pu.style.display="none";ms.style.display="none";pu.style.width="auto";pu.style.height="auto";if(nT!=null)I(nT);}
