How can I compare encounterDates using jQuery?

In an attempt to have my encounter dates(startDate and EndDate) well compared, I chose to adopt the code at jqueryUI . Am using their datepicker just like it is in OpenMRS. I don’t seem see any effect on my fields.

Notes: -startDate should be smaller or equal to the endDate as in the example of jQueryUI above. -OpenMRS build 1.9.9

My code is here.

$j("#startDate").change(function(){ $j("#startDate").datepicker({ changeMonth: true, changeYear: true, numberOfMonths: 1,
showAnim: “slideDown”, dateFormat: “mm-dd-yy”, onClose: function(mm) { $j("#endDate").datepicker(“option”, “minDate”, mm); } }); });

$j("#endDate").change( function(){
	$j("#endDate").datepicker({
    changeMonth: true,
    changeYear: true,
    numberOfMonths: 1,     
    showAnim: "slideDown",
    dateFormat: "mm-dd-yy",
    onClose: function(mm) {
        $j("#startDate").datepicker("option", "maxDate", mm);
    }
});
);

I think there is something wrong am doing. Could someone guide me? Help is welcome.