document.onselectstart = block;
document.oncontextmenu = block;
function block() {return false}

function search_validator(theForm) {
   if (theForm.kw.value == "") { alert('Введите слово или фразу для поиска!');theForm.kw.focus();return false; }
   if (theForm.kw.value.length < 3) {alert("Слишком короткий запрос. Введите, пожалуйста, другой");theForm.kw.focus();return false;}         
   return true;
}

function validator(theForm) {
   if (theForm.header.value == "") { alert('Укажите, пожалуйста, Ваше имя!');theForm.header.focus();return false; }
   if (theForm.short_inf.value == "") { alert('Напишите, пожалуйста, отзыв!');theForm.short_inf.focus();return false; }
   if (theForm.short_inf.value.length < 80) {alert("Слишком короткий текст. Минимальная длина текста для публикации 80 знаков.");theForm.short_inf.focus();return false;}         
   return true;
}

function account_validator(theForm) {
   if (theForm.email_new.value == "") { alert('Укажите, пожалуйста, свой e-mail!');theForm.email_new.focus();return false; }
   if (theForm.name_new.value == "") { alert('Напишите, пожалуйста, свое имя!');theForm.name_new.focus();return false; }
   if (theForm.pass_new.value.length < 4) {alert("Слишком короткий пароль. Минимальная длина 4 знака.");theForm.pass_new.focus();return false;}         
   return true;
}
 

function adjustHeight(textarea){
	var MinHeight = 200;
    var dif = textarea.scrollHeight - textarea.clientHeight
	if(textarea.scrollHeight > MinHeight)
	{
    if (dif){
        if (isNaN(parseInt(textarea.style.height))){
            textarea.style.height = textarea.scrollHeight + "px"
        }else{
            textarea.style.height = parseInt(textarea.style.height) + dif + "px"
        }
    }
	}
}

