function getPath(){
	var path = new String(document.location.pathname);
	var arr = new Array();
	arr = path.split("/");
	arr.pop();		
	var s = new String();
	var i;
	for(i = 0; i < arr.length; i++){
		s += arr[i].toString();
	}
	var pref = "";
	if(s != "") pref = "/" + s;
	return pref;
}
//template method
function  SendHTTPRequest(sMethod , sAction, bSwitch)  
{
	var xmlHttp;
	if (window.XMLHttpRequest)
	{
		xmlHttp = new XMLHttpRequest();
		xmlHttp.open("GET",sAction,bSwitch);			
		xmlHttp.send(null);
		xmlHttp.close;			
	}
	// code for IE
	else if (window.ActiveXObject)
	{
		xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
		if (xmlHttp)
		{
			xmlHttp.open(sMethod,sAction,bSwitch);
			xmlHttp.send()
			xmlHttp.close;
		}
	}		        
    return xmlHttp.responseText;
}

function SendHTTPRequestByPageName(pageName)
{	    
	var path = new String(document.location.pathname);
	var arr = new Array();
	arr = path.split("/");
	arr.pop();		
	var s = new String();
	var i;
	for(i = 0; i < arr.length; i++){
		s += arr[i].toString() + "/";
	}
	var pref = "";
	if(s != "") pref = s;
	var sURL = pref + pageName;
	var rnd = Math.round(1000*Math.random())
	sURL += "&rnd=" + rnd;	
	return SendHTTPRequest("POST", sURL, false);
}

function UpdateTracker(src, result, root){
	var param = "src=" + src + "&result=" + result;
	var path = root + "WebHandlers/PageTracker.ashx?" + param;
	SendHTTPRequest("POST", path, false);
	return false;
}