function _getRealX(who) {
		// Returns the true X (from left 0) of an object.
		// The parameter can be either reference of an ID of the object
		var obj = (typeof who == "string")?document.getElementById(who):who;
		var res = 0;
		var t = who;
		while (1 == 1) {
			if (typeof t.offsetLeft != "undefined") res += t.offsetLeft;
			t = t.offsetParent;
			if (t == document.body) return res;
		}
	}

	function _getRealY(who) {
		// Returns the true Y (from top 0) of an object.
		// The parameter can be either reference of an ID of the object
		var obj = (typeof who == "string")?document.getElementById(who):who;
		var res = 0;
		var t = who;
		while (1 == 1) {
			if (typeof t.offsetTop != "undefined") res += t.offsetTop;
			t = t.offsetParent;
			if (t == document.body) return res;
		}
	}

function hasParent(who,papa) {
	if (who == papa) return true;
	var current = who;
	while (1 == 1) {
		if (current == document.body) return false;
		if (current == papa) return true;
		current = current.parentNode;
	}
	return false;
}

var currentInfoBox = null;

function imgBoxOver(imgBox){
	imgBox.className="imgBox";
	currentInfoBox = imgBox;
	document.getElementById("bubbleBoxInfo").style.display="block";
	document.getElementById("bubbleBoxInfo").style.left=_getRealX(imgBox)+45+"px";
	document.getElementById("bubbleBoxInfo").style.top=_getRealY(imgBox)-10+"px";
	document.getElementById('mainT').onmousemove = removeBubble;
	document.getElementById("infoTxt").innerHTML=imgBox.getAttribute("clientInfoText");
}

function imgBoxOut(imgBox){
//imgBox.className="imgBoxOpacity";
}
function ResetAllExcept(who) {
	for (var i=0;i<document.getElementById("try").childNodes.length;i++) {
		if (typeof document.getElementById("try").childNodes[i] != "undefined" && document.getElementById("try").childNodes[i] != null &&
			typeof document.getElementById("try").childNodes[i].tagName != "undefined" && document.getElementById("try").childNodes[i].tagName.toLowerCase() == "img") {
			if (document.getElementById("try").childNodes[i] != who) {
				document.getElementById("try").childNodes[i].className = "imgBoxOpacity";
			}
		}
	}
}

function removeBubble(ev) {
	var s = (typeof ev == "undefined")?event.srcElement:ev.target;
	if (hasParent(s,document.getElementById("bubbleBoxInfo")) || hasParent(s,currentInfoBox)) {
		currentInfoBox.className = "imgBox";
		ResetAllExcept(currentInfoBox);
		return;
	} else {
		//alert(hasParent(s,document.getElementById("bubbleBoxInfo")));
		document.getElementById("bubbleBoxInfo").style.display="none";
		currentInfoBox.className = "imgBoxOpacity";
		currentInfoBox = null;
		document.getElementById('mainT').onmousemove = null;
	}
}




	