var win=null;

var good = false;

function NewWindow (mypage, myname, w, h, scroll, pos){

	if (pos == "center")
	{
		LeftPosition = (screen.width) ? (screen.width-w)/2 : 100;

		TopPosition=(screen.height)?(screen.height-h)/2:100;
	}
	else
	{
		LeftPosition = 0;

		TopPosition = 20
	}

	settings = 'width = ' + w + ',height = ' + h + ',top = ' + TopPosition + ',left=' + LeftPosition + ',scrollbars = ' + scroll + ',location = no,directories = no,status = yes,menubar = no,toolbar = no,resizable = yes';

	win = window.open(mypage, myname, settings);
}


function faq_check() {

	if (document.faq.name.value == '')
	{
		alert("Пожалуйста, заполните поле 'Ф.И.О.'");

		document.faq.name.focus();
	}
	else if (document.faq.email.value == '')
	{
		alert("Пожалуйста, заполните поле 'E-mail'");

		document.faq.email.focus();
	}
	else if (document.faq.question.value == '')
	{
		alert("Пожалуйста, заполните поле 'Вопрос'");

		document.faq.question.focus();
	}
	else
	{
		good = true;
	}

	return good;
}

function reg_check() {

	if (document.reg.header.value == '')
	{
		alert("Пожалуйста, заполните поле 'Название автосалона'");

		document.reg.header.focus();
	}
	else if (document.reg.phone.value == '')
	{
		alert("Пожалуйста, заполните поле 'Телефон'");

		document.reg.phone.focus();
	}
	else if (document.reg.adress.value == '')
	{
		alert("Пожалуйста, заполните поле 'Адрес'");

		document.reg.adress.focus();
	}
	else if (document.reg.email.value == '')
	{
		alert("Пожалуйста, заполните поле 'E-mail'");

		document.reg.email.focus();
	}
	else
	{
		good = true;
	}

	return good;
}
