// JavaScript Document



function Trim(s) 
{
	// Remove leading spaces and carriage returns
	while ((s.substring(0,1) == ' ') || (s.substring(0,1) == '\n') || (s.substring(0,1) == '\r'))
	{ s = s.substring(1,s.length); }
	
	// Remove trailing spaces and carriage returns
	while ((s.substring(s.length-1,s.length) == ' ') || (s.substring(s.length-1,s.length) == '\n') || (s.substring(s.length-1,s.length) == '\r'))
	{ s = s.substring(0,s.length-1); }
	
	return s;
} 

function checksfm(sfm)
{
	country = Trim(sfm.country.value)
	if (country == "")
	{
		alert("Please Select Country");
		sfm.country.focus();
		return false;
	}
	city = Trim(sfm.city.value)
	if (city == "")
	{
		alert("Please Select City");
		sfm.city.focus();
		return false;
	}
	date1x = Trim(sfm.date1x.value)
	if (date1x == "")
	{
		alert("Please Select Check-In Date");
		sfm.date1x.focus();
		return false;
	}
	date1y = Trim(sfm.date1y.value)
	if (date1y == "")
	{
		alert("Please Select Check-Out Date");
		sfm.date1y.focus();
		return false;
	}
	return true;
}
