function doStuff(){	

		// Get the start date
var start_date = document.ReservationsForm.start_date.value;

// Get the end date
var end_date = document.ReservationsForm.end_date.value;
 
// Break up the start date - using the delimiter "/" - into an array of strings
start_date = start_date.split("/")

// Break up the end date - using the delimiter "/" - into an array of strings
end_date = end_date.split("/")
 
// Access each element in the array.
start_year = start_date[2];
start_month = start_date[0];
start_day = start_date[1];

end_year = end_date[2];
end_month = end_date[0];
end_day = end_date[1];
 
// Set the start date using the Date object and pass it our date parameters.
// NOTE: when passing the month as a number, remember that the array starts at 0. // So Jan = 0, Feb = 1 ... Dec = 11
var sDate = new Date(start_year,start_month-1,start_day);
 
// Set the end date using the Date object and pass it our date parameters.
// NOTE: when passing the month as a number, remember that the array starts at 0. // So Jan = 0, Feb = 1 ... Dec = 11
var eDate = new Date(end_year,end_month-1,end_day);
 
// what is the difference between the start date and today's date
diff = eDate-sDate;
 
// get the difference in days
diff = Math.ceil(diff/1000/60/60/24);

	if(document.getElementById('start_date').value != "" && document.getElementById('end_date').value != ""){
					document.getElementById('dues').value = diff;
	}

}

function calculateCost(){
	
	
		// Get the start date
var start_date = document.ReservationsForm.start_date.value;

// Get the end date
var end_date = document.ReservationsForm.end_date.value;
 
// Break up the start date - using the delimiter "/" - into an array of strings
start_date = start_date.split("/")

// Break up the end date - using the delimiter "/" - into an array of strings
end_date = end_date.split("/")
 
// Access each element in the array.
start_year = start_date[2];
start_month = start_date[0];
start_day = start_date[1];

end_year = end_date[2];
end_month = end_date[0];
end_day = end_date[1];
 
// Set the start date using the Date object and pass it our date parameters.
// NOTE: when passing the month as a number, remember that the array starts at 0. // So Jan = 0, Feb = 1 ... Dec = 11
var sDate = new Date(start_year,start_month-1,start_day);
 
// Set the end date using the Date object and pass it our date parameters.
// NOTE: when passing the month as a number, remember that the array starts at 0. // So Jan = 0, Feb = 1 ... Dec = 11
var eDate = new Date(end_year,end_month-1,end_day);
 
// what is the difference between the start date and today's date
diff = eDate-sDate;
 
// get the difference in days
diff = Math.ceil(diff/1000/60/60/24);
	
/*Set Prices for Reservation Length in Nights Here */
var numberofDays = diff;

/* The discount applied is that for every 7 nights reserved you get one night free. This equation takes the total nights and looks to see if the total divided by 7 equals one. It it does it subtracts one from the total days. It it's two (aka you have 14 or more nights) it subtracts two. The floor function ALWAYS ROUNDS DOWN. So even if you have 20, the remainder still rounds DOWN to an integer, which is two.  */
var totalDays = numberofDays - Math.floor(numberofDays/7);		

/*Lastly, multiply the final amount times 150, then by state tax, then add $50 for the cleaning fee */
var cost = 150*totalDays;
var stateTax = cost*.09;
var costWithCleaning = cost+50;
var finalCost = costWithCleaning+stateTax;

	if(document.getElementById('start_date').value != "" && document.getElementById('end_date').value != ""){
					document.getElementById('cost').value = "$" +finalCost;
	}
}