<script type="text/javascript">

$(function()
{
MakeStartEndPicker("#checkIn", "#checkOut");
});

function MakeStartEndPicker(startElement, endElement)
{
$(startElement).datepicker({
minDate: 0,
dayNamesMin: ['Sen', 'Sel', 'Rab', 'Kam', 'Jum', 'Sab', 'Min'],
dateFormat: 'd-m-yy',
buttonText: 'Tentukan tanggal check in',
showOn: 'both', buttonImage: '<?php echo "$f[folder]/images/icon_calender.gif"; ?>',
buttonImageOnly: true,
changeMonth: true,
changeYear: true,
showAnim: 'slideDown',
showButtonPanel: true,
closeText: 'Tutup',
duration: 0 ,
beforeShow: function(input)
{
var date2 = $(endElement).datepicker('getDate');
if(date2 != undefined) return { maxDate: date2 };
}

});

$(endElement).datepicker({
minDate: 0,
dayNamesMin: ['Sen', 'Sel', 'Rab', 'Kam', 'Jum', 'Sab', 'Min'],
dateFormat: 'd-m-yy',
buttonText: 'Tentukan tanggal check out',
showOn: 'both', buttonImage: '<?php echo "$f[folder]/images/icon_calender.gif"; ?>',
buttonImageOnly: true, showAnim: 'slideDown',
duration: 0 ,
beforeShow: function(input)
{
var date1 = $(startElement).datepicker('getDate');
if(date1 != undefined) return { minDate: date1 };
}
});
}



</script>