/*
lifted from Prototype see documentation http://www.prototypejs.org/api/utility
and slightly changed to work stand alone - Ben

*/
function $(element) {
  if (arguments.length > 1) {
    for (var i = 0, elements = [], length = arguments.length; i < length; i++)
      elements.push($(arguments[i]));
    return elements;
  }
  if (typeof element == 'string')
    element = document.getElementById(element);
  return element;
}



function attachEventHandlers()
{
    //helper fuction to add all the events
    addEvent( $('idahologo'), 'mouseover', imageOn);
    addEvent( $('idahologo'), 'mouseout',  imageOff);
}

function addEvent( obj, type, fn )
{
	if (obj.addEventListener)
		obj.addEventListener( type, fn, false );
	else if (obj.attachEvent)
	{
		obj["e"+type+fn] = fn;
		obj[type+fn] = function() { obj["e"+type+fn]( window.event ); }
		obj.attachEvent( "on"+type, obj[type+fn] );
	}
}

function removeEvent( obj, type, fn )
{
	if (obj.removeEventListener)
		obj.removeEventListener( type, fn, false );
	else if (obj.detachEvent)
	{
		obj.detachEvent( "on"+type, obj[type+fn] );
		obj[type+fn] = null;
		obj["e"+type+fn] = null;
	}
}

//functions to control rollovers
function imageOn() {
    this.src = this.src.replace('.gif', '_on.gif' );
}

function imageOff() {
    this.src = this.src.replace('_on.gif', '.gif' );
}

addEvent(window, 'load', attachEventHandlers);






