
// ---------------------------------------------------------
//    Menu Variables
// ---------------------
//    Adjust the variables in this section to make the menu
// ---------------------------------------------------------
var mArray = new Array('LinkID','LinkTxt','HREF','SubMenu') // do not edit
//[Start] Code commented  as per WRM# 8013 and new code added similar to previous one for new nav items by Gajender Yadav(YD19) on 28th April 2008	
/*mArray[0] = new Array('a1','a2','a2b1','a3','a4','a4b1','a4b2','a4b3', 'a4b4','a5', 'a5b1', 'a5b2', 'a5b3', 'a5b4', 'a5b5', 'a5b6', 'a5b7', 'a5b8','a5b9','a5bc','a5bd','a5be', 'a6')
mArray[1] = new Array(
					  	'Home',
						'About Sun <br><img src=/images/sp.gif width=14 height=7 border=0>Capital Advisers <br><img src=/images/sp.gif width=14 height=7 border=0>LLC', 
						'Manager Bios', 'About Sun<br><img src=/images/sp.gif width=9 height=7 border=0> Life Financial',
						'Institutional <br><img src=/images/sp.gif width=14 height=7 border=0>Investors/<br><img src=/images/sp.gif width=14 height=7 border=0>Consultants',
						'Equity',
						'Fixed Income', 
						'Real Estate', 
						'Structured <br><img src=/images/sp.gif width=14 height=7 border=0>Products',
						'Individual<br><img src=/images/sp.gif width=14 height=7 border=0>Investors', 
						'Sun Capital &reg;<br><img src=/images/sp.gif width=14 height=7 border=0>All Cap Fund', 
						'Sun Capital Investment<br><img src=/images/sp.gif width=14 height=7 border=0>Grade Bond Fund &reg;', 
						'Sun Capital <br><img src=/images/sp.gif width=14 height=7 border=0>Money Market Fund &reg;',
						'Sun Capital <br><img src=/images/sp.gif width=14 height=7 border=0>Real Estate Fund &reg;',  
						'SC <sup>SM</sup> Blue Chip Mid<br><img src=/images/sp.gif width=14 height=7 border=0>Cap Fund',						
						'SC <sup>SM</sup> Davis Venture<br><img src=/images/sp.gif width=14 height=7 border=0>Value Fund', 
						'SC <sup>SM</sup> FI Large Cap<br><img src=/images/sp.gif width=14 height=7 border=0>Growth Fund',
						'SC <sup>SM</sup> Goldman Sachs<br><img src=/images/sp.gif width=14 height=7 border=0>Mid Cap Value Fund',
						'SC <sup>SM</sup> Goldman Sachs<br><img src=/images/sp.gif width=14 height=7 border=0>Short Duration Fund',
						'SC <sup>SM</sup> Lord Abett <br><img src=/images/sp.gif width=14 height=7 border=0>Growth and Income<br><img src=/images/sp.gif width=14 height=7 border=0>Fund',
						'SC <sup>SM</sup> Oppenheimer <br><img src=/images/sp.gif width=14 height=7 border=0>Main Street <br><img src=/images/sp.gif width=14 height=7 border=0>Small Cap Fund', 
						'SC <sup>SM</sup> Pimco High Yield<br><img src=/images/sp.gif width=14 height=7 border=0>Fund', 
						'Insurance<br><img src=/images/sp.gif width=14 height=7 border=0>Asset <br><img src=/images/sp.gif width=14 height=7 border=0>Management')
mArray[2]  = new Array('/','/AboutSCA/index.cfm', '/AboutSCA/company_profile.cfm','/AboutSLF/index.cfm', '/Inst_Investors/index.cfm','/Inst_Investors/Equity.cfm', '/Inst_Investors/FixedIncome.cfm','/Inst_Investors/RealEstate.cfm', '/Inst_Investors/StructuredProducts.cfm','/Indiv_Investors/index.cfm','/Indiv_Investors/SunCapAllCapFd.cfm','/Indiv_Investors/SunCapInvstmtGradeBdFd.cfm','/Indiv_Investors/SunCapMoneyMarktFd.cfm', '/Indiv_Investors/SunCapRealEstateFd.cfm','/Indiv_Investors/SunCapBlueChipMidCapFd.cfm','/Indiv_Investors/SunCapDavisVentValFd.cfm', '/Indiv_Investors/SCFILargeCap.cfm','/Indiv_Investors/SCGoldSachMidCap.cfm','/Indiv_Investors/SCGoldSachShtDur.cfm','/Indiv_Investors/SCLordAbbGroInc.cfm','/Indiv_Investors/SunCapValueSmlCapFd.cfm','/Indiv_Investors/SCPimHighYieldFd.cfm', '/Inst_AssetMgmt/index.cfm')
mArray[3]  = new Array(0,1,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0) */

