	/***************** LAYERS ********************/

var strHighColor = "669999";
var strOtherColor = "336666";
var imgTabLeft;
var imgTabRight;
var strTabName;		
var strInnerHtml;
var strSite = getSiteType();

function fncHideLayers(strExemptLayer){
	var strSubLayer;
	for(var j = 0; j < aryLayers.length; j++){
		if(strExemptLayer == aryLayers[j]){
			document.getElementById(aryLayers[j]).style.display = "block";
			strSubLayer = arySubDefaultLayers[j];
		}else{
			document.getElementById(aryLayers[j]).style.display = "none";
		}
	}
	fncHideSubLayers(strSubLayer);
}

function fncHideSubLayers(strExemptSubLayer){
	for(var h = 0; h < arySubLayers.length; h++){
		if(strExemptSubLayer == arySubLayers[h]){
			document.getElementById(arySubLayers[h]).style.display = "block";
		}else{
			document.getElementById(arySubLayers[h]).style.display = "none";
		}
	}
}

function fncChangeTab(strLayer){
	var i, x = 1;
	var strTabFunction, strTabTitle, strTabName, strSubLayer;
	for(i = 0; i < aryLayers.length; i++){
		strTabFunction = "fncChangeTab('" + aryLayers[i] + "')";
		strTabTitle = aryTabTitles[i];
		strTabName = aryTabLayerNames[i]
		if(strLayer == aryLayers[i]){
			strSubLayer = arySubDefaultLayers[i];
			document.getElementById(aryLayers[i]).style.display = "block";
			fncChangeTabStyle("chosen",strTabFunction,strTabTitle,strTabName);
		}else{
			document.getElementById(aryLayers[i]).style.display = "none";
			fncChangeTabStyle("notchosen",strTabFunction,strTabTitle,strTabName);
		}
	}
	fncHideSubLayers(strSubLayer);
}

function fncChangeTabStyle(strChosen,strFunction,strTitle,strTabName){
	var strInnerHtml = ""
	if(strChosen == "chosen"){
		strInnerHtml = '<table border="0" cellpadding="0" cellspacing="0">' + 
			'<tr><TD STYLE="border-left: 1px solid #FFFFFF;" ALIGN="LEFT" WIDTH="7" HEIGHT="6" VALIGN="TOP"><IMG ID="IMGLTCORNER1" BORDER="0" WIDTH="7" HEIGHT="6" SRC="/images/general/tabs/tab_left_' + strHighColor + '.gif"><\/TD>' + 
			'	<td BGCOLOR="#' + strHighColor + '" width="150" height="6" valign="top"><img src="/images/general/spacer.gif" width="120" height="6"><\/td>' + 
			'	<TD STYLE="border-right: 1px solid #FFFFFF;" ALIGN="RIGHT" WIDTH="7" HEIGHT="6" VALIGN="TOP"><IMG ID="IMGRTCORNER1" BORDER="0" WIDTH="7" HEIGHT="6" SRC="/images/general/tabs/tab_right_' + strHighColor + '.gif"><\/TD>' + 
			'<\/tr>' + 
			'<tr><td STYLE="border-left: 1px solid #99CCCC;" BGCOLOR="#' + strHighColor + '" width="7" height="20" valign="top"><img src="/images/general/spacer.gif" width="7" height="6"><\/td>' + 
			'	<TD BGCOLOR="#' + strHighColor + '" height="20" ALIGN="CENTER" valign="top"><SPAN CL' + 'ASS="clsTabTextChosen" ID="SPNTABTEXT1" ONCLICK="' + strFunction + '">' + strTitle + '<\/SPAN><\/TD>' + 
			'	<td STYLE="border-right: 1px solid #336666;" BGCOLOR="#' + strHighColor + '" width="7" height="20" valign="top"><img src="/images/general/spacer.gif" width="7" height="6"><\/td><\/tr>' + 
			'<\/table>';
	}else{
		strInnerHtml = '<table border="0" cellpadding="0" cellspacing="0">' + 
			'<tr><TD WIDTH="7" HEIGHT="6" VALIGN="TOP"><IMG ID="IMGLTCORNER2" BORDER="0" WIDTH="7" HEIGHT="6" SRC="/images/general/tabs/tab_left_' + strOtherColor + '.gif"><\/TD>' + 
			'	<td BGCOLOR="#' + strOtherColor + '" width="150" height="6" valign="top"><img src="/images/general/spacer.gif" width="120" height="6"><\/td>' + 
			'	<TD STYLE="border-right: 1px solid #FFFFFF;" ALIGN="RIGHT" WIDTH="7" HEIGHT="6" VALIGN="TOP"><IMG ID="IMGRTCORNER2" BORDER="0" WIDTH="7" HEIGHT="6" SRC="/images/general/tabs/tab_right_' + strOtherColor + '.gif"><\/TD>' + 
			'<\/tr>' + 
			'<tr><td BGCOLOR="#' + strOtherColor + '" width="7" height="20" valign="top"><img src="/images/general/spacer.gif" width="7" height="6"><\/td>' + 
			'	<TD BGCOLOR="#' + strOtherColor + '" ALIGN="CENTER" valign="top"><SPAN CL' + 'ASS="clsTabText" ID="SPNTABTEXT2" ONMOUSEOUT="tabMouseOut(this);" ONMOUSEOVER="tabMouseOver(this);" ONCLICK="' + strFunction + '">' + strTitle + '<\/SPAN><\/TD>' + 
			'	<td STYLE="border-right: 1px solid #003333;" BGCOLOR="#' + strOtherColor + '" width="7" height="20" valign="top"><img src="/images/general/spacer.gif" width="7" height="6"><\/td><\/tr>' + 
			'<\/table>';
	}
	document.getElementById(strTabName).innerHTML = strInnerHtml;
}

