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

var w=1
var h=1

var displayduration=0; //duration in seconds image should remain visible. 0 for always.

var timer;

var common_style = 'style="position:absolute; visibility:hidden; left:-1000px; top:-1000px; width:1px; height:1px; z-index:100;"' //CODE FOR BORDER ON BOX  - border:1px solid #888888;background:#ffffff;
var web_card_title = '<td style="text-align:center; font-weight: bold; font-size: 9px; color:#666666;">To go to this Agent\'s website, click on your mouse now.</td>'

document.write('<div id="trail_homepage" ' + common_style + '><table border="0" align="left" cellpadding="0" cellspacing="0"><tr><td width="15"></td><td><img src="ImageName_homepage" id="ttimg_homepage"></td></tr></table></div>')
//document.write('<div id="trail_homepage" ' + common_style + '><table border="0" align="left" cellpadding="0" cellspacing="0"><tr><td width="25" height="18"></td><td></td></tr><tr><td></td><td><INPUT style="color: #333333; font: 100.01% Verdana, Helvetica, sans-serif; width:100%; font-weight:bold; font-size:11px; border:0; " type="text" value="co_homepage_v" id="co_homepage"></td></tr><tr><td height="8"></td><td></td></tr><tr><td></td><td><img src="ImageName_homepage" id="ttimg_homepage"></td></tr><tr><td></td>' + web_card_title + '<td height="20"></td></tr></table></div>')

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

function gettrailobj_homepage()
{
if (document.getElementById) 
	return document.getElementById("trail_homepage").style
else if (document.all) 
	return document.all.trailimagid.style
}

function homepage_pics_hide()
{
	document.onmousemove=""
	document.getElementById('ttimg_homepage').src=''
	//document.getElementById('co_homepage').value=''

	gettrailobj_homepage().width="0px"
	gettrailobj_homepage().height="0px"
	gettrailobj_homepage().visibility="hidden"
	gettrailobj_homepage().left=-1000
	gettrailobj_homepage().top=0
}

function homepage_pics(width,height,background,file,mycompany)
{
	if (navigator.userAgent.toLowerCase().indexOf('oper a') == -1 && navigator.userAgent.toLowerCase().indexOf('safari' ) == -1)
	{
		gettrailobj_homepage().width=width+"px"
		gettrailobj_homepage().height=height+"px"
		gettrailobj_homepage().visibility="visible"

		document.getElementById("trail_homepage").style.background="url("+background+")"

		document.getElementById('ttimg_homepage').src=file
		//document.getElementById('co_homepage').value=mycompany
		document.onmousemove=followmouse_homepage
	}
}

function followmouse_homepage(e){

	var defaultimageheight = 480;	// maximum image size.
	var defaultimagewidth = 480;	// maximum image size.
	
	var offsetfrommouse=[10,0]; //image x,y offsets from cursor position in pixels. Enter 0,0 for no offset

	var xcoord=offsetfrommouse[0]
	var ycoord=offsetfrommouse[1]

	var docwidth=document.all? truebody().scrollLeft+truebody().clientWidth : pageXOffset+window.innerWidth-15
	var docheight=document.all? Math.min(truebody().scrollHeight, truebody().clientHeight) : Math.min(window.innerHeight)

	if (typeof e != "undefined"){
		if (docwidth - e.pageX < defaultimagewidth + 2*offsetfrommouse[0]){
			xcoord = e.pageX - xcoord - defaultimagewidth; // Move to the left side of the cursor
		} else {
			xcoord += e.pageX;
		}
		if (docheight - e.pageY < defaultimageheight + 2*offsetfrommouse[1]){
			ycoord += e.pageY - Math.max(0,(2*offsetfrommouse[1] + defaultimageheight + e.pageY - docheight - truebody().scrollTop));
		} else {
			ycoord += e.pageY;
		}

	} else if (typeof window.event != "undefined"){
		if (docwidth - event.clientX < defaultimagewidth + 2*offsetfrommouse[0]){
			xcoord = event.clientX + truebody().scrollLeft - xcoord - defaultimagewidth; // Move to the left side of the cursor
		} else {
			xcoord += truebody().scrollLeft+event.clientX
		}
		if (docheight - event.clientY < (defaultimageheight + 2*offsetfrommouse[1])){
			ycoord += event.clientY + truebody().scrollTop - Math.max(0,(2*offsetfrommouse[1] + defaultimageheight + event.clientY - docheight));
		} else {
			ycoord += truebody().scrollTop + event.clientY;
		}
	}
	gettrailobj_homepage().left=xcoord+"px"
	gettrailobj_homepage().top=ycoord+"px"

}