sfHover = function() {
	var sfEls = document.getElementById("header").getElementsByTagName("LI");
	for (var i=0; i<sfEls.length; i++) {
		sfEls[i].onmouseover=function() {
			this.className+=" sfhover";
		}
		sfEls[i].onmouseout=function() {
			this.className=this.className.replace(new RegExp(" sfhover\\b"), "");
		}
	}
}
//if (window.attachEvent) window.attachEvent("onload", sfHover);



function showhide ( id ) {
	
	el = document.getElementById(id)
	
	if (! el ) {
		return;
	}
	
	if( el.style.display == 'none' ) {
		el.style.display = 'block';	
	} else {
		el.style.display = 'none';	
	}
	
	return false; //don't jump on hrefs...
}

function show( id ) {
	el = document.getElementById(id)
	
	if (! el ) {
		return;
	}
	
	el.style.display = 'block';
}

function hide( id ) {
	el = document.getElementById(id)
	
	if (! el ) {
		return;
	}
	
	el.style.display = 'none';
}

/* Prevent the Evil IE flickr
	**************************************     */
try {
    document.execCommand( "BackgroundImageCache", false, true );
} 
catch( e ) { };




/* Unobtrusive Methods 
 	of adding onclicks to our pages 
	**************************************     */

function addFav() {
  if (!document.getElementsByTagName) return false;
  var links = document.getElementsByTagName("a");
  for (var i=0; i < links.length; i++) {
    if (links[i].className.match(yourClassNameHere)) {
      links[i].onclick = function() {
        window.external.AddFavorite(location.href, yourUrlHere)
        return false;
      }
    }
  }
}


// Mutiple onload events - this BB is a little gem :)
// http://www.sitepoint.com/blogs/2004/05/26/closures-and-executing-javascript-on-page-load/

function addLoadEvent(func) {
  var oldonload = window.onload;
  if (typeof window.onload != 'function') {
    window.onload = func;
  } else {
    window.onload = function() {
      if (oldonload) {
        oldonload();
      }
      func();
    }
  }
}




addLoadEvent(sfHover);


