function showMap () {
window.open("/assets/templates/itonlaby/view_map_office.html", "displayWindow", "width=610,height=610,status=no,toolbar=no,menubar=no");
}
function showMap_sklad () {
window.open("/assets/templates/itonlaby/view_map_sklad.html", "displayWindow", "width=610,height=610,status=no,toolbar=no,menubar=no");
}

i= "";
fix = "null";
function show_menu(i,evt){
         evt = (evt)?evt:(window.event)?window.event:""
    if (evt)
        {
         if(fix!=i&fix!="null") close_menu(fix);
         if(i!="") {

         document.all[i].style.visibility = "visible";
         fix=i;
         }
        }
}
function close_menu(i){
         if(document.all[i])
         document.all[i].style.visibility = "hidden";
}



function show_menu_id(i,evt){
         evt = (evt)?evt:(window.event)?window.event:""
    if (evt)
        {

         document.all[i].style.position = "absolute";
         document.all[i].style.left = "auto";
         document.all[i].style.zindex = 9999;
        }
}
function close_menu_id(i){
         if(document.all[i]){
          document.all[i].style.position = "absolute";
          document.all[i].style.left = "-999em";
          }
}


var op = 0;
var sStep = 16;
var sTimeout = 15;
var sLeft = 160;
var sRight = 160;
var wObj;


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 showCallBack(){
    openOverlay();
    document.getElementById('plcDialog').style.display = 'block';
	document.getElementById('plcDialog').style.left=document.body.clientWidth/2-200;
}
function hideCallBack(){
    op = 0.5;
    closeOverlay();
    document.getElementById('plcDialog').style.display = 'none';
}
function closeOverlay(){
    if (op > 0) {
        op -= 0.1;
        document.getElementById('overlay').style.opacity = op;
        document.getElementById('overlay').style.filter = 'alpha(opacity=' + op * 100 + ')';
        t = setTimeout('closeOverlay()', 30);
    }
    else {
        document.getElementById('overlay').style.display = 'none';
    }
}
function openOverlay(){
    document.getElementById('overlay').style.display = 'block';
    if (op < 0.5) {
        op += 0.1;
        document.getElementById('overlay').style.opacity = op;
        document.getElementById('overlay').style.filter = 'alpha(opacity=' + op * 100 + ')';
        t = setTimeout('openOverlay()', 30);
    }
}
function sendCallBack(){
	var name=document.frmCallBack.name.value;
	var phone='8('+document.frmCallBack.kod.value+')'+document.frmCallBack.nomer.value;
	var time=document.frmCallBack.time.value;
	var message=document.frmCallBack.message.value;
	var param = 'name='+encodeURIComponent(name)+'&phone='+encodeURIComponent(phone)+'&time='+encodeURIComponent(time)+'&message='+encodeURIComponent(message);
	var xmlhttp = getXmlHttp()
	xmlhttp.open('POST', 'sendcallback.php' , false);
	xmlhttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded; charset=windows-1251;");


	xmlhttp.send(param);
	if(xmlhttp.status == 200) {
	  if((xmlhttp.responseText.value)='ok') {alert('Запрос успешно отправлен!'); hideCallBack()};
	}
}


