function LogWebTrendsBasic() {
    var WT = _tag.WT;
    WT.z_Quick_Search = 1;
    _tag.dcsCollect();
}

function submitform()
{

  var zipcode = $("#zip").val();
  var radius = $("#radius").val();

  if (document.providerDir.zip.value=="" && document.providerDir.specialty.value=="" && document.providerDir.lastName.value=="") {
    alert("Please either provide or select some criteria prior to submitting the form.");
  }
  else {
      if (zipcode.length != 0 && radius.length == 0) {
          $("#radius").val("5");
      }
    // Call function to log webtrends for basic search
    LogWebTrendsBasic()
    document.providerDir.submit();
  }
}
function submitDentalForm()
{
  var zipcode = $("#zip").val();
  var radius = $("#radius").val();

  if (document.providerDir.zip.value=="" && document.providerDir.city.value=="" && document.providerDir.county.value=="" && document.providerDir.specialty.value=="" && document.providerDir.lastName.value=="") {
    alert("Please either provide or select some criteria prior to submitting the form.");
  }
  else {
      if (zipcode.length != 0 && radius.length == 0) {
          $("#radius").val("5");
      }    
    // Call function to log webtrends for basic search
    LogWebTrendsBasic()
    document.providerDir.submit();
  }
}
function submitPharmacyForm()
{
  var zipcode = $("#zip").val();
  var radius = $("#radius").val();
  
  if (document.providerDir.zip.value=="" && document.providerDir.city.value=="" && document.providerDir.county.value=="" && document.providerDir.pharmacy.value=="") {
    alert("Please either provide or select some criteria prior to submitting the form.");
  }
  else {
      if (zipcode.length != 0 && radius.length == 0) {
          $("#radius").val("5");
      }    
    // Call function to log webtrends for basic search
    LogWebTrendsBasic()
    document.providerDir.submit();
  }
}
function submitHospitalForm()
{
  var zipcode = $("#zip").val();
  var radius = $("#radius").val();

  if (document.providerDir.zip.value=="" && document.providerDir.city.value=="" && document.providerDir.county.value=="" && document.providerDir.hospital.value=="") {
    alert("Please either provide or select some criteria prior to submitting the form.");
  }
  else {
    // Call function to log webtrends for basic search
      if (zipcode.length != 0 && radius.length == 0) {
          $("#radius").val("5");
      }    
    LogWebTrendsBasic()
    document.providerDir.submit();
  }
}
function submitAncillaryForm()
{
  if (document.providerDir.county.value=="" && document.providerDir.ancillary.value=="") {
    alert("Please either provide or select some criteria prior to submitting the form.");
  }
  else {
    // Call function to log webtrends for basic search
    LogWebTrendsBasic()
    document.providerDir.submit();
  }
}
function submitRadiologyForm()
{
  if (document.providerDir.county.value=="" && getRadiologyCount()==0) {
    alert("Please either provide or select some criteria prior to submitting the form.");
  }
  else {
    // Call function to log webtrends for basic search
    LogWebTrendsBasic()
    document.providerDir.submit();
  }
}

function entsub(event,ourform) {
  if (event && event.which == 13) 
  {
    ourform.submit();
  }
  else
  {
    return true;
  }
}

//***** Functions for Physician Tab
function clearPage() {
	document.getElementById('andor1').innerHTML="OR";
	document.getElementById('andor2').innerHTML="OR";
	document.getElementById('searchBox_last').style.background="url('images/search_box_lastname_active.jpg')";
	document.getElementById('searchBox_zip').style.background="url('images/search_box_zip.jpg')";
	document.getElementById('searchBox_specialty').style.background="url('images/search_box_specialty.jpg')";
	document.getElementById('searchbutton_lastname').innerHTML="<a href='javascript:submitform()' tabstop='4'><img src='images/search_button_lastname.gif' border='0'></a><br>";
	document.getElementById('searchbutton_zip').innerHTML="&nbsp;";
	document.getElementById('searchbutton_specialty').innerHTML="&nbsp;";
	document.providerDir.lastName.value="";
	document.providerDir.zip.value="";
	document.providerDir.specialty.value="";
	document.providerDir.lastName.focus();
}

