// ----------------------------------------------------------------
// Begin user type (CBOL, FLS, CIS, etc.) detection code block.
//
// This block of code should be duplicated in the following files
// since various includes pull in the .js files out of order:
//	/js/01_login.js
//	/js/new/login.js
//	/js/new/CoreCookies.js
// ----------------------------------------------------------------
//var cbolWin;

if ( typeof core_user == "undefined" )
{
	var core_user = false;
	
	if( getcookie('CORE_CTX'))
	{
		var core_ctx = getcookie("CORE_CTX");

		if ( core_ctx != null && core_ctx != "" && core_ctx != "empty" )
		{ core_user = true; }
		else
		{
			if (getcookie('BRAND_CTX')) 
			{ 
				if(getcookie('BRAND_CTX').indexOf('MSSB')!= -1) 
				{ core_user = true; } 
			}
		}
	}
	else
	{
		if (getcookie('BRAND_CTX')) 
		{ 
			if(getcookie('BRAND_CTX').indexOf('MSSB')!= -1) 
			{ core_user = true; } 
		}
	}
}

if ( typeof cbol_user == "undefined" )
{
	var cbol_user = false;
	var cis_ctx = getcookie("CIS_CTX");
	var cbol_bc = getcookie("CBOLBreadcrumbs");
	var cis_exists = false;
	var cbolbc_exists = false;

	if ( cis_ctx != null && cis_ctx != "" && cis_ctx != "empty" )
	{
		if ( cbol_bc != null && cbol_bc != "" && cbol_bc != "empty" )
		{
			cis_exists = true;
			cbolbc_exists = true;
			cbol_user = true;
		}
		else
		{
			cis_exists = true;
			cbolbc_exists = false;
		}
	}
}

if ( typeof fls_user == "undefined" )
{
	var fls_user = false;
	
	if( getcookie('FLS_CTX'))
	{
		var fls_ctx = getcookie('FLS_CTX');

		if ( fls_ctx != null && fls_ctx != "" && fls_ctx != "empty" )
		{ 
			if (getcookie('BRAND_CTX')) 
			{ 
				if(getcookie('BRAND_CTX').indexOf('CPWM')!= -1 || getcookie('BRAND_CTX').indexOf('Citi')!= -1 ) 
				{ fls_user = true; } 
			}
		}
		else
		{
			if (getcookie('BRAND_CTX')) 
			{ 
				if(getcookie('BRAND_CTX').indexOf('CPWM')!= -1) 
				{ fls_user = true; } 
			}
		}
	}
	else
	{
		if (getcookie('BRAND_CTX')) 
		{ 
			if(getcookie('BRAND_CTX').indexOf('CPWM')!= -1) 
			{ fls_user = true; } 
		}
	}
}

//The new non-JV cookie for Citi retained business
if ( typeof non_jv_user == "undefined" )
{
	var non_jv_user = false;
			if (getcookie('BRAND_CTX')) 
			{ 
				if(getcookie('BRAND_CTX').indexOf('Citi')!= -1) 
				{ non_jv_user = true; } 
			}
		}

if ( typeof cpb_user == "undefined" )
	{
	var cpb_user = false;
		if (getcookie('BRAND_CTX')) 
		{ 
		if(getcookie('BRAND_CTX').indexOf('CPB')!= -1) 
		{ cpb_user = true; } 
	}
}

if ( typeof pcr_user == "undefined" )
{
	var pcr_user = false;
	var pcr_ctx = getcookie("PCR_CTX");

	if ( pcr_ctx != null && pcr_ctx != "" && pcr_ctx != "empty" )
	{
		pcr_user = true;
	}
}

//6/28/2007 Addition to trace the Company F
if (typeof CCF_user == "undefined")
{
	CCF_user=false;
	var custCookie = getCookie2("CUST_COOKIE");

	if(custCookie != null)
	{
		var values = custCookie.split("|");
	
		for(i = 0; i < values.length; i++)
		{
			if(values[i] == "CC=F")
			{
				var CCF_user = true;
			}
		}
	}
}
//End Addition

//11/25/2008 Added for Benefit Acceess
if ( typeof ba_user == "undefined" )
{
	var ba_user = false;
	var ba_ctx = getcookie("BA_CTX");

	if ( ba_ctx != null && ba_ctx != "" && ba_ctx != "empty" )
	{
		ba_user = true;
	}
}
//End Addition

