var calendarWidth = 250;
var calendarHeight = 280;

function findCalendarChild(id)
{
	var obj = null;

	if (document.layers) {
		obj = document.layers[id];
	} else {
		if (document.getElementById) {
			obj = document.getElementById(id);
		} else {
			obj = document.all(id);
		}
	}
	
	return obj;
}

function openCalendar(child)
{
	var wnd = null;
	var initialValue = null;
	var obj = findCalendarChild(child);
	var topLocation = (screen.height - calendarHeight) / 4;
	var leftLocation = (screen.width - calendarWidth) / 1.5;
	
	if (obj != null) {
		initialValue = "&value=" + escape(obj.value);
	}
	
	wnd = window.open("calendar.aspx?child=" + child + initialValue, "calendar", "width=" + calendarWidth + ",height=" + calendarHeight + ",top=" + topLocation + ",left=" + leftLocation);
	wnd.focus();
	
	return true;
}
