//function GetXmlHttpObject()//function ajaxGetURL(tmpUrl,resultFunction)//function ajaxGetURLSync(tmpUrl,resultFunction)//function ajaxPostURL(tmpUrl,resultFunction,parameters)//function saveFieldWithPostWebDoc//function ajaxResult()//function ajaxLeft(str, n)var ajaxNJ=new Array();var resultNJ=new Array();// get the  XML HTTP Objectfunction GetXmlHttpObject(){ 	var XMLHttp=null;	try	{		XMLHttp=new ActiveXObject("Msxml2.XMLHTTP");	}catch(e){			try	{ 				XMLHttp=new ActiveXObject("Microsoft.XMLHTTP"); 			}catch(e){ 				XMLHttp==null; 			}	}	if (XMLHttp==null)	{		XMLHttp=new XMLHttpRequest();	}	return	XMLHttp;}//Start Ajax //tmpUrl= the URL//resultFunction= is the function name in string without the "()", the result will be past to the function as a argumentfunction ajaxGetURL(tmpUrl,resultFunction){	var rand= ajaxLeft(""+(Math.random()*99999),5);	tmpUrl+="&ui="+ rand;	var arrayNr;	for (nr=0; nr<=  ajaxNJ.length; nr++ ){		if(ajaxNJ[nr]){			if(ajaxNJ[nr]==null){			 arrayNr=nr;			}		}else{		arrayNr=nr;		}	}	ajaxNJ[arrayNr]=GetXmlHttpObject();	resultNJ[arrayNr]=resultFunction;	if(ajaxNJ[arrayNr]!=null){			ajaxNJ[arrayNr].onreadystatechange= ajaxResult;			ajaxNJ[arrayNr].open("GET", tmpUrl, true); 			ajaxNJ[arrayNr].send(null);				}else{		alert("Your browser does not support this action.");		}	}//Start Ajax //tmpUrl= the URL//resultFunction= is the function name in string without the "()", the result will be past to the function as a argumentfunction ajaxGetURLSync(tmpUrl,resultFunction){	var rand= ajaxLeft(""+(Math.random()*99999),5);	tmpUrl+="&ui="+ rand;	var arrayNr;	for (nr=0; nr<=  ajaxNJ.length; nr++ ){		if(ajaxNJ[nr]){			if(ajaxNJ[nr]==null){			 arrayNr=nr;			}		}else{		arrayNr=nr;		}	}	ajaxNJ[arrayNr]=GetXmlHttpObject();	resultNJ[arrayNr]=resultFunction;	if(ajaxNJ[arrayNr]!=null){			ajaxNJ[arrayNr].onreadystatechange= ajaxResult;			ajaxNJ[arrayNr].open("GET", tmpUrl, false); 			ajaxNJ[arrayNr].send(null);				}else{		alert("Your browser does not support this action.");		}	}//Start Ajax //tmpUrl= the URL//resultFunction= is the function name in string without the "()", the result will be past to the function as a argumentfunction ajaxPostURL(tmpUrl,resultFunction,parameters){	var rand= ajaxLeft(""+(Math.random()*99999),5);	tmpUrl+="&ui="+ rand;	var arrayNr;	for (nr=0; nr<=  ajaxNJ.length; nr++ ){		if(ajaxNJ[nr]){			if(ajaxNJ[nr]==null){			 arrayNr=nr;			}		}else{		arrayNr=nr;		}	}	ajaxNJ[arrayNr]=GetXmlHttpObject();	resultNJ[arrayNr]=resultFunction;	if(ajaxNJ[arrayNr]!=null){			ajaxNJ[arrayNr].onreadystatechange= ajaxResult;			ajaxNJ[arrayNr].open("POST", tmpUrl, true);			ajaxNJ[arrayNr].setRequestHeader("Content-type", "application/x-www-form-urlencoded");			ajaxNJ[arrayNr].setRequestHeader("Content-length", parameters.length);			ajaxNJ[arrayNr].setRequestHeader("Connection", "close");			ajaxNJ[arrayNr].send(parameters);				}else{		alert("Your browser does not support this action.");		}	}function saveFieldWithPostWebDoc(db,view,id,parameters,separator,resultFunction){	var tmpUrl='/'+db+'/postWebDoc?openAgent';	if( !separator){separator=";"};	if( separator==""){separator=";"};	parameters='view='+view+'&id='+id+'&separator='+separator+"&"+parameters;	ajaxPostURL(tmpUrl,resultFunction,parameters)}//Ajax result function ajaxResult(){	var myForm=document.forms[0]; 	var xmlhttp;	var tmpResponse;	for (nr=0; nr<= ajaxNJ.length; nr++ ){			xmlhttp= ajaxNJ[nr];		if(xmlhttp!=null){			if (xmlhttp.readyState==4)  	{				// if "OK"				if (xmlhttp.status==200)  {					//the response are the requested free and occupied parking spaces								tmpResponse=xmlhttp.responseText;					eval(resultNJ[nr]+"( tmpResponse,4 )");									}else{					eval(resultNJ[nr]+"( '"+"!Problem retrieving XML data:" + xmlhttp.statusText+"',4 )")				}				ajaxNJ[nr]=null; 			} 			if (xmlhttp.readyState==3)  	{eval(resultNJ[nr]+"( '',3 )");}; 			if (xmlhttp.readyState==2)  	{eval(resultNJ[nr]+"( '',2 )");}; 			//if (xmlhttp.readyState==1)  	{eval(resultNJ[nr]+"( '',1 )");}; 			//if (xmlhttp.readyState==0)  	{eval(resultNJ[nr]+"( '',0 )");};  		}  	}}function ajaxLeft(str, n){	if (n <= 0)	    return "";	else if (n > String(str).length)	    return str;	else	    return String(str).substring(0,n);}