//set the EW8 user
if ( typeof ew8_user == "undefined" )
{
	var ew8_user = false;
	var ew8_ctx = getcookie("EW8Session");

	if ( ew8_ctx != null && ew8_ctx != "" && ew8_ctx != "empty" )
	{ ew8_user = true; }
}

// ----------------------------------------------------------------
// End user type code block.
// ----------------------------------------------------------------


function getcookie(in_cookiename) {
	var objCookies = document.cookie;
	var pos = objCookies.indexOf(in_cookiename);
	var begin = pos + in_cookiename.length;
	var end = objCookies.indexOf(";", begin);
	if (end  == -1) end= objCookies.length;
	var tempvalue = unescape(objCookies.substring(begin,end));
	if (pos == -1)  tempvalue = 'empty';
	return tempvalue;
}

//program to retrieve a cookie 6/26/2007
function getCookie2(name)
{
	var pos = document.cookie.indexOf(name + "=");
	if (pos == -1)
	{
		return null;
	}
	else
	{
		var pos2 = document.cookie.indexOf(";", pos);
		if (pos2 == -1)
		{
			return unescape(document.cookie.substring(pos + name.length + 1));
		}
		else
		{
			return unescape(document.cookie.substring(pos + name.length + 1, pos2));
		}
	}
}

//End Edit

// These functions are called by the old menu includes.
function PortfolioNavCookieHandlerOld()
{
	if ( ( core_user || cis_exists ) && !cbolbc_exists )
	{
		document.write('<a href="/app-bin/portfolio/Action/PortfolioAction?view=811">Banking &amp; Investments Summary</a><br />');
		//document.write('<a href="/app-bin/transapp/SSOAction.do?pageType=MemberHomePage" onclick="window.open(\'/app-bin/transapp/SSOAction.do?pageType=MemberHomePage\',\'CBOLWindow\',\'width=1000,height=600,scrollbars=yes,resizable=yes,toolbar=no,directories=no,location=no,menubar=no,status=no,left=0,top=0\'); return false;">Banking &amp; Investments Summary</a><br />');
	}
}

function BillPayNavCookieHandlerOld()
{
	//added !CCF-user
	if ( ( core_user || cis_exists || non_jv_user ) && !cbolbc_exists && !CCF_user)
	{
		//document.write('<a href="/app-bin/transapp/SSOAction.do?pageType=PaymentsMenu">Citigold Bill Pay</a><br />');
		//document.write('<a href="/app-bin/transapp/SSOAction.do?pageType=TransfersMenu">Citigold Transfer</a><br />');
		document.write('<a href="/app-bin/transapp/SSOAction.do?pageType=PaymentsMenu" onclick="window.open(\'/app-bin/transapp/SSOAction.do?pageType=PaymentsMenu\',\'CBOLWindow\',\'width=1000,height=600,scrollbars=yes,resizable=yes,toolbar=no,directories=no,location=no,menubar=no,status=no,left=0,top=0\'); return false;">Citigold Bill Pay</a><br />');
		document.write('<a href="/app-bin/transapp/SSOAction.do?pageType=TransfersMenu" onclick="window.open(\'/app-bin/transapp/SSOAction.do?pageType=TransfersMenu\',\'CBOLWindow\',\'width=1000,height=600,scrollbars=yes,resizable=yes,toolbar=no,directories=no,location=no,menubar=no,status=no,left=0,top=0\'); return false;">Citigold Transfer</a><br />');
	}
	
	//added this 6/26/2007 for Company F users
	if (CCF_user)
	{
		document.write('<a href="/app-bin/transapp/SSOAction.do?pageType=PaymentsMenu" onclick="window.open(\'/app-bin/transapp/SSOAction.do?pageType=PaymentsMenu\',\'CBOLWindow\',\'width=1000,height=600,scrollbars=yes,resizable=yes,toolbar=no,directories=no,location=no,menubar=no,status=no,left=0,top=0\'); return false;">Citibank Bill Pay</a><br />');
		document.write('<a href="/app-bin/transapp/SSOAction.do?pageType=TransfersMenu" onclick="window.open(\'/app-bin/transapp/SSOAction.do?pageType=TransfersMenu\',\'CBOLWindow\',\'width=1000,height=600,scrollbars=yes,resizable=yes,toolbar=no,directories=no,location=no,menubar=no,status=no,left=0,top=0\'); return false;">Citibank Transfer</a><br />');
	}
}

