function save(){

  window.external.AddFavorite('http://konveersnabservis.ru/','Конвейерные системы, транспортеры, рольганги');

return true;

}





var disappeardelay=250;

  var ie4=document.all;

  var ns6=document.getElementById&&!document.all;

function HideMenu() {

   document.getElementById('rez_1_3').style.visibility='hidden';

}



function HideMenu2() {

   document.getElementById('rez_1_4').style.visibility='hidden';

}



function ShowMenu(obj) {

  var el = document.getElementById('submenu');

  dropmenuobj=document.getElementById? document.getElementById("submenu") : dropmenudiv

  var arr = getPosition(el);

//  document.getElementById('rez_1_3').style.left=arr['left']-14;

//  document.getElementById('rez_1_3').style.top=arr['top']-12;

  document.getElementById('rez_1_3').style.display='block';

  document.getElementById('rez_1_3').style.visibility='visible';

 }



function ShowMenu2(obj) {

  var el = document.getElementById('submenu2');

  dropmenuobj=document.getElementById? document.getElementById("submenu2") : dropmenudiv

  var arr = getPosition(el);

  document.getElementById('rez_1_4').style.left=arr['left']-14;

  document.getElementById('rez_1_4').style.top=arr['top']-12;

  document.getElementById('rez_1_4').style.display='block';

  document.getElementById('rez_1_4').style.visibility='visible';

 }



function getPosition(e){ // e - объект

  var left = 0;

  var top = 0;

  while (e.offsetParent){

    left += e.offsetLeft;

    top += e.offsetTop;

    e = e.offsetParent;

  }

  left += e.offsetLeft;

  top += e.offsetTop;

  return {left:left, top:top};

}



function delayhidemenu(){

//if (ie4||ns6)

  delayhide=setTimeout("HideMenu()",disappeardelay);

}



function delayhidemenu2(){

//if (ie4||ns6)

  delayhide=setTimeout("HideMenu2()",disappeardelay);

}



function clearhidemenu(){

if (typeof delayhide!="undefined")

    clearTimeout(delayhide);

}



function clearhidemenu2(){

if (typeof delayhide!="undefined")

    clearTimeout(delayhide);

}



function dynamichide(e){

if (ie4&&!dropmenuobj.contains(e.toElement))

  delayhidemenu();

else if (ns6&&e.currentTarget!= e.relatedTarget&& !contains_ns6(e.currentTarget, e.relatedTarget))

  delayhidemenu();

}



function dynamichide2(e){

if (ie4&&!dropmenuobj.contains(e.toElement))

  delayhidemenu2();

else if (ns6&&e.currentTarget!= e.relatedTarget&& !contains_ns6(e.currentTarget, e.relatedTarget))

  delayhidemenu2();

}



function sendFrm1(){
  var org = document.forms['order1'].elements['org'].value;

  var contact = document.forms['order1'].elements['contact'].value;

  var dol = document.forms['order1'].elements['dol'].value;

  var phone = document.forms['order1'].elements['phone'].value;

  var mail = document.forms['order1'].elements['mail'].value.match(/\b(^([\.0-9a-zA-Z_-]+@[0-9a-zA-Z_\.-]+(\.[a-zA-Z]{2,4}){1,2})$)\b/gi);

  var file_on = document.forms['order1'].elements['file_on'].checked;

  var file = document.forms['order1'].elements['file1'].value;



    if (!org){
      alert("Не заполнено поле 'Организация'");

      document.forms['order1'].elements['org'].focus();

      return false;
    }



    if (!contact){

      alert("Не заполнено поле 'Контактное лицо'");

      document.forms['order1'].elements['contact'].focus();

      return false;

    }



    if (!dol){

      alert("Не заполнено поле 'Должность'");

      document.forms['order1'].elements['dol'].focus();

      return false;

    }



    if (!phone){

      alert("Не заполнено поле 'Телефон'");

      document.forms['order1'].elements['phone'].focus();

      return false;

    }



    if (!mail){

      alert("Не заполнено поле 'E-mail' или введен не правельный формат");

      document.forms['order1'].elements['mail'].focus();

      return false;

    }



    if (file_on==false && !(!file)){
      alert("Не отмечена галка");

      return false;

    }



    if (file_on==true){


      if (!file){
        alert('Не выбран файл');

        document.forms['order1'].elements['file1'].focus();

        return false;
      }
    }

    document.forms['order1'].elements['type'].value="order1";

    winop();

    document.forms['order1'].submit();


}





function sendFrm2(){
  var org = document.forms['order2'].elements['org'].value;

  var contact = document.forms['order2'].elements['contact'].value;

  var dol = document.forms['order2'].elements['dol'].value;

  var phone = document.forms['order2'].elements['phone'].value;

  var mail = document.forms['order2'].elements['mail'].value.match(/\b(^([\.0-9a-zA-Z_-]+@[0-9a-zA-Z_\.-]+(\.[a-zA-Z]{2,4}){1,2})$)\b/gi);

  var file_on = document.forms['order2'].elements['file_on'].checked;

  var file = document.forms['order2'].elements['file1'].value;



    if (!org){

      alert("Не заполнено поле 'Организация'");

      document.forms['order2'].elements['org'].focus();

      return false;

    }



    if (!contact){

      alert("Не заполнено поле 'Контактное лицо'");

      document.forms['order2'].elements['contact'].focus();

      return false;

    }



    if (!dol){

      alert("Не заполнено поле 'Должность'");

      document.forms['order2'].elements['dol'].focus();

      return false;

    }



    if (!phone){

      alert("Не заполнено поле 'Телефон'");

      document.forms['order2'].elements['phone'].focus();

      return false;

    }



    if (!mail){

      alert("Не заполнено поле 'E-mail' или введен не правельный формат");

      document.forms['order2'].elements['mail'].focus();

      return false;

    }



    if (file_on==false && !(!file)){

      alert("Не отмечена галка");

      return false;

    }



    if (file_on==true){



      if (!file){

        alert('Не выбран файл');

        document.forms['order2'].elements['file1'].focus();

        return false;

      }

    }

    document.forms['order2'].elements['type'].value="order2";

    winop();

    document.forms['order2'].submit();



}



