var ajaxwin;
var xmlHttp="";
function ajaxFunction(){try{ xmlHttp=new XMLHttpRequest();}catch (e){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 sendAjax(url,params){xmlHttp.open("POST",url,true);xmlHttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");xmlHttp.setRequestHeader("Content-length", params.length);xmlHttp.setRequestHeader("Connection", "close");xmlHttp.send(params);}


function Info(Page,param,go)
{
 var load=document.getElementById("loading");
	load.value="true";	
	window.status="Loading";
	xmlHttp=ajaxFunction();
	xmlHttp.onreadystatechange=function()
	{
	 if(xmlHttp.readyState==4)
		{
		 info=xmlHttp.responseText;
			xmlHttp=null;
			if(info!="logged off" && info!="Your IP Address has been banned.")
			{
			 eval(go+"()");
			}
			else
			{
			 alert("You Have Been Logged Off.");
				window.location.reload();			
			}
			load.value="false";
			window.status="";
			
		}
	}
	sendAjax("./includes/"+Page+".inc.php",param);
}

function Page(Page,Table,param)
{
	var obj=document.getElementById(Table);
 var load=document.getElementById("loading");
	load.value="true";
	window.status="Loading";
	xmlHttp=ajaxFunction();
	xmlHttp.onreadystatechange=function()
	{
	 if(xmlHttp.readyState==4)
		{
		 info=xmlHttp.responseText;
			xmlHttp=null;		
			if(param.indexOf("EditWhosWho")==-1 && Table!="LoreDisplay" && Page!="chatpages" && Table!="AS" && Table!="pageWindow")
			{
			 SitePages(Page,param,Table);
			}
			if(info!="logged off" && info!="Your IP Address has been banned.")
			{
		  obj.innerHTML=info;
			}
			else
			{
			 alert("You Have Been Logged Off.");
				window.location.reload();
			}
			load.value="false";
			window.status="";
		}
	}
	sendAjax("./includes/"+Page+".inc.php",param);
}

function PageExtras(Page,Table,param,title,x,y,id)
{
	var obj=document.getElementById(Table);
 var load=document.getElementById("loading");
	load.value="true";
	window.status="Loading";
	xmlHttp=ajaxFunction();
	xmlHttp.onreadystatechange=function()
	{
	 if(xmlHttp.readyState==4)
		{
		 info=xmlHttp.responseText;
			xmlHttp=null;		
			if(param.indexOf("EditWhosWho")==-1 && Table!="LoreDisplay" && Page!="chatpages" && Table!="AS" && Table!="pageWindow")
			{
			 SitePages(Page,param,Table);
			}
			if(info!="logged off" && info!="Your IP Address has been banned.")
			{
			 eval(id+"=dhtmlwindow.open('"+id+"', 'inline', info, title, 'width="+x+"px,height="+y+"px,left=300px,top=100px,resize=1,scrolling=1');")
			 
		  //obj.innerHTML=info;
			}
			else
			{
			 alert("You Have Been Logged Off.");
				window.location.reload();
			}
			load.value="false";
			window.status="";
		}
	}
	sendAjax("./includes/"+Page+".inc.php",param);
}
// 