function activateLastName() {
	if (document.providerDir.zip.value!="" && document.providerDir.specialty.value!="") {
		document.getElementById('andor1').innerHTML="AND";
		document.getElementById('andor2').innerHTML="AND";
		document.getElementById('searchbutton_lastname').innerHTML="&nbsp;";
		document.getElementById('searchbutton_zip').innerHTML="&nbsp;";
		document.getElementById('searchbutton_specialty').innerHTML="<a href='javascript:submitform()' tabstop='4'><img src='images/search_button_specialty_lastname_zip.jpg' border='0'></a><br>";
		
	}
	else {
		if (document.providerDir.zip.value!="" && document.providerDir.specialty.value=="") {
			document.getElementById('andor1').innerHTML="AND";
			document.getElementById('andor2').innerHTML="OR";
			document.getElementById('searchBox_specialty').style.background="url('images/search_box_specialty.jpg')";
			document.getElementById('searchbutton_lastname').innerHTML="&nbsp;";
			document.getElementById('searchbutton_specialty').innerHTML="&nbsp;";
			document.getElementById('searchbutton_zip').innerHTML="<a href='javascript:submitform()' tabstop='4'><img src='images/search_button_zip_lastname.gif' border='0'></a><br>";
		}
		else {
			if (document.providerDir.zip.value=="" && document.providerDir.specialty.value!="") {
				document.getElementById('andor1').innerHTML="OR";
				document.getElementById('andor2').innerHTML="AND";
				document.getElementById('searchBox_zip').style.background="url('images/search_box_zip.jpg')";
				document.getElementById('searchbutton_lastname').innerHTML="&nbsp;";
				document.getElementById('searchbutton_zip').innerHTML="&nbsp;";
				document.getElementById('searchbutton_specialty').innerHTML="<a href='javascript:submitform()' tabstop='4'><img src='images/search_button_specialty_lastname.jpg' border='0'></a><br>";
			}
			else {
				if (document.providerDir.zip.value=="" && document.providerDir.specialty.value=="") {
					document.getElementById('andor1').innerHTML="OR";
					document.getElementById('andor2').innerHTML="OR";
					document.getElementById('searchBox_zip').style.background="url('images/search_box_zip.jpg')";
					document.getElementById('searchBox_specialty').style.background="url('images/search_box_specialty.jpg')";
					document.getElementById('searchbutton_lastname').innerHTML="<a href='javascript:submitform()' tabstop='4'><img src='images/search_button_lastname.gif' border='0'></a><br>";
					document.getElementById('searchbutton_zip').innerHTML="&nbsp;";
					document.getElementById('searchbutton_specialty').innerHTML="&nbsp;";
				}
			}
		}
	}
	document.getElementById('searchBox_last').style.background="url('images/search_box_lastname_active.jpg')";
}

