if (document.getElementById("hplogo") != "") {
	addLoadListener(aboutRoll);
	addLoadListener(workRoll);
	addLoadListener(contactRoll);
	addLoadListener(etcRoll);
}





function aboutRoll()
{
  var id = document.getElementById("about");
   attachEventListener(id, "mouseover", showBlueAbout, false);
   attachEventListener(id, "mouseout", hideBlue, false);

  return true;
}


function showBlueAbout()
{
  var img = document.getElementById('hplogo');
  img.src = 'http://the441.com/tinge/wp-content/themes/custom/images/tinge_about.gif';

}

function workRoll()
{
  var id = document.getElementById("work");
   attachEventListener(id, "mouseover", showBlueWork, false);
   attachEventListener(id, "mouseout", hideBlue, false);

  return true;
}


function showBlueWork()
{
  var img = document.getElementById('hplogo');
  img.src = 'http://the441.com/tinge/wp-content/themes/custom/images/tinge_work.gif';

}

function contactRoll()
{
  var id = document.getElementById("contact");
   attachEventListener(id, "mouseover", showBlueContact, false);
   attachEventListener(id, "mouseout", hideBlue, false);

  return true;
}


function showBlueContact()
{
  var img = document.getElementById('hplogo');
  img.src = 'http://the441.com/tinge/wp-content/themes/custom/images/tinge_contact.gif';

}

function etcRoll()
{
  var id = document.getElementById("etc");
   attachEventListener(id, "mouseover", showBlueEtc, false);
   attachEventListener(id, "mouseout", hideBlue, false);

  return true;
}


function showBlueEtc()
{
  var img = document.getElementById('hplogo');
  img.src = 'http://the441.com/tinge/wp-content/themes/custom/images/tinge_etc.gif';

}
















function hideBlue()
{
  var img = document.getElementById('hplogo');
  img.src = 'http://the441.com/tinge/wp-content/themes/custom/images/tinge.gif';

}



/* utility functions -- no need to edit */

function addLoadListener(fn)
{
  if (typeof window.addEventListener != 'undefined')
  {
    window.addEventListener('load', fn, false);
  }
  else if (typeof document.addEventListener != 'undefined')
  {
    document.addEventListener('load', fn, false);
  }
  else if (typeof window.attachEvent != 'undefined')
  {
    window.attachEvent('onload', fn);
  }
  else
  {
    var oldfn = window.onload;
    if (typeof window.onload != 'function')
    {
      window.onload = fn;
    }
    else
    {
      window.onload = function()
      {
        oldfn();
        fn();
      };
    }
  }
}

function attachEventListener(target, eventType, functionRef, capture)
{
  if (typeof target.addEventListener != "undefined")
  {
    target.addEventListener(eventType, functionRef, capture);
  }
  else if (typeof target.attachEvent != "undefined")
  {
    target.attachEvent("on" + eventType, functionRef);
  }
  else
  {
    eventType = "on" + eventType;

    if (typeof target[eventType] == "function")
    {
      var oldListener = target[eventType];

      target[eventType] = function()
      {
        oldListener();

        return functionRef();
      }
    }
    else
    {
      target[eventType] = functionRef;
    }
  }

  return true;
}

function getEventTarget(event)
{
  var targetElement = null;

  if (typeof event.target != "undefined")
  {
    targetElement = event.target;
  }
  else
  {
    targetElement = event.srcElement;
  }

  while (targetElement.nodeType == 3 && targetElement.parentNode != null)
  {
    targetElement = targetElement.parentNode;
  }

  return targetElement;
}


function getElementsByAttribute(attribute, attributeValue)
{
  var elementArray = new Array();
  var matchedArray = new Array();

  if (document.all)
  {
    elementArray = document.all;
  }
  else
  {
    elementArray = document.getElementsByTagName("*");
  }

  for (var i = 0; i < elementArray.length; i++)
  {
    if (attribute == "class")
    {
      var pattern = new RegExp("(^| )" + attributeValue + "( |$)");

      if (elementArray[i].className.match(pattern))
      {
        matchedArray[matchedArray.length] = elementArray[i];
      }
    }
    else if (attribute == "for")
    {
      if (elementArray[i].getAttribute("htmlFor") || elementArray[i].getAttribute("for"))
      {
        if (elementArray[i].htmlFor == attributeValue)
        {
          matchedArray[matchedArray.length] = elementArray[i];
        }
      }
    }
    else if (elementArray[i].getAttribute(attribute) == attributeValue)
    {
      matchedArray[matchedArray.length] = elementArray[i];
    }
  }

  return matchedArray;
}
