var s1 = "2007-12-01";
var s2 = "2007-1-31";
s1 = s1.replace(/-/g, "/");
s2 = s2.replace(/-/g, "/");
s1 = new Date(s1);
s2 = new Date(s2);
alert(s1.toLocaleString() + " " + s2.toLocaleString());
var days= s1.getTime() - s2.getTime();
alert( days>0 ? 's1>s2' : 's1<s2');