function activateZip() {
	if (document.providerDir.lastName.value!="" && document.providerDir.specialty.value!="") {
		document.getElementById('andor1').innerHTML="AND";
		document.getElementById('andor2').innerHTML="AND";
		document.getElementById('searchbutton_lastname').innerHTML="&nbsp;";
		document.getElementById('searchbutton_zip').innerHTML="&nbsp;";
		document.getElementById('searchbutton_specialty').innerHTML="<a href='javascript:submitform()' tabstop='4'><img src='images/search_button_specialty_lastname_zip.jpg' border='0'></a><br>";
	}
	else {
		if (document.providerDir.lastName.value!="" && document.providerDir.specialty.value=="") {
			document.getElementById('andor1').innerHTML="AND";
			document.getElementById('andor2').innerHTML="OR";
			document.getElementById('searchBox_specialty').style.background="url('images/search_box_specialty.jpg')";
			document.getElementById('searchbutton_lastname').innerHTML="&nbsp;";
			document.getElementById('searchbutton_zip').innerHTML="<a href='javascript:submitform()' tabstop='4'><img src='images/search_button_zip_lastname.gif' border='0'></a><br>";
			document.getElementById('searchbutton_specialty').innerHTML="&nbsp;";
		}
		else {
			if (document.providerDir.lastName.value=="" && document.providerDir.specialty.value!="") {
				document.getElementById('andor1').innerHTML="OR";
				document.getElementById('andor2').innerHTML="AND";
				document.getElementById('searchBox_last').style.background="url('images/search_box_lastname.jpg')";
				document.getElementById('searchbutton_lastname').innerHTML="&nbsp;";
				document.getElementById('searchbutton_zip').innerHTML="&nbsp;";
				document.getElementById('searchbutton_specialty').innerHTML="<a href='javascript:submitform()' tabstop='4'><img src='images/search_button_specialty_zip.jpg' border='0'></a><br>";
			}
			else {
				if (document.providerDir.lastName.value=="" && document.providerDir.specialty.value=="") {
					document.getElementById('andor1').innerHTML="OR";
					document.getElementById('andor2').innerHTML="OR";
					document.getElementById('searchBox_last').style.background="url('images/search_box_lastname.jpg')";
					document.getElementById('searchBox_specialty').style.background="url('images/search_box_specialty.jpg')";
					document.getElementById('searchbutton_lastname').innerHTML="&nbsp;";
					document.getElementById('searchbutton_zip').innerHTML="<a href='javascript:submitform()' tabstop='4'><img src='images/search_button_zip.gif' border='0'></a><br>";
					document.getElementById('searchbutton_specialty').innerHTML="&nbsp;";
				}
			}
		}
	}
	document.getElementById('searchBox_zip').style.background="url('images/search_box_zip_active.jpg')";
}

function activateSpecialty() {
	if (document.providerDir.lastName.value!="" && document.providerDir.zip.value!="") {
		document.getElementById('andor1').innerHTML="AND";
		document.getElementById('andor2').innerHTML="AND";
		document.getElementById('searchbutton_lastname').innerHTML="&nbsp;";
		document.getElementById('searchbutton_zip').innerHTML="&nbsp;";
		document.getElementById('searchbutton_specialty').innerHTML="<a href='javascript:submitform()' tabstop='4'><img src='images/search_button_specialty_lastname_zip.jpg' border='0'></a><br>";
	}
	else {
		if (document.providerDir.lastName.value!="" && document.providerDir.zip.value=="") {
			document.getElementById('andor1').innerHTML="OR";
			document.getElementById('andor2').innerHTML="AND";
			document.getElementById('searchbutton_lastname').innerHTML="&nbsp;";
			document.getElementById('searchbutton_zip').innerHTML="&nbsp;";
			document.getElementById('searchBox_zip').style.background="url('images/search_box_zip.jpg')";
			document.getElementById('searchbutton_specialty').innerHTML="<a href='javascript:submitform()' tabstop='4'><img src='images/search_button_specialty_lastname.jpg' border='0'></a><br>";
		}
		else {
			if (document.providerDir.lastName.value=="" && document.providerDir.zip.value!="") {
				document.getElementById('andor1').innerHTML="OR";
				document.getElementById('andor2').innerHTML="AND";
				document.getElementById('searchbutton_lastname').innerHTML="&nbsp;";
				document.getElementById('searchbutton_zip').innerHTML="&nbsp;";
				document.getElementById('searchBox_last').style.background="url('images/search_box_lastname.jpg')";
				document.getElementById('searchbutton_specialty').innerHTML="<a href='javascript:submitform()' tabstop='4'><img src='images/search_button_specialty_zip.jpg' border='0'></a><br>";
			}
			else {
				if (document.providerDir.lastName.value=="" && document.providerDir.zip.value=="") {
					document.getElementById('andor1').innerHTML="OR";
					document.getElementById('andor2').innerHTML="OR";
					document.getElementById('searchbutton_lastname').innerHTML="&nbsp;";
					document.getElementById('searchbutton_zip').innerHTML="&nbsp;";
					document.getElementById('searchBox_last').style.background="url('images/search_box_lastname.jpg')";
					document.getElementById('searchBox_zip').style.background="url('images/search_box_zip.jpg')";
					document.getElementById('searchbutton_specialty').innerHTML="<a href='javascript:submitform()' tabstop='4'><img src='images/search_button_specialty.jpg' border='0'></a><br>";
				}
			}
		}
	}
	document.getElementById('searchBox_specialty').style.background="url('images/search_box_specialty_active.jpg')";
}
//***** End Functions for Physician Tab
//************************************************************************************************
//***** Functions for Dentist Tab
function clearPageDentist() {
	document.getElementById('andor1').innerHTML="OR";
	document.getElementById('andor2').innerHTML="OR";
	document.getElementById('searchBox_last').style.background="url('images/search_box_dentist_last_active.jpg')";
	document.getElementById('searchBox_zip').style.background="url('images/search_box_zip.jpg')";
	document.getElementById('searchBox_specialty').style.background="url('images/search_box_specialty.jpg')";
	document.getElementById('searchbutton_lastname').innerHTML="<a href='javascript:submitDentalForm()' tabstop='4'><img src='images/search_button_lastname.gif' border='0'></a><br>";
	document.getElementById('searchbutton_zip').innerHTML="&nbsp;";
	document.getElementById('searchbutton_specialty').innerHTML="&nbsp;";
	document.providerDir.lastName.value="";
	document.providerDir.zip.value="";
	document.providerDir.city.value="";
	document.providerDir.county.value="";
	document.providerDir.specialty.value="";
	document.providerDir.lastName.focus();
}

