// JavaScript Document
function get_xmlHttp(){
var xmlHttp;
try
  {
  // Firefox, Opera 8.0+, Safari
  xmlHttp=new XMLHttpRequest();
  }
catch (e)
  {
  // Internet Explorer
  try
    {
    xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
    }
  catch (e)
    {
    try
      {
      xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
      }
    catch (e)
      {
      alert("Your browser does not support AJAX!");
      return false;
      }
    }
  }
  return xmlHttp;
}

function ajaxFunction(box_id,query,state1,state2,state3,state4)
{

	if(get_xmlHttp()){
	
	  xmlHttp = get_xmlHttp();
	
	  xmlHttp.onreadystatechange=function()
		{
		if(xmlHttp.readyState==1)
		  {
		    document.getElementById(box_id).innerHTML=state1;
		  }
		if(xmlHttp.readyState==2)
		  {
		    document.getElementById(box_id).innerHTML=state2;
		  }
		if(xmlHttp.readyState==3)
		  {
		    document.getElementById(box_id).innerHTML=state3;
		  }
		if(xmlHttp.readyState==4)
		  {
			document.getElementById(box_id).innerHTML=state4;
		  }
		document.getElementById(box_id).innerHTML=xmlHttp.responseText;
		}
	  xmlHttp.open("GET",query,true);
	  xmlHttp.send(null);
	}
}




