 <!--
    function SubmitAgencySearch(){
        address = escape(document.getElementById("address").value);
		address = address.replace(/^\s+|\s+$/g,'');
		radius = 20;
		baseURL = "http://" + window.location.host;
		if(address.length < 5){			
			alert('Please enter a valid zip code.')
			document.getElementById("address").select();
			document.getElementById("address").focus();
		}else{
		    window.location = baseURL+"/travelleaders/FindAnAgency/index.htm?useSecondary=true&myExternalURL=" + baseURL+"/StoreLocator/AgencyResults.aspx?address=" + address + "{param}radius=" + radius + "{param}loadResult=yes"
		    //link(baseURL+"/StoreLocator/AgencyResults.aspx?address=" + address + "{param}radius=" + radius + "{param}loadResult=yes", '5097')		    
		}
	}
	
    //function SubmitAgencySearch(){
	//	var postalCode = document.getElementById("address").value;
	//	//var postalCode = document.Locator.postalCode.value;
	//	if(postalCode.length < 5){			
	//		alert('Please enter a valid zip code.')
	//		document.Locator.postalCode.select();
	//		document.Locator.postalCode.focus();
	//	}else{
	//		link('http://10best.travelleaders.com/TravelLeaders/index.html?___p=1&distanceThreshold=20&postalCode=' + postalCode)
	//	}
	//}

	
   function DetailedAgencySearch() { 
	baseURL = "http://" + window.location.host;
    window.location = baseURL+"/travelleaders/FindAnAgency/index.htm"
    
	//link("http://10best.travelleaders.com/TravelLeaders/");
   }
   
   // USED ON DETAILED SEARCH
       function getResults() { // function to clean up querystring for address and radius and conver post to get for querystring
        address = escape(document.getElementById("FullAddress").value);
        address = address.replace(/^\s+|\s+$/g,'');
        radius = document.getElementById("radius").value;
		baseURL = "http://" + window.location.host;
       	link(baseURL+"/StoreLocator/AgencyResults.aspx?address=" + address + "&radius=" + radius + "&loadResult=yes")
      }

function concatAndDisplay() { // concatenates all address input fields and combines them into a single string for querystring
         var address1 = document.getElementById("address1").value;
         var city = document.getElementById("city").value;
         var state = document.getElementById("state").value;
         var zip = document.getElementById("zip").value;
         var address = address1 + ' ' + city + ' ' + state + ' ' + zip;
         document.getElementById("FullAddress").value = address;
      }
      
      function checkFormDetailed() {  // detailed search error validation
        if ((document.getElementById("city").value == "") && (document.getElementById("zip").value == ""))  {
	     
		hideAllErrorsDetailed();
	    document.getElementById("cityError").style.display = "inline";	    
		document.getElementById("city").select();
		document.getElementById("city").focus();
		
		return false;

	    }
	  }
	  
      function hideAllErrorsDetailed() { // hides error display
	    document.getElementById("cityError").style.display = "none";
	  }
	  
	  function checkEnter(e){ //e is event object passed from function invocation
        var characterCode //literal character code will be stored in this variable
        if(e && e.which){ //if which property of event object is supported (NN4)
        e = e
            characterCode = e.which //character code is contained in NN4's which property
        } else {
            e = event
            characterCode = e.keyCode //character code is contained in IE's keyCode property
        }
        if(characterCode == 13){ //if generated character code is equal to ascii 13 (if enter key)
            document.forms.detailedSearch.submit() //submit the form
            return false
        }
        else{
            return true
        }
    }

	// fix  Permission denied domain issues
	function setDomain() { 
		var e = document.domain.split(/\./);
		if(e.length > 1) {
			var mydomain=  e[e.length-2] + "." +  e[e.length-1];
			document.domain = mydomain;
		}
	}
	setDomain()