/*
 *  This function allows the drop-down menu to function in IE
 *
 */
var FixNavigation = function(){
  if(document.all && document.getElementById){
    var navRoot = document.getElementById('navigation_ul');

    for(i = 0; i < navRoot.childNodes.length; i++){
      var node = navRoot.childNodes[i];

      if(node.nodeName == 'LI'){

        node.onmouseover = function(){
          this.className += ' over';
        }

        node.onmouseout = function(){
          this.className = this.className.replace(' over', '');
        }
      }
    }
  }
}

var SaveSearchCookie = function(theForm){
  document.cookie = "searchLocation=" + encodeURIComponent(theForm.q.value);
  return(true);
}

var LoadSearchCookie = function(){
  var searchLocation = '';
  var cStart, cEnd, cName;

  cName = "searchLocation";

  if(document.cookie.length>0){
    cStart=document.cookie.indexOf(cName + "=");
    if (cStart!=-1){ 
      cStart=cStart + cName.length+1; 
      cEnd=document.cookie.indexOf(";",cStart);
      if (cEnd==-1) cEnd=document.cookie.length;
      searchLocation = decodeURIComponent(document.cookie.substring(cStart,cEnd));
    } 
  }

  if(searchLocation.length > 0){
    document.forms.findHomeForm.q.value = searchLocation;
    document.forms.findAgentForm.q.value = searchLocation;
  }
}