

function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}


var hotspot = {};
hotspot.show = function(e,id){

	id = id.replace(/\s/g,"-");
	var el = document.getElementById("hsp_"+id);
	var cursor = getPosition(e);
	if (el){
		el.style.visibility="visible";
		el.style.left=(cursor.x-150)+"px";
		el.style.top=(cursor.y+10)+"px";
	}


}
hotspot.hide = function(id){
	id = id.replace(/\s/g,"-");
	var el = document.getElementById("hsp_"+id);
	if (el){
		el.style.visibility="hidden";
	}
}

 
function getPosition(e){
    e = e || window.event;
    var cursor = {x:0, y:0};
    if (e.pageX || e.pageY) {
        cursor.x = e.pageX;
        cursor.y = e.pageY;
    } 
    else {
        cursor.x = e.clientX + 
            (document.documentElement.scrollLeft || 
            document.body.scrollLeft) - 
            document.documentElement.clientLeft;
        cursor.y = e.clientY + 
            (document.documentElement.scrollTop || 
            document.body.scrollTop) - 
            document.documentElement.clientTop;
    }
    return cursor;
}


function addEvent(obj, evType, fn){ 
	if (obj.addEventListener){ 
		obj.addEventListener(evType, fn, false); 
		return true; 
	} else if (obj.attachEvent){ 
		var r = obj.attachEvent("on"+evType, fn); 
		return r; 
	} else { 
		return false; 
	} 
}

function createXMLHttpRequest() {
  try { return new ActiveXObject("Msxml2.XMLHTTP"); } catch(e) {}
  try { return new ActiveXObject("Microsoft.XMLHTTP"); } catch(e) {}
  try { return new XMLHttpRequest(); } catch(e) {}
  alert("XMLHttpRequest not supported");
  return null;
}

function makeHttpRequestVisitor(url,visitorId,details){
	url = url + "?visitorId="+escape(visitorId)+"&details="+escape(details);
	//alert(url);
	var xhReq = createXMLHttpRequest();
    xhReq.open("GET", url, false);
    xhReq.send(null);
}

function addHeading(gid,sty){
	var div = document.getElementById(gid);
	var str = div.innerHTML;
	if (div.childNodes.length<2) div.innerHTML = "<img src='/admin/ImageGen.aspx?text="+escape(str)+"&amp;"+sty+"'/>";
}
