function AjaxCall(callPage, qstring, setDivID, aCallBack,closeMe){ var xmlHttp; xmlHttp=GetXmlHttpObject(); if (xmlHttp==null){ alert ("Your browser does not support AJAX!"); return; } // prep calling page with sid to prevent caching callPage=callPage+"?sid="+Math.random(); // open call to posting page xmlHttp.open("POST",callPage,true); // attach callback function to xmlhttprequest object xmlHttp.onreadystatechange=function(){ if (xmlHttp.readyState==4){ // set container div with contents if(setDivID){ setThis = document.getElementById(setDivID); setReturn = xmlHttp.responseText; setThis.innerHTML = setReturn.replace(/^\s*|\s*$/g,''); if(closeMe==1){ setThis.innerHTML = "[ X ] Close" + setThis.innerHTML; } } // user defined call back on success if(aCallBack){ eval(aCallBack); } } } if(qstring.indexOf("=")==-1&&qstring!=''){ // qstring is a form - no equal sign for variables, parse it into a URL string of variables var frm = document[qstring]; frmL = frm.elements.length; frmE = frm.elements; postFile = ""; for(i=0;i