var MouseX = 0;
var MouseY = 0;
var horizontal_offset="9px" //horizontal offset of hint box from anchor link

/////No further editting needed

var vertical_offset="0" //horizontal offset of hint box from anchor link. No need to change.

function ToggleDiv( sObjName )
{
	var oDiv = document.getElementById( sObjName );
	if( oDiv.style.display == 'block' )
		oDiv.style.display = 'none';
	else
		oDiv.style.display = 'block';
}

function ToggleTr( sObjName )
{
	var oDiv = document.getElementById( sObjName );
	if( oDiv.style.display == '' )
		oDiv.style.display = 'none';
	else
		oDiv.style.display = '';
}

function ToggleTrVal( sObjName, h )
{
	var oDiv = document.getElementById( sObjName );

	if( h == true )
		oDiv.style.display = '';
	else
		oDiv.style.display = 'none';
}

function mousepos(evt) {
	var e = evt ? evt : event;
	MouseX = e.clientX;
	MouseY = e.clientY;
}

function getAbsLeft( oElement )
{
	var iReturnValue = 0;
	while( oElement != null ) {
		iReturnValue += oElement.offsetLeft;
		oElement = oElement.offsetParent;
	}
	return iReturnValue;
}

function getAbsTop( oElement )
{
	var iReturnValue = 0;
	while( oElement != null ) {
		iReturnValue += oElement.offsetTop;
		oElement = oElement.offsetParent;
	}
	return iReturnValue;
}

function ShowEcHint( text, name, ob, addy )
{
	if (addy == null )
		addy = 0;
		
	var o = document.getElementById(name);
	o.innerHTML = '<center>' + text + '</center>';
	o.style.display = 'block';

	o.x=getposOffset(ob, "left")
	o.y=getposOffset(ob, "top")
	o.style.left=o.x-clearbrowseredge(ob, "rightedge", o)+ob.offsetWidth+"px"
	o.style.top=o.y-clearbrowseredge(ob, "bottomedge", o)+"px"

//	document.title = MouseX + ' X ' + (nL-ScrollRight) + ' ' + o.offsetWidth+ ' ' + winW;
//	
//	if( nL+o.offsetWidth > winW )
//	{
//		o.style.left = (nL - o.offsetWidth - 15 ) + 'px';
//		nL = (nL - o.offsetWidth);
//	}
//
//	if( (nT-ScrollTop)+o.offsetHeight > winH )
//	{
//		o.style.top = (nT-ScrollTop - o.offsetHeight - 30) + 'px';
//
////		newT = (nT-ScrollTop - o.offsetHeight - 10);
////		if( newT < nT && (newT + o.offsetHeight) > nT )
////			o.style.top = nT 
//		o.style.left = (nL - 15) + 'px';
//	}

}

function HideHint(name)
{
	var o = document.getElementById( name );
	o.style.display = 'none';
}

document.onmousemove = mousepos;


/***********************************************
* Show Hint script- ? Dynamic Drive (www.dynamicdrive.com)
* This notice MUST stay intact for legal use
* Visit http://www.dynamicdrive.com/ for this script and 100s more.
***********************************************/
		
var ie=document.all
var ns6=document.getElementById&&!document.all

function getposOffset(what, offsettype){
var totaloffset=(offsettype=="left")? what.offsetLeft : what.offsetTop;
var parentEl=what.offsetParent;
while (parentEl!=null){
totaloffset=(offsettype=="left")? totaloffset+parentEl.offsetLeft : totaloffset+parentEl.offsetTop;
parentEl=parentEl.offsetParent;
}
return totaloffset;
}

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

function clearbrowseredge(obj, whichedge, o){
var edgeoffset=(whichedge=="rightedge")? parseInt(horizontal_offset)*-1 : parseInt(vertical_offset)*-1
if (whichedge=="rightedge"){
var windowedge=ie && !window.opera? iecompattest().scrollLeft+iecompattest().clientWidth-30 : window.pageXOffset+window.innerWidth-40
o.contentmeasure=o.offsetWidth
if (windowedge-o.x < o.contentmeasure)
edgeoffset=o.contentmeasure+obj.offsetWidth+parseInt(horizontal_offset)
}
else{
var windowedge=ie && !window.opera? iecompattest().scrollTop+iecompattest().clientHeight-15 : window.pageYOffset+window.innerHeight-18
o.contentmeasure=o.offsetHeight
if (windowedge-o.y < o.contentmeasure)
edgeoffset=o.contentmeasure-obj.offsetHeight
}
return edgeoffset
}


function OpenWindow(name, width, Height, URL )
{
	window.open(URL,name,"width=" + width + "px, height=" + Height +"px, scrollbars=yes");
}
