      var javaAjax=new Object();
	
    //??????????????????
	javaAjax.loader = function(url,doajax,onerrors) {
	    //alert("enter....");
		this.req = false;
        this.doajax=doajax;
		this.onerror=(onerrors) ? onerrors : this.defaultError;

		//?????XMLHttpRequest??
		if(window.XMLHttpRequest) { //Mozilla ???
			this.req = new XMLHttpRequest();

		}
		else if (window.ActiveXObject) { // IE???
			try {
				this.req = new ActiveXObject("Msxml2.XMLHTTP");
			} catch (e) {
				try {
					this.req = new ActiveXObject("Microsoft.XMLHTTP");
				} catch (e) {}
			}
		}
		if (!this.req) { // ???????????
			window.alert("????XMLHttpRequest????.");
			return false;
		}
		//alert("dd");
		var pq = this;
		this.req.onreadystatechange = function(){
		
        javaAjax.processRequest.call(pq);
      }
		// ??????????URL????????????
		this.req.open("POST", url, true);
		this.req.send(null);
	}

	// ??ajax???????
   javaAjax.processRequest = function() {
              
        if (this.req.readyState == 4) { // ??????
            if (this.req.status == 200) { // ???????????????

				this.doajax.call(this);

            } else { //?????
			    this.onerror.call(this);
                //alert("???????????");
            }
        }
    }


	javaAjax.defaultError=function(){
     alert("?????????!"
    +"\n\nreadyState:"+this.req.readyState
    +"\nstatus: "+this.req.status
    +"\nheaders: "+this.req.getAllResponseHeaders());
}