// JavaScript Document

	  function check_data()
	  	{
						//if((searchform.search_bar_zip.value=="e.g 92882" || searchform.search_bar_zip.value=="") && (searchform.location.value=="e.g Los Angeles" || searchform.location.value.length<3) && (searchform.search_bar_category.value!="e.g Pizza" && searchform.search_bar_category.value.length>=3))
			if(searchform.search_bar_category.value!="e.g Real Estate" && searchform.search_bar_category.value.length>=3)
				{
				
					 if((searchform.search_bar_zip.value=="e.g 92882" || searchform.search_bar_zip.value.length < 3))
						{
							alert("Please enter a valid Zip code or City");
							return false;
						}
					else if((searchform.search_bar_zip.value!="e.g 92882" && searchform.search_bar_zip.value!="" ))
						{
							if(searchform.search_bar_zip.value=="e.g 92882")
							{
								var s = "";
							}
						else
							{
								var s=searchform.search_bar_zip.value;
							}
						if(searchform.search_bar_category.value=="")
							{
								var s3="";
							}
						else
							{
								s3=searchform.search_bar_category.value;
								out = "&"; // replace this
								add = "%26"; // with this
								//temp = "" + entry; // temporary holder

								while (s3.indexOf(out)>-1) {
								pos= s3.indexOf(out);
								s3 = "" + (s3.substring(0, pos) + add + 
								s3.substring((pos + out.length), s3.length));
								}
									


							}
							query="action=all&string="+s+"&category="+s3;
							//document.location="http://www.gomylocal.com//listings.php:NOSSL?"+query;
							
							//var nW = window.open("","fbWin");
							
							//nW.location.href="http://www.gomylocal.com//listings.php:NOSSL?"+query;
							//nW=null;

							//document.location="http://www.gomylocal.com/listings.php?"+ query;
							//return false;
							var newWindow = window.open('http://www.gomylocal.com/listings.php?'+query, '_blank');
							newWindow.focus();
							return false;
						}
					
					else if(searchform.search_bar_zip.value!="e.g 92882" && searchform.search_bar_zip.value!="")
						{
							if(searchform.search_bar_zip.value=="e.g 92882")
							{
								var s = "";
							}
						else
							{
								var s=searchform.search_bar_zip.value;
							}
							
						if(searchform.search_bar_category.value=="")
							{
								var s3="";
							}
						else
							{
								s3=searchform.search_bar_category.value;
							}
								out = "&"; // replace this
								add = "%26"; // with this
								//temp = "" + entry; // temporary holder

								while (s3.indexOf(out)>-1) {
								pos= s3.indexOf(out);
								s3 = "" + (s3.substring(0, pos) + add + 
								s3.substring((pos + out.length), s3.length));
								
								}
							query="action=all&string="+s1+"&string="+s+"&category="+s3;
							//document.location="http://www.gomylocal.com//listings.php:NOSSL?"+query;
							//alert(query);
							
							
							//document.location="http://www.gomylocal.com/listings.php?"+ query;
							//return false;
							var newWindow = window.open('http://www.gomylocal.com/listings.php?'+query, '_blank');
							newWindow.focus();
							return false;
							
						}
					
				}
			if((searchform.search_bar_zip.value!="e.g 92882" && searchform.search_bar_zip.value.length>=3) && (searchform.search_bar_category.value=="e.g Real Estate" || searchform.search_bar_category.value.length<3))
				{
						if(searchform.search_bar_zip.value=="e.g 92882")
							{
								var s = "";
							}
						else
							{
								var s=searchform.search_bar_zip.value;
							}
						query="action=search&string="+s;
						//document.location="http://www.gomylocal.com/city_page.php:NOSSL?"+query;
						//alert(query);
							
						

							
							//document.location="http://www.gomylocal.com/city_page.php?"+ query;
							//return false;
							var newWindow = window.open('http://www.gomylocal.com/listings.php?'+query, '_blank');
							newWindow.focus();
							return false;
				}
			
			
				if(searchform.search_bar_zip.value=="e.g 92882" || searchform.search_bar_zip.value.length<3)
					{
							alert("Please enter  zip or location");
							return false;
					}
				else if((searchform.search_bar_zip.value=="e.g 92882" || searchform.search_bar_zip.value.length < 3) && (searchform.search_bar_category.value=="e.g Real Estate" || searchform.search_bar_category.value.length<3))
					{
						alert("Please enter a valid zip code");
						return false;
					}
					
		}

