var is_getElementById   = (document.getElementById) ? true : false;
if (!is_getElementById)
	{
	window.location="http://www.smithbarney.com/help/internet_toolbox/";
	}
function redNav(){
	if(sa_highlight) {
		var myNav = "sa" + sa_highlight;
		document.getElementById(myNav).firstChild.style.color= "#FF3300";
	}
}
startList = function() {
		redNav();
	if ( document.all && document.getElementById )
	{
		navRoot = document.getElementById("nav");
		for ( i = 0; i < navRoot.childNodes.length; i++ )
		{
			node = navRoot.childNodes[i];
			if ( node.nodeName == "LI" )
			{
				node.onmouseover = function() {
					this.className += " over";
					formhackOn();
				}
				node.onmouseout = function() {
					this.className = this.className.replace(" over", "");
					formhackOff();
				}
			}
		}
	}
}

function formhackOn()
{
	if ( document.all && document.getElementById )
	{
		if ( document.getElementById("formhackDiv") != null )
		{
			showLayer("formhackDiv");
			hideLayer("selectionsDiv");
			passFormValues();
		}
	}
}

function formhackOff()
{
	if ( document.all && document.getElementById )
	{
		if ( document.getElementById("formhackDiv") != null )
		{
			hideLayer("formhackDiv");
			showLayer("selectionsDiv");
		}
	}
}

window.onload = startList;
function passFormValues()
{
	f = document.portfolioFormBean;
	ff = document.quoteFormFake;
	var selectListArr = new Array();
	for ( var i = 0; i < f.length; i++ )
	{
		if ( f[i].type.toLowerCase().indexOf("select") != -1 )
		{
			selectListArr[selectListArr.length] = f[i].name;
		}
	}
	var myName;
	for (var i = 0; i < selectListArr.length; ++i)
	{
		myName = selectListArr[i];
		ff[myName + "_text"].value = document.portfolioFormBean.elements[myName].options[document.portfolioFormBean.elements[myName].options.selectedIndex].text;
	}

}
