// JavaScript Document

function date_diff(date1,date2)
{
    m1=date1.substr(0,2);
	d1=date1.substr(3,2);
	y1=date1.substr(6,4);
	
	m2=date2.substr(0,2);
	d2=date2.substr(3,2);
	y2=date2.substr(6,4);

   var frm_dt =new Date(y1, m1, d1) //Month is 0-11 in JavaScript
	to_dt=new Date(y2, m2, d2)
	var one_day=1000*60*60*24
	
	//Calculate difference btw the two dates, and convert to days
	 diff=Math.ceil((to_dt.getTime()-frm_dt.getTime())/(one_day));
	//document.write(Math.ceil((to_date.getTime()-from_date.getTime())/(one_day))+" days has gone by since the millennium!")
  return diff
}

