function popupCalendar(Date, DateField, PageName)
{
	// Date: the date value.
	// Pass in the "name" of the date field for the last parameter (eg document.form.myDateTextbox)
	// Pass the name of the file you are calling this from as the 7th parameter
	// THE FIELD NAMES ARE CASE SPECIFIC so make sure they match!
	// pass a blank  parameter if you only want to specify one of the paramaters
	var url="", popupwin=""
	url="calendar.asp?Date=" + Date + "&DateField=" + DateField + "&CallingPage=" + PageName
	popupWin = window.open(url,'calendar','location=0,resizable=0,height=215,width=235')
	popupWin.focus()
}

function setFocus() 
{
	//Sets Focus to the first Element in a Form
	for (var frm = 0; frm < document.forms.length; frm++) 
	{
		//Ignore the QuickList.
		if (document.forms[frm].name != 'frmQuickList')
		{
	
			for (var fld = 0; fld < document.forms[frm].elements.length; fld++) 
			{
				var el = document.forms[frm].elements[fld];
				//alert(el.type + " " + el.name);
				// to skip "select" types, remove from if statement
				if ((el.type == "text") || (el.type == "textarea") || (el.type == "select-one") || (el.type == "select-multiple")) 
				{
					el.focus();
					return true;
				}
			}
		}
	}
	return true;
}

function confirmDelete(oForm, iAction)
{
	//Confirms the deletion of a record
	
	if (confirm('Are you sure you want to Delete this record?'))
	{
		oForm.Action.value = iAction; 
		oForm.submit();
	}
	return true;
}
