﻿function redirect (form) {
    var TestVar = form.search.value;
	var newloc = "/search.aspx?query=" + TestVar;
	document.location.href = newloc;
}

 function searchname (form) {
        var PersonName = form.firstname.value + " " + form.lastname.value;
	    var newloc = "http://paasd.com/directory.aspx?NameFilter=" + PersonName;
	    document.location.href = newloc;
    }
   
    function searchother (form) {
        var CityName = form.City.value;
        var CountyFilter = document.getElementById('county').options[document.getElementById('county').selectedIndex].value
        var StateFilter = document.getElementById('state').options[document.getElementById('state').selectedIndex].value
        var AppraiserType = document.getElementById('appraiserType').options[document.getElementById('appraiserType').selectedIndex].value
        var Designation = document.getElementById('designation').options[document.getElementById('designation').selectedIndex].value
       	var newloc = "http://paasd.com/directory.aspx?CityFilter=" + CityName + "&CountyFilter=" + CountyFilter + "&StateFilter=" + StateFilter + "&TypeFilter=" + AppraiserType + "&DesignationFilter=" + Designation;
        document.location.href = newloc;

    }

function GoogleSearch (form,thiswidth,GoogleCSEID) 
{
    var TestVar = form.searchtext.value;
	var newloc = "/googlesearch.aspx?cx=" + GoogleCSEID + "&cof=FORID%3A11&ie=UTF-8&Width=" + thiswidth + " &q=" + TestVar;
	document.location.href = newloc;
}

function vote (form) {
    var TestVar = 0;
    var PollID = form.PollID.value;
    
    for (i=0; i<form.r1.length; i++)
    {
      if (form.r1[i].checked == true)
      TestVar = form.r1[i].value;
    }
    
	var newloc = "/scripts/vote.aspx?poll=" + PollID + "&vote=" + TestVar + "&location=" + location.href;
	document.location.href = newloc;
}

function MM_jumpMenu(targ,selObj,restore){ //v3.0
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}

function RedirectUser (NewLocation) {
    	document.location.href = NewLocation;
}

function ChangeEditMode (Location) {
    var NewLocation = Location.replace("?SwapEditMode=1","").replace("&SwapEditMode=1","");
    if(NewLocation.indexOf("?") >=0)
    {
    	window.location = NewLocation + "&SwapEditMode=1";       
    }
    else
    {
    	window.location = NewLocation + "?SwapEditMode=1";
	}
}

function showhide(divid)
{
var ActiveDiv = document.getElementById(divid);
var CurrentDisplay = ActiveDiv.style.display;

if(CurrentDisplay == "none")
{
    Effect.SlideDown(ActiveDiv);
}
else
{
    Effect.SlideUp(ActiveDiv);
}

}