var xmlHttp;
function Ajax()
{
	
	this.Ajaxdebug=0;
	this.responseText="";
	this.actionFunction="onGetContents("+this.responseText+")";
}
function open(script)
{
	xmlHttp=this.GetXmlHttpObject();
	var queryString=(typeof(arguments[1])=='undefined'?'':arguments[1]);
	var url= script + ".php"; //use dynamic file
	url=url+"?sid="+Math.random(); //id for ajax
	if(queryString!="")
		url=url+"&"+queryString;
	if(this.Ajaxdebug>0)
		alert("Posting url:= "+url);	
	xmlHttp.onreadystatechange=stateChanged;
	xmlHttp.open("GET",url,true);
	xmlHttp.send(null);
	
}
function GetXmlHttpObject(){ 
	var objXMLHttp=null
	
	if (window.XMLHttpRequest)
		objXMLHttp=new XMLHttpRequest()
	else if (window.ActiveXObject)
		objXMLHttp=new ActiveXObject("Microsoft.XMLHTTP")
	return objXMLHttp
}
function stateChanged(){ 
	if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
	{
			//aobj=new Ajax();
			//aobj.Action(xmlHttp.responseText);
			onGetContents(xmlHttp.responseText);
			
	}
} 
/*function Action(text)
{
	this.responseText=text;
	if(this.Ajaxdebug>0)
		alert(this.responseText);
	eval(this.actionFunction);
}*/
Ajax.prototype.xmlHttp="";
Ajax.prototype.open=open;
//Ajax.prototype.Action=Action;
Ajax.prototype.GetXmlHttpObject=GetXmlHttpObject;
//Ajax.prototype.stateChanged=stateChanged;
/*var xmlHttp;
var Ajaxdebug=0;
function placeContents(script,element)
{
	var qString=(typeof(arguments[2])=='undefined'?'':arguments[2]); 
	var debug=(typeof(arguments[3])=='undefined'?0:arguments[3]); 
	var passingArgs="'"+script+"'";
	if(qString!="")
		passingArgs+=",'"+qString+"'";
	if(debug>0)
		passingArgs+=","+debug;
	var contents=eval("getContents("+passingArgs+")");
	if(debug>0)
		alert("Now placing the following contents in "+element.name+"\n"+contents);	
	element.innerHTML=contents;
}
function getContents(script)
{
	var queryString=(typeof(arguments[1])=='undefined'?'':arguments[1]); 
	var debug=(typeof(arguments[2])=='undefined'?0:arguments[2]); 
	Ajaxdebug=debug;
	xmlHttp=GetXmlHttpObject()
	if (xmlHttp==null){
		alert ("Sorry, your browser does not support HTTP Request. Exiting function.");
		return;
	} 
	
	var url= script + ".php"; //use dynamic file
	url=url+"?sid="+Math.random(); //id for ajax
	if(queryString!="")
		url=url+"&"+queryString;
	if(Ajaxdebug>0)
		alert("Posting url:= "+url);	
	xmlHttp.onreadystatechange=stateChanged;
	xmlHttp.open("GET",url,true);
	xmlHttp.send(null);
}
function stateChanged(){ 
	if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
	{
			if(Ajaxdebug>0)
				alert(xmlHttp.responseText);
			return xmlHttp.responseText; //dynamic write
	}
} 

function GetXmlHttpObject(){ 
	var objXMLHttp=null
	
	if (window.XMLHttpRequest)
		objXMLHttp=new XMLHttpRequest()
	else if (window.ActiveXObject)
		objXMLHttp=new ActiveXObject("Microsoft.XMLHTTP")
	return objXMLHttp
}*/