// hover colors
function tabMouseOver(obj) {
	intChosen = intChosen.toUpperCase();
	obj.style.color = "#FFCC66";
	if (ns) obj.style.cursor = "pointer"; 					
	else obj.style.cursor = "hand";						
}

function tabMouseOut(obj) {
	obj.style.color = "#FFFFFF";
	obj.style.cursor = "default";		
}

/********************************************************/
	
	/* when a specific layer is called in the url, 
	this will open that layer instead of the default first layer */

	function fncLoadThisDiv(){
		//fncHideLayers("DIV_INTRODUCTION");
		var nmbrID = 0;
		var locationHref = window.location.href;	
		locationHref = locationHref.toUpperCase();
		var myD;
		
		if(locationHref.indexOf("DIVID") > 0){
			var param = locationHref.indexOf("=");
			param = param + 1;
			var paramDivID = locationHref.slice(param);
			paramDivID = paramDivID.toUpperCase();
			if (paramDivID > "" && paramDivID != "DIV_INTRO_SELECTION") {
				for (var n = 0; n < aryLayers.length; n++) {
					if (paramDivID == aryLayers[n]) {
						fncChangeTab(paramDivID);
						nmbrID = 1;
						break;
					}
				}
			} else if(paramDivID == "DIV_INTRO_SELECTION"){
				myD = "DIV_INTRO_SELECTION";	
			}
		}
		
		if(nmbrID == 0){
			if(strSite == "MF" || strSite == "CS"){
				fncChangeTab("DIV_FUNDS");
			}else{
				fncChangeTab("DIV_INTRODUCTION");
			}
		}
		
		if(myD > ""){
			fncHideSubLayers("DIV_INTRO_SELECTION");	
		}
	}
	
/*************** Adds and Removes Underline for Portfolio/Fund links ******************/


function fncStyleUnderline(obj){
	obj.style.textDecoration = "underline";
}

function fncStyleRemoveUnderline(obj){
	obj.style.textDecoration = "none";
}