function modalWindow(windowAddress, windowWidth, windowHeight) {
	if (window.showModalDialog) {
		window.showModalDialog(windowAddress,'mWindow', 'dialogWidth:' + windowWidth + 'px;dialogHeight:' + windowHeight + 'px;scroll:no;');
	} else {
		window.open(windowAddress,'mWindow', 'width=' + windowWidth + ',height=' + windowHeight + ' ,toolbar=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,modal=yes');
	}
} 

		function generalConfirm(message,address) {
			if(confirm(message)) {
				window.location = address;
			}
		}

function order_checkForm_step1(form) {
	
	var bad_character_found = false;
	var bad_character_list = "abcdefghijklmnopqrstuvwxyz,<.>/?;:'\"[{]}\\|`~!@#$%^&*()-_=+ ";
	
	if (form.ord_visit_date_arrival.value == "") {
		
		alert("Please select an arrival date.");
		return false ;
		
	}
	
	if (form.ord_visit_date_departure.value == "") {
		
		alert("Please select a departure date.");
		return false ;
		
	}
	
	if ( new Date(form.ord_visit_date_arrival.value) > new Date(form.ord_visit_date_departure.value) ){
		alert("Please make sure departure date is after your arrival date.");
		return false ;
	}
	
	if (form.ord_visit_location_arrival.selectedIndex == 0) {
		
		alert("Please select a delivery resort.");
		form.ord_visit_location_arrival.focus();
		return false ;
		
	}
	
	if (form.ord_visit_location_departure.selectedIndex == 0) {
		
		alert("Please select a pick-up resort.");
		form.ord_visit_location_departure.focus();
		return false ;
		
	}
	
	if (form.ord_stroller_1_count.value == "" && form.ord_stroller_2_count.value == "" || form.ord_stroller_1_count.value < 1 && form.ord_stroller_2_count.value < 1) {
		
		alert("Please provide a quantity for either a single or double stroller.");
		form.ord_stroller_1_count.focus();
		return false ;
		
	}
	
	for (i = 0; i < bad_character_list.length; i++) {
		
		if (form.ord_stroller_1_count.value.toLowerCase().indexOf(bad_character_list[i]) > -1) {
			bad_character_found = true;
			break;
		}
		
	}
	
	if (bad_character_found == true) {
		
		alert("Please provide a correct quantity for a single stroller.");
		form.ord_stroller_1_count.focus();
		return false ;
		
	}
	
	for (i = 0; i < bad_character_list.length; i++) {
		
		if (form.ord_stroller_2_count.value.toLowerCase().indexOf(bad_character_list[i]) > -1) {
			bad_character_found = true;
			break;
		}
		
	}
	
	if (bad_character_found == true) {
		
		alert("Please provide a correct quantity for a double stroller.");
		form.ord_stroller_2_count.focus();
		return false ;
		
	}
	
	return true;
	
}

