
function PRAjaxTransport(){}
PRAjaxTransport.prototype.objTransport=null;PRAjaxTransport.prototype.fnCallback=function(data){};PRAjaxTransport.prototype.fnError=function(){};PRAjaxTransport.prototype.Create=function(callbackFunction,errorFunction,forceIframe){var _this=this;if(typeof(callbackFunction)=='function'){_this.fnCallback=callbackFunction;}
if(typeof(errorFunction)=='function'){_this.fnError=errorFunction;}
if(forceIframe==false){try{_this.objTransport=new XMLHttpRequest();}catch(ex1){try{_this.objTransport=new ActiveXObject("Msxml2.XMLHTTP");}catch(ex2){try{_this.objTransport=new ActiveXObject("Microsoft.XMLHTTP");}catch(ex3){_this.objTransport=null;}}}}
if(forceIframe==true||_this.objTransport==null){try{_this.objTransport=document.createElement('iframe');_this.objTransport.setAttribute('id','prajax_iframe_fallback_'+Math.floor(Math.random()*9999));_this.objTransport.setAttribute('name',_this.objTransport.getAttribute('name'));_this.objTransport.setAttribute('src','javascript:void(0)');_this.objTransport.style.display='none';_this.objTransport.style.position='absolute';document.getElementsByTagName('body')[0].appendChild(_this.objTransport);}catch(ex4){alert('[PRAjaxTransport error] Your browser does not support XMLHttpRequest object, IFrame object or similar alternatives');}}
if(!_this.objTransport.src){_this.objTransport.onreadystatechange=function(){if(_this.objTransport.readystate==4||_this.objTransport.readyState==4){try{if(_this.objTransport.status==200){_this.fnCallback(_this.objTransport.responseText);}else{alert("[PRAjaxTransport error] XMLHttpRequest did not return status code 200, but returned "+_this.objTransport.status+" instead:\n"+_this.objTransport.statusText);_this.fnError();}}catch(exFFBug){}
_this.objTransport.onreadystatechange=function(){};delete _this.objTransport;}};}else{PRAjaxUtil.addEvent(_this.objTransport,'load',function(){if(_this.objTransport!=null){var data=_this.objTransport.contentWindow.document.getElementsByTagName('body')[0].innerHTML;if(data){callbackFunction(data);try{document.getElementsByTagName('body')[0].removeChild(_this.objTransport);}catch(ex){}
_this.objTransport=null;}}},false);}}
PRAjaxTransport.prototype.PerformRequest=function(uri,post_data,callbackFunction,errorFunction,openCallCount){var _this=this;var forceIFrame=false;if(openCallCount>2){forceIFrame=true;}
_this.Create(callbackFunction,errorFunction,forceIFrame);if(!_this.objTransport.src){_this.objTransport.open("POST",uri,true);_this.objTransport.setRequestHeader("Method","POST "+uri+" HTTP/1.1");_this.objTransport.setRequestHeader("Content-Type","application/x-www-form-urlencoded");_this.objTransport.send(post_data);}else{var codeForm='';codeForm+='<body onload="document.prajax_form.submit();">';codeForm+='<form name="prajax_form" action="'+uri+'" method="POST">';var aElements=post_data.split('&');var i=0;var count=aElements.length;for(i=0;i<count;i++){codeForm+='<input type="hidden" name="'+aElements[i].substr(0,aElements[i].indexOf('='))+'" value="'+aElements[i].substr(aElements[i].indexOf('=')+1)+'">';}
codeForm+='</form>';codeForm+='</body>';var i=_this.objTransport.getAttribute('id');_this.objTransport.contentWindow.document.open();_this.objTransport.contentWindow.document.write(codeForm);_this.objTransport.contentWindow.document.close();}}