/* Создание нового объекта XMLHttpRequest для общения с Web-сервером */
var xmlHttp = false;
/*@cc_on @*/
/*@if (@_jscript_version >= 5)
try {
  xmlHttp = new ActiveXObject("Msxml2.XMLHTTP");
} catch (e) {
  try {
    xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
  } catch (e2) {
    xmlHttp = false;
  }
}
@end @*/

if (!xmlHttp && typeof XMLHttpRequest != 'undefined') {
  xmlHttp = new XMLHttpRequest();
}

function callServer(pic) {
  var url1 = "lib/getpics.php?pic=" + escape(pic);
  xmlHttp.open("GET", url1, true);
  xmlHttp.onreadystatechange = updatePage;
  xmlHttp.send(null);
}

function updatePage() {
if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete") {
    var response1 = xmlHttp.responseText;
document.getElementById('pics').innerHTML = response1;
  }
}

function callServer1(id) {
  var url1 = "lib/sendvopros.php?id=" + escape(id);
  xmlHttp.open("GET", url1, true);
  xmlHttp.onreadystatechange = updatePage1;
  xmlHttp.send(null);
}

function updatePage1() {
if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete") {
    var response1 = xmlHttp.responseText;
document.getElementById('sendvopros').innerHTML = response1;
  }
}

function opendetailwindow() {
	window.open('','detailwindow','toolbar=no,scrollbars=yes,resizable=no,width=680,height=480');
}

function openIt() {
  currEl = event.srcElement;
  if (currEl.className == "subhead") {
    newId = currEl.id + "vis" 
     imgId = currEl.id
      showIt = document.all(newId) ;
     if (showIt.style.display == "none") {
       showIt.style.display = "" ;
        document.images(imgId).src = "img/minus.gif" 
       } else {
       showIt.style.display = "none" ;
        document.images(imgId).src = "img/plus.gif" 
      }
   }
}

function o_w(name, url, left, top, width, height, toolbar, menubar, statusbar, scrollbar, resizable)
{
  toolbar_str = toolbar ? 'yes' : 'no';
  menubar_str = menubar ? 'yes' : 'no';
  statusbar_str = statusbar ? 'yes' : 'no';
  scrollbar_str = scrollbar ? 'yes' : 'no';
  resizable_str = resizable ? 'yes' : 'no';
  window.open(url, name, 'left='+left+',top='+top+',width='+width+',height='+height+',toolbar='+toolbar_str+',menubar='+menubar_str+',status='+statusbar_str+',scrollbars='+scrollbar_str+',resizable='+resizable_str);
}