function activateLastNameDentist() {
	if ((document.providerDir.zip.value!="" || document.providerDir.city.value!="" || document.providerDir.county.value!="") && document.providerDir.specialty.value!="") {
		document.getElementById('andor1').innerHTML="AND";
		document.getElementById('andor2').innerHTML="AND";
		document.getElementById('searchbutton_lastname').innerHTML="&nbsp;";
		document.getElementById('searchbutton_zip').innerHTML="&nbsp;";
		document.getElementById('searchbutton_specialty').innerHTML="<a href='javascript:submitDentalForm()' tabstop='4'><img src='images/search_button_type_lastname_zip.jpg' border='0'></a><br>";
		
	}
	else {
		if ((document.providerDir.zip.value!="" || document.providerDir.city.value!="" || document.providerDir.county.value!="") && document.providerDir.specialty.value=="") {
			document.getElementById('andor1').innerHTML="AND";
			document.getElementById('andor2').innerHTML="OR";
			document.getElementById('searchBox_specialty').style.background="url('images/search_box_specialty.jpg')";
			document.getElementById('searchbutton_lastname').innerHTML="&nbsp;";
			document.getElementById('searchbutton_specialty').innerHTML="&nbsp;";
			document.getElementById('searchbutton_zip').innerHTML="<a href='javascript:submitDentalForm()' tabstop='4'><img src='images/search_button_zip_lastname.gif' border='0'></a><br>";
		}
		else {
			if ((document.providerDir.zip.value=="" || document.providerDir.city.value=="" || document.providerDir.county.value=="") && document.providerDir.specialty.value!="") {
				document.getElementById('andor1').innerHTML="OR";
				document.getElementById('andor2').innerHTML="AND";
				document.getElementById('searchBox_zip').style.background="url('images/search_box_zip.jpg')";
				document.getElementById('searchbutton_lastname').innerHTML="&nbsp;";
				document.getElementById('searchbutton_zip').innerHTML="&nbsp;";
				document.getElementById('searchbutton_specialty').innerHTML="<a href='javascript:submitDentalForm()' tabstop='4'><img src='images/search_button_type_lastname.jpg' border='0'></a><br>";
				document.getElementById('CityCounty').style.display="none";
			}
			else {
				if ((document.providerDir.zip.value=="" || document.providerDir.city.value=="" || document.providerDir.county.value=="") && document.providerDir.specialty.value=="") {
					document.getElementById('andor1').innerHTML="OR";
					document.getElementById('andor2').innerHTML="OR";
					document.getElementById('searchBox_zip').style.background="url('images/search_box_zip.jpg')";
					document.getElementById('searchBox_specialty').style.background="url('images/search_box_specialty.jpg')";
					document.getElementById('searchbutton_lastname').innerHTML="<a href='javascript:submitDentalForm()' tabstop='4'><img src='images/search_button_lastname.gif' border='0'></a><br>";
					document.getElementById('searchbutton_zip').innerHTML="&nbsp;";
					document.getElementById('searchbutton_specialty').innerHTML="&nbsp;";
					document.getElementById('CityCounty').style.display="none";
				}
			}
		}
	}
	document.getElementById('searchBox_last').style.background="url('images/search_box_dentist_last_active.jpg')";
}