mArray[0] = new Array('a1','a2','a2b1', 'a2b2', 'a2b3', 'a2b4', 'a2b5', 'a2b6', 'a2b7', 'a2b8','a2b9','a2bc','a2bd','a2be','a2bf','a2bg','a2bh','a2bi','a2bj','a2bk','a2bl','a2bm','a3','a4','a5','a6','a7','a8','a9', 'a10','a11','a12','a13','a14','a15','a16','a17','a18','a19', 'a20')
mArray[1] = new Array(
					  	'Home',
						'Sun Capital<br><img src=/images/sp.gif width=14 height=7 border=0>Advisers Trust',
						'Sun Capital Global<br><img src=/images/sp.gif width=14 height=7 border=0>Real Estate Fund &reg;',
						'Sun Capital Investment<br><img src=/images/sp.gif width=14 height=7 border=0>Grade Bond Fund &reg;', 
						'Sun Capital <br><img src=/images/sp.gif width=14 height=7 border=0>Money Market Fund &reg;',
						'SC <sup>SM</sup> AIM Small Cap<br><img src=/images/sp.gif width=14 height=7 border=0>Growth Fund',
						'SC <sup>SM</sup> Alliance Bernstein<br><img src=/images/sp.gif width=14 height=7 border=0>International <br><img src=/images/sp.gif width=14 height=7 border=0>Value Fund',
						'SC <sup>SM</sup> BlackRock Inflation<br><img src=/images/sp.gif width=14 height=7 border=0>Protected Bond <br><img src=/images/sp.gif width=14 height=7 border=0>Fund',
						'SC <sup>SM</sup> Davis Venture<br><img src=/images/sp.gif width=14 height=7 border=0>Value Fund',
						'SC <sup>SM</sup> Dreman Small Cap<br><img src=/images/sp.gif width=14 height=7 border=0>Value Fund',
						'SC <sup>SM</sup> FI Large Cap<br><img src=/images/sp.gif width=14 height=7 border=0>Growth Fund',
						'SC <sup>SM</sup> Goldman Sachs<br><img src=/images/sp.gif width=14 height=7 border=0>Mid Cap Value Fund',
						'SC <sup>SM</sup> Goldman Sachs<br><img src=/images/sp.gif width=14 height=7 border=0>Short Duration Fund',
						'SC <sup>SM</sup> Ibbotson Balanced<br><img src=/images/sp.gif width=14 height=7 border=0>Fund',
						'SC <sup>SM</sup> Ibbotson Growth<br><img src=/images/sp.gif width=14 height=7 border=0>Fund',
						'SC <sup>SM</sup> Ibbotson Moderate<br><img src=/images/sp.gif width=14 height=7 border=0>Fund',
						'SC <sup>SM</sup> Lord Abbett <br><img src=/images/sp.gif width=14 height=7 border=0>Growth and Income<br><img src=/images/sp.gif width=14 height=7 border=0>Fund',
						'SC <sup>SM</sup> Oppenheimer<br><img src=/images/sp.gif width=14 height=7 border=0>Large Cap Core Fund',
						'SC <sup>SM</sup> Oppenheimer <br><img src=/images/sp.gif width=14 height=7 border=0>Main Street <br><img src=/images/sp.gif width=14 height=7 border=0>Small Cap Growth Fund',
						'SC <sup>SM</sup> PIMCO High Yield<br><img src=/images/sp.gif width=14 height=7 border=0>Fund', 
						'SC <sup>SM</sup> PIMCO Total Return<br><img src=/images/sp.gif width=14 height=7 border=0>Fund',
						'SC <sup>SM</sup> Blue Chip Mid<br><img src=/images/sp.gif width=14 height=7 border=0>Cap Fund',
						'Institutional Asset<br><img src=/images/sp.gif width=14 height=7 border=0>Management','','','','','','','','','','','','','','','','','')
