/****************************************************************************
        THIS IS THE CODE NEEDED TO PRODUCE A CALENDAR!
*****************************************************************************/
var obj1 ;

function produceCalendar (bindToFld) {

    if(typeof(obj1) != 'object') obj1 = new suycCalendar() ;
    
    if (obj1.isIE4) {
        //Set the X & Y pos of the calendar object
        obj1.posX = window.event.clientX + 22 ;
        obj1.posY = window.event.clientY - 10 ;
    }else {
        obj1.posX = 250 ;
        obj1.posY = 150 ;    
    }

    // If the calendar is visible and the same button was pressed as was pressed
    // to create the Calendar then Hide the calendar and exit the Sub
    if( obj1.visible && bindToFld == obj1.bindToElement )
    {
        obj1.hide() ;
        return ;
    }else{
        obj1.bindToElement = bindToFld ;
    }

    obj1.BuildCalendar() ;
}

function positionCalendar(f) {

    var x = f.txtPosX.value;
    var y = f.txtPosY.value;

    if(typeof(obj1) != 'object') produceCalendar () ;

    if( isNaN(x) || isNaN(y) )
    {
        alert('You can only enter numbers for the x/y co-ordinates') ;
        return ;
    } else {
        obj1.moveTo(x,y)
    }

}

/****************************************************************************
        IMPLEMENT THESE 4 FUNCTIONS IF YOU WANT TO CATCH CLIENT
        SIDE EVENTS (To use this you must have hasEvents set to True) .
*****************************************************************************/
function clickhandler (d,m,y) {

    var objFld = eval("document.frm." + obj1.bindToElement) ;
    
    // Update our form field.
    objFld.disabled = false;
    objFld.value = m + ' / ' + d + ' / ' + y ;
    objFld.disabled = false;
    // hide the calendar object.
    obj1.hide() ;
}

function toggleCalendar (i) {

    obj1.toggleCalendar(i) ;
}

function toggleCurrent () {

    obj1.goToCurrent() ;
}

function calClose () {
    obj1.hide() ;
}

/*****************************************************************************/