//*** <Request.js> ***
var gvVEGARequestCount=0;
//***
function clsVEGARequest(url,routine,done,prm)
{
 this.XmlHttp=null;
 this.Url="";
 this.Routine="";
 this.Parameter="";
 this.Text="";
//***
 this.GetXmlHttp=function()
 {
   this.XmlHttp=null;
   try
   {
    this.XmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
   }
   catch(e)
   {
    try
    {
     this.XmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
    }
    catch(e)
    {
     this.XmlHttp=null;
    }
   }
   if(!this.XmlHttp && typeof XMLHttpRequest != 'undefined')
     {
      try
      {
       this.XmlHttp=new XMLHttpRequest();
      }
      catch(e)
      {
       this.XmlHttp=null;
      }
     }
   return this.XmlHttp;
 }
//***
 this.Done=function(cls)
 {
   if(cls.XmlHttp.readyState != 4) return;
   gvVEGARequestCount--;
   cls.Routine(cls.XmlHttp.responseText);
 }
//***
 this.Request=function(url,routine)
 {
   gvVEGARequestCount++;
   switch(arguments.length)
         {
          case 2:
               this.Routine=routine;
          case 1:
               this.Url=url;
               break;
         }
  var separator=this.Url.indexOf("?") >= 0 ? "&" : "?";
   this.XmlHttp=this.GetXmlHttp();
   if(this.Routine)
     {
  var q=this;
      this.XmlHttp.open("POST",this.Url,true);
      this.XmlHttp.onreadystatechange=function(){q.Done(q)};
     }
      else this.XmlHttp.open("POST",this.Url+rnd(separator),false);
   this.XmlHttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded; charset=Windows-1251');
   this.XmlHttp.send(this.Parameter);
   if(this.Routine) return;
   this.Text=this.XmlHttp.responseText;
   gvVEGARequestCount--;
   return this.XmlHttp.responseText;
 }
//***
   switch(arguments.length)
         {
          case 0:
               break;
          case 1:
               this.Url=url;
               break;
          case 2:
               this.Url=url;
               this.Routine=routine;
               break;
          default:
          case 4:
               this.Parameter=prm;
          case 3:
               this.Url=url;
               this.Routine=routine;
               this.Url=url;
               this.Routine=routine;
               if(done) this.Request();
               break;
         }
}
//*** </Request.js> ***