mArray[2]  = new Array('/','/Indiv_Investors/index.cfm','/Indiv_Investors/SunCapGREIT.cfm','/Indiv_Investors/SunCapInvstmtGradeBdFd.cfm','/Indiv_Investors/SunCapMoneyMarktFd.cfm', '/Indiv_Investors/AIMSmallCapGrowthFd.cfm','/Indiv_Investors/SCAllBerIntlFd.cfm','/Indiv_Investors/SCBlackRockInfBndFd.cfm',
'/Indiv_Investors/SunCapDavisVentValFd.cfm', '/Indiv_Investors/DremanSmall.cfm','/Indiv_Investors/SCFILargeCap.cfm',
'/Indiv_Investors/SCGoldSachMidCap.cfm',
'/Indiv_Investors/SCGoldSachShtDur.cfm',
'/Indiv_Investors/IbbotsonBal.cfm',
'/Indiv_Investors/IbbotsonGrowth.cfm',
'/Indiv_Investors/IbbotsonMod.cfm',
'/Indiv_Investors/SCLordAbbGroInc.cfm',
'/Indiv_Investors/SCOppLCC.cfm','/Indiv_Investors/SCOppMainSt.cfm',
'/Indiv_Investors/SCPimHighYieldFd.cfm','/Indiv_Investors/SCPimTotalRetFd.cfm', '/Indiv_Investors/SunCapBlueChipMidCapFd.cfm',
'/Inst_Asset_Mgt/index.cfm','','','','','','','','','','','','','','','','','')
mArray[3]  = new Array(0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)
//[End] Code commented  as per WRM# 8013 and new code added similar to previous one for new nav items by Gajender Yadav(YD19) on 28th April 2008	

var maxSub = 2 //this is the maximum submenu depth (count from 0) this could become a calculation


// ---------------------------------------------------------
//    Immediate Scripts
// ---------------------------------------------------------

// set up the hilight Array
var hilightArray = new Array()
for (var i=0; i<=maxSub; i++) {
	hilightArray[i] = null
}
// openItem is initially set to '' - to set the open Item,
// set this variable equal to the item ID in the HTML file,
// after this script file is called
var openItem = ''


// ---------------------------------------------------------
//    Menu Equivalency Statements
// ---------------------------------------------------------

// writeMenu globals
mStyle      = (NS4) ? 'CLASS="nsDx"' : '';
subImg      = '/images/arrowrtwht2.gif'
subImgOn    = '/images/arrowrtwht2_on.gif'
spImg       = '/images/sp.gif'
nsFirst     = ' CLASS="nsFirst"'
nsSecond    = ' CLASS="nsOrange"'
isOpenStart = (NS4) ? '<TR><TD>' : '';
isOpenEnd   = (NS4) ? '</TD></TR>' : '';

// doHilight image Path
subBkgd   = (NS4) ? '/images/bg_yellow.gif' : 'url("/images/bg_yellow.gif")'

// ---------------------------------------------------------
//    Menu Functions
// ---------------------------------------------------------

