  function showbig(picname) {
    window.open('/includes/foto.php?pic='+picname,'_blank','scrollbars=yes,taskbar=no,resizeable=no,status=no,menubar=no,top=30,left=30,width=30,height=30');
  }
  
  function showbig1(picname) {
    window.open('/includes/foto_my.php?pic='+picname,'_blank','scrollbars=yes,taskbar=no,resizeable=no,status=no,menubar=no,top=30,left=30,width=30,height=30');
  }
  
  function PreLoad(source) {
    var NewImage = new Image();
    tab1.style.display='none'
    NewImage.src = source;
  }
  
  function prepareSubmit(frm) {  	
    var len = frm.all("editbox").length; if (!len) len = 1;
    for (var i=0; i<len; i++)
      frm.all("codebox", i).innerText = frm.all("codebox", i).style.display ? borderOn(frm.all("codebox", i).innerText) : borderOn(frm.all("editbox", i).innerHTML);
  }
  
  
 function changeColor(mid,textColor,bgColor){
 	if(bgColor!="null")
    mid.style.backgroundColor = bgColor;
  if(textColor!="null")
    mid.style.color = textColor ;
 }  

 function menuProcess(menuId,tdId){
 	 if(menuId.style.display=='none'){
     menuId.style.display = 'block';
     changeColor(tdId,'#808AB0','null');
   }else{
   	 menuId.style.display = 'none';
     changeColor(tdId,'#525D8A','null');
   }
 }
 
 function render(i)
 {
 	if (i == '1') 
 	{
 		tab2.style.visibility='hidden';
 		tab1.style.visibility='visible';
 	} else
 	{
 		tab1.style.visibility='hidden';
 		tab2.style.visibility='visible';
 	}	
 }
 
 function sub()
 {
 		//alert(document.all('form1').org.value);
	if (((document.all('form1').org.value == '') || 
			(document.all('form1').contact.value == '') || 
			(document.all('form1').email.value == '') ||  
			(document.all('form1').adres.value == '') || 
			(document.all('form1').pass.value == '')) && 
			((document.all('form2').fio.value == '') ||
			(document.all('form2').adres.value == '') ||
			(document.all('form2').email.value == '') ||
			(document.all('form2').pass.value == ''))) 
		{
			pred.style.visibility='visible';
		} else
		{
			pred.style.visibility='hidden';
			
			if (document.all('form1').org.value == '')
			{
				document.all('form2').submit();
			} else
			{
				document.all('form1').submit();
			}
		}
 }
 
 function changeFizData()
 {
 		if ((document.all('form1').fio.value != '') &&	
 		(document.all('form1').adres.value != '') &&
 		(document.all('form1').email.value != '') &&
 		(document.all('form1').telefon.value != '') &&
 		(document.all('form1').pass.value != ''))
 		{
 			pred.style.visibility='hidden';
 		} else
 		{
 			pred.style.visibility='visible';
 		}
 }
 
 function changeYrData()
 {
 		if ((document.all('form1').org.value != '') && 
		(document.all('form1').contact.value != '') && 
		(document.all('form1').email.value != '') && 
		(document.all('form1').inn.value != '') && 
 		(document.all('form1').telefon.value != '') &&
		(document.all('form1').kpp.value != '') && 
		(document.all('form1').adres.value != '')
		(document.all('form1').pass.value != ''))
		{
			pred.style.visibility='hidden';
		} else
		{
			pred.style.visibility='visible';
		}		
 }
 
 function retive()
 {
 		while (document.all('forma').login.value == '')
 		{
 			alert("Введите e-mail для восстановления пароля!");
 			return;
 		}

 		document.all('forma').submit();
 }
  
 function enter()
 {
 		while (document.all('form3').login.value == '' || document.all('form3').pw.value == '')
 		{
 			alert("Введите e-mail (логин) и пароль для входа!");
 			return;
 		}

 		document.all('form3').submit();
 }
 
 function print_tg() 
 {
    window.open(location.href+'&print','_blank','scrollbars=yes,taskbar=no,resizeable=no,status=no,menubar=no,top=30,left=30,width=800,height=600');
 }
 