/*
	Drop down script
*/

var isDom = document.getElementById;

var focusElem = null;
function dropdown( obj )
{
	if( focusElem != null )
	{
		focusElem.className = focusElem.className.replace(" over", "");
	}
	focusElem = obj.parentElement;
	focusElem.className += ' over';
}

swDropMenu = function() {
	if (document.getElementById) {
		navRoot = document.getElementById("swDropMenu");
		for (i=0; i<navRoot.childNodes.length; i++) {
			node = navRoot.childNodes[i];
			if (node.className == "swDrop") 
				node.firstChild.onfocus = function() {dropdown(this)}; // JWJ
			{
				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.onload = swDropMenu;

/*
	PopUp window
*/
function popup(url,name,win_height,win_width) {
	pos_horizon = ((screen.width/2)-(win_width/2));
	pos_vertical = ((screen.height/2)-(win_height/2));
	window.open(url,name,"width="+win_width+",height="+win_height+",top="+pos_vertical+",left="+pos_horizon);
	}


/*
	Combobox selector

	mode 1 = Open in new window
*/
function LinkSelect(form, sel, mode) 
{
	c = sel.selectedIndex;
    adrs = sel.options[c].value;
    if (adrs != "-" && mode == 1)
    {
		window.open(adrs, 'New')
	 }
		else {
			parent.location.href = adrs;
		}
}
	
/* 

	Show/Hide function

*/
function fncToggleShow(pDiv) {
	if (isDom) { document.getElementById(pDiv).style.visibility=(document.getElementById(pDiv).style.visibility=='hidden')? 'visible':'hidden'; }
}

