//<SCRIPT LANGUAGE=javascript>
// the commented <SCRIPT> tags allows editing this file 
// using Visual InterDev's HTML/script editor

// adapted from dropdowncalendar.js:
//   http://www.jars.com/classes/jresout.cgi?resource=8287
//   Submitted by : Kaushik Datta 
// modified to use CSS instead of hard-coded colors, etc - Lindsay Bigelow Nov-2002
// modified to pop browser window instead of DIV element - Lindsay Bigelow Jan-2003

// include this script in the calling document

var calwindow = null;
var popWidth  = 260;
var popHeight = 220;

/***********************************
 ** unload handler for calendar caller BODY element
 */
function popcalUnload() {
    if (calwindow != null) {
        calwindow.close();
        calwindow = null;
    }
} 
/***********************************
 ** show a popup calendar
 * @param fld - name of source/destination element in calling document
 */
function popcal(fld) {
    if ((calwindow != null) && (document.getElementById("popcalflag").value == '1')) {
        calwindow.close();
        calwindow = null;
        document.getElementById("popcalflag").value = '0';
        return;
    }
    var line = 1;
    var itm = document.getElementById("popcalitem").value = fld;  line++;
    try {
        var popLeft   = Math.floor(screen.availWidth  * .7 - popWidth / 2);   line++;  // right-middle
        var popTop    = Math.floor(screen.availHeight * .3 - popHeight / 2);  line++;  // upper-middle
        calwindow = window.open(
                        "/c2dweb/scripts/calendar3b.htm",
                        "calwindow", 
                        "width=" + popWidth + ",height=" + popHeight
                        + ",left=" + popLeft  + ",top=" + popTop 
                        + ",resizable=yes,status=no,toolbar=no,location=no,menubar=no,titlebar=no" 
                        + ",directories=no,scrollbars=no,dependent=yes,alwaysRaised=yes"
                      );
    }
    catch(e) {
        alert("Error in popcal at line " + line + ": " + e);
    }
}
//</SCRIPT>

