function CheckForm(UserForm)
{
    var is_ok = true;

	if (document.contact.code.value.length < 5 || UserForm.message.value == '' || UserForm.email.value == '')
	{
		is_ok = false;
    	alert("Пожалуйста, заполните все поля, отмеченные *");
    	UserForm.code.focus();
	}
	
	p_email = document.contact.email.value.toString();
	t = p_email.indexOf("@");
	if((p_email.indexOf(".") == -1) || (t == -1) || (t < 1) || (t > p_email.length - 5) || (p_email.charAt(t - 1) == '.') || (p_email.charAt(t + 1) == '.')) 
	{
    	is_ok = false;
		alert('Указан некорректный e-mail.');
    	UserForm.email.focus();
	}

return is_ok;
}

function CheckFormEng(UserForm)
{
    var is_ok = true;

	if (document.contact.code.value.length < 5 || UserForm.message.value == '' || UserForm.email.value == '')
	{
		is_ok = false;
    	alert("Please, fill up all fields marked by *.");
    	UserForm.code.focus();
	}
	
	p_email = document.contact.email.value.toString();
	t = p_email.indexOf("@");
	if((p_email.indexOf(".") == -1) || (t == -1) || (t < 1) || (t > p_email.length - 5) || (p_email.charAt(t - 1) == '.') || (p_email.charAt(t + 1) == '.')) 
	{
    	is_ok = false;
		alert('Error in e-mail address.');
    	UserForm.email.focus();
	}

return is_ok;
}

function CheckFormInfo(UserForm)
{
    var is_ok = true;
	var s=document.send_item.email.value.indexOf("@");
	var d=document.send_item.email.value.length;
	x=d-s-1;
	    
    if (send_item.name.value == '')
    {
    	is_ok = false;
    	alert("Необходимо указать наименование товара");
    	send_item.name.focus();
	}
	
    if (UserForm.zavod.value == '')
    {
    	is_ok = false;
    	alert("Необходимо указать название организации");
    	UserForm.zavod.focus();
	}

    if (UserForm.fio.value == '')
    {
    	is_ok = false;
    	alert("Необходимо контактное лицо");
    	UserForm.fio.focus();
	}
	
    if (UserForm.email.value == '' && UserForm.phone.value == '')
    {
    	is_ok = false;
    	alert("Необходимо указать контактную информацию (e-mail или телефон), чтобы с Вам могли связаться.");
    	UserForm.email.focus();
	}
	
	if (x<5 || s<1)
	{
    	is_ok = false;
		alert('Указан некорректный e-mail.');
    	UserForm.email.focus();
	}


	
return is_ok;
}

function CheckFormConf(conf)
{
    var is_ok = true;
	var s=document.conf.email.value.indexOf("@");
	var d=document.conf.email.value.length;
	x=d-s-1;
	    
    if (conf.phone.value == '')
    {
    	is_ok = false;
    	alert("Пожалуйста, заполните все поля, отмеченные *.");
    	conf.phone.focus();
	}
	
	if (x<5 || s<1)
	{
    	is_ok = false;
		alert('Указан некорректный e-mail.');
    	conf.email.focus();
	}
	
return is_ok;
}

function CheckFormConf1(conf)
{
    var is_ok = true;
	var s=document.conf.email.value.indexOf("@");
	var d=document.conf.email.value.length;
	x=d-s-1;
	    
    if (conf.phone.value == '')
    {
    	is_ok = false;
    	alert("Пожалуйста, заполните все поля, отмеченные *.");
    	conf.phone.focus();
	}
	
	if (x<5 || s<1)
	{
    	is_ok = false;
		alert('Указан некорректный e-mail.');
    	conf.email.focus();
	}
	
return is_ok;
}

function CheckFormConf1Eng(conf)
{
    var is_ok = true;
	var s=document.conf.email.value.indexOf("@");
	var d=document.conf.email.value.length;
	x=d-s-1;
	    
    if (conf.fio.value == '' || conf.day.value == '' || conf.month.value == '' || conf.year.value == '' || conf.phone.value == '')
    {
    	is_ok = false;
    	alert("Please, fill up all fields marked by *.");
    	conf.fio.focus();
	}
	
	if (x<5 || s<1)
	{
    	is_ok = false;
		alert('Error in e-mail address.');
    	conf.email.focus();
	}
	
return is_ok;
}

