function gbShowForm(){
	var o=document.getElementById('gb_form_link');
	o.style.display='none';
	var o=document.getElementById('gb_form_div');
	o.style.display='block';
}
var taObj=null;
function GBEA(inc){
	if(taObj==null) taObj=document.getElementById('GBA');
	h = parseInt(taObj.style.height);
	d = inc*50;
	newh = h+d;
	if(newh>0) 	taObj.style.height = newh+'px';
	return false;
}
function checkfrmadd(form){
	if (isEmpty(form.name.value)){
		alert("Укажите ваше имя!");
		form.name.focus();
		return false;
	}
	if (isEmpty(form.otziv.value)){
		alert("Вы не написали сообщение!");
		form.otziv.focus();
		return false;
	}
	if (!isEmpty(form.email.value) && !isEmail(form.email.value)) {
		alert("Вы неправильно ввели E-mail!");
		form.email.focus();
		return false;
	}

	if (form.otziv.value.length>1000){
		alert("Ваше сообщение слишком большое. Максимальная длина - 1000 знаков.");
		form.otziv.focus();
		return false;
	}
	if (isEmpty(form.rnumber14.value)){
		alert("Вы не указали графический код!");
		form.otziv.focus();
		return false;
	}
	return true;
}

function isEmail(email) {
	var arr1 = email.split("@");
	if (arr1.length != 2) return false;
	else if (arr1[0].length < 1) return false;
	var arr2 = arr1[1].split(".");
	if (arr2.length < 2) return false;
	else if (arr2[0].length < 1) return false;
	return true;
}
function isEmpty (txt){
	return trim(txt)=='';
}
function trim(str){
	return str.length>0 ? str.replace( /(^\s+|\s+$)/, "" ) : "";
}
