// JavaScript Document
 
function novyokno( odkaz )
{
    try
	{
		var test;
		
		test = ! window.open( odkaz );
		return test;
	}
	
	catch (e)
	{
		alert( "Při otvírání nového okna došlo k vnitřní chybě JavaScriptu. Zkuste povolit otevírání nových oken nebo kontaktujte správce webu! Odkaz se otevře ve stávajícím okně" );
		return true;
	}
}

function validate(formular) 
{
    var vysl = true;
	
	if ((formular.f_nights.value<1)&&(formular.f_weeks.value<1)&&(formular.f_months.value<1))
		{	alert("Please select Length of stay !");
			formular.f_nights.focus();	vysl = false;	return false;		}	
	else if (formular.f_sname.value.length<1)
		{	alert("Plaese input your Last name !");
			formular.f_sname.focus();	vysl = false;	return false;		}	
	else if (formular.f_email.value.length<1)
		{	alert("Plaese input your email !");
			formular.f_email.focus();	vysl = false;	return false;		}	
	else if ((formular.f_email.value!="")&&(window.RegExp))
		{	re = new RegExp("^[^@]+@[^.]+\..+$");
			if (!re.test(formular.f_email.value))
				{
					alert("Entered email is not valid email address!");
					formular.f_email.focus();
					vysl = false;
					return false;	}	}
	if (vysl)
			return true;
	else 
		return false	
}