function activateZipDentist() {
	if (document.providerDir.lastName.value!="" && document.providerDir.specialty.value!="") {
		document.getElementById('andor1').innerHTML="AND";
		document.getElementById('andor2').innerHTML="AND";
		document.getElementById('searchbutton_lastname').innerHTML="&nbsp;";
		document.getElementById('searchbutton_zip').innerHTML="&nbsp;";
		document.getElementById('searchbutton_specialty').innerHTML="<a href='javascript:submitDentalForm()' tabstop='4'><img src='images/search_button_type_lastname_zip.jpg' border='0'></a><br>";
	}
	else {
		if (document.providerDir.lastName.value!="" && document.providerDir.specialty.value=="") {
			document.getElementById('andor1').innerHTML="AND";
			document.getElementById('andor2').innerHTML="OR";
			document.getElementById('searchBox_specialty').style.background="url('images/search_box_specialty.jpg')";
			document.getElementById('searchbutton_lastname').innerHTML="&nbsp;";
			document.getElementById('searchbutton_zip').innerHTML="<a href='javascript:submitDentalForm()' tabstop='4'><img src='images/search_button_zip_lastname.gif' border='0'></a><br>";
			document.getElementById('searchbutton_specialty').innerHTML="&nbsp;";
		}
		else {
			if (document.providerDir.lastName.value=="" && document.providerDir.specialty.value!="") {
				document.getElementById('andor1').innerHTML="OR";
				document.getElementById('andor2').innerHTML="AND";
				document.getElementById('searchBox_last').style.background="url('images/search_box_lastname.jpg')";
				document.getElementById('searchbutton_lastname').innerHTML="&nbsp;";
				document.getElementById('searchbutton_zip').innerHTML="&nbsp;";
				document.getElementById('searchbutton_specialty').innerHTML="<a href='javascript:submitDentalForm()' tabstop='4'><img src='images/search_button_type_zip.jpg' border='0'></a><br>";
			}
			else {
				if (document.providerDir.lastName.value=="" && document.providerDir.specialty.value=="") {
					document.getElementById('andor1').innerHTML="OR";
					document.getElementById('andor2').innerHTML="OR";
					document.getElementById('searchBox_last').style.background="url('images/search_box_lastname.jpg')";
					document.getElementById('searchBox_specialty').style.background="url('images/search_box_specialty.jpg')";
					document.getElementById('searchbutton_lastname').innerHTML="&nbsp;";
					document.getElementById('searchbutton_zip').innerHTML="<a href='javascript:submitDentalForm()' tabstop='4'><img src='images/search_button_zip.gif' border='0'></a><br>";
					document.getElementById('searchbutton_specialty').innerHTML="&nbsp;";
				}
			}
		}
	}
	document.getElementById('searchBox_zip').style.background="url('images/search_box_dentist_zip_active.jpg')";
	document.getElementById('CityCounty').style.display="block";
	
}

