var xmlhttp;
var loc="";
function loadRemotePage(url,loc) 
{
	this.loc = loc
	// code for Mozilla, etc.
	if (window.XMLHttpRequest)  
	{
	
  		xmlhttp=new XMLHttpRequest();
  		xmlhttp.onreadystatechange=manageStateChange;
  		xmlhttp.open("GET",url,true);
  		xmlhttp.send(null);
  	}
	// code for IE
	else if (window.ActiveXObject)
  	{
  		xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
    	if (xmlhttp)
    	{
    		xmlhttp.onreadystatechange=manageStateChange;
    		xmlhttp.open("GET",url,true);
   			xmlhttp.send();
    	}
  	}
}

function manageStateChange()
{
	// if xmlhttp shows "loaded"
	document.getElementById(loc).innerHTML=xmlhttp.readyState;	
	if (xmlhttp.readyState==4)
  	{
  		// if "OK"
  		if (xmlhttp.status==200)
  		{
  			try 
			{
  				//alert(xmlhttp.responseText);
				document.getElementById(loc).innerHTML=xmlhttp.responseText;				
			}
  			catch (e) 
			{
  				document.getElementById(loc).innerHTML = e.Message;
  			}
  		}
  		else
  		{
  			document.getElementById(loc).innerHTML = "Unable to retrieve stories";
  		}
  	}
}