/*
Simple Image Trail script- By JavaScriptKit.com
Visit http://www.javascriptkit.com for this script and more
This notice must stay intact
*/

var ua = navigator.userAgent.toLowerCase();
var divw=0;
var divh=0;
var xto;

if (document.getElementById || document.all)
	document.write('<div id="imgprev" style="position:absolute;visibility:hidden;z-index:50;"></div>')

function getprevob()
	{
	if (document.getElementById)
		return document.getElementById("imgprev")
	else if (document.all)
		return document.all.trailimagid
	}

function gettrailobj()
	{
	if (document.getElementById)
		return document.getElementById("imgprev").style
	else if (document.all)
		return document.all.trailimagid.style
	}

function truebody()
	{
	return (!window.opera && document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body
	}

function PreviewOff()
	{
		if (xto && xto > 0)
		{
			clearTimeout(xto);
		}

		document.onmousemove='';
		gettrailobj().visibility="hidden";
	}

function PreviewOn(thumbimg,imgtitle,thw,thh){
		if (navigator.userAgent.indexOf("Opera")==-1)
	{
		var smallmedium = 1;
	 
	   var thumbimgprev = thumbimg.replace(/800x600/, "100x75");
 
 
		gettrailobj().left="-500px";
		divthw = parseInt(thw);
		smthw = parseInt(thw) ;			
		halfthh = 10;
		halfthh = Math.ceil(parseInt(thh)/2);
		topx = halfthh - 9;
		smthh = parseInt(thh) ;	
		if (navigator.userAgent.indexOf("Firefox")!=-1 || navigator.userAgent.indexOf("Safari")!=-1)
			getprevob().innerHTML = '<div style="background-color: #D5D7D8; layer-background-color: #D5D7D8; border: 1px none #808080; padding:10px; width:'+divthw+'px;height:100%;z-index:51"><div style="background-color: #FFFFFF; layer-background-color: #FFFFFF;width:'+thw+'px;z-index:51">'+'<div style="border-width:0px;margin:0px;padding:0px;background-color: #ffffff; layer-background-color: #ffffff;z-index:51;position:absolute;width:'+thw+'px;height:'+smthh+'px;text-align:center"><img  src="'+thumbimgprev+'"  width="'+smthw+'" height="'+smthh+'" border="0"></div><div style="border-width:0px;margin:0px;padding:0px;z-index:52;position:absolute;width:'+thw+'px;top:'+topx+'px;text-align: center;"><img src="/images/loading.gif"></div><div style="border-width:0px;margin:0px;padding:0px;z-index:53;position:absolute;width:'+thw+'px;"><div style="border: 1px solid #808080;width:'+thw+'px;"><img name="fon" id="fon" src="fon.gif" border="0" width="'+thw+'" height="'+thh+'" ><div id="div_2" align="center" style="border-width:0px;margin:0px;z-index:53;layer-background-color: #FFFFFF;background-color:#ffffff;padding:0px;">'+imgtitle+'<br>'+(thw>=233?'<nobr>':'')+(thw>=233?'</nobr>':'')+'<br></div></div> </div></div><div style="visibility:hidden"><div style="height:'+thh+'px">&nbsp;</div><div id="div_2" style="padding:3px;">'+imgtitle+'<br>'+(thw>=233?'<nobr>':'')+(thw>=233?'</nobr>':'')+'<br></div> </div></div>';

		if (navigator.userAgent.indexOf("MSIE")!=-1)
			getprevob().innerHTML = '<div style="background-color: #D5D7D8; layer-background-color: #D5D7D8; border: 1px none #808080; padding:10px; width:'+divthw+'px;height:100%;z-index:51"><div style="background-color: #FFFFFF; layer-background-color: #FFFFFF;width:'+thw+'px;z-index:51">'+'<div style="border-width:0px;margin:0px;padding:0px;background-color: #FFFFFF; layer-background-color: #FFFFFF;z-index:51;position:absolute;width:'+thw+'px;height:'+smthh+'px;text-align:center"><img  src="'+thumbimgprev+'"  width="'+smthw+'" height="'+smthh+'" border="0"></div><div style="border-width:0px;margin:0px;padding:0px;z-index:52;position:absolute;width:'+thw+'px;top:'+topx+'px;text-align: center;"><img src="/images/loading.gif"></div><div style="margin:0px;padding:0px;z-index:53;position:absolute;width:'+thw+'px;"><div style="border: 1px solid #808080;width:'+thw+'px;"><img name="fon" id="fon" src="fon.gif" border="0" width="'+thw+'" height="'+thh+'"><div id="div_2" align="center" style="margin:0px;width:'+thw+'px;z-index:53;layer-background-color: #FFFFFF;background-color:#ffffff;padding:0px;">'+imgtitle+'<br>'+(thw>=233?'<nobr>':'')+(thw>=233?'</nobr>':'')+'<br></div></div> </div></div><div style="visibility:hidden"><div style="height:'+thh+'px">&nbsp;</div><div id="div_2" style="padding:3px;">'+imgtitle+'<br>'+(thw>=233?'<nobr>':'')+(thw>=233?'</nobr>':'')+'<br></div> </div></div>';
		
		
		
		//setTimeOut
		
		
		
		
		xto = setTimeout("xtimeOut('"+thumbimg+"')",100);
		
		gettrailobj().visibility="visible";
		divw = parseInt(thw)+25;
		divh = parseInt(thh)+130;
		document.onmousemove=followmouse;
	}	
}
function xtimeOut(thumbimgg){
	if (document.getElementById)
		document.getElementById('fon').src = thumbimgg;
	else if (document.all)
		document.all.fon.src = thumbimgg;

}
function followmouse(e)
	{
	var docwidth=document.all? truebody().scrollLeft+truebody().clientWidth : pageXOffset+window.innerWidth-15
	var docheight=document.all? Math.min(truebody().scrollHeight, truebody().clientHeight) : Math.min(document.body.offsetHeight, window.innerHeight)
if(typeof e != "undefined")
	{
	if(docwidth < 15+e.pageX+divw)
		xcoord = e.pageX-divw-5;
	else
		xcoord = 15+e.pageX+20;
 
		ycoord = 15+e.pageY+40;
	}
else if (typeof window.event != "undefined")
	{
	if(docwidth < 15+truebody().scrollLeft+event.clientX+divw)
		xcoord = truebody().scrollLeft-5+event.clientX-divw;
	else
		xcoord = truebody().scrollLeft+15+event.clientX-200;
 
		ycoord = truebody().scrollTop+15+event.clientY-400;
	}
	gettrailobj().left=xcoord+"px"
	gettrailobj().top=ycoord+"px"
	}

