function addEvent(obj, evType, fn)
{
	if (obj.addEventListener){
		obj.addEventListener(evType, fn, false);
		return true;
	} else if (obj.attachEvent){
		var r = obj.attachEvent("on"+evType, fn);
		return r;
	} else {
		return false;
	} 
}


function sfHover() {
	var sfEls = document.getElementById("nav").getElementsByTagName("li");
	for (var i=0; i<sfEls.length; i++) {
		sfEls[i].onmouseover=function() {
			this.className = "hover";
		}
		sfEls[i].onmouseout=function() {
			this.className = "";
		}
	}
}

/*
function sfHover()
{
	var Hover = new Function("$(this).addClass(\"hover\");");
	var Unhover = new Function("$(this).removeClass(\"hover\");");
	$("#nav li").mouseover(Hover).mouseout(Unhover);
}
*/

function OnReady()
{							
	$("a.accordion").click(function()
		{
			var title = $(this).attr("title");
			var s = title.split("->");
			var group = s[0]; // class
			var id = s[1];
			
			var target = $("#"+id);
			var isClosed = target.is(":hidden");
			
			$("."+group).slideUp();
			
			if( isClosed )
			{
				target.slideDown();
			}								
		}
	);
}

$(document).ready(OnReady);
$(document).ready(sfHover);

//addEvent(window, 'load', sfHover);