function CheckFormConfEng(conf)
{
    var is_ok = true;
	var s=document.conf.email.value.indexOf("@");
	var d=document.conf.email.value.length;
	x=d-s-1;
	    
    if (conf.phone.value == '')
    {
    	is_ok = false;
    	alert("Please, fill up all fields marked by *.");
    	conf.hall.focus();
	}
	
	if (x<5 || s<1)
	{
    	is_ok = false;
		alert('Error in e-mail address.');
    	conf.email.focus();
	}
	
return is_ok;
}

function CheckFormExcursionEng(exc)
{
    var is_ok = true;
	var s=document.exc.email.value.indexOf("@");
	var d=document.exc.email.value.length;
	x=d-s-1;
	    
    if (exc.fio.value == '' || exc.day.value == '' || exc.month.value == '' || exc.year.value == '' || exc.qlt_man.value == '' || exc.phone.value == '')
    {
    	is_ok = false;
    	alert("Please, fill up all fields marked by *.");
    	exc.fio.focus();
	}
	
	if (x<5 || s<1)
	{
    	is_ok = false;
		alert('Error in e-mail address.');
    	exc.email.focus();
	}
	
return is_ok;
}


function CheckOrder(order)
{
    var is_ok = true;

	if (document.order.code.value.length < 5 || order.phone.value == '' || order.email.value == '' || order.company.value == '' || order.man.value == '')
	{
		is_ok = false;
    	alert("Пожалуйста, заполните все поля, отмеченные *");
    	order.code.focus();
	}
	
	p_email = document.order.email.value.toString();
	t = p_email.indexOf("@");
	if((p_email.indexOf(".") == -1) || (t == -1) || (t < 1) || (t > p_email.length - 5) || (p_email.charAt(t - 1) == '.') || (p_email.charAt(t + 1) == '.')) 
	{
    	is_ok = false;
		alert('Указан некорректный e-mail.');
    	order.email.focus();
	}
	
return is_ok;
}

function CheckOrderMHall(order)
{
    var is_ok = true;

	if (document.order.code.value.length < 5 || order.phone.value == '' || order.email.value == '' || order.company.value == '' || order.man.value == '' || order.city.value == '' || order.format.value == '0')
	{
		is_ok = false;
    	alert("Пожалуйста, заполните все поля, отмеченные *");
    	order.code.focus();
	}
	
	p_email = document.order.email.value.toString();
	t = p_email.indexOf("@");
	if((p_email.indexOf(".") == -1) || (t == -1) || (t < 1) || (t > p_email.length - 5) || (p_email.charAt(t - 1) == '.') || (p_email.charAt(t + 1) == '.')) 
	{
    	is_ok = false;
		alert('Указан некорректный e-mail.');
    	order.email.focus();
	}
	
return is_ok;
}

function CheckShow(order)
{
    var is_ok = true;

	if (document.order.code.value.length < 5 || order.phone.value == '' || order.email.value == '' || order.company.value == '' || order.fio.value == '' || order.fax.value == '' || order.city.value == '' || order.day.value == '' || order.month.value == '')
	{
		is_ok = false;
    	alert("Пожалуйста, заполните все поля, отмеченные *");
    	order.code.focus();
	}
	
	p_email = document.order.email.value.toString();
	t = p_email.indexOf("@");
	if((p_email.indexOf(".") == -1) || (t == -1) || (t < 1) || (t > p_email.length - 5) || (p_email.charAt(t - 1) == '.') || (p_email.charAt(t + 1) == '.')) 
	{
    	is_ok = false;
		alert('Указан некорректный e-mail.');
    	order.email.focus();
	}
	
return is_ok;
}

