
function createXHR(){var xhr;try{xhr=new XMLHttpRequest();}catch(error){try{xhr=new ActiveXObject('Msxml2.XMLHTTP');}catch(error){try{xhr=new ActiveXObject('Microsoft.XMLHTTP');}catch(error){xhr=null;}}}
return xhr;}
var spareXHRObject;var sparePostmessage;var sparePHPScript;var spareJSResponse;function ajax(xhrObject,phpScript,jsResponse,postMessage){e12030count=0;if(xhrObject!=null){if(typeof postMessage=="undefined"){postMessage=null;try{xhrObject.open('GET',phpScript,true);}catch(err){if(console){console.log('xhrObject.open error: '+err);}}}
else{postMessage+="&superrandom="+Math.random();xhrObject.open('POST',phpScript,true);if(!navigator.userAgent.match(/iPhone/)){xhrObject.setRequestHeader("Content-type","application/x-www-form-urlencoded");xhrObject.setRequestHeader("Content-length",postMessage.length-1);xhrObject.setRequestHeader("Content-Disposition",'form-data; name="motaja"');xhrObject.setRequestHeader("Connection","close");}}
xhrObject.onreadystatechange=function(){if(xhrObject.readyState==4){try{if(xhrObject.status==200||xhrObject.status==304){if(typeof jsResponse=="function")
jsResponse(xhrObject.responseText,this);}
else if(xhrObject.status==12030){alert('error 12030');working=false;while(!working){try{e12030count++;if(e12030count<=3){spareXHRObject=xhrObject;sparePostmessage=postMessage;sparePHPScript=phpScript;spareJSResponse=jsResponse;setTimeout("ajaxRetry();",500);working=true;}
else{alert('Aj Error \nLimit exceeded on Internet Explorer 12030 errors');break;}}
catch(error){if(console){console.log('XHR retry for IE 12030 error: '+err);}}}}
else{if(console){console.log('XHR status error\nstatus: '+xhrObject.status+"\nscript: "+phpScript);}}}catch(err){if(console){console.log('XHR onreadystatechange error: '+err);}}}}
try{xhrObject.send(postMessage);}catch(err){if(console){console.log('XHR send error: '+err);}
xhrObject
alert('xhrObject.send error: '+err);}}
return false;}
function ajaxRetry(){ajax(spareXHRObject,sparePHPScript,spareJSResponse,sparePostmessage);}
