/*
	Drop down script
*/

var focusElem = null;
function dropdown( obj )
{
	if( focusElem != null )
	{
		focusElem.className = focusElem.className.replace(" over", "");
	}
	focusElem = obj.parentElement;
	focusElem.className += ' over';
}


function swDropMenu(pMenu) {
	if (document.getElementById) {
		navRoot = document.getElementById(pMenu);
		for (i=0; i<navRoot.childNodes.length; i++) {
			node = navRoot.childNodes[i];
			if (node.className == "swDrop") 
				node.firstChild.onfocus = function() {dropdown(this)}; 
			{
				node.onmouseover = function() 
				{
					this.className += " over";
					//this.firstChild.className += " expanded";
				}
				node.onmouseout = function()
				{
					this.className = this.className.replace(" over", "");
					if (this.firstChild.className == "selected expanded") this.firstChild.className = "selected";
					if (this.firstChild.className == " expanded" || this.firstChild.className == "expanded") this.firstChild.className = "";
				}
			}
		}
	}
} 
//window.addEvent('domready', function() {
   // swDropMenu('menu');
//});



