<!--
function MailFormQ()
{
 var print_send;
 print_send = "ОШИБКА!\nЗаполните эти поля.\n\n Ф.И.О. \n Сообщение";

 if (document.getElementById('last_name').value=='')
 {
 alert(print_send);
 return;
 }
 if (document.getElementById('message').value=='')
 {
 alert(print_send);
 return;
 }
 document.formm.act.value='submit';
 document.formm.submit();
}

function unset_news(hrf) {
 if(confirm("Вы уверены что хотите удалить эту Запись ?")) location.href=hrf;
}


function odrazd(parm1,parm2,parm3)
{
max_height = document.getElementById(parm1).clientHeight;
if (max_height < document.getElementById(parm2).clientHeight){
	max_height = document.getElementById(parm3).clientHeight;
}
if (max_height < document.getElementById(parm3).clientHeight){
	max_height = document.getElementById(parm3).clientHeight;
}
document.getElementById(parm1).height = max_height;
document.getElementById(parm2).height = max_height;
document.getElementById(parm3).height = max_height;
}


function che_portf(parm,color)
{

if(document.getElementById('t'+parm).bgColor!=color)
	{
     document.getElementById('t'+parm).bgColor=color;
     if(document.getElementById('tt'+parm))
     {
     	document.getElementById('tt'+parm).bgColor=color;
     }
     document.getElementById('t'+parm).style.cursor='pointer';
     if(document.getElementById('l'+parm)) document.getElementById('l'+parm).style.color='#cf0000';
	}
 else
    {
     document.getElementById('t'+parm).bgColor='#FFFFFF';
     if(document.getElementById('tt'+parm)) document.getElementById('tt'+parm).bgColor='#FFFFFF';
     if(document.getElementById('l'+parm)) document.getElementById('l'+parm).style.color='';
	}
}


function compimg(parm)
{

if(document.getElementById('i'+parm))
{

if(document.getElementById('i'+parm).style.display=='none')
	{
     document.getElementById('i'+parm).style.display='block';
	}
 else
    {
     document.getElementById('i'+parm).style.display='none';
	}
 }

}


function che_spisoc(parm,color)
{

if(document.getElementById('t'+parm).bgColor!=color)
	{
     document.getElementById('t'+parm).bgColor=color;
	}
 else
    {
     document.getElementById('t'+parm).bgColor='#FFFFFF';
	}
}


function che(parm,color)
{

if(document.getElementById('t'+parm).bgColor!=color)
	{
     document.getElementById('t'+parm).bgColor=color;
     document.getElementById('t'+parm).style.cursor='pointer';
     document.getElementById('l'+parm).style.color='#cf0000';
	}
 else
    {
     document.getElementById('t'+parm).bgColor='#FFFFFF';
     document.getElementById('l'+parm).style.color='';
	}
}


function che1(parm,action,color)
{


if(action==1)
	{
     document.getElementById('d'+parm).style.background=color;
     document.getElementById('d'+parm).style.cursor='pointer';
     document.getElementById('l'+parm).style.color='#cf0000';
	}
 else
    {
     document.getElementById('d'+parm).style.background='#FFFFFF';
     document.getElementById('l'+parm).style.color='';
	}
}




function podmenu(el)
{
	if(document.getElementById('p'+el).style.display=='block')
	{
	document.getElementById('p'+el).style.display='none';
	document.getElementById('i'+el).src='/element/l_bulet.gif';
	document.getElementById('l'+el).style.color='#5a728e';
	}
	else
	{
	document.getElementById('p'+el).style.display='block';
	document.getElementById('i'+el).src='/element/l_bulet2.gif';
	document.getElementById('l'+el).style.color='#df1314';
	}
}

function woi(url,w,h){
width = screen.width;
height = screen.height;
window.open(url, 'showpicture','width='+(w)+',height='+(h)+',left='+((width-w)/2)+',top=0,fullscreen=0,location=0,menubar=0,scrollbars=no,status=0,toolbar=0,resizable=yes');
}

