/*
http://simonwillison.net/2004/May/26/addLoadEvent/
*/
/*
function addLoadEvent(func)
{
  var oldonload = window.onload;
  if (typeof window.onload != 'function')
  {
    window.onload = func;
  }
  else
  {
    window.onload = function()
    {
      if (oldonload)
      {
        oldonload();
      }
      func();
    }
  }
}

addLoadEvent(explore_setup);

function explore_setup()
{
  var elObj;
  var elObjReg;

  if (!document.getElementById)
  {
    return;
  }
  if (elObj = document.getElementById("footer"))
  {
    if (elObjReg = document.getElementById("explorestate"))
    {
      elObjReg.onchange = exploreState;
    }
    if (elObjReg = document.getElementById("exploretown"))
    {
      elObjReg.onchange = exploreTown;
    }
  }
  else
  {
    setTimeout("explore_setup()",10);
  }
}
*/
function exploreState()
{
  var w = document.explorestate.explorestate.selectedIndex;
  var url_base = window.location.pathname;
  var url_add = document.explorestate.explorestate.options[w].value;
  window.location.href = url_base+'?explorestate='+url_add+'#explore';
}
function exploreTown()
{
  var w = document.exploretown.exploretown.selectedIndex;
  var url_add = document.exploretown.exploretown.options[w].value;
  top.location.href = url_add;
}

/*
function exploreState()
{
  var elObj;

  if (!document.getElementById)
  {
    return;
  }
  if (elObj = document.getElementById("explorestate"))
  {
    var w = elObj.selectedIndex;
    var url_base = window.location.pathname;
    var url_add = elObj.options[w].value;
    window.location.href = url_base+'?explorestate='+url_add+'#explore';
  }
}
function exploreTown()
{
  var elObj;

  if (!document.getElementById)
  {
    return;
  }
  if (elObj = document.getElementById("exploretown"))
  {
    var w = elObj.selectedIndex;
    var url_add = elObj.options[w].value;
    top.location.href = url_add;
  }
}
*/
