function daysBetweenDates() {
	d1 = new Date(document.form1.arriveYear.value, document.form1.arriveMonth.value-1, document.form1.arriveDay.value);
	d2 = new Date(document.form1.departYear.value, document.form1.departMonth.value-1, document.form1.departDay.value);
	/*
	//Get 1 day in milliseconds
	var one_day=1000*60*60*24;

	//Calculate difference btw the two dates, and convert to days
	document.form1.numberOfNights.value = Math.ceil((d2.getTime()-d1.getTime())/(one_day));
	*/

	// The number of milliseconds in one day
    var oneDay = 1000 * 60 * 60 * 24;

    // Convert both dates to milliseconds
    var date1_ms = d1.getTime();
    var date2_ms = d2.getTime();

    // Calculate the difference in milliseconds
    var difference = Math.abs(date1_ms - date2_ms);

    // Convert back to days and return
    document.form1.numberOfNights.value = Math.round(difference/oneDay);
}

function SplitV(){

        var strFilled;

        strFilled=$("#startDatePicker").val().split('/');

        $("#arriveMonth").val(strFilled[0]);
        $("#arriveDay").val(strFilled[1]);
        $("#arriveYear").val(strFilled[2]);


		var strFilled;

        strFilled=$("#endDatePicker").val().split('/');

        $("#departMonth").val(strFilled[0]);
        $("#departDay").val(strFilled[1]);
        $("#departYear").val(strFilled[2]);
		
		daysBetweenDates();
		    return true;
}


function goHome() {
 document.location.href = 'index.php';
}