DateRange in DatePicker...

DateRange in DatePicker...

Hi All,
I have a page like this:
<head>
$(function() {
      var currentDate = new Date()
      var minDateValue = '';
      $("#date_from").datepicker();
      $("#date_to").click(function(){
         minDateValue = timeDifference(dateFormat(currentDate, "yyyy-mm-dd"),dateFormat($("#date_from").val(),"yyyy-mm-dd"));
         //alert(minDateValue);
         $("#date_to").datepicker({minDate: -(minDateValue), maxDate: '+11D'});
      });
   });
</head>
<body>
<body>

<div class="demo">
<p>Date From: <input type="text" name="date_from" id="date_from"> Date To: <input type="text" name="date_to" id="date_to"></p>
</body>
</body>

Here I have two fields date_from and date to. I want to assign the minimum date value in Date to field, Which should at least be the value of date from. Instead of assigning the direct date, I have calculated the number of days and pass it to the minvalue. I checked the minvalue, which is giving the correct value, but date to is not showing correctly.
Is there any mistake? It just take the initial value and freeze it with the same value.
May be, I have done some mistake here. I need your suggestions. If this is not possible, What can be the best way to implement this feature.

Thanks in advance