function isNotEmpty(elem){
	var str = elem.value;
	var re = /.+/;
	
	if(!str.match(re)){
		alert("Пожалуйста, заполните все поля!");
		return false;
		}
	else{
		return true;
	}
}


function isEMailAddr(elem){
	var str = elem.value;
	var re = /^[\w-]+(\.[\w-]+)*@([\w-]+\.)+[a-zA-Z]{2,7}$/;
	
	if(!str.match(re)){
		alert("Неправильно введен адрес электронной почты!");
		return false;
		}
	else{
		return true;
	}
}

function validateForm(form){
	if(isNotEmpty(form.nameF)){
		if(isNotEmpty(form.questionF)){
			if(isNotEmpty(form.email) && isEMailAddr(form.email)){
				return true;
			}
		}
	}
	return false		
}

function validateFormcontact(form){
	if(isNotEmpty(form.name)){
		if(isNotEmpty(form.question)){
			if(isNotEmpty(form.email) && isEMailAddr(form.email)){
					return true;
			}
		}
	}
	return false		
}

function Resize(width, height){
		window.resizeTo(width, height);
	
}

function windowsOpen(url,width,height){
	var status = "width="+width+",height="+height+",location=no,status=no,toolbar=no,menubar=no,resizable=no,scrollbars=no";
	wn	=	window.open(url, 'newWin', status);
	wn.focus();
}

function FixClick(param){
		var img = new Image;
		img.src = 'fix.php?idF=' + param + '&tm=' + Math.random();
}

function showHide(id) {
	var e	=	document.getElementById('sub['+id+']');
	if (e.style.display == 'none')
		e.style.display	=	'block';
	else
		e.style.display	=	'none';
}