var gGlobalX = -1;
var gGlobalY = -1;

var tempX = 0
var tempY = 0
var pageIsLoaded = false;
var gContainerId = "";
var timerNum = 0;
var totalXSpace = 100;
var strInnerID = "";

function getMouseXY(e) {
  
  if(!pageIsLoaded)
	return;
	
  if (IE) { // grab the x-y pos.s if browser is IE
    tempX = event.clientX + document.body.scrollLeft;
    //tempX = document.body.scrollLeft + 1;
    //tempX = (document.body.clientWidth / 2) - 140;
	if (gGlobalX != -1)
		tempX = (tempX - gGlobalX);
    //alert(document.body.clientWidth);
    //tempY = event.clientY + document.body.scrollTop  + 30;;
    tempY = event.clientY + document.body.scrollTop;
    //tempY = 200;
    if(gGlobalY != -1)
		tempY = (tempY - gGlobalY);
    
    totalXSpace = document.body.scrollWidth;
    
  } else {  // grab the x-y pos.s if browser is NS
    //tempX = e.pageX + 100;
    tempX = e.pageX ;
    
    //alert(document.body.clientWidth);
    //tempX = (document.body.clientWidth / 2);
    tempY = e.pageY + 30;
    //tempY = 200;e.pageY
    if (gGlobalX != -1)
		tempX = (tempX - (gGlobalX -7));
    //if(gGlobalY != -1)
	//	tempY = (tempY - (gGlobalY + 7));
    
    totalXSpace = window.screen.width;
    
    
  }  
  // catch possible negative values in NS4
  if (tempX < 0){tempX = 1}
  if (tempY < 0){tempY = 1}  
  // show the position values in the form named Show
  // in the text fields named MouseX and MouseY
  //document.Show.MouseX.value = tempX
  //document.Show.MouseY.value = tempY
  return true
}// Detect if the browser is IE or not.
// If it is not IE, we assume that the browser is NS.
var IE = document.all?true:false

// If NS -- that is, !IE -- then set up for mouse capture
if (!IE) document.captureEvents(Event.MOUSEMOVE)

// Temporary variables to hold mouse x-y pos.s


// Main function to retrieve mouse x-y pos.s
/************************************************ Dynamic Ajax Content- © Dynamic Drive DHTML code library (www.dynamicdrive.com)* This notice MUST stay intact for legal use* Visit Dynamic Drive at http://www.dynamicdrive.com/ for full source code***********************************************/var bustcachevar=1 //bust potential caching of external pages after initial request? (1=yes, 0=no)var loadedobjects=""var rootdomain="http://"+window.location.hostnamevar bustcacheparameter=""function ajaxpage(url, containerid){stopClosingPending();
var strtemp = url;if(strtemp.indexOf("#") > -1){	strtemp = strtemp.substr(strtemp.indexOf("#"));
	strInnerID = strtemp.substr(1);	url = url.substr(0, url.indexOf("#")) + "?rnd=" + Math.floor(Math.random()*111111) + strtemp;
	//alert(url);}else{	url += "?rnd=" + Math.floor(Math.random()*111111);
	strInnerID = "";}

//alert(url);var page_request = falseif (window.XMLHttpRequest) // if Mozilla, Safari etcpage_request = new XMLHttpRequest()else if (window.ActiveXObject){ // if IEtry {page_request = new ActiveXObject("Msxml2.XMLHTTP")} catch (e){try{page_request = new ActiveXObject("Microsoft.XMLHTTP")}catch (e){}}}elsereturn falsepage_request.onreadystatechange=function(){loadpage(page_request, containerid)}if (bustcachevar) //if bust caching of external pagebustcacheparameter=(url.indexOf("?")!=-1)? "&"+new Date().getTime() : "?"+new Date().getTime()page_request.open('GET', url+bustcacheparameter, true)page_request.send(null)}function loadpage(page_request, containerid){
var num = 0;
var num2 = 0;if (page_request.readyState == 4 && (page_request.status==200 || window.location.href.indexOf("http")==-1))document.getElementById(containerid).innerHTML=page_request.responseTextdocument.getElementById(containerid).style.display = "";document.getElementById(containerid).style.visibility = "";

if(strInnerID != ""){
	//alert(getElementPosition(strInnerID).top);
	document.getElementById(containerid).scrollTop = (getElementPosition(strInnerID).top - getElementPosition(containerid).top) -12;}else{	document.getElementById(containerid).scrollTop = 0;}
if (tempX > 0 && tempY > 0)
{//alert(document.getElementById(containerid).style.width)	num = document.getElementById(containerid).style.width.replace("px", "");	num = parseInt(num);	
	num2 = document.getElementById(containerid).style.height.replace("px", "");
	num2 = parseInt(num2);	//alert(tempX);	if (IE) 	{		document.getElementById(containerid).style.left = tempX;
		document.getElementById(containerid).style.top = tempY;	}	else	{		//alert(tempX);
		document.getElementById(containerid).style.left = tempX + "px";
		document.getElementById(containerid).style.top = tempY + "px";
	}
	//alert(tempY);	/*
	if ((tempX + 50 + num) <= (totalXSpace -100))	{
		document.getElementById(containerid).style.left = tempX + 50;
		document.getElementById(containerid).style.top = tempY;// - num2;
			}	else	{		document.getElementById(containerid).style.left = (tempX - num) - 100;		document.getElementById(containerid).style.top = tempY;// - num2;	}	*/
}}function loadobjs(){if (!document.getElementById)returnfor (i=0; i<arguments.length; i++){var file=arguments[i]var fileref=""if (loadedobjects.indexOf(file)==-1){ //Check to see if this object has not already been added to page before proceedingif (file.indexOf(".js")!=-1){ //If object is a js filefileref=document.createElement('script')fileref.setAttribute("type","text/javascript");fileref.setAttribute("src", file);}else if (file.indexOf(".css")!=-1){ //If object is a css filefileref=document.createElement("link")fileref.setAttribute("rel", "stylesheet");fileref.setAttribute("type", "text/css");fileref.setAttribute("href", file);}}if (fileref!=""){document.getElementsByTagName("head").item(0).appendChild(fileref)loadedobjects+=file+" " //Remember this object as being already added to page}}}function hidedynamiccontent(containerid){	gContainerId = containerid;
	timerNum = window.setTimeout("hidedyncontentaction()", 500);}

function hidedyncontentaction(){	document.getElementById(gContainerId).style.display = "none";	document.getElementById(gContainerId).style.visibility = "hidden";}

function stopClosingPending(){
	if(timerNum != 0)		window.clearTimeout(timerNum);}

function getElementPosition(elemID){
var offsetTrail = document.getElementById(elemID);
var offsetLeft = 0;
var offsetTop = 0;
while (offsetTrail){
offsetLeft += offsetTrail.offsetLeft;
offsetTop += offsetTrail.offsetTop;
offsetTrail = offsetTrail.offsetParent;
}
if (navigator.userAgent.indexOf('Mac') != -1 && typeof document.body.leftMargin != 'undefined'){
offsetLeft += document.body.leftMargin;
offsetTop += document.body.topMargin;
}
return {left:offsetLeft,top:offsetTop};
}

// Set-up to use getMouseXY function onMouseMove
function setMouseFunction()
{
	document.onmousemove = getMouseXY;
	pageIsLoaded = true;
}
document.onload = setMouseFunction();