﻿/***************************\
* Greybox Related Functions *
\***************************/
var GB_ROOT_DIR = '/js/greybox/';
var curID = '';

function CloseGB()
{
    GB_hide();
}

function CloseGBandPost()
{
    GB_hide();

    // based on which button was clicked
    if (curID == '')
        alert('Unknown error. Please try again.');
    else
        causePostback(curID);
}

function causePostback(id)
{
    eval(unescape(document.getElementById(id).href));
}
/*******************************\
* End Greybox Related Functions *
\*******************************/

/****************************\
* Calendar Related Functions *
\****************************/
function createDatePicker(id)
{
    $('#' + id).css('margin-right', '3px');
    $('#' + id).datepicker(
            {
                showOn: 'button',
                buttonImage: '/images/calendar/calendar.jpg',
                buttonImageOnly: true,
                changeMonth: true,
                changeYear: true,
                showButtonPanel: true,
                currentText: 'Go To Today',
                closeText: 'Close',
                maxDate: '-1d'
            });
}

function createDatePickers()
{
    $('.date').css('margin-right', '3px');
    $('.date').datepicker(
    {
        showOn: 'button',
        buttonImage: '/images/calendar/calendar.jpg',
        buttonImageOnly: true,
        changeMonth: true,
        changeYear: true,
        showButtonPanel: true,
        currentText: 'Go To Today',
        closeText: 'Close',
        maxDate: '-1d'
    });
}
/********************************\
* End Calendar Related Functions *
\********************************/