// JScript source code
var cTimer = 0;				// timer for cursor stop
var cX, cY;

function findLivePageWidth() {
	if (window.innerWidth != null) return window.innerWidth;
	if (document.body.clientWidth != null) return document.body.clientWidth;
	return (null);
}

// pops up text at evt location
//		(requires findDOM.js)
function popUp(evt, objectID) {	
	if (isDHTML) {
		if (evt.x) {
			showMaptip(evt.x, evt.y, objectID)
		} else if (evt.pageX) {
			showMaptip(evt.pageX, evt.pageY, object)
		}
	}
}

function showMaptip(x, y, objectID) {
	var livePageWidth = findLivePageWidth();
	var domStyle = findDOM(objectID,1);
	var dom = findDOM(objectID,0);
	var state = domStyle.visibility;
	if (dom.offsetWidth) {
		var elemWidth = dom.offsetWidth;
	} else {
		if (dom.clip.width) var elemWidth = dom.clip.width;
	}
	if (state == "visible" || state == "show") {
		//domStyle.visibility = "hidden";
		//domStyle.visibility = "hidden";
	} else {
		
		var leftVal = x;
		var topVal = y+4;
		
		//*********************************************
		//temporary fix
		var leftVal = x-5;
		var topVal = y-5;
		//*********************************************
				
		if (isID) {
			topVal += document.body.scrollTop;
			leftVal += document.body.scrollLeft;
		}
		if (leftVal < 2) {
			leftVal = 2;
		} else {
			if ((leftVal + elemWidth) > livePageWidth) {
				leftVal = leftVal - (elemWidth/2); }
		}
		
		//domStyle.top = topVal; // positions element from the top
		//domStyle.left = leftVal; // positions element from the left
		
		//document.getElementById(objectID).style.top = topVal + "px";
		//document.getElementById(objectID).style.left = leftVal + "px";
		
		//document.getElementById(objectID).style.top = "50px";
		//document.getElementById(objectID).style.left = "50px";
		
		
		//******************************************
		// control maptip offset position
	
		x = x + 13;
		y = y + 180;
				
		
		domStyle.top = y + "px"; // positions element from the top
		domStyle.left = x + "px"; // positions element from the left
				
		domStyle.visibility = "visible";
	}
}




