var IE = document.all?true:false;

if (!IE) document.captureEvents(Event.MOUSEMOVE);

document.onmousemove = getMouseXY;
window.onload = getSize;
window.onresize = getSize;

var tempX = 0;
var tempY = 0;
var windowX = 0;
var windowY = 0;

function desc_layer_show(div_id, content)
{
	var objHeight = document.getElementById(div_id).offsetHeight;
	var objWidth = document.getElementById(div_id).offsetWidth;
	var addX = (windowX<tempX+objWidth+30)? (-objWidth-10) : (+12);
	var addY = (windowY<tempY+objHeight+30)? (-objHeight-0) : (0);
	var x = tempX + addX;
	var y = tempY + addY;
	document.getElementById(div_id).style.left = x;
	document.getElementById(div_id).style.top = y;
	document.getElementById(div_id).innerHTML = content;
	document.getElementById(div_id).style.display="block";
}

function desc_layer_hide(div_id)
{
	document.getElementById(div_id).style.display="none";

}


function getMouseXY(e) {
	if (IE) { // grab the x-y pos.s if browser is IE
		tempX = event.clientX + document.body.scrollLeft;
		tempY = event.clientY + document.body.scrollTop;
	} else {  // grab the x-y pos.s if browser is NS
		tempX = e.pageX;
		tempY = e.pageY;
	}
	// catch possible negative values in NS4
	if (tempX < 0){tempX = 0;}
	if (tempY < 0){tempY = 0;}

	return true;
}

function getSize(e) {
	if( typeof( window.innerWidth ) == 'number' ) {
	//Non-IE
		windowX = window.innerWidth;
		windowY = window.innerHeight;
	} else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
	//IE 6+ in 'standards compliant mode'
		windowX = document.documentElement.clientWidth;
		windowY = document.documentElement.clientHeight;
	} else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
	//IE 4 compatible
		windowX = document.body.clientWidth;
		windowY = document.body.clientHeight;
	}
	return true;
}