function order_checkForm_step2(form) {
	
	if (form.acp_email.value.indexOf('@') < 1 || form.acp_email.value.indexOf('.') < 1) {
	
		alert("Please provide your email address.");
		form.acp_email.focus();
		return false ;
	
	}
	
	if (form.acp_email2.value != form.acp_email.value) {
	
		alert("Please make sure your email addresses match.");
		form.acp_email2.focus();
		return false ;
	
	}
	
	var space_character = " ";
	
	if (form.acp_name.value == "" || form.acp_name.value.indexOf(space_character) < 1 || form.acp_name.value.indexOf(space_character) == form.acp_name.value.length - 1) {
		
		alert("Please provide your full name.");
		form.acp_name.focus();
		return false ;
		
	}
	
	if (form.acp_phone.value == "") {
		
		alert("Please provide your phone number.");
		form.acp_phone.focus();
		return false ;
		
	}
	
	if (form.acp_cell.value == "") {
		
		alert("Please provide your cell number.");
		form.acp_cell.focus();
		return false ;
		
	}
	
	if (form.acp_address.value == "") {
		
		alert("Please provide your address.");
		form.acp_address.focus();
		return false ;
		
	}
	
	if (form.acp_city.value == "") {
		
		alert("Please provide your city.");
		form.acp_city.focus();
		return false ;
		
	}
	
	if (form.acp_state.selectedIndex == 0) {
		
		alert("Please select your state.");
		form.acp_state.focus();
		return false ;
		
	}
	
	if (form.acp_zip.value == "") {
		
		alert("Please provide your zip code.");
		form.acp_zip.focus();
		return false ;
		
	}
	
	if (form.acp_country.selectedIndex == 0) {
		
		alert("Please select your country.");
		form.acp_country.focus();
		return false ;
		
	}
	
	if (form.acb_cc_name.value == "") {
		
		alert("Please provide the name on your card.");
		form.acb_cc_name.focus();
		return false ;
		
	}
	
	if (form.acb_dtc_id.selectedIndex == 0) {
		
		alert("Please select the type of card you plan to use.");
		form.acb_dtc_id.focus();
		return false ;
		
	}
	
	if (form.acb_cc_number.value == "") {
		
		alert("Please provide your card number.");
		form.acb_cc_number.focus();
		return false ;
		
	}
	
	if (form.acb_cc_exp_month.value.length < 2) {
		
		alert("Please provide your card's expiration date.");
		form.acb_cc_exp_month.focus();
		return false ;
		
	}
	
	if (form.acb_cc_exp_year.value.length < 2) {
		
		alert("Please provide your card's expiration date.");
		form.acb_cc_exp_year.focus();
		return false ;
		
	}
	
	if (form.acb_cc_csc.value == "") {
		
		alert("Please provide your card's security code.");
		form.acb_cc_csc.focus();
		return false ;
		
	}
	
	if (form.acb_cc_address.value == "") {
		
		alert("Please provide your billing address.");
		form.acb_cc_address.focus();
		return false ;
		
	}
	
	if (form.acb_cc_city.value == "") {
		
		alert("Please provide your billing city.");
		form.acb_cc_city.focus();
		return false ;
		
	}
	
	if (form.acb_cc_state.selectedIndex == 0) {
		
		alert("Please select your billing state.");
		form.acb_cc_state.focus();
		return false ;
		
	}
	
	if (form.acb_cc_zip.value == "") {
		
		alert("Please provide your billing zip code.");
		form.acb_cc_zip.focus();
		return false ;
		
	}
	
	if (form.acb_cc_country.selectedIndex == 0) {
		
		alert("Please select your billing country.");
		form.acb_cc_country.focus();
		return false ;
		
	}
	
	return true;
	
}

function order_checkForm_step2B(form) {
	
	if (form.acp_email.value.indexOf('@') < 1 || form.acp_email.value.indexOf('.') < 1) {
	
		alert("Please provide your email address.");
		form.acp_email.focus();
		return false ;
	
	}
	
	if (form.acp_email2.value != form.acp_email.value) {
	
		alert("Please make sure your email addresses match.");
		form.acp_email2.focus();
		return false ;
	
	}
	
	var space_character = " ";
	
	if (form.acp_name.value == "" || form.acp_name.value.indexOf(space_character) < 1 || form.acp_name.value.indexOf(space_character) == form.acp_name.value.length - 1) {
		
		alert("Please provide your full name.");
		form.acp_name.focus();
		return false ;
		
	}
	
	if (form.acp_phone.value == "") {
		
		alert("Please provide your phone number.");
		form.acp_phone.focus();
		return false ;
		
	}
	
	if (form.acp_cell.value == "") {
		
		alert("Please provide your cell number.");
		form.acp_cell.focus();
		return false ;
		
	}
	
	if (form.acp_address.value == "") {
		
		alert("Please provide your address.");
		form.acp_address.focus();
		return false ;
		
	}
	
	if (form.acp_city.value == "") {
		
		alert("Please provide your city.");
		form.acp_city.focus();
		return false ;
		
	}
	
	if (form.acp_state.selectedIndex == 0) {
		
		alert("Please select your state.");
		form.acp_state.focus();
		return false ;
		
	}
	
	if (form.acp_zip.value == "") {
		
		alert("Please provide your zip code.");
		form.acp_zip.focus();
		return false ;
		
	}
	
	if (form.acp_country.selectedIndex == 0) {
		
		alert("Please select your country.");
		form.acp_country.focus();
		return false ;
		
	}
	
	return true;
	
}