
		function fVerify(){

			// this will get rid of leading spaces in the Keyword field
    while (document.ypsearch.heading.value.substring(0,1) == ' ') 
        document.ypsearch.heading.value = document.ypsearch.heading.value.substring(1, document.ypsearch.heading.value.length);
				
				
			// this will get rid of leading spaces in the Business Name field
				while (document.ypsearch.coname.value.substring(0,1) == ' ') 
        document.ypsearch.coname.value = document.ypsearch.coname.value.substring(1, document.ypsearch.coname.value.length);				
																		
			if(document.ypsearch.city.value != ""){
				if(document.ypsearch.state.selectedIndex == ""){
					alert("You must choose a state if you are searching by city.");
					return false;
				}
			}
			
			if(document.ypsearch.phone7){
				var phoneNumber = document.ypsearch.phone7.value;		
				var regex = /^\d{3}([\-]\d{4})?$/;
				//check for the xxx-xxxx format
				if(phoneNumber != ""){
					if(!phoneNumber.match(regex)){
						alert("Please enter your phone number in the following format: xxx-xxxx");
						document.ypsearch.phone7.focus();
						return false;
					}
				}
			}
			if(document.ypsearch.heading.value != "" && document.ypsearch.coname.value != ""){
				alert("You may search by either Keyword OR Business Name, NOT both.");
				return false;
			}
			document.getElementById('btn-idx-search').disabled = true;
		}
		
		function fnSearchHelp(){
			window.open("/yellow_pages/search_tips.htm", "SearchHelp","scrollbars=yes,width=460,height=600,status=yes,resizable=yes;"); 
		}
		
		function fnAboutSearch(){
			window.open("about_search.htm", "AboutSearch","scrollbars=yes,width=460,height=600,status=yes,resizable=yes;"); 
		}
		
		function showBizPage(listingid){
			window.open("/yellow_pages/BizWebPage.aspx?listingid="+listingid+"", "BizWebPage","scrollbars=no,width=600,height=500,status=no,resizable=no;"); 	
		}
		
		function fnSaveListing(sURL,sCoName1,sCoName2,sAddress1,sAddress2,sCity,sState,sZip,sPhone,sFax,sWeb,sEmail,sBold,iLid){
			var fixedCoName1 = escape(sCoName1);
			var fixedCoName2 = escape(sCoName2);
			window.location="/yellow_pages/savedlistings.aspx?url="+sURL+"&coName1="+fixedCoName1+"&coName2="+fixedCoName2+"&address1="+sAddress1+"&address2="+sAddress2+"&cookiecity="+sCity+"&cookiestate="+sState+"&zip="+sZip+"&phone="+sPhone+"&fax="+sFax+"&web="+sWeb+"&email="+sEmail+"&bold="+sBold+"&lid="+iLid+"";
		}