function CheckVacForm(vac)
{
    var is_ok = true;
	var s=document.vac.email.value.indexOf("@");
	var d=document.vac.email.value.length;
	x=d-s-1;
	  
	if (vac.phone.value == '' || vac.fio.value == '' || vac.language.value == '' || vac.experience.value == '')
    {
    	is_ok = false;
    	alert("Пожалуйста, заполните все поля, отмеченные *.");
    	vac.fio.focus();
	}
	
	if (x<5 || s<1)
	{
    	is_ok = false;
		alert('Указан некорректный e-mail.');
    	vac.email.focus();
	}
	
return is_ok;
}

function CheckOrderFormEng(order)
{
   var is_ok = true;

	if (document.order.code.value.length < 5 || order.phone.value == '' || order.email.value == '')
	{
		is_ok = false;
    	alert("Please, fill up all fields marked by *");
    	order.code.focus();
	}
	
	p_email = document.order.email.value.toString();
	t = p_email.indexOf("@");
	if((p_email.indexOf(".") == -1) || (t == -1) || (t < 1) || (t > p_email.length - 5) || (p_email.charAt(t - 1) == '.') || (p_email.charAt(t + 1) == '.')) 
	{
    	is_ok = false;
		alert('Error in e-mail address');
    	order.email.focus();
	}
	
return is_ok;
}

function CheckFormRadio(radio)
{
    var is_ok = true;
	var s=document.radio.email.value.indexOf("@");
	var d=document.radio.email.value.length;
	x=d-s-1;
	    
    if (radio.fio.value == '' || radio.day.value == '' || radio.month.value == '' || radio.year.value == '' || radio.qnt_day.value == '' || radio.phone.value == '' || radio.country.value == '' || radio.region.value == '' || radio.company.value == '' || radio.address.value == '' || radio.hotel.value == '' || radio.accommodation.value == '' || radio.time_to.value == '' || radio.time_from.value == '' || radio.fax.value == '')
    {
    	is_ok = false;
    	alert("Пожалуйста, заполните все поля, отмеченные *.");
    	radio.fio.focus();
	}
	
	if (x<5 || s<1)
	{
    	is_ok = false;
		alert('Указан некорректный e-mail.');
    	radio.email.focus();
	}
	
return is_ok;
}

function CheckFormRadioEng(radio)
{
    var is_ok = true;
	var s=document.radio.email.value.indexOf("@");
	var d=document.radio.email.value.length;
	x=d-s-1;
	    
    if (radio.fio.value == '' || radio.day.value == '' || radio.month.value == '' || radio.year.value == '' || radio.qnt_day.value == '' || radio.phone.value == '' || radio.country.value == '' || radio.region.value == '' || radio.company.value == '' || radio.address.value == '' || radio.hotel.value == '' || radio.accommodation.value == '' || radio.time_to.value == '' || radio.time_from.value == '' || radio.fax.value == '')
    {
    	is_ok = false;
    	alert("Please, fill up all fields marked by *.");
    	radio.fio.focus();
	}
	
	if (x<5 || s<1)
	{
    	is_ok = false;
		alert('Error in e-mail address.');
    	radio.email.focus();
	}
	
return is_ok;
}

function CheckFormExcursion(exc)
{
    var is_ok = true;
	var s=document.exc.email.value.indexOf("@");
	var d=document.exc.email.value.length;
	x=d-s-1;
	    
    if (exc.fio.value == '' || exc.day.value == '' || exc.month.value == '' || exc.year.value == '' || exc.qlt_man.value == '' || exc.phone.value == '')
    {
    	is_ok = false;
    	alert("Пожалуйста, заполните все поля, отмеченные *.");
    	exc.fio.focus();
	}
	
	if (x<5 || s<1)
	{
    	is_ok = false;
		alert('Указан некорректный e-mail.');
    	exc.email.focus();
	}
	
return is_ok;
}

