// JScript File
jsonClass=function(argNames){
  var F=function(){
    var m=argNames; var a=arguments; var u;
    for(var i=0;i<m.length;i++){
      if(a[i]===u){continue};
      this[m[i]]=a[i];
    }
  };
  return F;
};

// JScript File
XMLPost = jsonClass(["control, id"]);
XMLPost.prototype = {
    reqObj : Object,
    extraparam : "",
    
    init : function(){
    },
    
    doPost : function(URL, postData, handler) {
        this.reqObj = this.getXmlHttpRequestObject();
        var instance = this;
        this.reqObj.open("POST", URL, true);
        this.reqObj.setRequestHeader('Content-Type','application/x-www-form-urlencoded');   
        //this.reqObj.setRequestHeader('Content-Type','application/x-www-form-urlencoded');                
        if ( handler != null ) {
            this.reqObj.onreadystatechange = function(){
              handler(instance);
            }
        }
        this.reqObj.send(postData);
    },
    
     doGet : function(URL, handler, extraparameter) {        
        this.reqObj = this.getXmlHttpRequestObject();        
        this.extraparam = extraparameter;
        var instance = this;
         this.reqObj.onreadystatechange = function(){
          handler(instance);
        }
        this.reqObj.open("GET", URL, true);
        this.reqObj.send(null);
    },
    
    getXmlHttpRequestObject : function() {
        if (window.XMLHttpRequest) {
            return new XMLHttpRequest();
        } else if(window.ActiveXObject) {
            return new ActiveXObject("Microsoft.XMLHTTP");
        } else {
            return null;
        }
    }
}



if ( typeof codeMirror == "undefined" ) {
 var codeMirror = null;
}