function paymentsNavTxtOld()
{
	if ( document.getElementById("tmenu05") )
	{
		var paymentsnavtxt = "";

		paymentsnavtxt += '<span class="dropdown">';
		paymentsnavtxt += '<a href="/cgi-bin/billpay/test_billpay.cgi">Bill Pay</a><br />';
		paymentsnavtxt += '<a href="/billpay/tour.html">Bill Pay Tour</a><br />';
		paymentsnavtxt += '<a href="/app-bin/aft/servlets/AftServlet">Automatic Funds Transfer</a><br />';
		paymentsnavtxt += '<a href="/app-bin/aft/servlets/AftServlet?viewCode=18&actionCode=0">Transfer Status</a><br />';
		paymentsnavtxt += '</span>';

		document.getElementById("tmenu04").innerHTML = paymentsnavtxt;
	}
}

function paymentsNavTxtNew()
{
	if ( document.getElementById("sa5") )
	{
		if ( document.getElementById("sa4").innerHTML.indexOf(" Transfers") != -1 )
		{
			var paymentsnavtxt = "";

			paymentsnavtxt += '<a href="/payments/">Payments</a>';
			paymentsnavtxt += '<ul class="subareas">';
			paymentsnavtxt += '<li><a href="/cgi-bin/billpay/test_billpay.cgi">Bill Pay</a></li>';
			paymentsnavtxt += '<li><a href="/billpay/tour.html">Bill Pay Tour</a></li>';
			paymentsnavtxt += '<li><a href="/app-bin/aft/servlets/AftServlet">Automatic Funds Transfer</a></li>';
			paymentsnavtxt += '<li><a href="/app-bin/aft/servlets/AftServlet?viewCode=18&actionCode=0">Transfer Status</a></li>';
			paymentsnavtxt += '</ul>';

			document.getElementById("sa4").innerHTML = paymentsnavtxt;
			document.getElementById("sa4").style.width = "5.6em";

		}
	}
}

// These functions are called by the new menu includes.
function PortfolioNavCookieHandlerNew( flag )
{
	if ( ( core_user || cis_exists ) && !cbolbc_exists )
	{
		document.write('<li><a href="/app-bin/portfolio/Action/PortfolioAction?view=811">Banking &amp; Investments Summary</a></li>');
		//document.write('<li><a href="/app-bin/transapp/SSOAction.do?pageType=MemberHomePage" onclick="window.open(\'/app-bin/transapp/SSOAction.do?pageType=MemberHomePage\',\'CBOLWindow\',\'width=1000,height=600,scrollbars=yes,resizable=yes,toolbar=no,directories=no,location=no,menubar=no,status=no,left=0,top=0\'); return false\;">Banking &amp; Investments Summary</a></li>');
	}
	
	
}

function BillPayNavCookieHandlerNew()
{
	//added the !CCF_user
	if ( ( core_user || cis_exists || non_jv_user ) && !cbolbc_exists && !CCF_user )
	{
		//document.write('<li><a href="/app-bin/transapp/SSOAction.do?pageType=PaymentsMenu">Citigold Bill Pay</a></li>');
		//document.write('<li><a href="/app-bin/transapp/SSOAction.do?pageType=TransfersMenu">Citigold Transfer</a></li>');
		document.write('<li><a href="/app-bin/transapp/SSOAction.do?pageType=PaymentsMenu" onclick="cbolWin=window.open(\'/app-bin/transapp/SSOAction.do?pageType=PaymentsMenu\',\'CBOLWindow\',\'width=1000,height=600,scrollbars=yes,resizable=yes,toolbar=no,directories=no,location=no,menubar=no,status=no,left=0,top=0\'); return false\;">Citigold Bill Pay</a></li>');
		document.write('<li><a href="/app-bin/transapp/SSOAction.do?pageType=TransfersMenu" onclick="window.open(\'/app-bin/transapp/SSOAction.do?pageType=TransfersMenu\',\'CBOLWindow\',\'width=1000,height=600,scrollbars=yes,resizable=yes,toolbar=no,directories=no,location=no,menubar=no,status=no,left=0,top=0\'); return false\;">Citigold Transfer</a></li>');
	}
	
	//added this 6/26/2007 for Company F users
	if(CCF_user)
	{
		document.write('<li><a href="/app-bin/transapp/SSOAction.do?pageType=PaymentsMenu" onclick="cbolWin=window.open(\'/app-bin/transapp/SSOAction.do?pageType=PaymentsMenu\',\'CBOLWindow\',\'width=1000,height=600,scrollbars=yes,resizable=yes,toolbar=no,directories=no,location=no,menubar=no,status=no,left=0,top=0\'); return false\;">Citibank Bill Pay</a></li>');
		document.write('<li><a href="/app-bin/transapp/SSOAction.do?pageType=TransfersMenu" onclick="window.open(\'/app-bin/transapp/SSOAction.do?pageType=TransfersMenu\',\'CBOLWindow\',\'width=1000,height=600,scrollbars=yes,resizable=yes,toolbar=no,directories=no,location=no,menubar=no,status=no,left=0,top=0\'); return false\;">Citibank Transfer</a></li>');
	}
}

