function dateerror()
	{alert("A Date is invalid");}
function dateerror2()
	{alert("The departure date must be later then the arival date");}    
function dateerror3()
	{alert("Arival date may not be earlier than today");}          
	function CheckDoc()
	{
		if (document.quicksearch.from_month.value=="2" && document.quicksearch.from_day.value>=30)
		{dateerror();return false;}
		if (document.quicksearch.from_month.value=="4" && document.quicksearch.from_day.value==31)
		{dateerror();return false;}
		if (document.quicksearch.from_month.value=="6" && document.quicksearch.from_day.value==31)
		{dateerror();return false;}
		if (document.quicksearch.from_month.value=="9" && document.quicksearch.from_day.value==31)
		{dateerror();return false;}        
		if (document.quicksearch.from_month.value=="11" && document.quicksearch.from_day.value==31)
		{dateerror();return false;} 
		if (document.quicksearch.to_month.value=="2" && document.quicksearch.to_day.value>=30)
		{dateerror();return false;}
		if (document.quicksearch.to_month.value=="4" && document.quicksearch.to_day.value==31)
		{dateerror();return false;}
		if (document.quicksearch.to_month.value=="6" && document.quicksearch.to_day.value==31)
		{dateerror();return false;}
		if (document.quicksearch.to_month.value=="9" && document.quicksearch.to_day.value==31)
		{dateerror();return false;}        
		if (document.quicksearch.to_month.value=="11" && document.quicksearch.to_day.value==31)
		{dateerror();return false;}         
        from_year = parseInt(document.quicksearch.from_year.value.substr(1,2));
        to_year = parseInt(document.quicksearch.to_year.value.substr(1,2));
        from_month = parseInt(document.quicksearch.from_month.value);
        to_month = parseInt(document.quicksearch.to_month.value);        
        from_day = parseInt(document.quicksearch.from_day.value);
        to_day = parseInt(document.quicksearch.to_day.value); 
        day = parseInt(document.quicksearch.day.value);  
        month = parseInt(document.quicksearch.month.value);
        year = parseInt(document.quicksearch.year.value);
        if(from_year < year)
        {alert(from_year+' '+year);dateerror3();return false;}
        if ((from_year == year)&&(from_month < month))
		{dateerror3();return false;} 
        if ((from_year == year)&&(from_month == month)&&(from_day < day))
		{dateerror3();return false;}                       
        if (from_year > to_year)
		{dateerror2();return false;}  	
        if ((from_year == to_year)&&(to_month < from_month))
		{dateerror2();return false;} 
        if ((from_year == to_year)&&(to_month == from_month)&&(to_day <= from_day))
		{dateerror2();return false;}     
        else
		{document.quicksearch.submit();}
		return true;
	}
    