var xmlhttp

function loadXMLDoc(url) 
{
xmlhttp=null
// code for Mozilla, etc.
if (window.XMLHttpRequest)
  {
  xmlhttp=new XMLHttpRequest()
  }
// code for IE
else if (window.ActiveXObject)
  {
  xmlhttp=new ActiveXObject("Microsoft.XMLHTTP")
  }
if (xmlhttp!=null)
  {
  xmlhttp.onreadystatechange=onResponse;
  xmlhttp.open("GET",url,true);
  xmlhttp.send(null);
  }
else
  {
  alert("Your browser does not support XMLHTTP.")
  }
}

function checkReadyState(obj)
{
  if(obj.readyState == 4)
  {
    if(obj.status == 200)
    {
      return true;
    }
    else
    {
      alert("Problem retrieving XML data");
    }
  }
}

function onResponse() 
{
  if(checkReadyState(xmlhttp))
  {
  var response = xmlhttp.responseXML.documentElement;
  txt=""
  x=response.getElementsByTagName("item")
    posttitle=x[0].getElementsByTagName("title")
    postlink=x[0].getElementsByTagName("link")
    postcontents=x[0].getElementsByTagName("description")
      {
      try
        {
        txt=txt + '<h2><a href="' + postlink[0].firstChild.data + '">'
        txt=txt + posttitle[0].firstChild.data + '</a></h2>'
        txt=txt + postcontents[0].firstChild.data + '\n\n'
        }
      catch (er)
        {
        txt=txt + "<h2>Feed Not Ready</h2><br>\n"
        }
      }
  document.getElementById('blogsample').innerHTML=txt
  }
}
