////////////////////////////////////////////////////////////// function selectAll(id) { document.getElementById(id).focus(); document.getElementById(id).select(); } ////////////////////////////////////////////////////////////// function onClickSearchZipShell() { var zip = document.getElementById('zip_shell').value; if (zip == '' || zip == 'Enter City, State, or Zip Code') { alert('Please enter a city, state or a zip code'); document.getElementById('zip_shell').focus(); return; } if (zip.length == 5) { document.location.href = "franchisee_locations.aspx?zip=" + escape(zip); } else if (zip.indexOf(',')!=-1) { arr = zip.split(","); city = arr[0]; state = arr[1]; state = state.trim(); state = state.toUpperCase(); if (state.length > 2) { alert('Please enter a 2 letter abbreviation for state'); } else { document.location.href = "franchisee_locations.aspx?city=" + escape(city) + "&loc=" + escape(state); } } else if (zip.indexOf(' ') != -1) { arr = zip.split(" "); city = arr[0]; state = arr[1]; state = state.trim(); state = state.toUpperCase(); if (state.length > 2) { alert('Please enter a 2 letter abbreviation for state'); } else { document.location.href = "franchisee_locations.aspx?city=" + escape(city) + "&loc=" + escape(state); } } } ////////////////////////////////////////////////////////////// String.prototype.trim = function () { return this.replace(/^\s*/, "").replace(/\s*$/, ""); } ////////////////////////////////////////////////////////////// function onKeyDownZipShell(e) { var key; if (window.event) { key = window.event.keyCode; //IE } else { key = e.which; //firefox } if (key == 13) { onClickSearchZipShell(); return false; } return true; }