var isNavPopup, isIEPopup;
var coll = "";
var styleObj = "";
if (parseInt(navigator.appVersion) >= 4) {
	if (navigator.appName == "Netscape") {
		isNavPopup = true;
	}
	else {
		isIEPopup = true;
		coll = "all.";
		styleObj = ".style";
	}
}

function getPosObject(obj) {
	var theObj
	if (typeof obj == "string") {
		theObj = eval("document." + coll + obj + styleObj);
	} else {
		theObj = obj;
	}
	return theObj;
}
function getObject(obj) {
	var theObj
	if (typeof obj == "string") {
		theObj = eval("document." + coll + obj);
	} else {
		theObj = obj;
	}
	return theObj;
}
function show(obj) {
	var theObj = getPosObject(obj);
	theObj.visibility = "visible";
}
function hide(obj) {
	var theObj = getPosObject(obj);
	theObj.visibility = "hidden";
}

function setVisibility(obj, visible) {
	if (visible)
		show(obj);
	else
		hide(obj);
}
function shiftTo(obj, x, y) {
	//window.alert("shiftTo");
	if (isNavPopup)
		obj.moveTo(x,y);
	else {
		obj.pixelLeft = x;
		obj.pixelTop = y;
	}
}
function getObjHeight(obj) {
	//window.alert("getObjHeight");
	if (isNavPopup)
		return obj.clip.height;
	else
		return obj.clientHeight;
}
function getObjWidth(obj) {
	//window.alert("getObjWidth");
	if (isNavPopup)
		return obj.clip.width;
	else
		return obj.clientWidth;
}
function getEvent(evt) {
	if (isNavPopup)
		return evt;
	else
		return window.event;
}
function getMouseX(evt) {
	if (isNavPopup)
		return evt.pageX;
	else
		return evt.x+document.body.scrollLeft;
}
function getMouseY(evt) {
	if (isNavPopup)
		return evt.pageY;
	else
		return evt.y+document.body.scrollTop;
		//return evt.clientY;
}
function setZIndex(obj, ind) {
	obj.zIndex = ind;
}
function getInsideWindowWidth() {
	if (isNavPopup) {
		return window.innerWidth;
	} else {
		return document.body.clientWidth;
	}
}
function getInsideWindowHeight() {
	if (isNavPopup) {
		return window.innerHeight;
	} else {
		return document.body.clientHeight;
	}
}
function getInsideWindowTop() {
	if (isNavPopup) {
		return window.pageYOffset;
	} else {
		return document.body.clientTop;
	}
}
function getInsideWindowLeft() {
	if (isNavPopup) {
		return window.pageXOffset;
	} else {
		return document.body.clientLeft;
	}
}


function ViewData(evt, obj, valueShow) {
	theObj = getObject(obj);
	theEvent = getEvent(evt);
	var wid = getObjWidth(theObj);
	var ht = getObjHeight(theObj);
	var xLoc = 0;
	var yLoc = 0;
	if (valueShow)
	{
		xloc = wid - 20;
		yloc = 0;
		//xLoc = getMouseX(theEvent) - Math.round(wid/2);       // place popup at the mouse X (left) location
		//if (xLoc<getInsideWindowLeft()) {
		//	xLoc = getInsideWindowLeft();
		//}
		//else if ((xLoc+wid)>getInsideWindowWidth()) {
		//	xLoc = (getInsideWindowWidth()-wid);
		//}

		//yLoc = getMouseY(theEvent) -100;            // place popup at the mouse Y (top) location
		//if ((ht+yLoc)>(getInsideWindowHeight()+getInsideWindowTop()))
		//	yLoc = Math.max(0,getInsideWindowHeight()-ht);
	}
	//document.forms[0].debugText.innerText = "xLoc="+xLoc+"\nyLoc="+yLoc+"\nheight="+getInsideWindowHeight()+"\ngetMouseY(theEvent)="+getMouseY(theEvent);
	hideShowData(obj, xLoc, yLoc, valueShow)
}
function hideShowData(obj, xLoc, yLoc, valueShow) {
	thePosObj = getPosObject(obj);
	setVisibility(thePosObj, valueShow);
	if (valueShow)
	{
		shiftTo(thePosObj, xLoc, yLoc);
		//thePosObj.zIndex = 10;
	}
}