function activateTypeOfDentist() {
	if (document.providerDir.lastName.value!="" && (document.providerDir.zip.value!="" || document.providerDir.city.value!="" || document.providerDir.county.value!="")) {
		document.getElementById('andor1').innerHTML="AND";
		document.getElementById('andor2').innerHTML="AND";
		document.getElementById('searchbutton_lastname').innerHTML="&nbsp;";
		document.getElementById('searchbutton_zip').innerHTML="&nbsp;";
		document.getElementById('searchbutton_specialty').innerHTML="<a href='javascript:submitDentalForm()' tabstop='4'><img src='images/search_button_type_lastname_zip.jpg' border='0'></a><br>";
	}
	else {
		if (document.providerDir.lastName.value!="" && (document.providerDir.zip.value=="" || document.providerDir.city.value=="" || document.providerDir.county.value=="")) {
			document.getElementById('andor1').innerHTML="OR";
			document.getElementById('andor2').innerHTML="AND";
			document.getElementById('searchbutton_lastname').innerHTML="&nbsp;";
			document.getElementById('searchbutton_zip').innerHTML="&nbsp;";
			document.getElementById('searchBox_zip').style.background="url('images/search_box_zip.jpg')";
			document.getElementById('searchbutton_specialty').innerHTML="<a href='javascript:submitDentalForm()' tabstop='4'><img src='images/search_button_type_lastname.jpg' border='0'></a><br>";
			document.getElementById('CityCounty').style.display="none";
		}
		else {
			if (document.providerDir.lastName.value=="" && (document.providerDir.zip.value!="" || document.providerDir.city.value!="" || document.providerDir.county.value!="")) {
				document.getElementById('andor1').innerHTML="OR";
				document.getElementById('andor2').innerHTML="AND";
				document.getElementById('searchbutton_lastname').innerHTML="&nbsp;";
				document.getElementById('searchbutton_zip').innerHTML="&nbsp;";
				document.getElementById('searchBox_last').style.background="url('images/search_box_lastname.jpg')";
				document.getElementById('searchbutton_specialty').innerHTML="<a href='javascript:submitDentalForm()' tabstop='4'><img src='images/search_button_type_zip.jpg' border='0'></a><br>";
			}
			else {
				if (document.providerDir.lastName.value=="" && (document.providerDir.zip.value=="" || document.providerDir.city.value=="" || document.providerDir.county.value=="")) {
					document.getElementById('andor1').innerHTML="OR";
					document.getElementById('andor2').innerHTML="OR";
					document.getElementById('searchbutton_lastname').innerHTML="&nbsp;";
					document.getElementById('searchbutton_zip').innerHTML="&nbsp;";
					document.getElementById('searchBox_last').style.background="url('images/search_box_lastname.jpg')";
					document.getElementById('searchBox_zip').style.background="url('images/search_box_zip.jpg')";
					document.getElementById('searchbutton_specialty').innerHTML="<a href='javascript:submitDentalForm()' tabstop='4'><img src='images/search_button_type.jpg' border='0'></a><br>";
					document.getElementById('CityCounty').style.display="none";
				}
			}
		}
	}
	document.getElementById('searchBox_specialty').style.background="url('images/search_box_dentist_type.jpg')";
}
//***** End Functions for Dentist Tab
//************************************************************************************************
//***** Functions for Pharmacy Tab
function clearPagePharmacy() {
	document.getElementById('andor1').innerHTML="OR";
	document.getElementById('searchBox_last').style.background="url('images/search_box_pharmacy_name_active.jpg')";
	document.getElementById('searchBox_zip').style.background="url('images/search_box_zip.jpg')";
	document.getElementById('searchbutton_lastname').innerHTML="<a href='javascript:submitPharmacyForm()' tabstop='4'><img src='images/search_button_pharmacy.gif' border='0'></a><br>";
	document.getElementById('searchbutton_zip').innerHTML="&nbsp;";
	document.providerDir.pharmacy.value="";
	document.providerDir.zip.value="";
	document.providerDir.city.value="";
	document.providerDir.county.value="";
	document.providerDir.pharmacy.focus();
}

function activatePharmacy() {
	if (document.providerDir.zip.value!="" || document.providerDir.city.value!="" || document.providerDir.county.value!="") {
		document.getElementById('andor1').innerHTML="AND";
		document.getElementById('searchbutton_lastname').innerHTML="&nbsp;";
		document.getElementById('searchbutton_zip').innerHTML="<a href='javascript:submitPharmacyForm()' tabstop='4'><img src='images/search_button_zip_pharmacy.gif' border='0'></a><br>";
		
	}
	else {
		if (document.providerDir.zip.value=="" || document.providerDir.city.value=="" || document.providerDir.county.value=="") {
		    document.getElementById('andor1').innerHTML="OR";
			document.getElementById('searchBox_zip').style.background="url('images/search_box_zip.jpg')";
			document.getElementById('searchbutton_lastname').innerHTML="<a href='javascript:submitPharmacyForm()' tabstop='4'><img src='images/search_button_pharmacy.gif' border='0'></a><br>";
			document.getElementById('searchbutton_zip').innerHTML="&nbsp;";
			document.getElementById('CityCounty').style.display="none";
		}
	}
	document.getElementById('searchBox_last').style.background="url('images/search_box_pharmacy_name_active.jpg')";
}

