var dom=(document.getElementById)?true:false;
var ns5=((navigator.userAgent.indexOf("Gecko")>-1)&&dom)?true:false;
var ie5=((navigator.userAgent.indexOf("MSIE")>-1)&&dom)?true:false;
var ns4=(document.layers&&!dom)?true:false;
var ie4=(document.all&&!dom)?true:false;
var nodyn=(!ns5&&!ns4&&!ie4&&!ie5)?true:false;
var origWidth,origHeight;
if(ns4){
	origWidth=window.innerWidth;
	origHeight=window.innerHeight;
	window.onresize=function(){if(window.innerWidth!=origWidth||window.innerHeight!=origHeight)history.go(0);}
}
if(nodyn){event="nope"}
var theDiv,divCSS;
function initDiv(){
	if(nodyn)return;
	theDiv=(ns4)?document.imgDiv.document:(ie4)?document.all['imgDiv']:(ie5||ns5)?document.getElementById('imgDiv'):null;
	divCSS=(ns4)?document.imgDiv:theDiv.style;
	if(theDiv){
		if(ns4)document.captureEvents(Event.MOUSEMOVE);
		document.onmousemove=trackMouse;
	}
}

var t1,t2;
var imgOn=false;
function showImg(evt,theImg){
	if(!theDiv)return;
	if(t1)clearTimeout(t1);
	if(t2)clearTimeout(t2);
	imgOn=true;
	if(ns4){
		theDiv.write('<img src="Uploaded/tn/'+theImg+'">');
		theDiv.close();
	}else if(ie4||ie5||ns5){
		theDiv.innerHTML='<img src="Uploaded/tn/'+theImg+'">';
	}
	t1=setTimeout("divCSS.visibility='visible'",100);
}
var mouseX,mouseY;
function trackMouse(evt){
	
	var posx = 0;
	var posy = 0;
	if (!evt) var evt = window.event;
	if (evt.pageX || evt.pageY) 	{
		posx = evt.pageX;
		posy = evt.pageY;
	}
	else if (evt.clientX || evt.clientY) 	{
		posx = evt.clientX + document.body.scrollLeft
			+ document.documentElement.scrollLeft;
		posy = evt.clientY + document.body.scrollTop
			+ document.documentElement.scrollTop;
	}
	// posx and posy contain the mouse position relative to the document

	
	mouseX = posx;
	mouseY = posy;
	
	if(imgOn){
		divCSS.left=(ns4)?mouseX+20:mouseX+20+"px";
		divCSS.top=(ns4)?mouseY+12:mouseY+12+"px";
	}
}
function hideImg(){
	if(!theDiv)return;
	t2=setTimeout("divCSS.visibility='hidden'",100);
	imgOn=false;
}
