/* 
	Title: Jamie Stephen - Global JavaScript file
	Description: Contains all JavaScript functions for use on site
	Client: Jamie Stephen
	Date: 08/08/2008
	Updated: 05/09/2008
	Version 1.0
	Author: Ben Ellis
*/

/* 
	Title: hideEmail()
	Description: Function to add custom behaviours to the main navigation
	Arguments: 
		$name: name for email
		$domain: domain for email
*/
function hideEmail(name,domain){
   document.write("<a href=\"mailto");
   document.write(":" + name + "@");
   document.write(domain + "\" title=\"Contact "+domain+"\">" + name + "@" + domain + "<\/a>");
}

// Attach the onmouseover events for IE to handle suckfish menus properly
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"), "");
		}
	}
}
if (window.attachEvent) window.attachEvent("onload", sfHover);