

function createRequestObject() {
    var tmpXmlHttpObject;
    
    //depending on what the browser supports, use the right way to create the XMLHttpRequest object
    if (window.XMLHttpRequest) { 
		// Mozilla, Safari would use this method ...
		tmpXmlHttpObject = new XMLHttpRequest();
	
    }else if (window.ActiveXObject) { 
		// IE would use this method ...
		try{
			tmpXmlHttpObject = new ActiveXObject("MSXML2.XMLHTTP");	
		}catch(e){
			try{
				tmpXmlHttpObject = new ActiveXObject("Microsoft.XMLHTTP");	
			}catch(e){}
		}  
	}else{

		alert("Your browser doesn't support AJAX");
		return null;
	}    
    return tmpXmlHttpObject;
}


function testSession(e, theUrl) {

	//call the above function to create the XMLHttpRequest object
	var http = createRequestObject();

	// Fecth the divs
	var dDev = document.getElementById('sess_hd');

    // Fetch the content	
	http.open('get', theUrl);
			
	//assign a handler for the response
	http.onreadystatechange = function(){processSessTest(http, dDev);}
	
    //actually send the request to the server
    http.send(null);
}

function processSessTest(http, dDev) {

	// Check if the response has been received from the server
	if(http.readyState == 4){

		//read the response and set content
		//var response = http.responseText;
		if(http.responseText.length > 0)
			dDev.innerHTML = http.responseText;
    }
}


