

	// -----------------------------------------
	// CREATED BY CW - 08/04/2004 FOR 
	function sendOff(object) {
		var strConfirm='';
		var now = new Date();

		// ---------------------------------------------
		// *** CREATE TODAY'S DATE BASED ON BROWSER TYPE ***
		if (navigator.appName == 'Microsoft Internet Explorer') {
			var today = parseInt(now.getMonth()+1, 10) + '/' + now.getDate() + '/' + parseInt(now.getYear(), 10);
		} else if (navigator.appName == 'Netscape') {
			var today = parseInt(now.getMonth()+1, 10) + '/' + now.getDate() + '/' + parseInt(now.getYear()+1900, 10);
		} else {
			var today = parseInt(now.getMonth()+1, 10) + '/' + now.getDate() + '/' + parseInt(now.getYear()+1900, 10);
		}
		// ---------------------------------------------
		// *** CHECK THAT DEP & ARR CITIES HAVE VALUES ENTERED ***
		
		//*** COMMENTED NEW JOE
	//	if (!document.TravelRequestForm.from.value && (eval("document.TravelRequestForm.typeOfPackage[4].checked")==false)) {
		if (!document.TravelRequestForm.from.value) {
			strConfirm += 'Please enter your departure location' + '\n';
		}

		if (!document.TravelRequestForm.to.value) {
			strConfirm += 'Please enter your destination location' + '\n';
		}
		// ---------------------------------------------
		// *** CHECK THAT DEP & ARR CITIES ARE DIFFERENT ***
		if (
			document.TravelRequestForm.from.value && document.TravelRequestForm.to.value
			&& (document.TravelRequestForm.from.value==document.TravelRequestForm.to.value)
		) {
			strConfirm += 'Departure location and Destination location must be different' + '\n';
		}
		// ---------------------------------------------
		// *** VALID DEP & ARR DATES? ***
		// *** COMMENTED BY JOE USES THE 'isDate' Function
		/*if (!checkdate(document.TravelRequestForm.itineraryStartDate)) {
			strConfirm += 'Departure Date is not filled in correctly' + '\n';
		}

		if (!checkdate(document.TravelRequestForm.itineraryEndDate)) {
			strConfirm += 'Return Date is not filled in correctly' + '\n';
		}*/
		// THE 'isDate' Function
		// ---------------------------------------------
			var depdate=document.TravelRequestForm.itineraryStartDate
			var retdate=document.TravelRequestForm.itineraryEndDate
		// --------------------------------------------
		if (!isDate(depdate.value)) {
			strConfirm += 'Departure Date is not filled in correctly' + '\n';
			} 
		// ---------------------------------------------
		if (!isDate(retdate.value)) {	
			strConfirm += 'Return Date is not filled in correctly' + '\n';
		}
		// ---------------------------------------------
		// *** ARE DEP & ARR DATES GREATER THAN TODAY? ***
		if (daysElapsed(document.TravelRequestForm.itineraryStartDate.value, today)<=0) {
			strConfirm += 'Departure Date should be greater than today' + '\n';
		}

		if (daysElapsed(document.TravelRequestForm.itineraryEndDate.value, today)<=0) {
			strConfirm += 'Return Date should be greater than today' + '\n';
		}
		// ---------------------------------------------
		// *** IS DEP DATE EARLIER THAN ARR DATE? ***
		// COMMENTED BY JOE - 11/02/2005
		/*
		if (daysElapsed(document.TravelRequestForm.itineraryEndDate.value, document.TravelRequestForm.itineraryStartDate.value)<=0) {
			strConfirm += 'Return Date should be greater than the Departure Date' + '\n';
			// COMMENTED BY CW - 09/14/2004
//			strConfirm += 'Departure Date should be greater than today' + '\n';
		}
		*/
		// ---------------------------------------------
		// *** IF DEP DATE AND ARR DATE SAME? CHECK TIME ***		
	
		if (daysElapsed(document.TravelRequestForm.itineraryStartDate.value, today) == daysElapsed(document.TravelRequestForm.itineraryEndDate.value, today)
			&& (document.TravelRequestForm.departureTime.value==document.TravelRequestForm.returnTime.value)) {			
			strConfirm += 'Return time must be after departure time' + '\n';
		}	
		// ---------------------------------------------
		// *** ARE DEP & ARR DATES WITHIN 330 DAYS OF TODAY? ***
		if (daysElapsed(date_diff(today), document.TravelRequestForm.itineraryStartDate.value)<0) {
			strConfirm += 'Please set the Departure Date within 330 days from today' + '\n';
		}

		if (daysElapsed(date_diff(today), document.TravelRequestForm.itineraryEndDate.value)<0) {
			strConfirm += 'Please set the Return Date within 330 days from today' + '\n';
		}
		// ---------------------------------------------
		// *** FINAL CHECK ***
		if (strConfirm.length > 0) {
			alert(strConfirm);
			
		} else {

		if (checkNumOfPassengers()) {
		
			document.TravelRequestForm.action='http://pts.get2hawaii.com/ots/Index.do';
		
				document.TravelRequestForm.submit();
			}
		}
	}

