var xmlhttp;var req;function loadXMLDoc(url)
{  document.write('MOZILLA');
// code for Mozilla, Firefox, Netscape, Opera.
if (window.XMLHttpRequest)
  {//  document.write('MOZILLA');
  xmlhttp=new XMLHttpRequest();  xmlhttp.open('GET',url,true); //  document.write('MOZILLA1');  xmlhttp.onreadystatechange=state_Change;
// document.write('MOZILLA2');//  document.write('MOZILLA3');
  xmlhttp.send(null);  document.write('MOZILLA3');
  }  
// code for IE
else if (window.ActiveXObject)
  {
	xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
    if (xmlhttp)
    {	xmlhttp.open("GET",url,true);
    xmlhttp.onreadystatechange=state_Change;
    xmlhttp.send();
    }
  }
}

function state_Change()
{	// if xmlhttp shows "loaded"
	if (xmlhttp.readyState==4)
	{
		// if "OK"
		if (xmlhttp.status==200)
		{			alert("XML data OK")
			document.getElementById('rss_feed').innerHTML=xmlhttp.status
			document.getElementById('rss_feed').innerHTML=xmlhttp.statusText
			document.getElementById('rss_feed').innerHTML=xmlhttp.responseText
		}
		else
		{
			alert("Problem retrieving XML data:" + xmlhttp.statusText);
		}
	}
}

// Parse the RSS feed and write to the rss_feed div
function parse_data(data) {
  var pos = 0;
  var feed = document.getElementById("rss_feed");
  feed.innerHTML = '';
  while((pos = data.indexOf('<item>', pos+1)) != -1)   {
    title_b = data.indexOf('<title>', pos);
    title_e = data.indexOf('</title>', pos);
    title_s = data.substr(title_b+7, title_e-title_b-7);

    link_b = data.indexOf('<link>', pos);
    link_e = data.indexOf('</link>', pos);
    link_s = data.substr(link_b+6, link_e-link_b-6);

    feed.innerHTML += '<a href="'+link_s+'">'+title_s+'</a><br />';
  }
} 