/*===================================================================
    File        : Calendar.js
    Description : functions for the popup-calendar
    Require     : Date.js, OpenwinUtil.js, Calendar.html
    $Revision: 1.1 $
    Last Check-in $Date: 2006/01/11 10:00:22 $
===================================================================*/

if (!this._ET_include_OpenwinUtil) {
    document.write('<script type="text/javascript" language="JavaScript" src="/js/OpenwinUtil.js"></script>');
}

var gsCalendarURL = "/js/Calendar.html";
var gsFlashCalendarURL = "/js/FlashCalendar.html";
var gsDateFormat;
var goDateField;

/*
    Function    : openCalendar
    Description : set the input text field as a date input field
    Parameters  : oDateField
                  sDateFormat
    Return      : a popup calendar window will be dispaly
*/
function openCalendar(oDateField, sDateFormat, bUseFlashCalendar) {
    gsDateFormat  = sDateFormat;
    goDateField   = oDateField;
    if (bUseFlashCalendar) {
        openChildWin(gsFlashCalendarURL,"FlashCalendar");
    } else {
        openChildWin(gsCalendarURL,"Calendar");
    }
}

/*
    Function    : childGetDateFormat
    Description : return the global date format variable "gsDateFormat"
    Parameters  : --
    Return      : gsDateFormat
*/
function childGetDateFormat() {
    return gsDateFormat;
}

/*
    Function    : childSetDate
    Description : set the text field "goDateField" value to the inputted value
    Parameters  : sReturnDateString
    Return      : --
*/
function childSetDate(sReturnDateString) {
    goDateField.value = sReturnDateString;
}

/*
    Function    : childGetDate
    Description : get the value of the field "goDateField"
    Parameters  : --
    Return      : --
*/
function childGetDate() {
    return goDateField.value;
}

