function grinfo(){
  var sId = document.getElementById("selcatId").value;
  if (typeof window.ActiveXObject != 'undefined' )
  {
    SR = new ActiveXObject("Microsoft.XMLHTTP");
    SR.onreadystatechange = ResultGr;
  }
  else
  {
     SR = new XMLHttpRequest();
     SR.onload = ResultGr;
  }
  SR.open("GET","http://emercom-expo.ru/listgr.php?id=" + sId, true );
  SR.send(null);
}

function ResultGr(){
  if ( SR.readyState != 4 )
  {
    return ;
  }
  var arr = SR.responseText.split("|");
  var  selObj =  document.getElementById("selgrId");
  selObj.options.length=0;
  j=0;
  for(i=0; i<arr.length-1; i=i+2)
  {
    selObj.options[j] = new Option(arr[i+1],arr[i]);
    j++;
  }
}


