function search(type)
{
	if(type.toUpperCase() == "TYPE")
	{
		if(document.Form1.CaseType.selectedIndex == 0)
		{
			alert("You must select a case type.");
			return false;
		}
		if(document.Form1.ddlLocation2.selectedIndex == 0)
		{
			alert("You must enter a location.");
			return false;
		}
		document.Form1.hdnType.value = "TYPE";
	}
	else if(type.toUpperCase() == "NUMBER")
	{
		if(document.Form1.casenumber.value == "")
		{
			alert("You must enter a case number.");
			document.Form1.casenumber.focus();
			return false;
		}
		document.Form1.hdnType.value = "NUMBER";
	}
	else if(type.toUpperCase() == "NAME")
	{
		if(document.Form1.lastname.value == "")
		{
			alert("You  must enter a last name.");
			document.Form1.lastname.focus();
			return false;
		}
		document.Form1.hdnType.value = "NAME";
	}
	document.Form1.submit();
	return true;
}

function clearFields(type)
{
	if(type.toUpperCase() == "TYPE")
	{
		document.Form1.ddlLocation2.selectedIndex = 0;
		document.Form1.CaseType.selectedIndex = 0;
	}
	else if(type.toUpperCase() == "NUMBER")
	{
		document.Form1.casenumber.value = "";
		document.Form1.casenumber.focus();
	}
	else if(type.toUpperCase() == "NAME")
	{
		document.Form1.lastname.value = "";
		document.Form1.firstname.value = "";
		document.Form1.lastname.focus();
	}
	return false;
}
function setFocusCaseSearch()
{
	document.Form1.CaseNumber.focus();
}

function setFocusNameSearch()
{
	document.CivilCalendarSearchName.lastName.focus();
}

function checkSearchCaseForm(thisForm) 
{
	if(thisForm.CaseNumber.value.trim() == "")
	{
		alert("You must enter a Case Number.");
		thisForm.CaseNumber.focus();
		return false;
	}
	return true;
}

function checkSearchNameForm(thisForm) 
{
	if(thisForm.lastName.value.trim() == "")
	{
		alert("You must enter a last name.");
		thisForm.lastName.focus();
		return false;
	}
	return true;
}

function checkSearchTypeForm(thisForm)
{
	if(get_radio_value(thisForm.CaseType).trim() == "")
	{
		alert("You must enter a case type.");
		return false;
	}
	if(thisForm.lbxLocations.value.trim() == "")
	{
		alert("You must enter a location.");
		return false;
	}
	return true;

	return false;
}
