<!--
// javascript.js - spolem.net - copyright Jake Laack - ekaj@spolem.net
//
// General purpose JavaScript


function getObject(obj)
//Returns reference to object matching given id
{
  if(document.getElementById) {
    obj = document.getElementById(obj);
  } else if (document.all) {
    obj = document.all.item(obj);
  } else {
    obj = null;
  }

  return obj;
}


function showthis(thing)
//Changes style of object with given id to be visible
{
  var x = getObject(thing);
  x.style.visibility = "visible";
	x.style.display = "block";
}

function hidethis(thing)
//Changes style of object with given id to be hidden
{
  var x = getObject(thing);
  x.style.visibility = "hidden";
	x.style.display = "none";
}


function setCookie(name, value, expire)
//Creates a cookie via JavaScript
{
  document.cookie = name + "=" + escape(value)
    + ((expire == null) ? "" : ("; expires=" + expire.toGMTString()));
}


function areYouSure(promptString)
//Used to ensure the user's choices
{
  message = "Are you sure you want to " + promptString + "?";
  return confirm(message);
}

function errorMessage(errorMsg)
{
  alert("Stone Park Homeowners' Association Website Error:\n\n" + errorMsg);
}

function showLegend()
{
  showthis("Legends");
	hidethis("LegendsLink");
}

-->
