function checkdates ( form )  {
// get variables for the destinations and months of travel
var origin=document.forms[0].ORIGIN.selectedIndex;
fromairport=document.forms[0].ORIGIN.options[origin].value;
var dest=document.forms[0].DESTINATION.selectedIndex;
toairport=document.forms[0].DESTINATION.options[dest].value;
var month=document.forms[0].MONTHYEAR.selectedIndex;
godate=document.forms[0].MONTHYEAR.options[month].value;
var day=document.forms[0].DAY.selectedIndex;
goday=document.forms[0].DAY.options[day].value;
var rmonth=document.forms[0].RMONTHYEAR.selectedIndex;
backdate=document.forms[0].RMONTHYEAR.options[rmonth].value;

// what if they haven't completed the form?
 if (fromairport=="-1")
 {
 alert('Please specify where you are flying from');
 return false;
 }


if (fromairport=="CMF" || toairport=="CMF")
{
alert('Chambery flights will now operate to/from Grenoble - please reenter your request');
return false;
}



if (toairport=="GNB" || fromairport=="GNB")
{
// they are going to Grenoble, so are they booking a date that's too early?

if (godate.indexOf('2009') !=-1)
	   {
       // they want to travel in 2009
	    if (godate=="NOV2009" || godate=="OCT2009" || godate=="SEP2009" || godate=="AUG2009" || godate=="JUL2009" || godate=="JUN2009" || godate=="MAY2009")
       		// in the wrong month
		{
alert('Flights to Grenoble operate between 20 Dec 2009 and 27 Feb 2010');
        	return false;
		}
	    if (godate=="DEC2009")
		// in December
       		{ 
		// Are they trying to go before the 20th?                
		if (day<19)
			{alert('Flights to Grenoble operate between 20 Dec 2009 and 27 Feb 2010');
        	return false;
			}
      		 }
	      }


if (godate.indexOf('2010') !=-1)
	   {
       // they want to travel in 2010

	    if (godate=="JAN2010")
       		// in Jan
		{
	// all well, pass friend.
  	 		  return checkFormPage1();
		}
  if (godate=="FEB2010")
		// in February
       			{ 
			// Are they trying to go before the 20th?                
			if (day>27)
			{alert('Flights to Grenoble operate between 20 Dec 2009 and 27 Feb 2010');
        		return false;
			}
	// all well, pass friend.
  	 		  return checkFormPage1();
      		 	}
    // travelling in the wrong months
		alert('Flights to Grenoble operate between 20 Dec 2009 and 27 Feb 2010');
        		return false;
	  
	      }


}

// nothing wrong with what these people want to book, go to next stage:

return checkFormPage1();
}
	