function myAjax()
{
}

 myAjax.prototype.runAjax = this.runAjax;

 function createAJAX(){
   if (window.ActiveXObject) {
     try
      {
         return new ActiveXObject('Msxml2.XMLHTTP');
      } catch(e) {
        try {
              return new ActiveXObject('Micorsoft.XMLHTTP');
        } catch(e2) {
              return null;
        }
      }
     } else if (window.XMLHttpRequest) {
             return new XMLHttpRequest();
    } else { return null; }
 }


 function onRcvData(http,receive)
 {
    if (http.readyState==4) {
       if (http.status ==200) {  //-- status must be lowcase,otherwise occure error in FF
          document.getElementById(receive).innerHTML = http.responseText;
       } else {
          alert("process failed error:"+http.status); //-- design time for debug
//          window.location.reload();  //-- run time
       }
    }
 }

 function runAjax(target,method,param,result)
 {
     var ajax  =  createAJAX();
     ajax = createAJAX();
     ajax.open(method,target,true);
//------
    if  (method.toUpperCase() =="POST")
    {
		ajax.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
		ajax.setRequestHeader("Content-length", param.length);
		ajax.setRequestHeader("Connection", "close")
    }
//------
     ajax.onreadystatechange = function(){ onRcvData(ajax,result);}
     ajax.send(param);
 }

