function AjAXRequest() { var xmlHttp=null; var a,ua=navigator.userAgent; var _urlparse=new Array; var url=null; var method="GET"; var id=null; var password=null; var param=null; var charset="UTF-8"; this.browser={ safari : ((a=ua.split('AppleWebKit/')[1])?a.split('(')[0]:0)>=124, moz : ((a=ua.split('Gecko/')[1])?a.split(" ")[0]:0) >= 20011128, opera : (!!window.opera) && ((typeof XMLHttpRequest)=='function') }; this.check=function() { var error=1; if(!this.url) { alert('AJAX : ERROR_URL'); error=0; } return error; }; this.run=function(proc_funcname) { if(this.check()) { if(window.ActiveXObject) { try{ xmlHttp=new ActiveXObject("Msxml2.XMLHTTP"); } catch (e) { try { xmlHttp=new ActiveXObject("Microsoft.XMLHTTP"); } catch (e2) { xmlHttp=null; } } } else if(window.XMLHttpRequest) { xmlHttp=new XMLHttpRequest(); } else{ xmlHttp=null; }; if (this.method=="GET") { xmlHttp.open("GET",this.url,true); _urlparse[0]=this.url; _urlparse[1]=null; } else if(this.method=="POST") { _urlparse[0]=this.url; _urlparse[1]=this.param; if(this.id && this.password) { xmlHttp.open("POST",_urlparse[0],true,this.id,this.password); } else { xmlHttp.open("POST",_urlparse[0],true); } xmlHttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded; charset=" + this.charset); }; if(this.browser.opera || this.browser.safari || this.browser.moz) { xmlHttp.onload=function() { proc_funcname(xmlHttp.responseText); } } else { xmlHttp.onreadystatechange = function() { if (xmlHttp.readyState == 4) { proc_funcname(xmlHttp.responseText); } } } xmlHttp.send(_urlparse[1]); } } }