/*27 Apr 2007
added TWR nav function currently set to true. 
*/
var twr = true;
function TWRNavCookieHandlerNew()
{
	if(pcr_user==true)
	{
		document.write('<li><a href="/app-bin/twr/TwrSSO">Total Wealth Report</a></li>');
	}
}

function TWRNavCookieHandlerOld()
{
	if(pcr_user==true)
	{
		document.write('<a href="/app-bin/twr/TwrSSO">Total Wealth Report</a><br />');
	}
}


/*
27 Apr 2007
replaced anchors in billpayleftnavcookiehandler with copies of those in billpaycookiehandlernew, to enable popup functionality from left nav
*/
function BillPayLeftNavCookieHandler()
{
//	if ( ( core_user ) || ( cis_ctx != null && cis_ctx != "" && cis_ctx != "empty" ) )
// change 6/27/2007 - altered side nav for Company F users
	if ( ( core_user || cis_exists || non_jv_user ) && !cbolbc_exists  && !CCF_user  )
	{
		document.write('<li id="i4"><a href="/app-bin/transapp/SSOAction.do?pageType=PaymentsMenu" onclick="window.open(\'/app-bin/transapp/SSOAction.do?pageType=PaymentsMenu\',\'CBOLWindow\',\'width=1000,height=600,scrollbars=yes,resizable=yes,toolbar=no,directories=no,location=no,menubar=no,status=no,left=0,top=0\'); return false\;"><img id="img_i4" src="/images/newstandards/0_bul_nav1.gif" width="8" height="8" border="0" alt="" /> Citigold Bill Pay</a></li>');
		document.write('<li id="i5"><a href="/app-bin/transapp/SSOAction.do?pageType=TransfersMenu" onclick="window.open(\'/app-bin/transapp/SSOAction.do?pageType=TransfersMenu\',\'CBOLWindow\',\'width=1000,height=600,scrollbars=yes,resizable=yes,toolbar=no,directories=no,location=no,menubar=no,status=no,left=0,top=0\'); return false\;"><img id="img_i5" src="/images/newstandards/0_bul_nav1.gif" width="8" height="8" border="0" alt="" /> Citigold Transfer</a></li>');
	}
	if(CCF_user)
	{
		document.write('<li id="i4"><a href="/app-bin/transapp/SSOAction.do?pageType=PaymentsMenu" onclick="window.open(\'/app-bin/transapp/SSOAction.do?pageType=PaymentsMenu\',\'CBOLWindow\',\'width=1000,height=600,scrollbars=yes,resizable=yes,toolbar=no,directories=no,location=no,menubar=no,status=no,left=0,top=0\'); return false\;"><img id="img_i4" src="/images/newstandards/0_bul_nav1.gif" width="8" height="8" border="0" alt="" /> Citibank Bill Pay</a></li>');
		document.write('<li id="i5"><a href="/app-bin/transapp/SSOAction.do?pageType=TransfersMenu" onclick="window.open(\'/app-bin/transapp/SSOAction.do?pageType=TransfersMenu\',\'CBOLWindow\',\'width=1000,height=600,scrollbars=yes,resizable=yes,toolbar=no,directories=no,location=no,menubar=no,status=no,left=0,top=0\'); return false\;"><img id="img_i5" src="/images/newstandards/0_bul_nav1.gif" width="8" height="8" border="0" alt="" /> Citibank Transfer</a></li>');
	}	
}


