String.prototype.trim = function() {return this.replace(/^\s+|\s+$/g,"");}
String.prototype.ltrim = function() {return this.replace(/^\s+/,"");}
String.prototype.rtrim = function() {return this.replace(/\s+$/,"");}
function runSearch() {url = document.searchform.churchName.value;d = document.searchform.churchDenomination;if (d.options[d.selectedIndex].value != 'All') {url = url + ' ' + d.options[d.selectedIndex].value;} url = url + ' ' + document.searchform.churchLocation.value;location.href = '/churches/search?q=' + url.trim();}
function CreateBookmarkLink(title) {url = window.location;if (window.sidebar) {window.sidebar.addPanel(title, url,"");} else if(window.external){window.external.AddFavorite( url, title);}else if(window.opera && window.print){return true;}}
function linkToUrl(url) {if(url.indexOf('http') == -1) {url = 'http://' + url;} day = new Date(); id = day.getTime(); eval("page" + id + " = window.open(url, '" + id + "', 'toolbar=1,scrollbars=1,location=1,statusbar=1,menubar=1,resizable=1,width=800,height=600,left = 240,top = 100');");}