// shows menu
function showMenu (mID) {
	clearTimeout(timeID)
	mL = mID.length
	isOpenItem = (openItem.substr(0,mL)==mID)
	isOpenTree = (mL>2) ? (openItem.substr(0,mL-2)==mID.substr(0,mL-2)) : isOpenItem ;
	mLevel = ((openItem!=null)&&(!isOpenTree))||(mL<=2) ? (mL/2) - 1 : (mL/2) - 2
	//objID is the item that is rolled over
	objID = (NS4) ? 'level' + mLevel + '.document.' : ''
	theObjRef = gDivRef + objID + mID
	theObj = eval(theObjRef)

	
	curObjRef = hilightArray[mLevel]
	// the following will force the submenu to turn off if on the base level
	isSubOnMain = 0
	if ((openItem == mID) && (mL>2)) { isSubOnMain = 1 }
	
	// turn off the current highlight
	if (curObjRef != null) {
		curObj = eval(curObjRef)
		doHilight (curObj, 0, mLevel)
		closeLevels(mLevel)
	}
	// set the new item in the array
	if (!isOpenItem || isSubOnMain) { 
		hilightArray[mLevel] = theObj
		doHilight (theObj, 1, mLevel, isOpenTree)
	}
		
if (!isOpenItem) {
	// Detect if there is a subMenu
	for (x in mArray[0]) {
		if (mArray[0][x] == mID && mArray[3][x] == 1) { // there is a sub-menu
			theDocRef = gDivRef + 'level' + (mLevel+1) // these are at the doc root
			theDocObj = eval(theDocRef)
			
			if (NS4) {
				theDocObj.document.open('text/html');
				txt = writeMenu(mID)
				theDocObj.document.write(txt);
				theDocObj.document.close();
				theDocObj.bgColor="#FFCC00"
				
				// page coordinates
				y = theObj.pageY
				x = theObj.pageX 
				w = theObj.clip.width
						
			} else {
          
				theDocObj.innerHTML = '';
				theDocObj.innerHTML = writeMenu(mID)

				// coordinates local to previous level div
				y = eval(theObjRef + '.offsetTop')// original placement
				if ((mLevel > 0)) {
					y += eval(theObjRef + '.offsetParent.offsetTop')   
				}
				x = theObj.offsetParent.offsetLeft
				w = theObj.offsetWidth
			}
			
			// Position the Popup
			rPos = (NS4) ? x + w + 4 : x + w + 4 // add 8 for NS table padding
			eval(theDocRef + gStyle + '.left = ' + rPos);
			eval(theDocRef + gStyle + '.top = ' + y);
			eval(theDocRef + gStyle + '.visibility="' + gVisible + '"');
			
			break
		}
	}
}
}

// ---------------------------------------------------------
// hides menu

function hideMenu() {
	timeID = setTimeout('closeLevels(0)', 1000)
}


function doHilight (theObj, state, mLevel, isOpenTree) {
	if (isOpenTree) { // sub menu on base level
		// always level 0
		hil = state ? '#FAEEBB' : trsp	
		if (NS4) {
			theObj.bgColor = hil
		} else {
			theObj.style.backgroundColor = hil
		}

	} else if (mLevel == 0) { // base menu
		hil = state ? '#FFCC00' : trsp
		if (NS4) {
			theObj.bgColor = hil
		} else {
			theObj.style.backgroundColor = hil
		}
	} else { // submenu
		if (NS4) {
			hil = state ? subBkgd : null
			theObj.background.src = hil
		} else {
			hil = state ? subBkgd : 'none'
			theObj.style.backgroundImage = hil
		}
	}
}