function activateZipPharmacy() {
	if (document.providerDir.pharmacy.value!="") {
		document.getElementById('andor1').innerHTML="AND";
		document.getElementById('searchbutton_lastname').innerHTML="&nbsp;";
		document.getElementById('searchbutton_zip').innerHTML="<a href='javascript:submitPharmacyForm()' tabstop='4'><img src='images/search_button_zip_pharmacy.gif' border='0'></a><br>";
	}
	else {
		if (document.providerDir.pharmacy.value=="") {
		    document.getElementById('andor1').innerHTML="OR";
			document.getElementById('searchBox_last').style.background="url('images/search_box_lastname.jpg')";
			document.getElementById('searchbutton_lastname').innerHTML="&nbsp;";
			document.getElementById('searchbutton_zip').innerHTML="<a href='javascript:submitPharmacyForm()' tabstop='4'><img src='images/search_button_zip.gif' border='0'></a><br>";
		}
	}
	document.getElementById('searchBox_zip').style.background="url('images/search_box_dentist_zip_active.jpg')";
	document.getElementById('CityCounty').style.display="block";
	
}
//***** End Functions for Dentist Tab
//************************************************************************************************
//***** Functions for Hospital Tab
function clearPageHospital() {
	document.getElementById('andor1').innerHTML="OR";
	document.getElementById('searchBox_last').style.background="url('images/search_box_hospital_active.jpg')";
	document.getElementById('searchBox_zip').style.background="url('images/search_box_zip.jpg')";
	document.getElementById('searchbutton_lastname').innerHTML="<a href='javascript:submitHospitalForm()' tabstop='4'><img src='images/search_button_hospital.gif' border='0'></a><br>";
	document.getElementById('searchbutton_zip').innerHTML="&nbsp;";
	document.providerDir.hospital.value="";
	document.providerDir.zip.value="";
	document.providerDir.city.value="";
	document.providerDir.county.value="";
	//document.providerDir.hospital.focus();
}

function activateHospital() {
	if (document.providerDir.zip.value!="" || document.providerDir.city.value!="" || document.providerDir.county.value!="") {
		document.getElementById('andor1').innerHTML="AND";
		document.getElementById('searchbutton_lastname').innerHTML="&nbsp;";
		document.getElementById('searchbutton_zip').innerHTML="<a href='javascript:submitHospitalForm()' tabstop='4'><img src='images/search_button_zip_hospital.gif' border='0'></a><br>";
		
	}
	else {
		if (document.providerDir.zip.value=="" || document.providerDir.city.value=="" || document.providerDir.county.value=="") {
		    document.getElementById('andor1').innerHTML="OR";
			document.getElementById('searchBox_zip').style.background="url('images/search_box_zip.jpg')";
			document.getElementById('searchbutton_lastname').innerHTML="<a href='javascript:submitHospitalForm()' tabstop='4'><img src='images/search_button_hospital.gif' border='0'></a><br>";
			document.getElementById('searchbutton_zip').innerHTML="&nbsp;";
			document.getElementById('CityCounty').style.display="none";
		}
	}
	document.getElementById('searchBox_last').style.background="url('images/search_box_hospital_active.jpg')";
	
}

function activateZipHospital() {
	if (document.providerDir.hospital.value!="") {
		document.getElementById('andor1').innerHTML="AND";
		document.getElementById('searchbutton_lastname').innerHTML="&nbsp;";
		document.getElementById('searchbutton_zip').innerHTML="<a href='javascript:submitHospitalForm()' tabstop='4'><img src='images/search_button_zip_hospital.gif' border='0'></a><br>";
	}
	else {
		if (document.providerDir.hospital.value=="") {
		    document.getElementById('andor1').innerHTML="OR";
			document.getElementById('searchBox_last').style.background="url('images/search_box_lastname.jpg')";
			document.getElementById('searchbutton_lastname').innerHTML="&nbsp;";
			document.getElementById('searchbutton_zip').innerHTML="<a href='javascript:submitHospitalForm()' tabstop='4'><img src='images/search_button_zip.gif' border='0'></a><br>";
		}
	}
	document.getElementById('searchBox_zip').style.background="url('images/search_box_dentist_zip_active.jpg')";
	document.getElementById('CityCounty').style.display="block";
	
}
//***** End Functions for Hospital Tab
//************************************************************************************************
//***** Functions for Ancillary Tab
function ProcessAncillary(){
    ProcessSelection();
    ActivateAncillary();
    DisplayConjuction();
}

