var net=new Object();

net.READY_STATE_UNINITIALIZED=0;
net.READY_STATE_LOADING=1;
net.READY_STATE_LOADED=2;
net.READY_STATE_INTERACTIVE=3;
net.READY_STATE_COMPLETE=4;


net.ContentLoader=function(url,onload,onerror,method,params,contentType){
  this.req=null;
  this.onload=onload;
  this.onerror=(onerror) ? onerror : this.defaultError;
  this.loadXMLDoc(url,method,params,contentType);
}

net.ContentLoader.prototype.loadXMLDoc=function(url,method,params,contentType){
  if (!method){
    method="GET";
  }
  if (!contentType && method=="POST"){
    contentType='application/x-www-form-urlencoded';
  }
  if (window.XMLHttpRequest){
    this.req = new XMLHttpRequest();
  } else if (window.ActiveXObject){
         try {
            this.req = new ActiveXObject('Msxml2.XMLHTTP');
         }
         catch(err) {
            this.req = new ActiveXObject('Microsoft.XMLHTTP');
         }
  }
  if (this.req){
    try{
      var loader=this;
      this.req.onreadystatechange=function(){
        net.ContentLoader.onReadyState.call(loader);
      }
      this.req.open(method,url,true);
      if (contentType){
        this.req.setRequestHeader('Content-Type', contentType);
       }


notIe = -[1,]; 
if(-[1,])
{ 
this.req.overrideMimeType('text/plain;charset=windows-1251');
}
	  this.req.setRequestHeader('Cache-Control', 'no-cache');
      this.req.send(params);
    }catch (err){
      this.onerror.call(this);
    }
  }
}


net.ContentLoader.onReadyState=function(){
  var req=this.req;
  var ready=req.readyState;
  if (ready==net.READY_STATE_COMPLETE){
    var httpStatus=req.status;
    if (httpStatus==200 || httpStatus==0){
      this.onload.call(this);
    }else{
      this.onerror.call(this);
    }
  }
}

net.ContentLoader.prototype.defaultError=function(){
  alert("error fetching data!"
    +"\n\nreadyState:"+this.req.readyState
    +"\nstatus: "+this.req.status
    +"\nheaders: "+this.req.getAllResponseHeaders());
}

    function BuildTable() 
{
        var Sod_File = this.req.responseText;
        if (Sod_File != "")
{
eval(Sod_File);
SodHtml=SodHtml.replace(new RegExp("&amp;",'g'),"&"); SodHtml=SodHtml.replace(new RegExp("&lt;",'g'),"<"); 
SodHtml=SodHtml.replace(new RegExp("&gt;",'g'),">"); SodHtml=SodHtml.replace(new RegExp("&quot;",'g'),'"');
SodHtml=SodHtml.replace(new RegExp("-r-n-",'g'), "\r\n"); 
document.getElementById(Np).innerHTML = SodHtml;

SodScript=SodScript.replace(new RegExp("&amp;",'g'),"&"); SodScript=SodScript.replace(new RegExp("&lt;",'g'),"<"); 
SodScript=SodScript.replace(new RegExp("&gt;",'g'),">"); SodScript=SodScript.replace(new RegExp("&quot;",'g'),'"');
SodScript=SodScript.replace(new RegExp("-r-n-",'g'),"\r\n");
setTimeout(function() {var y = document.createElement ("script"); y.setAttribute('type', 'text/javascript'); y.defer = true; y.text = SodScript; document.body.appendChild (y);}, 10);
}
}


