//Helper Functions
function locateMousePos(e) {
    var posx = 0, posy =0;
    if(e){
		if(e.pageX || e.pageY) {
			posx=e.pageX; posy=e.pageY;
		} else if (e.clientX || e.clientY) {
			if(document.documentElement.scrollTop){
				posx=e.clientX;+document.documentElement.scrollLeft;
				posy=e.clientY;+document.documentElement.scrollTop;
			} else {
				posx=e.clientX;+document.body.scrollLeft;
				posy=e.clientY+document.body.scrollTop;
			}
		}
    }
    return {x:posx, y:posy};
} 
function findPosition(obj) {
	var l = 0;
	var t = 0;
	if (obj.offsetParent) {
		l = obj.offsetLeft
		t = obj.offsetTop
		while (obj = obj.offsetParent) {
			l += obj.offsetLeft
			t += obj.offsetTop
		}
	}
	return {x:l,y:t};
}

function getDimensions(obj) {
	if(obj){
		var objStyle = obj.style;
		var originalVisibility = objStyle.visibility;
		var originalPosition = objStyle.position;
		var originalDisplay = objStyle.display;
		objStyle.visibility = 'hidden';
		objStyle.position = 'absolute';
		objStyle.display = 'block';
		var originalWidth = obj.clientWidth;
		var originalHeight = obj.clientHeight;
		objStyle.display = originalDisplay;
		objStyle.position = originalPosition;
		objStyle.visibility = originalVisibility;
		return {width: originalWidth, height: originalHeight};
	}
	return {width: 0, height: 0};
}
// Repeater row highlight
var ACMSLastCss = "";
function ACMSHighLightMe(objRef, doHighLight){
	if (doHighLight == true) {
		ACMSLastCss = objRef.className.toString();
		objRef.className = "ACMSRowOver";
	} else {
		objRef.className = ACMSLastCss;
		ACMSLastCss = "";
	}

}

// Menu clickpath
function ACMSMarkMenuPath(ACMSarrPath, ACMSmenuGUID, ACMScssClass){
	for(ACMSmenuID in ACMSarrPath){
		ACMSmItemID = ACMSmenuGUID + "_" + ACMSarrPath[ACMSmenuID];
		//alert(ACMSmItemID);
		ACMSmItemRef = document.getElementById(ACMSmItemID);
		if (ACMSmItemRef != null){
			ACMSmItemRef.innerHTML = "<div class=\"" + ACMScssClass + "\">" + ACMSmItemRef.innerHTML + "<\/div>";
		}
	}

}

//Help tags
function ACMSGetURLText(ACMSUrl, ACMSctlName)
{
	
	ACMSGetURLText_xmlHttp = ACMSGetURLText_GetXmlHttpObject();
    if (ACMSGetURLText_xmlHttp == null)
    {
    	alert ("Browser does not support HTTP Request");
    	return;
    } 
    
    ACMSGetURLText_xmlHttp.onreadystatechange = function(){
     if (ACMSGetURLText_xmlHttp.readyState==4 || ACMSGetURLText_xmlHttp.readyState=="complete"){ 
            document.getElementById(ACMSctlName).innerHTML= "<div class=\"ACMSHelp\">" + ACMSGetURLText_xmlHttp.responseText + "<\/div>";
        }
     };

    ACMSGetURLText_xmlHttp.open("GET", ACMSUrl, true);
    ACMSGetURLText_xmlHttp.send(null);
}

function ACMSGetURLText_GetXmlHttpObject()
{ 
    var ACMSGetURLText_objXMLHttp=null;
    if (window.XMLHttpRequest)
    {
        ACMSGetURLText_objXMLHttp=new XMLHttpRequest();
    }
    else if (window.ActiveXObject)
    {
        ACMSGetURLText_objXMLHttp=new ActiveXObject("Microsoft.XMLHTTP");
    }
    return ACMSGetURLText_objXMLHttp;
}
// /Help tags