function _xml(){var xmlhttp=false;
/*@cc_on @*//*@if (@_jscript_version >= 5)
try{xmlhttp=new ActiveXObject("Msxml2.XMLHTTP");}catch(e){try{xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");}catch(E){xmlhttp = false;}}
@else
 xmlhttp=false
@end @*/if (!xmlhttp && typeof XMLHttpRequest!='undefined'){try{xmlhttp=new XMLHttpRequest();}catch(e){xmlhttp=false}}return xmlhttp;}

	function changeLinks() {
		if (!document.getElementsByTagName) return false;
		var as = document.getElementsByTagName("a");
		if (as.length == 0) return false;
		for (var i = 0; i < as.length; i++) {
			var href = as[i].href;
			if (href.indexOf("link.cp2?t=Article&i=")>-1 || (href.indexOf('&letter=')>-1 && window.location.href.indexOf("linkid=43")<0)) {
				as[i].onmouseover = function (e) {
					if (!e) e = window.event;
					if (e.target) targ = e.target;
					else if (e.srcElement) targ = e.srcElement;
					if (targ.nodeType == 3) targ = targ.parentNode;
					if (targ.tagName.toUpperCase()=='A') {
						window.hoverElement = targ;
						return showDesc(true);
					}
					return false;
				}
				as[i].onmouseout = function () {
					window.hoverElement = null;
					window.bi_req.abort();
					return showDesc(false);
				}
			}
		}
	}

	function doOnclick(uid) {
		if (!document.getElementsByTagName) return false;
		var as = document.getElementsByTagName("a");
		if (as.length == 0) return false;
		for (var i = 0; i < as.length; i++) {
			var href = as[i].href;
			if (href.indexOf("link.cp2?t=Article&i=" + uid) > -1) {
				as[i].onclick = function () {return !window.open('help.cp2?uid=' + uid + '','Help','width=623,height=500,scrollbars=1,toolbar=0,status=0,resizable=0,menubar=0,location=0');};
			}
		}
	}

	function showDesc(show) {
		var object = document.getElementById("tooltip");
		if (show) {
			if (window.hoverElement==null) return;
			var href = window.hoverElement.href;
			var uid = (href.indexOf("&i=")>-1)? href.substring(href.indexOf("&i=") + 3, href.length) : href.substring(href.indexOf("&uid=")+5, href.indexOf("&",href.indexOf("&uid=")+1));
			document.onmouseover = function () { return showDesc(false); }
			var bi_req = _xml();
			bi_req.open("GET", "/getTooltip.cp2?uid=" + uid, true);
			bi_req.onreadystatechange = function() {
				if (bi_req.readyState == 4) {
					if (bi_req.status == 200) {
						var res = bi_req.responseText;
						var type = res.substring(0, 4);
						if (type == "help") doOnclick(uid);
						var text = res.substring(4, res.length);
						object.innerHTML = text;
						object.style.display = (object.style.display == 'none') ? 'block' : 'none';
						if (type!='help' && window.hoverElement!=null) {
							var letter = window.hoverElement.innerHTML.substr(0,1).toUpperCase();
							window.hoverElement.href = '/tradeport.cp2?cid=DBF56218-45C2-E324-8823-0DE3E19573A1&linkid=43&uid='+uid+'&letter='+letter;
						}
					} else {
						object.innerHTML = "";
						object.style.display = "none";
					}
				}
			}
			bi_req.send(null);
			window.bi_req = bi_req;
		} else {
			object.style.display = "none";
		}
	}

	function getCoord(e) {
		var xcoord = 0;
		var ycoord = 0;
		if (!e) {
			if (window.event) {
				//DOM
				e = window.event;
			} else {
				//TOTAL FAILURE, WE HAVE NO WAY OF REFERENCING THE EVENT
				return;
			}
		}
		if (typeof( e.pageX ) == 'number') {
			//NS 4, NS 6+, Mozilla 0.9+
			xcoord = e.pageX;
			ycoord = e.pageY;
		} else {
			if (typeof( e.clientX ) == 'number') {
				//IE, Opera, NS 6+, Mozilla 0.9+
				//except that NS 6+ and Mozilla 0.9+ did pageX ...
				xcoord = e.clientX;
				ycoord = e.clientY;
				if (!( ( window.navigator.userAgent.indexOf('Opera') + 1 ) ||
				       ( window.ScriptEngine && ScriptEngine().indexOf('InScript') + 1 ) ||
				       window.navigator.vendor == 'KDE' )) {
					if (document.body && ( document.body.scrollLeft || document.body.scrollTop )) {
						//IE 4, 5 & 6 (in non-standards compliant mode)
						xcoord += document.body.scrollLeft;
						ycoord += document.body.scrollTop;
					} else if (document.documentElement &&
					           ( document.documentElement.scrollLeft || document.documentElement.scrollTop )) {
						//IE 6 (in standards compliant mode)
						xcoord += document.documentElement.scrollLeft;
						ycoord += document.documentElement.scrollTop;
					}
				}
			} else {
				//TOTAL FAILURE, WE HAVE NO WAY OF OBTAINING THE
				//MOUSE COORDINATES
				return;
			}
		}
		var object = document.getElementById("tooltip");
		if (object != null) {
			object.style.left = xcoord + 15 + "px";
			object.style.top = ycoord + 10 + "px";
		}
	}

	changeLinks();
	document.onmousemove = getCoord;