    var StartDate = document.aspnetForm.ctl00$wpm$ShowProduct$ctl02$InputField_65;
	var EndDate = document.aspnetForm.ctl00$wpm$ShowProduct$ctl02$InputField_66;
	var TotalDays = document.aspnetForm.ctl00$wpm$ShowProduct$ctl02$Quantity;
	var StartEndDate = document.aspnetForm.LineMessage;
	var SpecialNeeds = document.aspnetForm.SpecialNeeds;
	
	TotalDays.value = "";
	
	StartDate.disabled = true;
	StartDate.style.background = "#ffffff";
	StartDate.style.border = "solid 1px #7F9DB9";
	StartDate.style.color = "#000000";
	StartDate.style.width = "70px";
	
	EndDate.disabled = true;
	EndDate.style.background = "#ffffff";
	EndDate.style.border = "solid 1px #7F9DB9";
	EndDate.style.color = "#000000";
	EndDate.style.width = "70px";
	
	TotalDays.style.background = "#ffffff";
	TotalDays.style.border = "solid 1px #ffffff";
	TotalDays.style.color = "#000000";
	
	StartEndDate.style.background = "#ffffff";
	StartEndDate.style.border = "solid 1px #ffffff";
	StartEndDate.style.color = "#000000";
	StartEndDate.style.width = "430px";
	StartEndDate.style.height = "300px";
	StartEndDate.style.overflow = "hidden";
	
	SpecialNeeds.style.overflow = "hidden";

    function calcDays(){
        var ctl00$wpm$ShowProduct$ctl02$InputField_65 = document.aspnetForm.ctl00$wpm$ShowProduct$ctl02$InputField_65.value;
        var ctl00$wpm$ShowProduct$ctl02$InputField_66 = document.aspnetForm.ctl00$wpm$ShowProduct$ctl02$InputField_66.value;
        ctl00$wpm$ShowProduct$ctl02$InputField_65 = ctl00$wpm$ShowProduct$ctl02$InputField_65.split("/");
        ctl00$wpm$ShowProduct$ctl02$InputField_66 = ctl00$wpm$ShowProduct$ctl02$InputField_66.split("/");
		
        var sDate = new Date(ctl00$wpm$ShowProduct$ctl02$InputField_65[0]+"/"+ctl00$wpm$ShowProduct$ctl02$InputField_65[1]+"/"+ctl00$wpm$ShowProduct$ctl02$InputField_65[2]);
        var eDate = new Date(ctl00$wpm$ShowProduct$ctl02$InputField_66[0]+"/"+ctl00$wpm$ShowProduct$ctl02$InputField_66[1]+"/"+ctl00$wpm$ShowProduct$ctl02$InputField_66[2]);
        var ctl00$wpm$ShowProduct$ctl02$Quantity = Math.abs(Math.round((sDate-eDate)/86400000));
        ctl00$wpm$ShowProduct$ctl02$InputField_65.disabled = true;
		
        if(ctl00$wpm$ShowProduct$ctl02$InputField_65 != "" && ctl00$wpm$ShowProduct$ctl02$InputField_66 != "") {
            if(sDate < eDate) {
                document.aspnetForm.ctl00$wpm$ShowProduct$ctl02$Quantity.value = ctl00$wpm$ShowProduct$ctl02$Quantity;
                //return LineMessage();
				return minimumDates();
                }
            else {
                alert("Please choose a later end date.");
                document.aspnetForm.ctl00$wpm$ShowProduct$ctl02$InputField_66.value = "";
                document.aspnetForm.ctl00$wpm$ShowProduct$ctl02$Quantity.value = "";
				document.aspnetForm.LineMessage.value = "";
                return false;
            }
        }
    }      
    calcDays();

    function LineMessage() {
        var LineMessage = document.aspnetForm.LineMessage;
        var StartDate = document.aspnetForm.ctl00$wpm$ShowProduct$ctl02$InputField_65;
        var EndDate = document.aspnetForm.ctl00$wpm$ShowProduct$ctl02$InputField_66;
		var NameRegisteredUnder = document.aspnetForm.NameRegisteredUnder;
		var HotelName = document.aspnetForm.HotelName;
		var DestinationCity = document.aspnetForm.DestinationCity;
		var DestinationAddress = document.aspnetForm.DestinationAddress;
		var SpecialNeeds = document.aspnetForm.SpecialNeeds;
		var CellPhone = document.aspnetForm.CellPhone;
		var EmailAddress = document.aspnetForm.EmailAddress;
        LineMessage.value = "<br /><strong>Dates:</strong> " + StartDate.value + " 9:00 a.m. - " + EndDate.value + " 9:00 a.m.<br /><strong>Name Registered Under:</strong> " + NameRegisteredUnder.value + "<br /><strong>Hotel Name:</strong> " + HotelName.value + "<br /><strong>Destination City:</strong> " + DestinationCity.value + "<br /><strong>Destination Address:</strong> " + DestinationAddress.value + "<br /><strong>Cell Phone:</strong> " + CellPhone.value + "<br /><strong>Email Address:</strong> " + EmailAddress.value + "<br /><strong>Special Needs:</strong> " + SpecialNeeds.value + "<br /><br /><span style=\"color:red\">I have agreed to the terms of the Rental Agreement and the Refund/Cancellation Policy.</span><br /><br /><strong>Order Date Stamp:</strong> " + Date() + "<br />";
		var line = LineMessage.value;
		return true;
		}
    
	function totalDays() {
		var TotalDays = document.aspnetForm.ctl00$wpm$ShowProduct$ctl02$Quantity;
		if(TotalDays.value == "") {
			TotalDays.value = "1";
			}
		}
		
	totalDays();

	//
	// BEGIN MINIMUM DATES FUNCTION	
	//
    function minimumDates(thisThing) {
        var TotalDays = document.aspnetForm.ctl00$wpm$ShowProduct$ctl02$Quantity;
        var TodayDate = new Date();
        var StartDate = document.aspnetForm.ctl00$wpm$ShowProduct$ctl02$InputField_65.value;
        var EndDate = document.aspnetForm.ctl00$wpm$ShowProduct$ctl02$InputField_66.value;
        var StartDateArray = StartDate.split("/");
        var StartDateMonth = StartDateArray[0];
        var StartDateDay = StartDateArray[1];
        var StartDateYear = StartDateArray[2];
        var TodayDateMonth = TodayDate.getMonth() + 1;
        var TodayDateDay = TodayDate.getDate();
        var TodayDateDayPlusOne = TodayDate.getDate()+1;
        var TodayDateDay48 = TodayDateDay + 1;
        var TodayDateYear = TodayDate.getFullYear();
		
		//IF THIS THING IS
        if (thisThing == "ctl00_wpm_ShowProduct_ctl02_InputField_66") {
            if(StartDateMonth <= TodayDateMonth && StartDateDay <= TodayDateDay && StartDateYear <= TodayDateYear) {
                alert("You may not select a date earlier than " + TodayDateMonth + "/" + TodayDateDayPlusOne + "/" + TodayDateYear + ".");
                document.aspnetForm.ctl00$wpm$ShowProduct$ctl02$InputField_65.value = "";
                return false;
				}
            if(StartDateMonth == TodayDateMonth && StartDateDay <= TodayDateDay48 && StartDateYear == TodayDateYear) {
                document.getElementById("AlertMessage").style.display = "block";
                document.getElementById("AlertMessage").innerHTML = "<p style=\"color:red;font-size:10px;width:200px;\">The Start Date you've selected, " + StartDate + ", is less than 24 hours away. Please be aware that it may take up until 2:00 p.m. eastern time to deliver your scooter.</p>";
                displayDatePicker('ctl00$wpm$ShowProduct$ctl02$InputField_65');
				}
            else {
                    document.getElementById("AlertMessage").style.display = "none";
                    displayDatePicker('ctl00$wpm$ShowProduct$ctl02$InputField_66');
					}
			}
        
        if(thisThing == "ctl00$wpm$ShowProduct$ctl02$InputField_65") {
            if(StartDateMonth == TodayDateMonth && StartDateDay == TodayDateDay && StartDateYear == TodayDateYear) {
                alert("You may not select today's date as your Start Date.");
                document.aspnetForm.ctl00$wpm$ShowProduct$ctl02$InputField_65.value = "";
                return false;
				}
            else {
	            displayDatePicker('ctl00$wpm$ShowProduct$ctl02$InputField_65');
				}
			}
			
		/*
		if(thisThing == "YourWeight" || thisThing == "DeliverTo" || thisThing == "NameRegisteredUnder" || thisThing == "HotelName" || thisThing == "SpecialNeeds" || thisThing == "EmailAddress") {
			return LineMessage();
		}
		*/

        if(thisThing == "btnBuyNow") {
            if(StartDateMonth <= TodayDateMonth && StartDateDay <= TodayDateDay && StartDateYear <= TodayDateYear) {
                alert("You may not select a date earlier than " + TodayDateMonth + "/" + TodayDateDayPlusOne + "/" + TodayDateYear + ".");
                document.aspnetForm.ctl00$wpm$ShowProduct$ctl02$InputField_65.value = "";
                return false;
				}
            if(StartDateMonth == TodayDateMonth && StartDateDay <= TodayDateDay48 && StartDateYear == TodayDateYear) {
                document.getElementById("AlertMessage").style.display = "block";
                document.getElementById("AlertMessage").innerHTML = "<p style=\"color:red;font-size:10px;width:200px;\">The Start Date you've selected, " + StartDate + ", is less than 24 Hours away. Please be aware that your scooter delivery can be delayed up until 2:00 p.m. easter time.</p>";
                //displayDatePicker('ctl00$wpm$ShowProduct$ctl02$InputField_66');
				}
			
			// IF THE START DATE IS EMPTY ALERT THE USER
			if(StartDate == "") {
				alert("You must enter the Start Date for this Rental.");
				return false;
				}
			
			//IF THE END DATE IS EMPTY ALERT THE USER
			if(EndDate == "") {
				alert("You must enter the End Date for this Rental.");
				return false;
				}
			
			//IF THE TOTAL DAYS IS LESS THAN OR EQUAL TO 3 THEN ALERT THE USER THEY MUST SELECT MORE DAYS
            if(TotalDays.value < 3) {
	            alert("Sorry, we have a three day minimum!\nYou have currently selected only " + TotalDays.value + " day(s).");
	            return false;
				}
				
			//IF THE USER HASN'T CHECKED THE REFUND CANCELLATION AGREEMENT THEN ALERT THE USER	
			var RefundCancellationAgreement = document.aspnetForm.RefundCancellationCheckbox;
			if(RefundCancellationAgreement.checked == false) {
	            alert("You must agree to the terms of the Refund/Cancellation Agreement.");
	            RefundCancellationAgreement.focus();
	            return false;
				}
			
			//IF THE USER HASN'T CHECKED THE RENTAL AGREEMENT THEN ALERT THE USER
            var RentalAgreement = document.aspnetForm.RentalAgreementCheckbox;
            if(RentalAgreement.checked == false) {
                alert("You must agree to the terms of the Rental Agreement.");
                RentalAgreement.focus();
                return false;
				}
				
			var FloridaStatutesCheckbox = document.aspnetForm.FloridaStatutesCheckbox;
			if(FloridaStatutesCheckbox.checked == false) {
				alert("You must agree to the terms of the Florida Statutes and check the corresponding box.");
				FloridaStatutesCheckbox.focus();
				return false;
			}
				
            else if(StartDateMonth == TodayDateMonth && StartDateDay > TodayDateDay48 && StartDateYear == TodayDateYear) {
                document.getElementById("AlertMessage").style.display = "none";
                	return checkEmail();
				}
            else {
	            return checkHotelName();
				}
			}
		}
		//
		//END MINIMUM DATES FUNCTION
		//
	