function Bandialog(src)
{
  var dialog;
  var obj_option = '';
  dialog = window.showModalDialog(src,"help","dialogWidth:750px; dialogHeight:550px; center:1; help:0; resizable:1; status:0");
  //dialog = window.open(src,"nombre","width=640, height=640,  toolbar=yes, menubar=no,  resizable=yes, scrollbars=yes" );
  if(dialog) {
   var TxtreaD  = document.all['htmlread'];
   for (i=0;i<dialog.length;i++)
   {
    obj_option += "<input type=\"Hidden\" name=newrub["+ i +"] value=\""+ dialog[i] +"\">";
   }
   TxtreaD.innerHTML =  obj_option;
  }
}


 function changeIm(act, img)
 {
   if(actdsel) return;
   if(!ActM)
    document.all[act].src = '/element/'+ img +'.jpg';
 }

function ChMenu(indexM, act) {
     var MtyMenu = document.all[indexM];
	 if(MtyMenu.style.display == 'none') {
	   MtyMenu.style.display = 'block';
	   ActM = true;
	   document.all[act].src = '/element/mnn2.jpg';
	   document.all["TOP_ZN1A"].style.color = "#980000";
	 }else{
	   MtyMenu.style.display = 'none';
	   document.all[act].src = '/element/mnn.jpg';
	   document.all["TOP_ZN1A"].style.color = "#3D4145";
	   ActM = false;
	 }
 }

menuactiv = false;
function MainMenu(indexM, nameim) {
  if(menuactiv && menuactiv==indexM) return;
     var MtyMenu = document.all[indexM];
     MtyMenu.src = '/element/'+ nameim;
 }

function MailForm()
{
 var print_send;
 print_send = "ОШИБКА!\nЗаполните эти поля.\n\n Отправитель \n Сообщение";

 if (document.formm.last_name.value=="")
 {
 alert(print_send);
 document.formm.last_name.focus();
 return;
 }
 if (document.formm.message.value=="")
 {
 alert(print_send);
 document.formm.message.focus();
 return;
 }
 document.formm.act.value='submit';
 document.formm.submit();
}

function ph_help()
{
  var dialogps;
  dialogps = window.showModalDialog("helpfile/help.html","help","dialogWidth:750px; dialogHeight:550px; center:1; help:0; resizable:1; status:0");
}

function addbookmark(bookmarkurl, bookmarktitle){
 if (document.all) { window.external.AddFavorite(bookmarkurl,bookmarktitle); }
}


function WFOpen(file)
{
    myWin= open( "/image.php?img="+file,"", "width=400,height=500,status=yes,toolbar=no,directories=no,location=no,resizable=yes,scrollbars=yes,menubar=no");
}


function WFOpenImage(file, name)
{
    myWin= open( "/image.php?img="+file+"&name="+name,"Image", "width=600,height=500,status=yes,toolbar=no,directories=no,location=no,resizable=yes,scrollbars=yes,menubar=no");
}

now = new Date();
function print_date() {
 var day = now.getDay();
 var monthNames = new Array("01", "02", "03", "04", "05", "06", "07", "08", "09", "10", "11", "12");
 var month = now.getMonth();
 var monthName = monthNames[month];
 var year = now.getYear();
 if ( year < 1000 ) year += 1900;
 var datestring = now.getDate() +'.'+ monthName +'.'+ year;
 document.write('&nbsp;' + datestring + '');
}

