   function z_ajax(){
this.ajax=ajax_z;
            
 /* q=>строка запроса   */ 
 function ajax_z(url,q,cible){   
   var xhr = null;         
  if (window.XMLHttpRequest) 
  { // Mozilla, Safari,...
     try {xhr = new XMLHttpRequest();  
     if (xhr.overrideMimeType) { xhr.overrideMimeType('text/plain'); } } 
      catch (e) {alert('XMLHttpRequest error');}
  } 
  else 
  if (window.ActiveXObject) 
  { // IE
    try { xhr = new ActiveXObject("Msxml2.XMLHTTP"); } 
    catch (e) 
    {
      try { xhr = new ActiveXObject("Microsoft.XMLHTTP"); } 
      catch (e) {alert('XMLHttp request error');}
    }
  }                                                                          
if(document.getElementById("divWait"))document.getElementById("divWait").style.display="block";  
xhr.open("POST",url,true);   
xhr.onreadystatechange = function (){
  if (xhr.readyState == 4) 
  {     //alert('There the request. :'+n);   
         if (xhr.status == 200) 
    {    
    if(document.getElementById("divWait"))document.getElementById("divWait").style.display="none";       
   if(!document.getElementById(cible)){alert("error : no ID "+cible);return false; } 
   document.getElementById(cible).innerHTML=xhr.responseText;
   
   }
     if(document.getElementById("divWait"))document.getElementById("divWait").style.display="none"; 
  }
}  
xhr.setRequestHeader("Content-type", "application/x-www-form-urlencoded; charset=UTF-8");
xhr.setRequestHeader("Content-length", q.length);
xhr.setRequestHeader("Connection", "close");          
xhr.send('NC='+NC+'&SI='+SI+'&idSite='+encodeURIComponent(idSite)+'&p='+PLATF+'&b='+codeNav+q);                                              
}


} 