// function added on 2007-04-13
// Renders "Tax Center" link only for non-CBOL users
// navType is "sp" for "span", e.g. "old" nav, "li" for "list", e.g. "new" nav.
function ToolsNavCookieHandler(navType){
       var str = "";
       if(!cbol_user){
              switch ( document.location.host ) 
              { 
                     case "onsttxdvl4.ssmb.com" : 

                            str = (navType=="sp") ? '<a href="https://acstxdvl11.ssmb.com/tools/taxcenter/">Tax Center</a><br />' : '<li><a href="https://acstxdvl11.ssmb.com/tools/taxcenter/">Tax Center</a></li>';

                            break;

                     case "onststgtx8.ssmb.com" :

                            str = (navType=="sp") ? '<a href="https://accstgtx8.ssmb.com/tools/taxcenter/">Tax Center</a><br />' : '<li><a href="https://accstgtx8.ssmb.com/tools/taxcenter/">Tax Center</a></li>';

                            break;

                     case "onsite.smithbarney.com" : 

                            str = (navType=="sp") ? '<a href="https://www.smithbarney.com/tools/taxcenter/">Tax Center</a><br />' : '<li><a href="https://www.smithbarney.com/tools/taxcenter/">Tax Center</a></li>';

                            break;

                     default : 

                            str = (navType=="sp") ? '<a href="/tools/taxcenter/">Tax Center</a><br />' : '<li><a href="/tools/taxcenter/">Tax Center</a></li>';

              }
              document.write(str);
       }
}



//added functions May 1, 2007

//Suppresses the other investments products along the left-side nav for FLS Users
//Arguments: lcTag= is the id of the menu to be deleted; lcMenuItem is the name of the menu.
//EX: flsSideNavCookieHandler('i1', 'Futures') in includes/new/leftnav-struct_products.inc;
function flsSideNavCookieHandler(lcTag, lcMenuItem) {
	if (fls_user)
	{
	var menuList = document.getElementById(lcTag);

	// double-checking on the side nav structure. lcTag should be pulling the menu <li>
	if (menuList.nodeName === 'LI')
		{		
			if (menuList.hasChildNodes())
			{
				for (var i=0;i<menuList.childNodes.length; i++)
				{
					if (menuList.childNodes[i].innerHTML.indexOf(lcMenuItem)!=-1)
					{
						var parentMenu = menuList.parentNode;
						parentMenu.removeChild(menuList);
						return;
					}
				}
			}
		}
	}
}

//5/14/2007 additions - see above flsSideNavCookieHandler

//Note: working to bring it into deleteMainMenuItem() below.
function cisSideNavCookieHandler(lcTag, lcMenuItem) {
	if (cbol_user)
	{
	
	var menuList = document.getElementById(lcTag);

	// double-checking on the side nav structure. lcTag should be pulling the menu <li>
	if (menuList.nodeName === 'LI')
		{		
			if (menuList.hasChildNodes())
			{
				for (var i=0;i<menuList.childNodes.length; i++)
				{
					if (menuList.childNodes[i].innerHTML.indexOf(lcMenuItem))
					{
						var parentMenu = menuList.parentNode;
						parentMenu.removeChild(menuList);
						return;
					}
				}
			}
		}
	}
}
//End of additions


// Following function is a basic window spawning function
// Should ultimately be moved to some sort of utils.js file
// Is here for the moment since corecookies is called by almost every page

// added 07May2007
// targ=target url; w=window width; h=window height
function openWin(targ,w,h){
	sbWin = window.open(targ,'extWin','width='+w+' height='+h+' left=137, top=165, status=yes, scrollbars=yes, resizable=no');
}
//alert("international? " + intl_user);

//June 7, 2007 -  Global Menu Delete Function. There's three components: 
//The killMenus(userType); will be called up by 02_loader.js for new files; older ones either in menu, page or a .js that does an init.

// deleteMainMenuItem could be called by any function.
//lcTag = the div id for the menu: ex, tmenu01; lcItem is the menu item to be deleted.
function deleteMainMenuItem(lcTag, lcItem)
{
					   
	switch (lcTag.substr(0,2)) 
	{
		case 'tm' :
		{
			//old top menu item
			var menuList = document.getElementById(lcTag);
			
			if(menuList == null) {break;}
			var anchorList = menuList.getElementsByTagName('a')

			for (i=0; i<anchorList.length; i++)
			{
				if(anchorList[i].innerHTML == lcItem)
				{
					var anchorParent = anchorList[i].parentNode;
			
					if(anchorList[i].nextSibling.nodeName == 'BR')
					{
						anchorParent.removeChild(anchorList[i].nextSibling);
					}
					
					anchorParent.removeChild(anchorList[i]);
				}
			}
			break;
		}
		case 'sa' :
		{
			//This is a new top menu
			var menuList = document.getElementById(lcTag);
			if(menuList == null) {break;}
			
			var anchorList = menuList.getElementsByTagName('li')
	
			for (i=0; i<anchorList.length; i++)
			{
				if(anchorList[i].firstChild.innerHTML == lcItem)
				{
					var anchorParent = anchorList[i].parentNode;
					anchorParent.removeChild(anchorList[i]);
				}
			}
			break;
		}
	}
}

