function sfHoverLeft() 
{
	if (!window.attachEvent) {return false;};

	var getSubNav = document.getElementsByClassName('sub_sub_nav');

	if (!getSubNav)
	{
		return;
	}

	for (q = 0; q < getSubNav.length; q++)
	{
		var getSubNavLi = getSubNav[q].getElementsByTagName('li');
		if (getSubNavLi)
		{
			for (w = 0; w < getSubNavLi.length; w++)
			{
				getSubNavLi[w].onmouseover = function() {
					this.className += " sfhover";
				}
				getSubNavLi[w].onmouseout = function() {
					this.className = this.className.replace(new RegExp(" sfhover\\b"), "");
				}
			}
		}
	}
}

function menus() 
{
	//Left Nav Functions//

	function getNextSibling(startBrother)
	{
		endBrother = startBrother.nextSibling;
		if (endBrother)
		{
			while(endBrother && endBrother.nodeType != 1)
			{
				endBrother = endBrother.nextSibling;
			}
		}
		return endBrother;
	}


	var openClose = document.getElementsByClassName('open_close');


	if (openClose)
	{

		for (i = 0; i < openClose.length; i++)
		{
			myOpenClose = openClose[i];

			myOpenClose.onmouseover = function() {

				if (this.style.backgroundPosition == '0% 100%')
				{
					this.style.backgroundPosition = '0% 0%'
						return false;
				}
			}

			myOpenClose.onmouseout = function() 
			{
				if (this.style.backgroundPosition == '0% 0%')
				{
					this.style.backgroundPosition = '0% 100%';
					return false;
				}
			} 

                        myOpenClose.parentNode.onclick = function() {
                           var es = this.getElementsBySelector('.open_close');
                           for (j = 0; j < es.length; j++) 
                           {
                               es[j].toggleIt();
                           }
                        }
			myOpenClose.toggleIt = function() 
			{
				var myNextSibling = getNextSibling(this);
	                        /*if (myNextSibling) { Element.toggle(myNextSibling);}*/
							if (myNextSibling) {
if (navigator.userAgent.indexOf("MSIE 6.") != -1) { 
Element.toggle(myNextSibling);
}
else
{
Effect.toggle(myNextSibling, 'blind');
}

}
				if (this.style.backgroundImage == 'url(/images/pulldown_arrow_close.gif)')
				{
					this.style.backgroundImage = 'url(/images/pulldown_arrow_open.gif)';
					return false;
				}

				if (this.style.backgroundImage == 'url(/images/pulldown_arrow_open.gif)')
				{
					this.style.backgroundImage = 'url(/images/pulldown_arrow_close.gif)';
					return false;
				}
			}

			var myLinks = myOpenClose.ancestors()[0].getElementsBySelector('ul.sub_main li a');
			for (j = 0; j < myLinks.length; j++)
			{
				myLink = myLinks[j];
				if (document.location.href.indexOf(myLink.href) == 0) { myOpenClose.toggleIt(); }
			}
                     
		}
	}

	var openAll = $('open_all');

	if (openAll)
	{
		openAll.onclick = function() 
		{
			if (this.innerHTML == 'Collapse View')
			{
				this.innerHTML = 'Expand View';
				this.style.backgroundImage = 'url(/images/nav/hide_show.gif)';
			}
			else 
			{
				this.innerHTML = 'Collapse View';
				this.style.backgroundImage = 'url(/images/nav/hide_show_1.gif)';
			}
			var subDrop = document.getElementsByClassName('sub_main');

			if (subDrop)
			{
				for (t = 0; t < subDrop.length; t++)
				{
					var mySubDrop = subDrop[t];
					if (mySubDrop.style.display == 'block')
					{
						mySubDrop.style.display = 'none';
						document.getElementsByClassName('open_close').each( function(elem) { elem.style.background = 'url(/images/onelink/components/nav/sm_nav_arrow.gif) repeat-y 50% 0%'; } );
					}
					else
					{
						mySubDrop.style.display = 'block';
						document.getElementsByClassName('open_close').each( function(elem) { elem.style.background = 'url(/images/onelink/components/nav/sm_nav_arrow.gif) repeat-y 50% 0%'; } );
					}
				}

			}
		}
	}

	var hideMenu = $('hide_toggle');
	var hideSpan = $('hide_menu');

	if (hideMenu)
	{
		hideMenu.onclick = function() 
		{
			var leftNav = $('left_nav_cont');
			if (leftNav)
			{
				if (navigator.userAgent.indexOf("MSIE 6.") != -1) {
					Element.toggle(leftNav);
				} else {
					Effect.toggle(leftNav, 'blind');
				}
			}
			var leftNavRoll = $('left_nav_cont_roll');
			if (leftNavRoll)
			{
				if (navigator.userAgent.indexOf("MSIE 6.") != -1) {
					Element.toggle(leftNavRoll);
				} else {
					Effect.toggle(leftNavRoll, 'blind');
				}
			}
			if (hideSpan.style.backgroundImage == 'url(/images/pulldown_arrow_close.gif)')
			{
				hideSpan.style.backgroundImage = 'url(/images/pulldown_arrow_open.gif)';
				return false;
			}
			else 
			{
				hideSpan.style.backgroundImage = 'url(/images/pulldown_arrow_close.gif)';
				return false;
			}
		}
	}
}

function focusGoogleBar()
{
	if (document.getElementById('q'))
	{
		// use try to eliminate IE7 error
		try
		{
			document.getElementById('q').focus();
		}
		catch (e)
		{
		
		}
	}
}
function testClick() {
	if (this.style.backgroundPosition == '0% 100%')
	{
		this.style.backgroundPosition = '0% 0%'
		return false;
	}
}

function addLoadEvent(fn)
{
	if (window.addEventListener)
		window.addEventListener('load', fn, false)
	else if (window.attachEvent)
		window.attachEvent('onload', fn);
}

// Image Swap
function fToggleImgDiv(strDiv) {
	var objDiv = document.getElementById(strDiv);
	if(objDiv.style.visibility == "hidden") {
		objDiv.style.visibility = "visible";
		objDiv.style.display = "block";
		if(document.getElementById(strDiv + "plus")) {
			document.getElementById(strDiv + "plus").src = "/images/" + strDiv + "_minus.gif";
		}
	} else {
		objDiv.style.visibility = "hidden";
		objDiv.style.display = "none";
		if(document.getElementById(strDiv + "plus")) {
			document.getElementById(strDiv + "plus").src = "/images/" + strDiv + "_plus.gif";
		}
	}
}

//addLoadEvent(menus);
//addLoadEvent(sfHoverLeft);
//addLoadEvent(focusGoogleBar); // JRG 12.13.2007 - we're doing this in the google bar component