
// getXMLData()
function getXMLData()
{
var connectString="getData.php";
xmlData=null;
    if (window.XMLHttpRequest)
        {// code for IE7, Firefox, Mozilla, etc.
        xmlData=new XMLHttpRequest();
        }
    else if (window.ActiveXObject)
        {// code for IE5, IE6
        xmlData=new ActiveXObject("Microsoft.XMLHTTP");
        }
    if (xmlData!=null)
        {
        xmlData.onreadystatechange=showXMLData;
        xmlData.open("get",connectString,true,null,null);
        xmlData.send(null);
        }
    else
        {
        alert("This browser does not support XMLHTTP objects.");
        }
}

// showXMLData()
function showXMLData()
{
if(xmlData.readyState!=4) return;
if(xmlData.status!=200)
  	{
  	alert("Problem retrieving XML data\n" + " State=" + xmlData.parseError.reason);
  	return;
  	}
// retrieve quotation and author
document.getElementById("pageContent").innerHTML=xmlData.responseText;
}