function getXmlHttp(){
  var xmlhttp;
  try {
    xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
  } catch (e) {
    try {
      xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
    } catch (E) {
      xmlhttp = false;
    }
  }
  if (!xmlhttp && typeof XMLHttpRequest!='undefined') {
    xmlhttp = new XMLHttpRequest();
  }
  return xmlhttp;
}

function checkvendors(id){
  if(id!=0)
  {
  vendorss.innerHTML = "Загрузка";
  var currentdate = new Date();
  var xmlhttp = getXmlHttp();
  xmlhttp.open('GET', 'ajax/model.php?id='+id+'&d='+currentdate, true);
  xmlhttp.onreadystatechange = function() {
   if (xmlhttp.readyState == 4)
   {
    if(xmlhttp.status == 200)
    {
     vendorss.innerHTML = xmlhttp.responseText;
    }
   }
  }
  xmlhttp.send(null);
 }
 if(id==0)
 {
 vendorss.innerHTML = "";
 }
}


function checkmodel(id){
  if(id!=0)
  {
  modell.innerHTML = "Загрузка";
  var current_date = new Date();
  var xmlhttp = getXmlHttp();
  xmlhttp.open('GET', 'ajax/god.php?id='+id+'&d='+current_date, true);
  xmlhttp.onreadystatechange = function() {
   if (xmlhttp.readyState == 4)
   {
    if(xmlhttp.status == 200)
    {
     modell.innerHTML = xmlhttp.responseText;
    }
   }
  }
  xmlhttp.send(null);
}
 if(id==0)
 {
 modell.innerHTML = "";
 }
}

function checkgod(id){
  if(id!=0)
  {
  godd.innerHTML = "Загрузка";
  var current_date = new Date();
  var xmlhttp = getXmlHttp();
  xmlhttp.open('GET', 'ajax/dvigatel.php?id='+id+'&d='+current_date, true);
  xmlhttp.onreadystatechange = function() {
   if (xmlhttp.readyState == 4)
   {
    if(xmlhttp.status == 200)
    {
     godd.innerHTML = xmlhttp.responseText;
    }
   }
  }
  xmlhttp.send(null);
}
 if(id==0)
 {
 godd.innerHTML = "";
 }
}

function checkdvigatel(id){
  if(id!=0)
  {
  dvigatell.innerHTML = 'Загрузка';
  var current_date = new Date();
  var xmlhttp = getXmlHttp();
  xmlhttp.open('GET', 'ajax/1.php?id='+id+'&d='+current_date, true);
  xmlhttp.onreadystatechange = function() {
   if (xmlhttp.readyState == 4)
   {
    if(xmlhttp.status == 200)
    {
     dvigatell.innerHTML = xmlhttp.responseText;
    }
   }
  }
  xmlhttp.send(null);
 }
 if(id==0)
 {
 dvigatell.innerHTML = "";
 }
}
function add_box(count, id, product) {
 location = 'index.php?go=Magaz&in=add_box&product='+product+'&id='+id+'&count='+count;
 }
function MM_openBrWindow(theURL,winName,features) {
  window.open(theURL,winName,features);
}

function add_box(count, id, product) {
 location = 'index.php?go=Magaz&in=add_box&product='+product+'&id='+id+'&count='+count;
 }
function MM_openBrWindow(theURL,winName,features) {
  window.open(theURL,winName,features);
}


