var xmlhttp = GetXmlHttpObject(); function GetXmlHttpObject() { if (window.XMLHttpRequest) { // code for IE7+, Firefox, Chrome, Opera, Safari return new XMLHttpRequest(); } if (window.ActiveXObject) { // code for IE6, IE5 return new ActiveXObject("Microsoft.XMLHTTP"); } return null; } function ReadXml() { xmlhttp = GetXmlHttpObject(); if (xmlhttp != null) { xmlhttp.onreadystatechange=stateChanged; xmlhttp.open( "GET", "/includes/def.xml", true ); xmlhttp.send( null ); } } function stateChanged() { if (xmlhttp.readyState == 4) { var re = new RegExp( /<(\S+).*>(.*)<\/\1>/gi ); var ar = xmlhttp.responseText.match( re ); for (var i = 0; i < ar.length; i++) { var reId = new RegExp( /(.*)<\/id>/i ); var reText = new RegExp( /(.*)<\/text>/i ); var bMatch1 = ar[i].match( reId ); if (bMatch1[1] != null) { var bMatch2 = ar[++i].match( reText ); if (bMatch2[1] != null) { var sId = "tt_" + bMatch1[1]; setCookie(bMatch1[1],bMatch2[1],1); var tid = document.getElementById( sId ); if (tid != null) { addEvent( tid, 'mouseover', SetLocation ); tid.onmouseout = function() { HideOverlay( "tooltip" ); } } } } } } } function addEvent(obj, evType, fn) { //alert("in addEvent"); if (obj.addEventListener) { //alert(fn); obj.addEventListener(evType, fn, false); return true; } else if (obj.attachEvent) { var r = obj.attachEvent("on"+evType, fn); return r; } else { return false; } }