function clearInput(el,val){
	if(el.value==val)
	{
	el.value='';
	}
}

function addLoadEvent(func) {   
	var oldonload = window.onload;   
	if (typeof window.onload != 'function') {   
		window.onload = func;   
	}	else {   
			window.onload = function() {   
				oldonload();   
				func();   
			}   
		}   
}   

//addLoadEvent(initsIFR);
addLoadEvent(initNavigation);

function initsIFR() {
	if(typeof sIFR == "function"){

	// This is the preferred "named argument" syntax
		sIFR.replaceElement(named({sSelector:"#ctrNav .nav dt a", sFlashSrc:"swf/4StarFace.swf", sColor:"#ffffff", sLinkColor:"#ffffff", sWmode:"transparent", sFlashVars:"textalign=left&offsetTop=1"}));
		sIFR.replaceElement(named({sSelector:"#questionblockA p span", sFlashSrc:"swf/4StarFace.swf", sColor:"#000000", sLinkColor:"#000000", sWmode:"transparent", sFlashVars:"textalign=left&offsetTop=0"}));
		sIFR.replaceElement(named({sSelector:"#questionblockA h3 span", sFlashSrc:"swf/4StarFace.swf", sColor:"#BA3D79", sLinkColor:"#BA3D79", sWmode:"transparent", sFlashVars:"textalign=left&offsetTop=0"}));
	};
}

function initNavigation() {
	var noderange = document.getElementById("ctrNav");
	var target = noderange.getElementsByTagName("DL");
	if (target.length == 0) {return false;}
	for(var i = 0; i < target.length; i++) {
		if (target[i].className == "nav")
		{
			var ddelement = target[i].lastChild;
			ddelement.style.position="absolute";
			ddelement.style.zIndex="999";
			ddelement.style.display="none";
			registerNavEvent(target[i], i+1);
		}
	}
}

function registerNavEvent(target, nr) {
	if (document.addEventListener) { // DOM Level 2 Event Registration
			target.addEventListener("mouseover",mouseOver,false);
			target.addEventListener("mouseout",mouseOut,false);
		} 
		else { // Microsoft Event Registration
			target.attachEvent('onmouseover',mouseOver);
			target.attachEvent('onmouseout',mouseOut);
		}
	function mouseOver() {expandNav(target, nr);}
	function mouseOut() {collapseNav(target, nr);}
}

function expandNav(target, nr) {
	var ddelement = target.lastChild;
	var ulelement = ddelement.firstChild;
	if (ulelement.firstChild != null) {
		ddelement.style.display="block";
	}
}

function collapseNav(target, nr) {
	var ddelement = target.lastChild;
	ddelement.style.display="none";
}
