var whichbutton

function OnSubmitForm(){
  var Pre="http://swishercommercial.catylist.com"
  var Post //used for property type
  var City //used for city
  var Street //used for street
  switch(whichbutton){
    case "all":
        Pre="http://swishercommercial.catylist.com/listings"
        break
    case "sale":
        Pre="http://swishercommercial.catylist.com/listings/sale"
        break
    case "lease":
        Pre="http://swishercommercial.catylist.com/listings/lease"
        break
  }
  Post=""
  City=""
  Street=""
  switch(document.forms[0].search_type.value){
    case "all":
      Post=""
      break

    case "industrial":
      Post="/industrial"
      break

    case "office":
      Post="/office"
      break

    case "shopping":
      Post="/shoppingcenter"
      break

    case "retail":
      Post="/retailcommercial"
      break

    case "multifamily":
      Post="/multifamily"
      break

    case "vacantland":
      Post="/vacantland"
      City=""
      break

    case "specialpurpose":
      Post="/specialpurpose"
      break

    case "businessopportunity":
      Post="/business"
      break

    default:
      Post=""
  }
  if(document.forms[0].city.value) City="?location=" + document.forms[0].city.value + ",mi"
  if(document.forms[0].street1.value) Street="?street=" + document.forms[0].street1.value
  document.forms[0].action=Pre + Post + City + Street
  //alert(document.forms[0].action)
  return true;
}

function OnSubmitForm2(){
  //var Pre="http://swishercommercial.catylist.com/jsp/search/results/results_agent_listings.jsp?agent_id="
  //var Pre="http://swishercommercial.catylist.com/jsp/agents/agent_listings.jsp?search=true&agent_id="
  var Pre="http://swishercommercial.catylist.com/listings/agent-"
  var agentForm = document.getElementById("agentForm")
  if(document.forms[1].Broker.value!=0){
    agentForm.action=Pre + agentForm.Broker.value
    //alert(agentForm.action)
    return true;
  }
  else{
    return false;
  }
}
