I'm using a js calendar to provide a start date that is stored in a db. Its for a daily newspaper, so the newspaper can accept ads until 3pm for the next days edition. After 3pm, it needs to be scheduled for the day after. How can I add that functionality?

Thanks in advance




Code:
<script language="javascript" type="text/javascript">
YAHOO.namespace("example.calendar");
YAHOO.example.calendar.init = function() {
function mySelectHandler(type,args,obj) {
var arrDates = obj.getSelectedDates();
var runDate = '';
var i;
for (i = 0; i < arrDates.length; i++)
{
runDate += (arrDates[i].getMonth()+1) + '/' + arrDates[i].getDate() + '/' + arrDates[i].getFullYear() + ',';
}
runDate = runDate.substring(0, runDate.length -1);
getElement('txtPubStartDate').value = runDate;
};
YAHOO.example.calendar.cal = new YAHOO.widget.Calendar("cal","calContainer", { mindate: "<?= date('m/d/Y', mktime(0, 0, 0, date("m"), date("d")+2, date("Y"))) ?>", maxdate: "<?= date('m/d/Y', mktime(0, 0, 0, date("m"), date("d")+5, date("Y")+1)) ?>", pagedate: "<?= date('m/Y', mktime(0, 0, 0, date("m"), date("d"), date("Y"))) ?>", selected: "<?= date('m/d/Y', mktime(0, 0, 0, date("m"), date("d")+1, date("Y"))) ?>",  hide_blank_weeks: true });
YAHOO.example.calendar.cal.selectEvent.subscribe(mySelectHandler, YAHOO.example.calendar.cal, true);
YAHOO.example.calendar.cal.deselectEvent.subscribe(mySelectHandler, YAHOO.example.calendar.cal, true);
YAHOO.example.calendar.cal.render();
}
YAHOO.util.Event.onDOMReady(YAHOO.example.calendar.init);
</script>