/* This script and many more are available free online at
The JavaScript Source :: http://javascript.internet.com
Created by: Chris Hallberg :: http://kanoa.heavenfromhell.com */

function Calc_Days(dateString) {
  // Enter the month, day, and year below you want to use as
  // the starting point for the date calculation
  var Datefrom = document.getElementById("Arrival_Day").value
  var DateTo = dateString
  var myDateIndian1 = new Array()
  var myDateIndian2 = new Array()
  date2 = Date("mm/dd/yyyy");
  myDateIndian1 = Datefrom.split("/");
  myDateIndian2 = DateTo.split("/");
  date1 = new Date(myDateIndian1[1]+"/"+myDateIndian1[0]+"/"+myDateIndian1[2])
  date2 = new Date(myDateIndian2[1]+"/"+myDateIndian2[0]+"/"+myDateIndian2[2])
  // The number of milliseconds in one day
    var ONE_DAY = 1000 * 60 * 60 * 24
	
    // Convert both dates to milliseconds
    var date1_ms = date1.getTime()
    var date2_ms = date2.getTime()

//    // Calculate the difference in milliseconds
    var difference_ms = Math.abs(date1_ms - date2_ms)
//    
//    // Convert back to days and return
//   // return Math.round(difference_ms/ONE_DAY)
	document.getElementById("days_id").innerHTML = Math.round(difference_ms/ONE_DAY) +" Day (s)";
}