//This function calls the userType object and the deleteMainMenuItem() function
function killMenus(userType) {
	var user_type = userType.getUser();
	
	//j = the property i.e., tmenu01, tmenu02, sa1; user_type[j] is the value of the property
	for( j in user_type )
		{
			deleteMainMenuItem(j, user_type[j]);
		}
}

//below is an example of a nested object with a method
var userType={
		//Creating literal (sub) objects
		
		//tmenu06 is a property, 'Annuities' is the value of the property
		flsUser: {sa6: 'Annuities' , tmenu06: 'Annuities'},
		
		//Below is if you need to add another user object
		//cbolUser: {sa2: 'Marketwatch', sa1: 'Positions', tmenu02: 'Options'},
		
		//this is a method
		getUser: function() 
		{ 
			if(fls_user){ return this.flsUser; }
			
			//If need to call up another user... 
			//else if(cbol_user){ return this.cbolUser; }
		} 
}
//End

//8/10/2007 - checks to make sure sb.com is the top window except when in wrappe
function ethicHack()
{
	if (cbol_user != true)
	{
		if( self != top )
		{
			top.location = self.location;
		}
	}
}

//1/24/2008: Making sure the Miranda is being displayed. Will be called from the footer.
function cbolMiranda()
{
	//1/22/2008: I think I'm going to write 
	if (cbol_user==true)
	{
		if ( document.getElementById("miranda") )
		{
			return;
		}
		else
		{
		
			if (document.title == "Portfolio")
			{
				//2/6/08: May have to check for cbol here
				
				var placeMiranda = document.getElementById("holdSpace");
				
				//placeMiranda.innerHTML = "Put Miranda In Here";
			
				var MSG = ''
				MSG += '<br />'
				MSG += '<span id="miranda" style="border:1px solid #000;margin:10px;padding:5px;font-size:0.85em;width:525px;">'
				MSG +=		'<span style="padding:0;margin:0;margin-right:5px;font-weight:bold;">INVESTMENTS PRODUCTS:</span>'

				var style = 'padding:0 0 0 20px;font-weight:bold;'

				MSG += 	'<span style="' + style + '">NOT FDIC INSURED</span>'
				MSG += 	'<span style="' + style + '">NO BANK GUARANTEE</span>'
				MSG += 	'<span style="' + style + '">MAY LOSE VALUE </span>'

				MSG += '</span>'
				
				placeMiranda.innerHTML = MSG;

			}
			
		}
	}
} 

//added this for Benefit Access 11/26/2008
//Called up in 02_loader.js init.

function addBA()
{
	//add the if statement for what kind of menu it is
	if (document.getElementById('mainNav'))
	{ 	var parent = document.getElementById('mainNav'); 
		var newNode = document.createElement("li");
		newNode.id = "sa9"; 
		newNode.innerHTML = '<a href="https://benefits.smithbarney.com/cgi-bin/benefits/index.cgi" title="Benefit Access"><span>Benefit Access</span></a>';
		//newNode.innerHTML = '<a href="https://benefitaccessstaging.smithbarney.com/app-bin/bacbs/beHomeServlet" title="Benefit Access"><span>Benefit Access</span></a>';
		parent.appendChild(newNode);		
	}
	else if (document.getElementById('nav')) 
	{ 	var parent = document.getElementById('nav'); 
		var newNode = document.createElement("li");
		newNode.id = "sa9"; 
		newNode.className="siteareas";
		newNode.innerHTML = '<a href="https://benefits.smithbarney.com/cgi-bin/benefits/index.cgi" title="Benefit Access">Benefit Access</a>';
		//newNode.innerHTML = '<a href="https://benefitaccessstaging.smithbarney.com/app-bin/bacbs/beHomeServlet" title="Benefit Access">Benefit Access</a>';
		parent.appendChild(newNode);
		document.getElementById("sa8").style.borderRight="2px solid #9CF";
		document.getElementById("sa8").style.paddingRight="6px";
		document.getElementById("sa9").style.borderRight="0px";
	} 
}

//this is for the older menu. I also have to add the border right to the sa8
//		<li id="sa9" class="siteareas" style="padding:0 0.6em 0 0.6em; margin:0; width:auto; border-right:0"><a href="/myaccess/">My Access</a>

