function AJAX(data,php,module,callback,divid)
{
//alert('PostData - ' + data + '\r\n' + 'PHP - ' + php + '\r\n' + 'Callback - ' + callback + '\r\n' + 'DivID - ' + divid);
if(data)
{
document.getElementById(divid).innerHTML = "
";
AjaxRequest(data,php,module,callback,divid);
}
else
{
var elements=document.getElementsByTagName("input");
var elements1=document.getElementsByTagName("textarea");
var elements2=document.getElementsByTagName("select");
var postdata;
for (i = 0; i ";
AjaxRequest(postdata,php,module,callback,divid);
}
}
var req;
function AjaxRequest(data, url, module, callback, divid)
{
//alert('PostData - ' + data + '\r\n' + 'PHP - ' + url + '\r\n' + 'module - ' + module + '\r\n' + 'Callback - ' + callback + '\r\n' + 'DivID - ' + divid);
if (window.XMLHttpRequest)
{
req = new XMLHttpRequest();
}
else if (window.ActiveXObject)
{
req = new ActiveXObject("Microsoft.XMLHTTP");
}
if(req)
{
req.onreadystatechange=function state_Change()
{
if (req.readyState==4)
{
if (req.status==200)
{
//alert ( req.responseText );
eval ( callback + "('" + divid + "');" );
}
else
{
alert("There was a problem contacting server:\n" + req.statusText);
}
}
}
req.open("POST", url, true);
req.setRequestHeader('Content-Type','application/x-www-form-urlencoded;');
req.send(data + module);
}
else
{
alert ( "Could not initialize XMLHTTPRequest object. Unable to make request");
return null;
}
}