/** function params for loadXMLDoc

url - Page you are requesting to do the work for you
params - Parameters for the request page. separated by '&'
response - Method called when AJAX returns a response. This
           is where you will put custom code on how you want 
           to work with the XML or XHTML returned. The method
           should be located on the page or in a .js file related 
           to that page.
           
           This is how the response method needs to look 

			function xmlhttpChange()
			{
			// if xmlhttp shows "loaded"
			if (xmlhttp.readyState==4)
			  {
			  // if "OK"
			  if (xmlhttp.status==200)
			    {
					....Your custom code or method call goes here.....
					
					....xmlhttp.responseText to get HTML....
									or
					....xmlhttp.responseXML to get XML as an object....
			    }
			  else
			    {
			    	alert("Problem retrieving XML data");
			    }
			  }
			}           
           
*/
//Include client logging JavaScript file
document.write('<script type="text/javascript" src="'+jsContextPath+'/javascript/common/logClientMessage.js"></script>');

var xmlhttp;

//used for IE 6 since it caches AJAX XML Response to the same url
var randomNum = Math.random();
var updateCount = randomNum;

function loadXMLDoc(url, params, response)
{
// code for Mozilla, Firefox, IE 7 etc.
if (window.XMLHttpRequest)
  {
  xmlhttp=new XMLHttpRequest();
  xmlhttp.onreadystatechange=response;
  xmlhttp.open("GET",url,true);
  xmlhttp.send(null);
  }
// code for IE 6
else if (window.ActiveXObject)
  {
  xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
    if (xmlhttp)
    {
    xmlhttp.onreadystatechange=response;
    //alert(url+"&uc="+updateCount);
    xmlhttp.open("GET",url+"&uc="+updateCount,true);
    xmlhttp.send();
    updateCount = updateCount +1;
    }
  }
}

function loadXMLDocPost(url, content, response)
{
// code for Mozilla, Firefox, IE 7 etc.
if (window.XMLHttpRequest)
  {
  xmlhttp=new XMLHttpRequest();
  xmlhttp.onreadystatechange=response;
  xmlhttp.open("POST",url,true);
  xmlhttp.send(content);
  }
// code for IE 6
else if (window.ActiveXObject)
  {
  xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
    if (xmlhttp)
    {
    xmlhttp.onreadystatechange=response;
    //alert(url+"&uc="+updateCount);
    xmlhttp.open("POST",url+"&uc="+updateCount,true);
    xmlhttp.send(content);
    updateCount = updateCount +1;
    }
  }
}
