// Initialize sIFR
if (typeof sIFR == "function"){
  sIFR.replaceElement("h1.sifr", named({sFlashSrc: "/images/fonts/lucida.swf", sColor: "#ffffff", sWmode: "transparent"}));
  sIFR.replaceElement("p.subtitle", named({sFlashSrc: "/images/fonts/lucida.swf", sColor: "#93C44C", sWmode: "transparent"}))
   sIFR.replaceElement("p.intro", named({sFlashSrc: "/images/fonts/lucida.swf", sColor: "#CCCCCC", sWmode: "transparent"}))
}

function initHomeSlideshow() {
  if(!document.getElementById || !document.getElementById('home-slideshow')) {
    return;
  }
  var FO = { movie: "http://www.robothams.co.uk/resources/slideshow/home-slideshow.swf", width:"698", height:"448", majorversion:"7", build:"0", wmode:"transparent" };
  UFO.create(FO, "home-slideshow");	
}

function initProjectsSlideshow() {
  if(!document.getElementById || !document.getElementById('projects-slideshow')) {
    return;
  }
  var FO = { movie: "/resources/slideshow/projects-slideshow.swf", width:"700", height:"430", majorversion:"7", build:"0", wmode:"transparent" };
  UFO.create(FO, "projects-slideshow");	
}


sfHover = function () {
	var sfEls = document.getElementById("nav").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"), "");
		}
	}
}

// Cross-browser event handling for IE5+, NS6 and Mozilla 
// By John Resig 
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] );
	}
}

// ADD EVENT HANDLERS
addEvent(window, 'load', initHomeSlideshow);
addEvent(window, 'load', initProjectsSlideshow);
if (window.attachEvent) window.attachEvent("onload", sfHover);



