// Begin Ajax functions here
var xmlHttp

function showPHP(phpfile,id,method,postform)
{

if (phpfile.length==0){
  document.getElementById(id).innerHTML="";
  return;
 }

xmlHttp=GetXmlHttpObject();

if (xmlHttp==null){
  alert ("Your browser does not support AJAX!");
  return;
}

var url=phpfile;

if(method == 'post'){
	var str = getFormValues(postform);
	//var str = "this=2&that=3";


	xmlHttp.open("POST",url,true);
	xmlHttp.onreadystatechange= function() { stateChanged(id); };
	//Send the proper header information along with the request
	xmlHttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded; charset=UTF-8");

	//document.writeln(str);

	xmlHttp.send(str);
}else{

	url=url+"&sid="+Math.random();
	xmlHttp.onreadystatechange= function() { stateChanged(id); };
	xmlHttp.open("GET",url,true);
	xmlHttp.send(null);
}
}

function stateChanged(id)
{
	if (xmlHttp.readyState==4){
		document.getElementById(id).innerHTML=xmlHttp.responseText;
	}
}

function GetXmlHttpObject()
{
var xmlHttp=null;
try
  {
  // Firefox, Opera 8.0+, Safari
  xmlHttp=new XMLHttpRequest();
  }
catch (e)
  {
  // Internet Explorer
  try
    {
    xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
    }
  catch (e)
    {
    xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
    }
  }
return xmlHttp;
}