function CheckFormHotel(hotel)
{
    var is_ok = true;
	var s=document.hotel.email.value.indexOf("@");
	var d=document.hotel.email.value.length;
	x=d-s-1;
	    
    if (hotel.hotel_name.value == '' || hotel.fio.value == '' || hotel.d_in.value == '' || hotel.m_in.value == '' || hotel.y_in.value == '' || hotel.d_out.value == '' || hotel.m_out.value == '' || hotel.y_out.value == '' || hotel.room.value == '' || hotel.phone.value == '' || hotel.food.value == '')
    {
    	is_ok = false;
    	alert("Пожалуйста, заполните все поля, отмеченные *.");
    	hotel.hotel_name.focus();
	}
	
	if (x<5 || s<1)
	{
    	is_ok = false;
		alert('Указан некорректный e-mail.');
    	hotel.email.focus();
	}
	
return is_ok;
}

function CheckFormHotelEng(hotel)
{
    var is_ok = true;
	var s=document.hotel.email.value.indexOf("@");
	var d=document.hotel.email.value.length;
	x=d-s-1;
	    
    if (hotel.hotel_name.value == '' || hotel.fio.value == '' || hotel.d_in.value == '' || hotel.m_in.value == '' || hotel.y_in.value == '' || hotel.d_out.value == '' || hotel.m_out.value == '' || hotel.y_out.value == '' || hotel.room.value == '' || hotel.phone.value == '' || hotel.food.value == '')
    {
    	is_ok = false;
    	alert("Please, fill up all fields marked by *.");
    	hotel.hotel_name.focus();
	}
	
	if (x<5 || s<1)
	{
    	is_ok = false;
		alert('Error in e-mail address.');
    	hotel.email.focus();
	}
	
return is_ok;
}

function CheckFormTourEng(tour)
{
    var is_ok = true;
	var s=document.tour.email.value.indexOf("@");
	var d=document.tour.email.value.length;
	x=d-s-1;
	    
    if (tour.country.value == '' || tour.hotel.value == '' || tour.fio.value == '' || tour.d_in.value == '' || tour.m_in.value == '' || tour.y_in.value == '' || tour.d_out.value == '' || tour.m_out.value == '' || tour.y_out.value == '' || tour.room.value == '' || tour.phone.value == '' || tour.food.value == '' || tour.men.value == '')
    {
    	is_ok = false;
    	alert("Please, fill up all fields marked by *.");
    	tour.hotel.focus();
	}
	
	if (x<5 || s<1)
	{
    	is_ok = false;
		alert('Error in e-mail address.');
    	tour.email.focus();
	}
	
return is_ok;
}

function CheckFormTour(tour)
{
    var is_ok = true;
	var s=document.tour.email.value.indexOf("@");
	var d=document.tour.email.value.length;
	x=d-s-1;
	    
    if (tour.country.value == '' || tour.hotel.value == '' || tour.fio.value == '' || tour.d_in.value == '' || tour.m_in.value == '' || tour.y_in.value == '' || tour.d_out.value == '' || tour.m_out.value == '' || tour.y_out.value == '' || tour.room.value == '' || tour.phone.value == '' || tour.food.value == '' || tour.men.value == '')
    {
    	is_ok = false;
    	alert("Пожалуйста, заполните все поля, отмеченные *.");
    	tour.hotel.focus();
	}
	
	if (x<5 || s<1)
	{
    	is_ok = false;
		alert('Указан некорректный e-mail.');
    	tour.email.focus();
	}
	
return is_ok;
}

function CheckFormSochi(sochi)
{
    var is_ok = true;
	var s=document.sochi.email.value.indexOf("@");
	var d=document.sochi.email.value.length;
	x=d-s-1;
	    
    if (sochi.hotel.value == '' || sochi.fio.value == '' || sochi.day_in.value == '' || sochi.month_in.value == '' || sochi.year_in.value == '' || sochi.day_out.value == '' || sochi.month_out.value == '' || sochi.year_out.value == '' || sochi.hotel_level.value == '' || sochi.phone.value == '' || sochi.food.value == '' || sochi.adult.value == '')
    {
    	is_ok = false;
    	alert("Пожалуйста, заполните все поля, отмеченные *.");
    	sochi.hotel.focus();
	}
	
	if (x<5 || s<1)
	{
    	is_ok = false;
		alert('Указан некорректный e-mail.');
    	sochi.email.focus();
	}
	
return is_ok;
}

