I would personally ensure your date entry for manual entries is clear in the format expected, I prefer DD-MMM-YYYY, removes all ambiguity. Also, if the date is not recognised handle this error (the code below will write out any "invalid date").
The first thing to do, is parse the dates in a date object.
Then simply perform an equality test of the valueOf the date object (according to the javascript docs, valueOf output is the same as toString).
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head>
<title>Untitled Page</title>
</head>
<body>
Date Input 1;<br />
<input id="Text1" type="text" /><br />
Date Input 2;<br />
<input id="Text2" type="text" /><br />
<input id="Button1" type="button" value="Compare Dates" onclick="compareDates()" />
<div id="output">Enter the dates and hit the button.</div>
<script type="text/javascript">
function compareDates() {
var d1 = new Date(Date.parse(Text1.value));
var d2 = new Date(Date.parse(Text2.value));
output.innerHTML = "D1 value is: " + d1.toUTCString() + "<br />" + "D2 value is: " + d2.toUTCString();
alert("Are the dates the same; " + (d1.valueOf() == d2.valueOf()));
}
</script>
</body>
</html>