/* 
	Copyright (c) 2005-2006 Metablocks, Inc, Metablocks, Ltd. and their affiliates. 
	Not to be reused without permission. All Rights Reserved.
	
	Do not remove this copyright notice.
*/
function show (e, obj, id){
	var posx = 0;
	var posy = 0;
	if (!e)
		e = window.event;
	if (e.pageX || e.pageY){
		posx = e.pageX;
		posy = e.pageY;
	}
	else if (e.clientX || e.clientY){
		if (document.documentElement && document.documentElement.scrollTop){
			theTop = document.documentElement.scrollTop;
			theLeft = document.documentElement.scrollLeft;
		}else if (document.body){
			theTop = document.body.scrollTop
			theLeft = document.body.scrollLeft;
		}
		posx = e.clientX + theLeft;
		posy = e.clientY + theTop;
	}
	// If you resize graphic, you need to modify this
	var ie4=(document.all)? true:false;
	if (navigator.userAgent.indexOf("MSIE") > -1)
		//posx -= 300;// determines how far the frame should be from the mouse in IE
		posx += 20;
	else
		//posx -= 300;// determines how far the frame should be from the mouse in other Browsers
		posx += 20;

	//posy -= 400;
	posy -= 80;
	var elem = document.getElementById(id);
	elem.style.display = "block";
	elem.style.top = posy + "px";
	elem.style.left = posx + "px";
}

var xCoord;
var yCoord;

function showFix(e, obj, id, imageWidth, imageHeight){
	var posx = 0;
	var posy = 0;
	if (!e)
		e = window.event;

	if (e.pageX || e.pageY)
	{
		posx = e.pageX;
		posy = e.pageY;
	}
	else if (e.clientX || e.clientY)
	{
		if (document.documentElement && document.documentElement.scrollTop)
		{
			theTop = document.documentElement.scrollTop;
			theLeft = document.documentElement.scrollLeft;
		}
		else if (document.body)
		{
			theTop = document.body.scrollTop
			theLeft = document.body.scrollLeft;
		}

		posx = e.clientX + theLeft;
		posy = e.clientY + theTop;
	}

	// If you resize graphic, you need to modify this
	
	var ie4=(document.all)? true:false;

	if (navigator.userAgent.indexOf("MSIE") > -1)
		posx += 20;
	else
		posx += 20;
	posy -= 20;

	if(document.body.clientWidth < (xCoord + imageWidth + 30)){
		posx = posx - 20 - 20 - imageWidth;
	}
	//alert(yCoord +", "+ imageHeight)
	if( yCoord > imageHeight){
		posy = posy - imageHeight;
	}
	var elem = document.getElementById(id);
	elem.style.display = "block";
	elem.style.top = posy + "px";
	elem.style.left = posx + "px";
}



function checkwhere(e) {
	if (document.layers){
		xCoord = e.x;
		yCoord = e.y;
	} else if (document.all){
		xCoord = event.clientX;
		yCoord = event.clientY;
	} else if (document.getElementById){
		xCoord = e.clientX;
		yCoord = e.clientY;
	}
}

document.onmousemove = checkwhere;
if(document.captureEvents) {document.captureEvents(Event.MOUSEMOVE);}

function hide (id){
	document.getElementById(id).style.display = "none";
}