﻿function headerOver(id){
    document.getElementById(id).src="/images/"+id+"_on.jpg";
}
function headerOut(id){
    document.getElementById(id).src="/images/"+id+"_off.jpg";
}
var w=1
var h=1

if (document.getElementById || document.all)
//document.write("<table id='trailimageid' cellpadding='0' cellspacing='0' style='visibility: hidden; position: absolute; z-index: 99;'><tr><td style='width: 6px; height: 6px; vertical-align: bottom; text-align: right;'><img src='images/hu.gif' style='vertical-align: bottom' /></td><td style='background-image: url(images/pue.gif); background-repeat: repeat-x; height: 6px; background-position: left bottom;'></td><td style='width: 6px; height: 6px; vertical-align: bottom; text-align: left;'><img src='images/mu.gif' style='vertical-align: bottom' /></td></tr><tr><td style='background-image: url(images/phidari.gif); width: 6px; background-repeat: repeat-y'></td><td style='background-color: #ffffff'><img src='images/loading.gif' id='ttimg' /></td><td style='background-image: url(images/pmigi.gif); width: 6px; background-repeat: repeat-y'></td></tr><tr><td style='width: 6px; height: 6px; vertical-align: top; text-align: right;'><img src='images/hs.gif' style='vertical-align: top' /></td><td style='background-image: url(images/psita.gif); background-repeat: repeat-x; height: 6px'></td><td style='width: 6px; height: 6px; vertical-align: top; text-align: left;'><img src='images/ms.gif' style='vertical-align: top' /></td></tr></table>")
document.write("<div style='visibility: hidden; position: absolute; z-index: 99;' id='trailimageid'><img src='images/loading.gif' id='ttimg' /></div>")

function gettrailobj()
{
	if (document.getElementById) return document.getElementById("trailimageid").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 hidetrail()
{
	document.onmousemove=""
	//document.getElementById('ttimg').src='img/s.gif'
	gettrailobj().visibility="hidden"
	gettrailobj().left=-1000
	gettrailobj().top=0
}


function showtrail(width,height,file)
{
	if(navigator.userAgent.toLowerCase().indexOf('opera') == -1 && navigator.userAgent.toLowerCase().indexOf('safari') == -1)
	{
		w=width
		h=height
		
		gettrailobj().visibility="visible"
		gettrailobj().width=w+"px"
		gettrailobj().w=w;
		gettrailobj().height=h+"px"
		document.getElementById('ttimg').src=file
		document.onmousemove=followmouse

	}
}


function followmouse(e)
{

	if(navigator.userAgent.toLowerCase().indexOf('opera') == -1 && navigator.userAgent.toLowerCase().indexOf('safari') == -1)
	{
		
		var xcoord=0
		var ycoord=20

		if (typeof e != "undefined")
		{
			xcoord+=e.pageX
			ycoord+=e.pageY
		}
		else if (typeof window.event !="undefined")
		{
			xcoord+=truebody().scrollLeft+event.clientX
			ycoord+=truebody().scrollTop+event.clientY
		}

		var docwidth=document.all? truebody().scrollLeft+truebody().clientWidth : pageXOffset+window.innerWidth-15
		var docheight=document.all? Math.max(truebody().scrollHeight, truebody().clientHeight) : Math.max(document.body.offsetHeight, window.innerHeight)
		//alert(xcoord+w+3+" - "+docwidth+" "+ w +)
		//if (xcoord+w+3>docwidth)
		//xcoord=xcoord-w-(20*2)
		if((docwidth-xcoord)<250) xcoord -=250
		

		if (ycoord-truebody().scrollTop+h>truebody().clientHeight)
		ycoord=ycoord-h-20;
		
		gettrailobj().left = xcoord + "px"
		gettrailobj().top  = ycoord + "px"

	}

} 