function ProcessCounty() {
    ProcessSelection();
    ActivateCounty();
    DisplayConjuction();
}

function ProcessSelection() {
    if ($('#county').val() != "") ActivateCounty(); else DeactivateCounty();
    if ($('#ancillary').val() != "") ActivateAncillary(); else DeactivateAncillary();
}

function ActivateCounty() {
	if ($('#searchbutton_specialty').is(':visible'))
	{
	    $("#searchbutton_zip").hide(); 
	    $("#searchbutton_zip_ancillary").show(); 
	}
	else 
	{
	    $("#searchbutton_zip").show(); 
	    $("#searchbutton_zip_ancillary").hide();
	}
	
	$('#searchBox_zip').css("background", "url('images/search_box_dentist_zip_active.jpg')");
	$("#searchbutton_specialty").hide();  
}

function DeactivateCounty() {
    $("#searchbutton_zip").hide();
    $("#searchbutton_zip_ancillary").hide();
	$('#searchBox_zip').css("background", "url('images/search_box_zip.jpg')");
}

function ActivateAncillary() {
	$("#searchbutton_specialty").show();
	$('#searchBox_specialty').css("background", "url('images/search_box_ancillary_active.jpg')");
}

function DeactivateAncillary() {
    $("#searchbutton_specialty").hide();
	$('#searchBox_specialty').css("background", "url('images/search_box_specialty.jpg')");
}

function DisplayConjuction() {
    if ($('#searchbutton_zip').is(':visible') && $('#searchbutton_specialty').is(':visible'))
        $('#andor2').html("AND");
    else
        $('#andor2').html("OR");
}


//***** End Functions for Ancillary Tab
//************************************************************************************************
//***** Functions for Radiology Tab
function checkTotal(checkbox) {
    if (getRadiologyCount() > 0) ActivateRadiology(); else DeactivateRadiology();
    if ($("#county").val() != "") ActivateRadiologyCounty(); else DeactivateRadiologyCounty();
    DisplayRadiologyConjuction();
    
    if (getRadiologyCount() > 3) {
        checkbox.checked = false;
        alert ("You cannot select more than 3 Radiology Centers.");
        return false
    } 
    return true
}

function specialty_click(checkbox)
{
    checkbox.checked = false;
}

function getRadiologyCount()
{
    return $("#uxSpecialty").find("input:checked").length;
}

function ProcessRadiologyCounty() {
    ActivateRadiologyCounty();
    DisplayRadiologyConjuction();
}

function ActivateRadiologyCounty() {
	$("#searchbutton_zip").show();
	$('#searchBox_zip').css("background", "url('images/search_box_dentist_zip_active.jpg')");
}

function DeactivateRadiologyCounty() {
    $("#searchbutton_zip").hide();
	$('#searchBox_zip').css("background", "url('images/search_box_zip.jpg')");
}

function ActivateRadiology() {
	$("#searchbutton_radiology").show();
}

function DeactivateRadiology() {
    $("#searchbutton_radiology").hide();
}

function DisplayRadiologyConjuction() {
    if ($('#searchbutton_zip').is(':visible') && getRadiologyCount() > 0)
        $('#andor2').html("AND");
    else
        $('#andor2').html("OR");
        
    if ($('#searchbutton_radiology').is(':visible'))
        $("#searchbutton_zip").hide();
}

		
//***** End Functions for Radiology Tab
//************************************************************************************************

function test() {
    document.providerDir.hospital.className='active';
    //document.getElementById('hospital').options[1].selected=true;
    //document.providerDir.hospital.options[1].select()
    //onClick="this.className='active'"
}

function test2() {
    document.providerDir.hospital.className='normal'
    //document.providerDir.hospital.blur();
    //document.getElementById('searchbutton_lastname').selected=true
}