function  postPage(pageUrl,divField,query) 
{
	xmlHttp=GetXmlHttpObject()
	if (xmlHttp==null)
	{
		alert ("Browser does not support HTTP Request")
		return
	} 

	xmlHttp.onreadystatechange=stateChanged;
	document.getElementById(divField).innerHTML = 'laden...';
	xmlHttp.open("POST", pageUrl, true);
    xmlHttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");    
    xmlHttp.send(query);
	
	function GetXmlHttpObject(handler)
	{ 
		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)
	   {
		  if(xmlHttp.status == 200)
		  { 
			 document.getElementById(divField).innerHTML=xmlHttp.responseText 
		  } 
		  else
		  {
			alert("Deze pagina bestaat mogelijk (nog) niet." + xmlHttp.status);
		  }
	   }
	}  
	
}

function  check(pageUrl,divField,query) 
{
	xmlHttp=GetXmlHttpObject()
	if (xmlHttp==null)
	{
		alert ("Browser does not support HTTP Request")
		return
	} 

	xmlHttp.onreadystatechange=stateChanged;
	xmlHttp.open("POST", pageUrl, true);
	xmlHttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");    
    xmlHttp.send(query);
	
	function GetXmlHttpObject(handler)
	{ 
		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)
	   {
		  if(xmlHttp.status == 200)
		  { 
			eval(xmlHttp.responseText);
		  } 
		  else
		  {
			alert("Deze pagina bestaat mogelijk (nog) niet." + xmlHttp.status);
		  }
	   }
	}  
	
}

/* Start ajaxLoad script 

Author: A.H. Borger
Email: borger@glovi-network.com
It's not allowed to copy or use this script without permission from the author.
Copyright protected.
*/

function  ajaxLoad(pageUrl,divField,query,bck) 
{
	xmlHttp=GetXmlHttpObject()
	if (xmlHttp==null){
		alert ("Browser does not support HTTP Request")
		return
	} 

	xmlHttp.onreadystatechange=stateChanged;
	document.getElementById(divField).innerHTML = 'Laden...';
	if (undefined !== query){
		xmlHttp.open("POST", pageUrl, true);
		xmlHttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); 
		xmlHttp.send(query);
	} else {
		xmlHttp.open("GET", pageUrl, true);	
		xmlHttp.send(null);
	}
	
	
	function GetXmlHttpObject(handler){ 
		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) {
		  if(xmlHttp.status == 200){ 
			 document.getElementById(divField).innerHTML=xmlHttp.responseText ;
			 if (objXMLHttp !== true){
					dsHistory.addFunction(function() {ajaxLoad(pageUrl,divField,query,true)})
				}
		  } 
		  else {
			alert("Deze pagina bestaat mogelijk (nog) niet." + xmlHttp.status);
		  }
	   }
	}  
	
}
/* End ajaxLoad script*/

function status(status, id){
	if (status == 'ok'){
	document.getElementById(id).style.border = '1px solid #00FF00';
	}
	if (status == 'errors'){
	document.getElementById(id).style.border = '1px solid #FF0000';
	}
}