function CheckFormSochiEng(sochi)
{
    var is_ok = true;
	var s=document.sochi.email.value.indexOf("@");
	var d=document.sochi.email.value.length;
	x=d-s-1;
	    
    if (sochi.hotel.value == '' || sochi.fio.value == '' || sochi.day_in.value == '' || sochi.month_in.value == '' || sochi.year_in.value == '' || sochi.day_out.value == '' || sochi.month_out.value == '' || sochi.year_out.value == '' || sochi.hotel_level.value == '' || sochi.phone.value == '' || sochi.food.value == '' || sochi.adult.value == '')
    {
    	is_ok = false;
    	alert("Please, fill up all fields marked by *.");
    	sochi.hotel.focus();
	}
	
	if (x<5 || s<1)
	{
    	is_ok = false;
		alert('Error in e-mail address.');
    	sochi.email.focus();
	}
	
return is_ok;
}


function showHotel( id ) {
	var myDiv = document.getElementById( "hotel" + id );
	if(myDiv.style.display == 'none')
	{
		myDiv.style.display = 'block';
	}
	else
	{
		myDiv.style.display = 'none';
	}
	return false;
}

function CheckOffer(offer)
{
    var is_ok = true;
	
	if (document.offer.code.value.length < 5 || offer.man.value == '' || offer.email.value == '' || offer.fio.value == '' || offer.company.value == '' || offer.phone.value == '')
	{
		is_ok = false;
    	alert("Пожалуйста, заполните все поля, отмеченные *");
    	offer.code.focus();
	}
	
	p_email = document.offer.email.value.toString();
	t = p_email.indexOf("@");
	if((p_email.indexOf(".") == -1) || (t == -1) || (t < 1) || (t > p_email.length - 5) || (p_email.charAt(t - 1) == '.') || (p_email.charAt(t + 1) == '.')) 
		{
	    	is_ok = false;
			alert('Указан некорректный e-mail.');
	    	offer.email.focus();
		}

return is_ok;
}

function CheckFormPresent(present)
{
    var is_ok = true;
	
	if (document.present.code.value.length < 5 || present.data.value == '' || present.fio.value == '' || present.name.value == '' || present.age.value == '' || present.status.value == '' || present.preference.value == '' || present.refusal.value == '' || present.company.value == '' || present.money.value == '' || present.phone.value == '' || present.call.value == '')
	{
		is_ok = false;
    	alert("Пожалуйста, заполните все поля, отмеченные *");
    	present.code.focus();
	}
	
	p_email = document.present.email.value.toString();
	t = p_email.indexOf("@");
	if((p_email.indexOf(".") == -1) || (t == -1) || (t < 1) || (t > p_email.length - 5) || (p_email.charAt(t - 1) == '.') || (p_email.charAt(t + 1) == '.')) 
		{
	    	is_ok = false;
			alert('Указан некорректный e-mail.');
	    	present.email.focus();
		}

return is_ok;
}
function CheckFormAvia(avia)
{
    var is_ok = true;
	
	if (document.avia.code.value.length < 5 || avia.company.value == '' || avia.name.value == '' || avia.phone.value == '' || avia.from.value == '' || avia.to.value == '' || avia.man.value == '' || avia.d_from.value == '' || avia.d_from.value == '' || avia.y_from.value == '' || avia.d_to.value == '' || avia.d_to.value == '' || avia.y_to.value == '' || avia.type.value == '')
	{
		is_ok = false;
    	alert("Пожалуйста, заполните все поля, отмеченные *");
    	avia.code.focus();
	}
	
	p_email = document.avia.email.value.toString();
	t = p_email.indexOf("@");
	if((p_email.indexOf(".") == -1) || (t == -1) || (t < 1) || (t > p_email.length - 5) || (p_email.charAt(t - 1) == '.') || (p_email.charAt(t + 1) == '.')) 
		{
	    	is_ok = false;
			alert('Указан некорректный e-mail.');
	    	avia.email.focus();
		}

return is_ok;
}

