/*
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;

if (document.getElementById || document.all)
	document.write('<div id="imgtrailer" style="position:absolute;visibility:hidden;"></div>')

function gettrailobject()
	{
	if (document.getElementById)
		return document.getElementById("imgtrailer")
	else if (document.all)
		return document.all.trailimagid
	}

function gettrailobj()
	{
	if (document.getElementById)
		return document.getElementById("imgtrailer").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 trailOff1()
	{
	document.onmousemove='';
	gettrailobj().visibility="hidden";
	}

function trailOn1(desc1,thw,thh)
	{
	if(ua.indexOf('opera') == -1 && ua.indexOf('safari') == -1)
		{
		gettrailobj().left="-1000px";
		divthw = parseInt(thw);
		divthh = parseInt(thh);
		//gettrailobject().innerHTML = '<div style="background-color: #E8559C; layer-background-color: #9c8263; border: 5px none #ffffff; padding:5px; width:'+divthw+'px; height:'+divthh+'px;"><div style="background-color: #FFFFFF; layer-background-color: #FFFFFF; border: 1px solid #ffffff;background-image: url(img/lloading.gif);"><img src="'+thumbimg+'" border="0" width="'+thw+'" height="'+thh+'"></div></div>';
		gettrailobject().innerHTML = '<div style="background-color: #ffffff; layer-background-color: #9c8263; border: 1px solid #dcdbdb; padding:5px;"><div style="background-color: #FFFFFF; layer-background-color: #FFFFFF; border: 1px solid #ffffff;background-image: url(img/lloading.gif);width:'+divthw+'px;height:'+divthh+'px;">'+desc1+'</div></div>';
		//gettrailobject().innerHTML = '<div style="background-color: #dadada; layer-background-color: #dadada; border: 1px none #ffffff; padding:1px; width:'+divthw+'px;"><div style="background-color: #fffff7;padding:10px; layer-background-color: #fffff7;background-image: url(../images/tool.gif); border: 1px solid #ffffff;" align=left>'+desc1+'</div></div>';
		//gettrailobject().innerHTML = '<div style="width:'+divthw+'px;height:243px;padding:15px;padding-left:30px;" align=left><div style="width:170px;height:200px;white-space:normal;">'+desc1+'</div></div>';
		gettrailobj().visibility="visible";
		divw = parseInt(thw);
		divh = parseInt(thh);
		document.onmousemove=followmouse;
		}
	}

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;
	if(docheight < 15+e.pageY+divh)
		ycoord = 15+e.pageY-Math.max(0,(divh + e.pageY - docheight - truebody().scrollTop - 30));
	else
		ycoord = 15+e.pageY;
	}
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;

	if(docheight < 15+truebody().scrollTop+event.clientY+divh)
		ycoord = 15+truebody().scrollTop+event.clientY-Math.max(0,(divh + event.clientY - docheight - 30));
	else
		ycoord = truebody().scrollTop+15+event.clientY;
	}
	gettrailobj().left=xcoord+"px"
	gettrailobj().top=ycoord+"px"
		
	}
	
	
