var CalendarDateField; // init a date field for popup
var CalendarDateFormat = "mmm dd yyyy";
var CalendarEvent = "";

// open the calendar and return the value to Object
function open_calendar(ThisObject)
{
    var newWindow;
    var ScreenY = document.body.clientHeight;
    var ScreenX = document.body.clientWidth;

    var posX = (ScreenX) / 2;
    var posY = (ScreenY) / 2;

//    var posX = (window.event.x) + 20;
//    var posY = (window.event.y) + 85;
   
    // defined at the top
    CalendarDateField = ThisObject;
    var urlstring = '../JSDB/wincalendar/calendar.htm';
     
     newWindow = window.open(urlstring,'',
               'height=220,width=225,toolbar=no,minimize=no,status=no,memubar=no,location=no,scrollbars=no,top=' + posY + ',left=' + posX);
               
}

// open the calendar and return the value to Object and calls the trigger function
function open_calendar_trigger(ThisObject,triggername)
{
    var newWindow;
    var ScreenY = document.body.clientHeight;
    var ScreenX = document.body.clientWidth;

    var posX = (ScreenX) / 2;
    var posY = (ScreenY) / 2;

//    var posX = (window.event.x) + 20;
//    var posY = (window.event.y) + 85;
   
    // defined at the top
    CalendarDateField = ThisObject;
    CalendarEvent = triggername;
    var urlstring = '../JSDB/wincalendar/calendar.htm';
     
     newWindow = window.open(urlstring,'',
               'height=220,width=225,toolbar=no,minimize=no,status=no,memubar=no,location=no,scrollbars=no,top=' + posY + ',left=' + posX);
               
}

