//////////////////- Real Estate Quick Search -////////////////////////////////// &ol=1
var surl='http://nh.agentave.com/index.php?cid=1076&action=results&searchaction=ownersearch&newsearch=1';
var thetowns="&thetowns[]=";
var minprice="&MinPrice=";
var maxprice="&MaxPrice=";
var surl2="&submit=Search+Listings";
var pclass="&PClass%5B%5D=";
var wf="&wf=wf";
var waterbody="&water_body=";


    function search_onclick() 
    {
        var townmenu = document.getElementById("towns");
        var minpricemenu = document.getElementById("minprice");
        var maxpricemenu = document.getElementById("maxprice");
        var realestatetype = document.getElementById("realestatetype");
        var wbody = document.getElementById("wbody");
        var commun = document.getElementById("commun");
        var townsfixed="";
        var wbodyfixed="";
        if(!(townmenu.options[townmenu.selectedIndex].value == ""))
        {
           townsfixed = thetowns + townmenu.options[townmenu.selectedIndex].value;
        }
        if(!(wbody.options[wbody.selectedIndex].value == ""))
        {
           wbodyfixed = waterbody + wbody.options[wbody.selectedIndex].value;
        }
        if (!(document.getElementById("wfcheck").checked)){wf=""}else{wf="&wf=wf"}
       
       var turl = surl+ pclass + realestatetype.options[realestatetype.selectedIndex].value + wf + townsfixed + wbodyfixed + 
					minprice + minpricemenu.options[minpricemenu.selectedIndex].value +
					maxprice + maxpricemenu.options[maxpricemenu.selectedIndex].value + commun.options[commun.selectedIndex].value  + surl2
					
		
        window.open("searchResults.php" + "?url=" + turl)
    }
	
	 function disp_qs()
    {
        var qsurl = window.location.search;

	    //var resultspage = "http://nh.agentave.com/index.php" + qstr;
	    //frm.location = resultspage;
		
		//var qsurl = document.URL;
        var qsurl1 = qsurl.substring(qsurl.search(/url=/)+4);
        ifrmn.location=qsurl1;
		return;
    }
	
	var murl="http://nh.agentave.com/v12/index.php?action=results&cid=1076&newsearch=1&mlsno=";

    function search1_onclick()
    {
        var mlss = document.getElementById("mlss").value;
        if(!(isNaN(mlss)))
        {
            var msurl = murl + mlss;
            window.open("searchResults.php" + "?url=" + msurl);
        }
        else{alert("Please enter the six digit MLS #")}
    }
	
	function blank_txt()
    {
        if((document.getElementById("mlss").value=="Enter MLS #")){
        document.getElementById("mlss").value="";}
    }
