/*
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

if (document.getElementById || document.all)
document.write('<div id="tooltip_id" style="position:absolute; z-index:9999; visibility:hidden; left:0px; top:0px; width:auto; height:auto;"><span id="tooltipcontent_id"></span></div>')

function tooltip_getobj()
{
	if (document.getElementById) return document.getElementById("tooltip_id").style
	else if (document.all) return document.all.tooltip_id.style
}

function truebody()
{
	return (!window.opera && document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body
}

function tooltip_hide()
{
	if (tooltip_isfixed) return;
	tooltip_isfixed = false;
	document.onmousemove=""
	document.getElementById('tooltipcontent_id').innerHTML = '';
	tooltip_getobj().visibility="hidden"
	tooltip_getobj().left=0
	tooltip_getobj().top=0
}


function tooltip_show(width,height,content)
{
	if(navigator.userAgent.toLowerCase().indexOf('opera') == -1)
	{
		w=parseInt(width)
		h=parseInt(height)

		tooltip_followmouse()

		document.getElementById('tooltipcontent_id').innerHTML=content
		document.onmousemove=tooltip_followmouse
		tooltip_getobj().visibility="visible"
		tooltip_getobj().width=w+"px"
		tooltip_getobj().height=h+"px"


	}
}

var tooltip_isfixed = false;
function tooltip_fix(state)
{
		if (state == undefined) state = true;
		tooltip_isfixed = state;
}


function tooltip_followmouse(e)
{
	if (tooltip_isfixed) return;
	if(navigator.userAgent.toLowerCase().indexOf('opera') == -1)
	{

		var xcoord=20
		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)

		if (document.getElementById('mypage'))
				docwidth = document.getElementById('mypage').offsetWidth;
		else
				docwidth = document.getElementById('main').offsetWidth;

		if (xcoord+w+3>docwidth)
				xcoord=xcoord-w-(20*2)

		if (ycoord-truebody().scrollTop+h>truebody().clientHeight)
				ycoord=ycoord-h-20;

		tooltip_getobj().left=xcoord+"px"
		tooltip_getobj().top=(ycoord-20)+"px"

	}

}


function tooltip_showStr(str,width,height)
{
		if (!width) var width = 'auto'; else width = width+"px";
		if (!height) var height = 'auto'; else height = height+"px";
		tooltip_show(width,height,str)
}
function tooltip_showHtml(id,width,height)
{
		if (!width) var width = 'auto'; else width = width+"px";
		if (!height) var height = 'auto'; else height = height+"px";
		tooltip_show(width,height,document.getElementById(id).innerHTML)
}
function tooltip_showImg(img_src,width,height)
{
		if (!width) var width = 'auto'; else width = width+"px";
		if (!height) var height = 'auto'; else height = height+"px";
		tooltip_show(width,height, '<img src="'+img_src+'" />')
}