function checkDates (thisForm){
	TDate = new Date();
	lastDate = new Date();
	CurDayOfWeek = TDate.getDay();
	CurDay = TDate.getDate();
	CurYear = TDate.getFullYear();
	CurMonth = TDate.getMonth();
	outDate = new Date();
	
	outMonth = parseInt(thisForm.form.outmonth[thisForm.form.outmonth.selectedIndex].value);
	outDay =  parseInt(thisForm.form.outday[thisForm.form.outday.selectedIndex].value);
	outYear = CurYear;
	outMonth = outMonth - 1;
	
	if (outMonth < CurMonth){
		outYear = CurYear + 1;
	}
	else if(outMonth == CurMonth && outDay < CurDay){
		outYear = CurYear + 1; 
	}
	
	outDate.setYear(outYear);
	outDate.setMonth(outMonth);
	outDate.setDate(outDay);	
	//#SW Per Thorunn (AIR-206) the advance purchase is now 4 days regardless of day of week (+3 daymod) 12/11/2008	
	/*switch(CurDayOfWeek){
		case 2:
		var dayMod = 3;
		break;
		case 3:
		var dayMod = 4;
		break;
		case 4:
		var dayMod = 4;
		break;
		case 5:
		var dayMod = 4;
		break;
		case 6:
		var dayMod = 3;
		break;
		case 7:
		var dayMod = 3;
		break;
		default:
		var dayMod = 3;
		break;
	}*/
	TDate.setDate(TDate.getDate()+3); //#SW (AIR-206)
	daysBetween = days_between(TDate,outDate);
	if (daysBetween < '1'){
		alert ("Thank you for choosing 1-800-Fly-Europe.\nFor last minute itineraries please contact us @ 1800-359-3876 so that one of our agents can further assist you");
		return false;
	}
	else{
		return true;
	}
	

}

function days_between(date1, date2) {

	// The number of milliseconds in one day
	var ONE_DAY = 1000 * 60 * 60 * 24;

	// Convert both dates to milliseconds
	var date1_ms = date1.getTime();
	//alert(date1_ms);
	var date2_ms = date2.getTime();
	//alert(date2_ms);
	var difference_ms = 0;
	// Calculate the difference in milliseconds Math.abs()
	//alert('date1: '+ date1_ms + ' date2: ' + date2_ms);
	if (date1_ms > date2_ms){
	//	alert('hi');
		difference_ms = 0;
	}
	else{
		var difference_ms = Math.abs(date1_ms - date2_ms);
   // alert(difference_ms);
	// Convert back to days and return
   }
   return Math.round(difference_ms/ONE_DAY);

}
