   function openSpecialty() {
       var myWin=window.open("specialty.jsp", "specialty", "width=330,height=400,scrollbars=yes,resizable=yes")
   }

   function isPartialZip(zip) {
      if ((zip.length >= 3) && (zip.length <= 5)) {
		   return true;}
		else {
         alert("Not a valid zip code.")
         return false
      }
   }

   function isZip(zip) {
      if (zip.length > 4) {
		   return true;}
		else {
         alert("Not a valid zip code.")
         return false
      }
   }

   function validate(theForm)  {
/*  if (theForm.p_specialty.options[0].selected)  {  
		   	alert("Please select a specialty.")
        	theForm.p_specialty.focus()
		   	return false
	  }
*/	  
	  
      if ((theForm.p_city.value == "" ) &&
         (theForm.p_zip.value == "" ) && 
         (theForm.p_zip_d.value == "") &&
		 (theForm.p_name.value == "") &&
		   (theForm.p_county.value == "")) {
		   if (theForm.p_name_state.options[0].selected ==false) {
		   		alert("Please enter a provider name.")
				theForm.p_name.focus()
				return false
			} else {	
            	alert("Select one of five search options.")
            	return false
			}
      }
	  
      if (theForm.p_city.value !="" ) {
         if ((theForm.p_zip.value !="")  || 
			  (theForm.p_zip_d.value !="") || 
			  (theForm.p_name.value !="") ||
			  (theForm.p_county.value !="")) {
               alert("Select only ONE of five search options.")
               return false
          }
          if (theForm.p_politicalregion.options[0].selected)  {
                      alert("Please select a state.")
                      theForm.p_politicalregion.focus()
                      return false
          }
       }
	   
       if (theForm.p_zip_d.value != "") { 
          if ((theForm.p_city.value != "") || 
             (theForm.p_zip.value != "") ||
			 (theForm.p_name.value !="") ||
             (theForm.p_county.value != "")) {
                alert("Please select ONE of the five search options.")
                return false
          }
          if ((theForm.p_distance[0].checked == false) && 
             (theForm.p_distance[1].checked == false) && 
             (theForm.p_distance[2].checked == false) && 
             (theForm.p_distance[3].checked == false) && 
             (theForm.p_distance[4].checked == false) && 			 
             (theForm.p_distance[5].checked == false)) {
                alert("Please select a search distance.")
                theForm.p_distance[0].focus()
                return false
          }
          var zip = theForm.p_zip_d.value
          return isZip(zip)
       }
	   
       if (theForm.p_zip.value !="") {
          if ((theForm.p_city.value != "") || 
             (theForm.p_zip_d.value != "") ||
			 (theForm.p_name.value !="") ||
             (theForm.p_county.value != "")) {
                alert("Please select ONE of the five search options.")
                return false
          }
          var zip = theForm.p_zip.value
          return isPartialZip(zip) 
       }
	   
       if (theForm.p_county.value != "") { 
          if ((theForm.p_city.value != "") || 
             (theForm.p_zip.value != "") ||
			 (theForm.p_name.value !="") ||
             (theForm.p_zip_d.value != "")) {
                alert("Please select ONE of the five search options.")
                return false
          }
          if (theForm.p_county_state.options[0].selected)  {
                      alert("Please select a state.")
                      theForm.p_county_state.focus()
                      return false
          }
       }
	   
       if (theForm.p_name.value != "") { 
          if ((theForm.p_city.value != "") || 
             (theForm.p_zip.value != "") ||
			 (theForm.p_county.value !="") ||
             (theForm.p_zip_d.value != "")) {
                alert("Please select ONE of the five search options.")
                return false
          }
          if (theForm.p_name_state.options[0].selected)  {
                      alert("Please select a state.")
                      theForm.p_name_state.focus()
                      return false
          }
		  
       }
	   
       return true
   }
   
   document.cookie = "page=" + escape(0);
	var allcookies = document.cookie;
	var pos = allcookies.indexOf("version=")	;
		if (pos!= -1) {
			var start = pos + 8;
			var end = allcookies.indexOf(";", start);
				if (end == -1) 
				{
					end = allcookies.length;
				}
			var value = allcookies.substring(start, end);
			value = unescape(value);
		}

function clearForm() {
	if (value == 1) {
		document.searchForm.reset()	
		document.cookie = "version=" + escape(0)
	}
}