/* This function returns the absolute position of an element on a form */
function getPos(el){
	var rd = {x:0,y:0};
	do{
	
		rd.x += el.offsetLeft;
		rd.y += el.offsetTop;
		el = el.offsetParent;
		} while(el)
		return rd
}

/* Used to create the calendar control */
function ShowCalendar(cal, field){
	DateField = document.getElementById(field);
	DateField.value = '';
	oPos =	getPos(cal);
	InlineX = oPos.x;
	InlineY = oPos.y + 20;
	
	
	show_calendar(DateField.id,null,null,null,'INLINE','CallFunction=;AllowWeekends=Yes;CloseOnSelect=Yes;InlineX='+  InlineX + ';InlineY=' + InlineY);
}	

/* This function shows and hides a dive */
function PleaseShowMe(me)
{
	var obj = document.getElementById(me);
	if (obj.style.display == "none")
		obj.style.display = "";
	else
		obj.style.display = "none";
}
function ShowReport(FileName)
	{
		window.open('ReportFiles/' + FileName, null, 'width=500, height=500');
	}