// The 'time' argument is a string (example: "23:59:59.999" or "16:20")
// containing a time to be appended to the date that the picker returns
// to the form.  Note that the format of the time string just needs
// to be one that Zope's DateTime class will understand.  That actual
// format returned to your form will use the aquired 'format_datetime' method.
// *** If you want to deal with bare dates (with no time component) pass
// an empty string as the value of the time argument.

function popupDatePicker(formname, inputname, time) {
    if(time == null) { time = ''; }
    var width = 160;
    var height = 160;
    var left = (screen.width - width) / 2;
    var top = (screen.height - height) / 2; 
    var url = 'date_picker_popup?formname='+formname+'&inputname='+inputname+'&hilitedate='+escape(document.forms[formname].elements[inputname].value)+'&time='+time;
    var date_picker = window.open(url, 'date_picker', 'toolbar=0,scrollbars=0,status=0,resizable=0,width='+width+',height='+height+',left='+left+',top='+top);
    date_picker.focus();
}

