// JavaScript Document

function jumpSortMenu(selObj,restore,url) {
  if (selObj.options[selObj.selectedIndex].value != '') {
    eval("window.location='" + url + "/sort/"
         + selObj.options[selObj.selectedIndex].value + "'");
  }
  if (restore) {
    selObj.selectedIndex = 0;
  }
}

function searchFormSubmit(theForm,isSearch) {
  var myurl = '';
  var pathElement = document.getElementById('path');
  var path = pathElement.options[pathElement.selectedIndex].value;

  if (path) {
    myurl = path;
  }
  if(isSearch)
    myurl += 'Search/';
  else
    myurl += 'OpenHouses/';

  var i = 0;
  for (i = 0; i < theForm.length; i++) { 
    if (theForm.elements[i].name && theForm.elements[i].value != ''
	&& theForm.elements[i].name != 'path') {
      myurl += theForm.elements[i].name + "/" + theForm.elements[i].value + "/";
    }
  }
  document.location = myurl;
}

function removeClassName(e, className) {
  e.className = e.className.replace(className, '');
}

function addClassName(e, className) {
  removeClassName(e, className);
  e.className = e.className + ' ' + className;
}

