var nowd=date.getFullYear()+'-'+(date.getMonth() + 1)+'-'+date.getDate()//2013-1-17
var nextd=date.getFullYear()+'-'+(date.getMonth() + 2)+'-'+date.getDate()//2013-2-17
var d1 = document.getElementById("Text1").valuevar myDate1 = new Date()
myDate1.setFullYear(d1.substring(0, 4), d1.substring(4, 6), d1.substring(6))
var d2 = document.getElementById("Text2").value
var myDate2 = new Date()
myDate2.setFullYear(d2.substring(0, 4), d2.substring(4, 6), d2.substring(6))
alert((myDate2 - myDate1)/86400000)