function sendFrm3(){

  var contact = document.forms['prices'].elements['contact'].value;

  var phone = document.forms['prices'].elements['phone'].value;

  var mail = document.forms['prices'].elements['mail'].value.match(/\b(^([\.0-9a-zA-Z_-]+@[0-9a-zA-Z_\.-]+(\.[a-zA-Z]{2,4}){1,2})$)\b/gi);

  var file_on = document.forms['prices'].elements['file_on'].checked;

  var file = document.forms['prices'].elements['file1'].value;





    if (!contact){

      alert("Не заполнено поле 'Контактное лицо'");

      document.forms['prices'].elements['contact'].focus();

      return false;

    }





    if (!phone){

      alert("Не заполнено поле 'Телефон'");

      document.forms['prices'].elements['phone'].focus();

      return false;

    }



    if (!mail){

      alert("Не заполнено поле 'E-mail' или введен не правельный формат");

      document.forms['prices'].elements['mail'].focus();

      return false;

    }



    if (file_on==false && !(!file)){

      alert("Не отмечена галка");

      return false;

    }



    if (file_on==true){



      if (!file){

        alert('Не выбран файл');

        document.forms['prices'].elements['file1'].focus();

        return false;

      }

    }

    document.forms['prices'].elements['msg_price'].value="1";

    winop_price();

    document.forms['prices'].submit();



}





function winop(){

var windop=window.open("","OK","left=" + (screen.width / 2-350 / 2) + ",top=" + (screen.height / 2-160 / 2) + ",width=350,height=160");

windop.document.open();

windop.document.write("<html><head><title>www.konveersnabservis.ru</TITLE>");

windop.document.write("<script> function href(){setTimeout(\"time_()\", 6000);} function time_(page){window.close(); return true;}</script>");

windop.document.write("<meta http-equiv=\"Content-Type\" content=\"text/html; charset=windows-1251\" /></head><body onLoad=\"href();\" bgcolor=#B9D5E1>");

windop.document.write("<center><b><br><div style=font-family:Verdana;font-size:11px;color:#300A0A;>Ваш запрос успешно отправлен.<br>");

windop.document.write("Для уточнения технического задания наши специалисты свяжутся с Вами в ближайшее время.<br>");

windop.document.write("Спасибо!</div></b></center>");

windop.document.write("<center><form><input type='button' style=\"border-width:1px;border-color:#437B95;border-style:solid;font-family:Verana;color:#000000;background-color:#F6FAFE;\" value='Закрыть' onClick='window.close()'></form></center>");

windop.document.write("</body></html>");

windop.document.close();

}



function winop_price(){

var windop=window.open("","OK","left=" + (screen.width / 2-450 / 2) + ",top=" + (screen.height / 2-200 / 2) + ",width=450,height=200");

windop.document.open();

windop.document.write("<html><head><title>www.konveersnabservis.ru</TITLE>");

windop.document.write("<script> function href(){setTimeout(\"time_()\", 15000);} function time_(page){window.close(); return true;}</script>");

windop.document.write("<meta http-equiv=\"Content-Type\" content=\"text/html; charset=windows-1251\" /></head><body onLoad=\"href();\" bgcolor=#B9D5E1>");

windop.document.write("<center><b><br><div style=font-family:Verdana;font-size:11px;color:#300A0A;>На указанный электронный адрес будет выслана ориентировочная стоимость конвейера  в соответствии с указанными параметрами.<br>");

windop.document.write("Для выезда специалиста на место и проведения необходимых замеров, необходимо заполнить техническое задание в разделе «оформить заказ»<br>");

windop.document.write("Для оформления Договора просим связаться с менеджерами компании.</div></b></center>");

windop.document.write("<center><form><input type='button' style=\"border-width:1px;border-color:#437B95;border-style:solid;font-family:Verana;color:#000000;background-color:#F6FAFE;\" value='Закрыть' onClick='window.close()'></form></center>");

windop.document.write("</body></html>");

windop.document.close();

}



function href(){

setTimeout("time_()", 3000);

}

function time_(page){

window.close();

return true;

}


function openMap() {
var width=472;
var height=715;
var left= (screen.width / 2) - (width / 2);
var top = (screen.height / 2) - (height / 2);
  wnd = window.open("", "imageWindow", 
    "left=" + left + ",top=" + top + ",width=" + width + ",height=" + height);
  var doc = wnd.document;
  doc.open();
  doc.write('<html><head><title>Схема проезда</title></head>' + 
            '<body topmargin="0" leftmargin="0" marginheight="0" marginwidth="0">' +
            '<img src="../images/cx.png" width="' + width + '" height="' + height + 
            '" vspace="0" hspace="0" alt="Схема проезда">' +
            '<br></body></html>'
            );
  doc.close();
  wnd.focus();
  return false;
}



