

if (document.images)
{
  pic1= new Image(32,32); 
  pic1.src="/images/info_indicator.gif"; 
}


/*
  добавление предприятия
*/
function check_add_enterprice(checkfrm)
{
	
  
		
  if( (checkfrm.title.value == null) || (checkfrm.title.value.length < 1) ) 
  {  
    alert('Введите название предприятия');
    checkfrm.title.focus();
    return false; 
  }
  
   if( (checkfrm.description.value == null) || (checkfrm.description.value.length < 1) ) 
  {  
    alert('Заполните описание деятельности');
    checkfrm.description.focus();
    return false; 
  }
  
  if( (checkfrm.city.value == null) || (checkfrm.city.value.length < 1) ) 
  {  
    alert('Заполните город');
    checkfrm.city.focus();
    return false; 
  }
  
  if( (checkfrm.email.value == null) || (checkfrm.email.value.length < 1) ) 
  {  
    alert('Заполните E-mail');
    checkfrm.email.focus();
    return false; 
  }
  
 if( (checkfrm.phone.value == null) || (checkfrm.phone.value.length < 1) || (checkfrm.phone.value=='+Х (ХХХ) ХХХ-ХХ-ХХ') ) 
  {  
  	 if( (checkfrm.phone_mobile.value == null) || (checkfrm.phone_mobile.value.length < 1) ) 
     {  	
        alert('Введите телефон');
        checkfrm.phone.value ='';
        checkfrm.phone.focus();
        return false;
     } 
  }
  
 if( (checkfrm.contact_person.value == null) || (checkfrm.contact_person.value.length < 1) ) 
  {  
    alert('Укажите контактное лицо');
    checkfrm.contact_person.focus();
    return false; 
  }
  
  
      
   if( (checkfrm.registration_login)) {
  
   	 if((checkfrm.registration_login.value == '') || (checkfrm.registration_login.length < 1) ) 
      {  
        alert('Заполните Логин');
        checkfrm.registration_login.focus();
        return false; 
      }
      
       if( (checkfrm.registration_password.value == '') || (checkfrm.registration_password.length < 1) ) 
      {  
        alert('Заполните Пароль');
        checkfrm.registration_password.focus();
        return false; 
      }
      
      if( (checkfrm.registration_password.value != checkfrm.registration_password2.value)) 
      {  
        alert('Введенные пароли не совпадают');
        checkfrm.registration_password2.focus();
        return false; 
      }
   }
  
    var check_cat=false;
     for (var i=0; i < checkfrm.elements.length; i++) {
        if(checkfrm.elements[i].type == "checkbox" && checkfrm.elements[i].checked)
            check_cat = true;
    }
    if (check_cat==false  && document.getElementById('new_cat_name').value=='')
     {
     	 alert('Невыбранна сфера деятельности');
     	 return false;
     }	 
    
  document.getElementById('upload_div').style.left='50%';
  document.getElementById('upload_div').style.display='block';
  document.getElementById('fade').style.height=getDocumentHeight()+'px';
  document.getElementById('fade').style.display='block'; 
	
  return true;
} 

/*
  добавление новости
*/
function check_add_news(checkfrm)
{
	
  
		
  if( (checkfrm.title.value == null) || (checkfrm.title.value.length < 1) ) 
  {  
    alert('Введите заголовок новости');
    checkfrm.title.focus();
    return false; 
  }
  
   if( (checkfrm.body.value == null) || (checkfrm.body.value.length < 1) ) 
  {  
    alert('Заполните краткую версию новости');
    checkfrm.body.focus();
    return false; 
  }
  
  
   if( (checkfrm.body_full.value == null) || (checkfrm.body_full.value.length < 1) ) 
  {  
    alert('Заполните полную версию новости');
    checkfrm.body_full.focus();
    return false; 
  }
  
    
  document.getElementById('upload_div').style.left='50%';
  document.getElementById('upload_div').style.display='block';
  document.getElementById('fade').style.height=getDocumentHeight()+'px';
  document.getElementById('fade').style.display='block'; 
	
  return true;
 } 