function closeLevels (startLevel) {
	// turn off the current highlight
	curObjRef = hilightArray[startLevel]
	if (curObjRef != null) {
		curObj = eval(curObjRef)
		doHilight (curObj, 0, startLevel)
		hilightArray[startLevel] = null
		//closeLevels(startLevel)
		for (var i = startLevel+1; i<= maxSub; i++) {
			theDocRef = gDivRef + 'level' + i // these are at the doc root
			eval(theDocRef + gStyle + '.visibility="' + gHidden + '"');
			hilightArray[i] = null
		}
	}
}
		
function writeMenu(cID) {
	var txt  = ""
	var mLinkNum = 0
	var mLevel = (cID.length/2)
	var m = String.fromCharCode(97+mLevel)
	for (x in mArray[0]) {
		if (doLink(cID, mArray[0][x], m)) {
			var isOpen = (mArray[0][x]==openItem.substr(0,mLevel+2))
			mLinkNum++
			var mID = cID + m + mLinkNum
			var mDiv = '<DIV ID="' + mID + '" ' + mStyle
			var mLink  = '<A HREF="' + mArray[2][x] + '"'
			var mJS  = ' onMouseOver="showMenu(\'' + mID + '\')" onMouseOut="hideMenu()"'
			var cImg = (mArray[3][x]) ? ((isOpen) ? subImgOn : subImg) : spImg;
			var mImg = '<IMG SRC="' + cImg + '" ALIGN="baseline" VSPACE="0" BORDER="0" WIDTH="14" HEIGHT="7">'
			var mLinkText = mImg + mArray[1][x]

			if (NS4) {
				txtStyle = (mLevel > 0) ? nsSecond : nsFirst
				// NETSCAPE : DIV + LINK + JS + SPACER
				txt += '<TR><TD>' + mDiv + '>' + mLink + mJS + txtStyle + '>'
				txt += '<IMG SRC="/images/sp.gif" BORDER="0" WIDTH="7" HEIGHT="1">' + mLinkText
				txt += '<\/A>'
				txt += '<BR><IMG SRC="/images/sp.gif" BORDER="0" WIDTH="147" HEIGHT="3">' //NS width only works with this at the end
				txt += '<\/DIV></TD></TR>'
	
			} else {
				mClass = (mLevel > 0) ? 'jorange' : 'jfirst'
				// IE : LINK + DIV + JS
				txt += mLink + '>' + mDiv + mJS + ' CLASS="' + mClass + '">' + mLinkText
				txt += '<\/DIV><\/A>'
			}
			//if link is "on", write the menu below the link.
			if (isOpen) {
				txt += isOpenStart + writeMenu(mArray[0][x]) + isOpenEnd
			}
			
		}
	}
	if (NS4) {
		
		txt = '<TABLE BORDER="0" WIDTH="147" CELLPADDING="0" CELLSPACING="0">' + txt + '</TABLE>'
	}
	return txt
}

function doLink(cID, dbItem, m) {
	// detect if the items in the array start with the current Item
	if ((dbItem.indexOf(cID + m) != -1) && (dbItem.length-2 == cID.length)) {
		return true
	}
	return false
}

function writeDiv() {
	txt = ''
	for (var i = 1; i <= maxSub; i++) {
		txt += '<DIV ID="level' + i + '" STYLE="position:absolute; visibility:hidden;'
		if (IE4) {
			txt += ' z-index=' + (500+i) + '; background-color:#FFCC00; width:147'
		}
		txt += '"><\/DIV>\n'
	}
	return txt
}


function initMenu() {
	if (NS4) {
		document.level0.top = 126 // 71(table)+9(image)+46(stock ticker)
	}
	subMenu=0
	/*
	for (var i=2; i<=openItem.length; i++) {
		
		objID = (NS4) ? 'level0.document.' : ''
		theObjRef = gDivRef + objID + openItem.substr(0,i)
		theObj = eval(theObjRef)
		doHilight (theObj, 1, 0, subMenu)
		subMenu=1 // after the first time we are into submenus
		i++ // increment by 2 each loop
	}
	*/
	eval(gDivRef + 'level0' + gStyle + '.visibility = "' + gVisible + '"')
}