function SendMch()
{
 var print_send;
 print_send = "Для подачи заявки необходимо заполнить поле: \n";

  if (document.formm.last_name.value=="") {
 alert(print_send +"  * Контактное лицо");
 document.formm.last_name.focus(); return; }
  if (document.formm.phon.value=="") {
 alert(print_send +"  * Телефон");
 document.formm.phon.focus(); return; }
   if (document.formm.email_name.value=="") {
 alert(print_send +"  * E-Mail");
 document.formm.email_name.focus(); return; }
 document.formm.act.value='submit';
 document.formm.submit();
}

 function MenuDisplay(index) {
	 if(document.getElementById(index).style.display == 'none') {
	     document.getElementById(index).style.display = 'block';
	  }else{ 
	     document.getElementById(index).style.display = 'none';
	  }
  }
  
  
  	function verScroll(dir, spd, loop) {
        tb_height = 155;
        loop = true;
        direction = "up";
        speed = 100;
        scrolltimer = null;
        if (document.layers) {
                var page = eval(document.contentLayer);
        } else {
                if (document.getElementById) {
                        var page= eval("document.getElementById('contentLayer').style");
                } else {
                        if (document.all) {
                                var page = eval(document.all.contentLayer.style);
                      }
                   }
        }
        if (document.layers) {
                var page_height = eval(document.contentLayer.scrollHeight);
                var n_page_height = tb_height - page_height;
        } else {
                if (document.getElementById) {
                        var page_height = eval("document.getElementById('tbtext').scrollHeight");
                        var n_page_height = tb_height - page_height;
                } else {
                        if (document.all) {
                                var page_height = eval(document.all.contentLayer.scrollHeight);
                                var n_page_height = tb_height - page_height;
                      }
                   }
        }
        direction = dir;
        speed = parseInt(spd);
        var y_pos = parseInt(page.top);
        if (loop == true) {
        if (direction == "dn" && y_pos > n_page_height) {
                page.top = (y_pos - (speed));
        } else {
                if (direction == "up" && y_pos < 0) {
                        page.top = (y_pos + (speed));
                } else {
                        if (direction == "top") {
                                page.top = 10;
                      }
                   }
        }
        scrolltimer = setTimeout("verScroll(direction,speed)", 1);
           }
}

function stopScroll() {
        loop = false;
        clearTimeout(scrolltimer);
}
 
function logoloadd(){
	var winWidth;
    if(document.documentElement.clientWidth) {
	 winWidth = document.documentElement.clientWidth; 
	}else{
	 winWidth = document.body.clientWidth; 
	}
	var countlogo;
	countlogo = 4;
	if (winWidth < 1119 ) {
      countlogo = 4;
	}
	if (winWidth >= 1200 && winWidth < 1350 ) {
	  countlogo = 5;
	}
	if (winWidth >= 1400 ) {
	  countlogo = 6;
	}

	for(i=1;i<=6;i++)
	{
	  if(document.getElementById('img_main_'+i)) {
		document.getElementById('img_main_'+i).style.display="none";
	  }
	}
	
	for(i=1;i<=countlogo;i++)
	{
	   if(document.getElementById('img_main_'+i)) {
		document.getElementById('img_main_'+i).style.display="inline";
	   }
	}
	
}
 
//Ajax ---------------------------------------------
function ObjectHttpRequestUser() {
    if (window.XMLHttpRequest) {
        req = new XMLHttpRequest();
    } else if (window.ActiveXObject) {
        req = new ActiveXObject("Microsoft.XMLHTTP");
    }
	return req;
}
var request;
function HttpRequestPostUser(method, url, datavalue, functionn) {
   request = ObjectHttpRequestUser();
     if(!request) { return; }
    	  
	   request.onreadystatechange = function () {
		 if (request.readyState == 4) {
           if (request.status == 200) {
		      //-------------------------------
			     eval(functionn +"(request)");
			  //-------------------------------
           } else {
             return; //alert("Не удалось обработать XML файл:  \n" + request.statusText);
           }
          }
		};
		request.open(method, url, true);
		if(method == 'POST') { request.setRequestHeader("Content-Type","application/x-www-form-urlencoded"); }		
        request.send(datavalue);
}

var nkpatch = false;
var tempcod = 0;
function InfoActualHttp(id) {
 	var method = 'GET';
	tempcod = id;
	var url = '/xml/Input.php?idkod='+ id;
	var datavalue = null;
	HttpRequestPostUser(method, url, datavalue, 'InfoActualGET');
}

function InfoActualGET(request) {
          if(request.responseXML.documentElement) {
           response = request.responseXML.documentElement;
		   resultmod = response.getElementsByTagName('resultmod');			  
		  
		   if(resultmod[0].firstChild.data==1) {
		    nkpatch = tempcod;
		    document.getElementById('nncod').innerHTML = '<span style="color:red;">Готово!</span>';
		   } else {
		    document.getElementById('nncod').innerHTML = 'не верен';
		   }
		   
		   if(nkpatch && nkpatch != tempcod) {
			 document.getElementById('nncod').innerHTML = 'не верен';
			}
		 }
} 
//Ajax ---------------------------------------------

// -->