/*

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="imgtrailer" style="position:absolute;visibility:hidden;z-index:49;"></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 trailOff()

	{

		if (xto && xto > 0)

		{

			clearTimeout(xto);

		}



		document.onmousemove='';

		gettrailobj().visibility="hidden";

	}



function trailOn(thumbimg,imgtitle,imgdesc){		

		width = 350; //set for image width

		height = 250;//set for image height

		

		thw = width;thh = height;gettrailobj().left="0px";divthw = parseInt(thw);smthw = parseInt(thw);

		halfthh = 50;

		halfthh = Math.ceil(parseInt(thh)/2);

		topx = halfthh - 9;

		smthh = parseInt(thh) + 2;

		

		if (navigator.userAgent.indexOf("Opera")!=-1)

			gettrailobject().innerHTML = '<div style="background-color: #b2a99d; layer-background-color: #b2a99d; border: 1px none #808080; padding:0px; 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="margin:0px;padding:0px;background-color: #D7DEE9; layer-background-color: #ffffff;z-index:51; position:absolute; width:'+thw+'px; height:'+smthh+'px; border:1px #CCCCCC solid; text-align:center"><img  src="'+thumbimg+'"  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/portfolio/loader.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="btcontainer" id="btcontainer" src="images/portfolio/temp.gif" border="0" width="'+thw+'" height="'+thh+'" ><div id="div_2" style="border-width:0px;margin:0px;z-index:53;layer-background-color: #FFFFFF;background-color:#ffffff;padding:0px;"><div style="padding:4px 4px 8px 12px;"><b>'+imgtitle+'</b><br>'+imgdesc+'</div></div></div> </div></div></div>';

		

		if (navigator.userAgent.indexOf("Firefox")!=-1 || navigator.userAgent.indexOf("Safari")!=-1)

			gettrailobject().innerHTML = '<div style="background-color:transparent; layer-background-color: #b2a99d; border: 1px none #808080; padding:0px; 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="'+thumbimg+'"  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/portfolio/loader.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="btcontainer" id="btcontainer" src="images/portfolio/temp.gif" border="0" width="'+thw+'" height="'+thh+'" ><div id="div_2" style="border-width:0px;margin:0px;z-index:53;layer-background-color: #FFFFFF;background-color:#ffffff;padding:0px;"><div style="padding:4px 4px 8px 12px;"><b>'+imgtitle+'</b><br>'+imgdesc+'</div></div></div> </div></div></div>';

		

		if (navigator.userAgent.indexOf("MSIE")!=-1)

			gettrailobject().innerHTML = '<div style="background-color:transparent; layer-background-color: #b2a99d; border: 1px none #808080; padding:0px; 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: #F5FCFF; layer-background-color: #FFFFFF;z-index:51;position:absolute;width:'+thw+'px;height:'+smthh+'px;text-align:center"><img  src="'+thumbimg+'"  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/portfolio/loader.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="btcontainer" id="btcontainer" src="images/portfolio/temp.gif" border="0" width="'+thw+'" height="'+thh+'"  ><div id="div_2" style="margin:0px;width:'+thw+'px;z-index:53;layer-background-color: #FFFFFF;background-color:#ffffff;padding:0px;">'+'<div style="padding:4px 4px 8px 12px;"><b>'+imgtitle+'</b><br>'+imgdesc+'</div></div></div> </div></div></div>';



		//setTimeOut

		xto = setTimeout("xtimeOut('"+thumbimg+"')",200);

		gettrailobj().visibility="visible";

		divw = parseInt(thw)-350;

		divh = parseInt(thh)-250;

		document.onmousemove=followmouse;



}



function xtimeOut(thumbimgg){

	if (document.getElementById)

		document.getElementById('btcontainer').src = thumbimgg;

	else if (document.all)

		document.all.btcontainer.src = thumbimgg;



}

function followmouse(e)

	{

	var docwidth=document.all? truebody().scrollLeft+truebody().clientWidth : pageXOffset+window.innerWidth-150

	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 = e.pageY-Math.max(0,(divh + e.pageY - docheight - truebody().scrollTop - 30))-150;

	else

		ycoord = e.pageY-150;

	}

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 = truebody().scrollTop+event.clientY-Math.max(0,(divh + event.clientY - docheight - 30))-150;

	else

		ycoord = truebody().scrollTop-150+event.clientY;

	}

	gettrailobj().left=xcoord+"px"

	gettrailobj().top=ycoord+"px"

	}
