var popUp; 

function OpenCalendar(idname, postBack,evt)
{
    OpenCalendar2(idname, postBack, evt, '../utilities/');
}
function OpenCalendar2(idname, postBack, evt,path) {
    if (popUp != null) popUp.close();
    var e = (window.event) ? window.event : evt;
    popUp = window.open(path + 'calendar.aspx?formname=' + document.forms[0].name +
		'&id=' + idname + '&selected=' + document.forms[0].elements[idname].value + '&postBack=' + postBack,
		'popupcal',
		'width=250,height=270,location=0,left=' + (e.clientX - 125) + ',top=' + (e.clientY - 70));
    popUp.focus();
}
function SetDate(formName, id, newDate, postBack)
{
	eval('var theform = document.' + formName + ';');
	popUp.close();
	if(theform.elements[id].className='watermarked'){
	    theform.elements[id].AjaxControlToolkitTextBoxWrapper.set_Value(newDate);
	}
	else{
		theform.elements[id].value = newDate;
	}
	if (postBack)
		__doPostBack(id,'');
}		

function AlertError(src){
	window.alert(src.title);
}
function MouseOverError(src){
	window.status=src.title;
}
function MouseOutError(src){
	window.status="";
}

function calendarShown(sender, e) { sender._switchMode("years"); }
