// JavaScript Document
function loadurl(dest,sendInfo,div) { 

	mydiv = div;

	if (document.getElementById(mydiv)){
		document.getElementById(mydiv).style.display='none';
	}

	if (document.getElementById('loading')){
		document.getElementById('loading').style.display='inline';
	}

	try { 

	// Moz supports XMLHttpRequest. IE uses ActiveX.  
	// browser detction is bad. object detection works for any browser  
	xmlhttp = window.XMLHttpRequest?new XMLHttpRequest(): 
	new ActiveXObject("Microsoft.XMLHTTP"); 
			
  } 
  catch (e) { 
  
	// browser doesn't support ajax. handle however you want  
  } 
  
  // the xmlhttp object triggers an event everytime the status changes  
  // triggered() function handles the events  
  xmlhttp.onreadystatechange = triggered; 
  
  // open takes in the HTTP method and url.  
	//alert(dest+"?"+sendInfo);
  xmlhttp.open("GET", dest+"?"+sendInfo); 
  
  // send the request. if this is a POST request we would have  
  // sent post variables: send("name=aleem&gender=male)  
  // Moz is fine with just send(); but  
  // IE expects a value here, hence we do send(null);  
  xmlhttp.send(null); 
  
} 

function triggered() { 
  
  // if the readyState code is 4 (Completed)  
  // and http status is 200 (OK) we go ahead and get the responseText  
  // other readyState codes:  
  // 0=Uninitialised 1=Loading 2=Loaded 3=Interactive  
//alert('debug mode');
  if ((xmlhttp.readyState == 4) && (xmlhttp.status == 200)) { 

	if (document.getElementById('loading')){
		document.getElementById('loading').style.display='none';
	}

	// xmlhttp.responseText object contains the response.  
	if (document.getElementById(mydiv)){
	document.getElementById(mydiv).innerHTML = xmlhttp.responseText; 
	Effect.BlindDown(mydiv);
	//document.getElementById(mydiv).style.display = 'block';
	}
	
  } 
}
