///////
// sfHover() IE Drop Down Menu fix
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"), "");
		}
	}
}

//////
// expand arrows
var arrow_down = new Image();
arrow_down.src = "images/right.gif";
var arrow_up = new Image();
arrow_up.src = "images/down.gif";

// expand functions
function showExpand(title,objToShow,expandGroup) {
	var nScrollHeight = document.getElementById(objToShow).scrollHeight;
	var nActualHeight = document.getElementById(objToShow).offsetHeight;
	var arrow = "arrow_" + title.split("_")[1];
	if (nActualHeight < nScrollHeight) {
		sizeObjV(objToShow,nScrollHeight,"null");
		document.getElementById(title).className = "expand-selected";
		document.getElementById(arrow).src = arrow_up.src;
	}
	else {
		sizeObjV(objToShow,1,"null");
		document.getElementById(title).className = "expand-normal";
		document.getElementById(arrow).src = arrow_down.src;
	}
}

function hoverExpand(title,hover) {
	if (document.getElementById(title).className != "expand-selected"){
		var arrow = "arrow_" + title.split("_")[1];
		if (hover) { 
			document.getElementById(title).className = "expand-hover";
			//document.getElementById(arrow).src = arrow_hover.src;
		}
		else { 
			document.getElementById(title).className = "expand-normal";
			//document.getElementById(arrow).src = arrow_down.src;
		}
	}
}
function sizeObjV(objToShow,showSize,completeFunction) {
	//completeFunction should take format: null OR {complete:function() {setStatus('done fading element.',1500);}} 
	new Rico.Effect.Size(document.getElementById(objToShow),null,showSize,20,10,completeFunction);	
}

function sizeObjH(objToShow,showSize,completeFunction) {
	//completeFunction should take format: null OR {complete:function() {setStatus('done fading element.',1500);}} 
	new Rico.Effect.Size(document.getElementById(objToShow),showSize,null,20,10,completeFunction);	
}

function fadeObjV(objToFade,opacity,completeFunction) {
	new Rico.Effect.FadeTo(document.getElementById(objToFade),opacity,500,10,completeFunction);
}


