function showCalendar(PstrTextBoxName, PstrForm)
{
    if(PstrForm == null) {
        return showCalendar2(PstrTextBoxName);
    }
	strFieldName = PstrTextBoxName;
	strForm = PstrForm;

	var windowAttributes = 'dialogWidth:275px;dialogHeight:250px;dialogTop:5px;dialogLeft:5px;center:Yes;status:No;';
	var ret = window.showModalDialog( '../Include/Calendar.aspx', 'WMPCalendar', windowAttributes);
    if(ret != null && ret != '') {
	    var tmp = eval('document.' + PstrForm + '.' + PstrTextBoxName);
	    tmp.value = ret;
        return true;
    }
    return false;
}

function showCalendarNotInFolder(PstrTextBoxName, PstrForm)
{
	strFieldName = PstrTextBoxName;
	strForm = PstrForm;

	windowAttributes = "toolbar=0,scrollbars=0,width=5,height=5";
	calendarWindow = window.open("Include/Calendar.aspx?strTextBox=" + PstrTextBoxName + "&strFormName=" + PstrForm + "", 'WMPCalendar', windowAttributes);
}

function showCalendar2(elem)
{
	var windowAttributes = 'dialogWidth:275px;dialogHeight:250px;dialogTop:5px;dialogLeft:5px;center:Yes;status:No;';
	var ret = window.showModalDialog( '../Include/Calendar.aspx', 'WMPCalendar', windowAttributes);
    if(ret != null && ret != '') {
        elem.value = ret
        return true;
    }
    return false;
}