//
//BEGIN CHECK EMAIL FUNCTION
//
    function checkEmail() {

    var EmailAddress = document.aspnetForm.EmailAddress;
    var illegalChars = /[\(\)\<\>\,\;\:\\\"\[\]]/;
    var emailFilter =/^.+@.+\..{2,3}$/;
    
    //IF THE EMAIL ADDRESS VALUE IS EMPTY THEN ALERT THE USER
    if (EmailAddress.value == "") {
       alert("You didn't enter an email address.\n");
       EmailAddress.focus();
       return false;
       }
    //TEST TO ENSURE THIS IS AN EMAIL ADDRESS
    if (!(emailFilter.test(EmailAddress.value))) { 
       alert("Please enter a valid email address.\n");
       EmailAddress.focus();
       return false;
       }
           
    //TEST FOR ILLEGAL CHARACTERS IN THE EMAIL ADDRESS
    if (EmailAddress.value.match(illegalChars)) {
        alert("The email address contains illegal characters.\n");
        EmailAddress.focus();
        return false;
       }
    return LineMessage();       
	}
//
//END CHECK EMAIL FUNCTION
//

//CHECK HOTEL NAME
function checkHotelName(){
		var hotelName = document.aspnetForm.HotelName;
		
		if(hotelName.value == "" || trim(hotelName.value) == ""){
			alert("You didn't enter a Hotel Name.\n");
       		hotelName.focus();
       		return false;
		}else{
			return checkRegisteredName();
			
		}
}



//CHECK NAME REGISTERED UNDER
function checkRegisteredName(){
		var registerName = document.aspnetForm.NameRegisteredUnder;
		
		if(registerName.value == "" || trim(registerName.value) == ""){
			alert("You didn't enter a Name Registered Under.\n");
       		registerName.focus();
       		return false;
		}else{
			return checkDestCity();
			
		}
}



//CHECK DESTINATION CITY
function checkDestCity(){
		var destCity = document.aspnetForm.DestinationCity;
		
		if(destCity.value == "" || trim(destCity.value) == ""){
			alert("You didn't enter a Destination City.\n");
       		destCity.focus();
       		return false;
		}else{
			return checkDestAddress();
			
		}
}


//CHECK DESTINATION ADDRESS
function checkDestAddress(){
		var destAddress = document.aspnetForm.DestinationAddress;
		
		if(destAddress.value == "" || trim(destAddress.value) == ""){
			alert("You didn't enter a Destination Address.\n");
       		destAddress.focus();
       		return false;
		}else{
			return checkEmail();
			
		}
}




//TRIM LEADING AND TRAILING WHITE SPACES
function trim(strText) { 
    // this will get rid of leading spaces 
    while (strText.substring(0,1) == ' ') 
        strText = strText.substring(1, strText.length);

    // this will get rid of trailing spaces 
    while (strText.substring(strText.length-1,strText.length) == ' ')
        strText = strText.substring(0, strText.length-1);

   return strText;
} 