// ==================================================================================================
// MENU LOADER (2008-10)
// ==================================================================================================
// this is a generalised version of ARTC's menu file. why would you use it? if you didn't have
// a dynamic, db driven way of generating a site's navigation, you could put all the navigation
// links into this js file and still mark off the current page.

// script has been updated in order to handle multiple drop down menus on the one page while
// remaining functional in ie6

// ==================================================================================================
// ON LOAD EVENT LOADER
// ==================================================================================================
// enabling multiple onload functions via addLoadEvent method 
// courtesy of Simon Willison: 
// http://simon.incutio.com/archive/2004/05/26/addLoadEvent
function addLoadEvent(func) {
  var oldonload = window.onload;
  if (typeof window.onload != 'function') {
    window.onload = func;
  } else {
    window.onload = function() {
      oldonload();
      func();
    }
  }
}

// -----------------------------------------------------------------------
// this code emulates li:hover in ie. wonderful browser that
// code courtesy of HTML dog: http://www.htmldog.com/articles/suckerfish/dropdowns/
sfHover = function() {
	var menu_divs = new Array();
	menu_divs[0] = 'artcbar';
	
	for (n=0; n<menu_divs.length; n++){
		var sfEls = document.getElementById(menu_divs[n]).getElementsByTagName("LI");
		for (var i=0; i<sfEls.length; i++) {
			sfEls[i].onmouseover=function() {
				this.className+="sfhover";
			}
			sfEls[i].onmouseout=function() {
				this.className='';
			}
		}
	}
}
if (window.attachEvent) window.attachEvent("onload", sfHover);


