/* ------------------------------------------------
  /apps/fundperformancecalc/js/common.js 
  DUV/Performance shared functions  
------------------------------------------------ */

//-----------------
// temporary alert until 10/1/2005 for new funds - save for future use 
//-----------------
function isValid() {
	/*if (sMnemonic == "BONES" || sMnemonic == "BONEU") {
		alert("Quarterly Fund Performance will not be available until October 1, 2005.");
		return false;	
	}*/	
	return true;
}


function isNet4x() {
	if (document.getElementById)
		return false;
	return true;
}

function getProduct() {
	var i, y;
	
	for(i=0; i<aryProducts.length; i++) {
		for(y=0; y<aryProducts[i][2].length; y++) {
			if(sMnemonic.toLowerCase() == strSplit(aryProducts[i][2][y], "|")[1].toLowerCase()) 
				return aryProducts[i][0];							
		}												
	}	
}

function getCompanyCode() {
	var companyCode = "101";
	if (document.location.host.indexOf("pacificlifeandannuity") != -1)
		companyCode = "111";		
	return companyCode;		
}

function strSplit(str, delimiter) {
	var arySplit = "";
	arySplit = str.split(delimiter);
	return arySplit;
}

function getInvestmentOption()  {
	var i;
	
	for(i=0; i<aryInvestments.length; i++) {
		if (sFund == aryInvestments[i][0])
			return aryInvestments[i][1];
	}
}	

function getFundInception() {
	var i, strFundIncep;
	
	for(i=0; i<aryInvestments.length; i++) {
		if (sFund == aryInvestments[i][0]) {
			strFundIncep = aryInvestments[i][2];			
			return strFundIncep; // returns mm/dd/yyyy
		}
	}		
}


function getFundTerm() {
	var i, strFundTerm;
	for(i=0; i<aryInvestments.length; i++) {
		if (sFund == aryInvestments[i][0]) {
			strFundTerm = aryInvestments[i][3];		
			return strFundTerm; // returns mm/dd/yyyy
		}
	}	
}


function getDeathBenefit() {
	var i, x=0; 
	
	for(i=0; i<aryProducts.length; i++) {
		if (sProduct.toLowerCase() == aryProducts[i][0].toLowerCase()) {
			if (aryProducts[i][2].length >= 1) {
				do {													
					if(sMnemonic.toLowerCase() == strSplit(aryProducts[i][2][x], "|")[1].toLowerCase()) {
						if((strSplit(aryProducts[i][2][x], "|")[0]) == "Premier Death Benefit"){
							var strPremierReturn = strSplit(aryProducts[i][2][x], "|")[0] + "<br><span class=aSmallRed>(Not available on contracts issued after 4/30/03.)</span>"
							return strPremierReturn;
						}else{
							return strSplit(aryProducts[i][2][x], "|")[0];
						}
					}	
					x++;					
				} while(x < aryProducts[i][2].length)	
				x=0;
			}			
		}			
	}
}

function getRequestedMonth() {	
	if (sTabName.toLowerCase() != "trchart") 
		return aryMonthLong[strSplit(sValueDate, "/")[0]-1];	
}

function getRequestedYear() {	
	if (sTabName.toLowerCase() != "trchart") 
		return strSplit(sValueDate, "/")[2];	
}



/* ------------------------------------------------
  duv and fund performance form object controls 
------------------------------------------------ */

var frm;
function setUpForm() {
	frm = document.frmDailyUnitValue;			
	
	if (frm) { // daily values form
	
		if (getCompanyCode() == "101")	// if more than one NY product, remove this line		
			clearOptions(frm.sltBene);		
			
		setDefaultDate();			
	}

	setUpFundForm();
}

function setUpFundForm() {	
	frm = document.frmFundPerformance;
	//setFrmVar(document.frmFundPerformance);
	setDefaultDate();		
}

function setFrmVar(currObj) {
	frm = document.frmFundPerformance;
	
	if(currObj.name == "frmDailyUnitValue"){
		frm = document.frmDailyUnitValue;
	}else if (currObj.form) {
		if (currObj.form.name == "frmDailyUnitValue")
			frm = document.frmDailyUnitValue;
	}
}

function setDeathBene(obj) {
	var i, x=0, y;	
	
	setFrmVar(obj);		

	if (obj.options.selectedIndex != 0) {
		for(i=0; i<aryProducts.length; i++) {				
			var selectedProduct = obj.options[obj.selectedIndex].text;	
			
			// if POS is inactive it should use benes for the (proir to 8-1) version				
			if (selectedProduct == "Pacific One Select") { 
				for (var y=0; y<aryAnnInactiveProducts.length; y++) {
					if (aryAnnInactiveProducts[y] == selectedProduct)
						selectedProduct = "Pacific One Select (prior to 8-1-06)"; 
				}			 
			}	
				
			if (selectedProduct == aryProducts[i][0]) {			
				clearOptions(frm.sltBene);
				
				if (aryProducts[i][2].length > 1) {
				
					displayBene("block");
									
					do {				
						frm.sltBene.options[x+1] = new Option(strSplit(aryProducts[i][2][x], "|")[0], strSplit(aryProducts[i][2][x], "|")[1]);
						x++;
					} while(x < aryProducts[i][2].length)	
					x=0;					

					frm.sltBene.selectedIndex = 0;								 
													
						
				} else if (aryProducts[i][2].length == 1) { // need to get mnemonic code if only on bene
					frm.sltBene.options[1] = new Option(strSplit(aryProducts[i][2][0], "|")[0], strSplit(aryProducts[i][2][x], "|")[1]);
					frm.sltBene.selectedIndex = 1;			
					displayBene("none");	
				}	
			}
		}
	} else { // else product select is set to defaultValue so remove the bene's 
		clearOptions(frm.sltBene);
	}		
}

function clearOptions(obj) {

	for(y=obj.length-1; y>0; y--) { // remove in reverse order.
		if(obj.options[y].value != "")
			obj.options[y] = null;			
	}
	if (!isNet4x()) {
		displayBene("block");		
	}
}

function displayBene(state) {
	var oppState = "block";
	
	if (state == "block")
		oppState = "none";
			
	document.frmDailyUnitValue.sltBene.style.display = state;			

	if (document.getElementById("DIVSTATICBENE") != null)
		document.getElementById("DIVSTATICBENE").style.display = oppState;
		
}

//  date form objects

function setDefaultDate() { 
	var today = new Date(); 

	frm.sltMonth.selectedIndex = today.getMonth();	
	frm.sltDay.selectedIndex = today.getDate()-1;
	setDefaultYears();	
	setDays(frm.sltMonth);

}

function setDefaultYears() {
	var i=0; 	
	var today = new Date(); 
	var xyear = today.getFullYear();
	var strBeginYear = 1990;
	if (document.location.host.indexOf("pacificlifeandannuity") != -1){
		strBeginYear = 2002;
	}
	
	while(xyear >= strBeginYear) {				
		if(xyear == today.getFullYear())	
			frm.sltYear.options[i] = new Option(xyear, xyear, true, true);
		else 						
			frm.sltYear.options[i] = new Option(xyear, xyear);		
		
		i++;	
		xyear--;		
	}
}

function setDays(objMon){
	var i, x, y, z, days=27;
	var ary30DayMon = new Array(2, 4, 6, 9, 11);
	var selectedMonth = parseInt(objMon.options[objMon.options.selectedIndex].value);
	
	setFrmVar(objMon);
	
	for(i=0; i<ary30DayMon.length; i++){
		if (selectedMonth == ary30DayMon[i]) {			
			if (selectedMonth == 02) { // additional clean up for feb.
				if (isLeapYear())
					days = 28;				
				for(x=frm.sltDay.length-1; x>days; x--) { 
					frm.sltDay.options[x] = null;				
				}				
				if(isLeapYear() && !frm.sltDay.options[28]) // if 29th removed and leap year add 29th							
					frm.sltDay.options[28] = new Option(29, 29);
			}
			
			if ((!frm.sltDay.options[30]) && (selectedMonth != 02)) {
				for(z=27; z<=29; z++) { // add days back to months that have less then 31 days except feb.
					if (!frm.sltDay.options[z])
						frm.sltDay.options[z] = new Option(z+1, z+1);
				}
			}
			 			
			frm.sltDay.options[30] = null;			
			break;
			
		} else if ((!frm.sltDay.options[30]) && (selectedMonth != ary30DayMon[i])) {
			for(y=27; y<=30; y++) { // add days back to months that have 31 days
				if (!frm.sltDay.options[y])
					frm.sltDay.options[y] = new Option(y+1, y+1);
			}
		}	
	}	
}

function isLeapYear() {
	var z=2004;
	var today = new Date();

	while (z <= today.getFullYear()) {
		if (z == frm.sltYear.options[frm.sltYear.selectedIndex].value)
			return true;
		z += 4;		
	}
	return false;	
}

function setYearInception(objProduct) {
	var i, y, aryIncepDate;

	setFrmVar(objProduct);
	setDefaultYears(); // reset all years first	
	
	for(i=0; i<aryProducts.length; i++) {
	
		var selectedProduct = objProduct.options[objProduct.selectedIndex].text;	
		
		// if POS is inactive it should use benes for the (proir to 8-1) version				
		if (selectedProduct == "Pacific One Select") { 
			for (var y=0; y<aryAnnInactiveProducts.length; y++) {
				if (aryAnnInactiveProducts[y] == selectedProduct)
					selectedProduct = "Pacific One Select (prior to 8-1-06)"; 
					// we need to change the name so we show the correct dates
			}			 
		}	
	
		if (selectedProduct == aryProducts[i][0]) {
			aryIncepDate = strSplit(aryProducts[i][1], "/");		
			
		if (frm.name == "frmFundPerformance" && objProduct.options[objProduct.selectedIndex].text == "Pacific One Select")
			//aryIncepDate = new Array (04,02,2001); // this is the only exception so far, so we will hard code for now		
			aryIncepDate = new Array (01,02,1996); 	
				
			for(y=frm.sltYear.length-1; y>0; y--) {	// remove years prevoius to product inception 				
				if (frm.sltYear.options[y].value < aryIncepDate[2]) {
					frm.sltYear.options[y] = null;								
				} 	
			}	
		} 
	}		
}


//  validate and submit duv and performance forms

var aryFrmValues = new Array(); 
function submitPerformance(obj) {
	var submitPath = "";
	var params = "";
	
	setFrmVar(obj);	 	
	
	for(i=0; i<frm.length; i++) {	
		if (frm.elements[i].type == "select-one")
			aryFrmValues[i] = frm.elements[i].options[frm.elements[i].selectedIndex].value;
		else if ((frm.elements[i].name == "fundBeneHidden") || (frm.elements[i].name == "sltProductTemp"))	
			aryFrmValues[i] = frm.elements[i].value;	
	}	
	
	// temp - please save
	// 	displays disclaimer for new Products.
	/*
	if ((getCompanyCode() == "111") && (aryFrmValues[0] == "PVYS" || aryFrmValues[0] == "PVYU" || aryFrmValues[0] == "pvo")) {
		if (frm.name == "frmFundPerformance") {				
			alert("Performance will not be available until 6/5/2007.");
			return;		 		
		} else { //DUV
			alert("Daily Unit Values will not be available until 6/2/2007.");
			return;		
		}
	}
	*/	
	//end temp		
	
	if (validatePerformance()) {
		if (frm.name == "frmFundPerformance") {
			submitPath = "/--/performance/PerfSrv/Performance/displayFunds?"
			params = "company_code=" + getCompanyCode() +
					 "&performanceMonth=" + aryFrmValues[1] +
					 "&performanceDay=" + aryFrmValues[2] +
					 "&performanceYear=" + aryFrmValues[3] +
					 "&VAI_CALC_TYPE=D&VAI_PRODUCT_MNEMONIC=" + aryFrmValues[0];
			
			//bb removed - Performance Update is its own tab.
			//fncLoadPerformanceUpdate("IFRM_DAILY");
			//document.getElementById("IFRM_DAILY").height = "4030px"; 
			document.getElementById("IFRM_DAILY").src = submitPath + params;
			strLastSubmitUrl = submitPath + params;
			document.getElementById("IFRM_DAILY").style.display = "block";
			
		} else { // daily unit values 
			submitPath = "/--/performance/DailyValues.jsp?"		
			params = "company_code=" + getCompanyCode() +
					 "&rep_type=" + aryFrmValues[1] + 
					 "&duvDateMonth=" + aryFrmValues[2] +
					 "&duvDateDay=" + aryFrmValues[3] +
					 "&duvDateYear=" + aryFrmValues[4];		 
			
					 			
			
			
			//document.getElementById("IFRM_DUV").height = "1180px";
			document.getElementById("IFRM_DUV").src = submitPath + params;
			strLastSubmitUrl = submitPath + params;
			document.getElementById("IFRM_DUV").style.display = "block";
			//window.frames[0].document.location.href = submitPath + params;
		}					
	}			
}

function validatePerformance() {
	var badDate = false;	
	var aryIncepDate = "", aryIncepDateBene = "";
	var strSelectedBene, strMnemonic;
	var appName = "the Daily Unit Values"
	var boolBeneErrorMsg = false;
	
	if (frm.name == "frmFundPerformance")
		appName = "Daily Performance";	
	
	if (aryFrmValues.length > 0) { // do we have all the values
		if (aryFrmValues[0] == "")	{
			alert ("Please select a Product to view " + appName + ".");	
			return false;
		}
			
		if (aryFrmValues[1] == "") {
			alert ("Please select a Death Benefit to view the Daily Unit Values.");
			return false;
		}		
	}	
	
	var strHost = document.location.host.toLowerCase();
	
	for(var i=0; i<aryProducts.length; i++) { // loop products		
		
		var selectedProduct = frm.sltProduct.options[frm.sltProduct.selectedIndex].text;	
		
		// if POS is inactive it should use benes for the (proir to 8-1) version				
		if (selectedProduct == "Pacific One Select") { 
			for (var y=0; y<aryAnnInactiveProducts.length; y++) {
				if (aryAnnInactiveProducts[y] == selectedProduct)
					selectedProduct = "Pacific One Select (prior to 8-1-06)"; 
			}			 
		}			
		
		// find all the dates
		if (selectedProduct == aryProducts[i][0]) {
		
			//alert("inside prod name check.....");
						
			if (frm.name != "frmFundPerformance") { // daily unit values
				aryIncepDate = strSplit(aryProducts[i][1], "/"); // product inception date			
				aryBeneData = aryProducts[i][2]; // benenfits array				
					
				//loop thru benefits and get inception date	
				for (var j=0; j<aryBeneData.length; j++) { 					
					 strSelectedBene = new String(frm.sltBene.options[frm.sltBene.selectedIndex].value);
					 strMnemonic = strSplit(aryBeneData[j], "|")[1];		 					
	
					if (strSelectedBene.indexOf(strMnemonic) != -1) { //find selected bene
						aryBeneIncepDate = strSplit(aryBeneData[j], "|")[2]; 
						aryBeneIncepDate = strSplit(aryBeneIncepDate, "/"); //make sure bene date is passed as array	
							
						//-------------------------------------------------------
						// Temp - Remove on 3/4/2008						
							/*
							if (strMnemonic == "JRNS" || strMnemonic == "JRNU") {
								alert("Daily Unit Values not available until 03/04/2008.");				
								return false;								
							}
							*/	
						// End Temp 					
						//-------------------------------------------------------					
													
							
						if (aryBeneIncepDate.toString() != aryIncepDate.toString()) { 
							aryIncepDate = aryBeneIncepDate;  // if the prod date and bene date are different set the incep date equal bene date.
							var boolBeneErrorMsg = true;
							break;
						}												
					}
				}
					
			} else { // daily performance
				aryIncepDate = strSplit(aryProducts[i][3], "/"); // 1st day of the next quarter	from product inception
			}		
		} 			
	}
	
	
	
	
	//This added because parseInt was returning 0 when the string was "08" or "09"	
	var testaryIncepDate0 = aryIncepDate[0];	
	if (testaryIncepDate0 == "08"){
		testaryIncepDate0 = "8";
	}else if (testaryIncepDate0 == "09") {
		testaryIncepDate0 = "9";
	}else{
		testaryIncepDate0 = aryIncepDate[0];
	}
	
	//added because DUV and Daily Performance have the dates at different locations in the array
	var currentFormMonth;
	var currentFormDay;
	var currentFormYear;	
	
	if (frm.name != "frmFundPerformance") { // daily unit values
		currentFormMonth = aryFrmValues[2];
		currentFormDay = aryFrmValues[3];
		currentFormYear = aryFrmValues[4];
	}else{
		currentFormMonth = aryFrmValues[1];
		currentFormDay = aryFrmValues[2];
		currentFormYear = aryFrmValues[3];		
	}
	
	if(currentFormDay == "08"){
		currentFormDay = "8";
	}else if(currentFormDay == "09") {
		currentFormDay = "9";
	}	
	
	if ( parseInt(currentFormYear) < parseInt(aryIncepDate[2])) 
		badDate = true;				
	if ( parseInt(currentFormYear) == parseInt(aryIncepDate[2])) {		 
		if ( parseInt(currentFormMonth) < parseInt(testaryIncepDate0)) 
			badDate = true;				
		if ( parseInt(currentFormMonth) == parseInt(testaryIncepDate0)) {
			if ( parseInt(currentFormDay) < parseInt(aryIncepDate[1]))
				badDate = true;										 
		}					
	}	
	
	if (badDate) {
		var strMsg = "Please enter a date on or after " + aryIncepDate.join("/");
		if (boolBeneErrorMsg)
			strMsg += " for the selected Death Benefit.";
		else
			strMsg += ".";
		
		alert(strMsg);
		return false;
	}
	
	// is date in the future
	var today = new Date(); 
	var todayMonth = today.getMonth()+1;	
	var todayDate = today.getDate();	
	var todayYear = today.getFullYear();
	
	if (currentFormYear == todayYear) {		
		if (currentFormMonth >= todayMonth) {				
			if (currentFormMonth > todayMonth) {			
				badDate = true;			
			} else {  
				if (currentFormDay > todayDate)
					badDate = true;
			}
		}
		
		if (badDate) {
			alert("Please enter a valid date.");
			return false;
		}
	}		
	return true;			
}


// temp - remove after 10/1/2005
function launchDisclaimerWin() {
	//alert("Daily Performance unavailable until October 1, 2005.");
	//window.open("/public/performance/panda_new_prod_message.html", "perfDisclaimerWin", "width=350,height=250,menubar=no,resizable=no,scrollbars=no");			
}
// end temp


// Fund controls for DUV and Calendar
//Fund Specific Information - Right Nav
var userAgent = navigator.userAgent.toLowerCase();
var userApp = navigator.appName.toLowerCase();
var userVersion = parseFloat(navigator.appVersion);
var userAppVersion = navigator.appVersion.toLowerCase();

function mouseOverIcon(obj){
	if (obj.style.color.toLowerCase() != "#000000" && obj.style.color.toLowerCase() != "rgb(0, 0, 0)") {	// not disabled
		if (userVersion == 4 && userAgent.indexOf("msie 5.0") != -1){
			obj.style.cursor = "hand";
		}else{
			obj.style.cursor = "pointer";
		}
		obj.style.textDecoration = "none";
	}
}

function mouseOutIcon(obj) {
	if (obj.style.color.toLowerCase() != "#000000" && obj.style.color.toLowerCase() != "rgb(0, 0, 0)") {	// not disabled
		obj.style.cursor = "default";
		obj.style.textDecoration = "underline";
	}
}

var aryFundLayers = new Array("DIV_FUND_CALENDAR","DIV_FUND_PERFORMANCE","DIV_DAILY_PERFORMANCE","DIV_VALUE_LIST");
var aryFundTitles = new Array("Fund Calendar","Fund Performance","Daily Performance","Daily Unit Values");
var aryFundLinks = new Array("TD_FUND_CALENDAR","TD_FUND_PERFORMANCE","TD_DAILY_PERFORMANCE","TD_VALUE_LIST");
var strPageUrl = document.location.href;

function fncGetFundParameters(){
	var aryPageUrlParams = strPageUrl.split("?");
	aryPageUrlParams = aryPageUrlParams[1].split("&");
	var aryCompanyCode;
	var aryRepType;
	var aryDate;
	var strMonth;
	var strDay;
	var strYear;
	
	for(var i = 0; i < aryPageUrlParams.length; i++){
		if(aryPageUrlParams[i].indexOf("company_code") != -1){
			aryCompanyCode = aryPageUrlParams[i].split("=");
		}
		if(aryPageUrlParams[i].indexOf("product_mnemonic") != -1){
			aryRepType = aryPageUrlParams[i].split("=");
		}
		if(aryPageUrlParams[i].indexOf("value_date") != -1){
			aryDate = aryPageUrlParams[i].split("=");
			aryDate = aryDate[1].split("/");
			strMonth = aryDate[0];
			strDay = aryDate[1];
			strYear = aryDate[2];
		}
	}
	var strParameters = "/--/performance/DailyValues.jsp?company_code=" + aryCompanyCode[1] +
							"&rep_type=" + aryRepType[1] + 
							"&duvDateMonth=" + strMonth +
							"&duvDateDay=" + strDay +
							"&duvDateYear=" + strYear;
	return strParameters;
}

/* ---- OLD function ---- */
function fncChangeDuvFrameHeight(strFundView){
	if(strFundView == "TD_VALUE_LIST"){
		parent.document.getElementById("IFRM_DUV").height = "1180px";
	}else{
		parent.document.getElementById("IFRM_DUV").height = "600px";
	}
}

/* ----- dynamic iframe height ------- */
/*************************************************************************
  This code is from Dynamic Web Coding at http://www.dyn-web.com/
  See Terms of Use at http://www.dyn-web.com/bus/terms.html
  regarding conditions under which you may use this code.
  This notice must be retained in the code as is!
*************************************************************************/
function getDocHeight(doc) {
  var docHt = 0, sh, oh;
  if (doc.height) docHt = doc.height;
  else if (doc.body) {
    if (doc.body.scrollHeight) docHt = sh = doc.body.scrollHeight;
    if (doc.body.offsetHeight) docHt = oh = doc.body.offsetHeight;
    if (sh && oh) docHt = Math.max(sh, oh);
  }
  return docHt;
}

function setIframeHeight(iframeName) {
  var iframeWin = window.frames[iframeName];
  var iframeEl = document.getElementById? document.getElementById(iframeName): document.all? document.all[iframeName]: null;
  if ( iframeEl && iframeWin ) {  
    iframeEl.style.height = "auto"; // helps resize (for some) if new doc shorter than previous  
    var docHt = getDocHeight(iframeWin.document);
    // need to add to height to be sure it will all show	
    if (docHt) iframeEl.style.height = docHt + 30 + "px";
	if (document.getElementById('BGBLOCK')) 
		document.getElementById('BGBLOCK').style.height = docHt + 500 + "px";
  }
}

function fncCheckFund(strFundView){
	var strSelectValue = document.frmFundInfo.selGetFund.options[document.frmFundInfo.selGetFund.selectedIndex].value;
	
	if(strSelectValue > "" || strFundView == "TD_VALUE_LIST"){
		if(strPageUrl.indexOf("DailyValues") == -1 && strFundView == "TD_VALUE_LIST"){	//not daily unit values page
			//document.location.href = fncGetFundParameters();
			parent.document.frmDailyUnitValue.btnSubmitPerformance.click();
			//fncChangeDuvFrameHeight("TD_VALUE_LIST");
		}else{			
		  
		 /* temporary block until end of quarter for new funds - save for future use 
		 
			if(strFundView == "TD_FUND_PERFORMANCE" && strSelectValue.indexOf("fund_no=970") != -1 ) { 
				alert("Quarterly Fund Performance will not be available until January 4, 2010.");
				return false;
			}	
							
		  end temp alert */
		
			for(var i = 0; i < aryFundLinks.length; i++){
				if(aryFundLinks[i] == strFundView){		//selected fund view				
					if (document.getElementById(aryFundLinks[i])) {
						document.getElementById(aryFundLinks[i]).style.textDecoration = "none";
						document.getElementById(aryFundLinks[i]).style.color = "#000000";
						document.getElementById(aryFundLinks[i]).style.fontWeight = "bold";
						//document.getElementById(aryFundLayers[i]).style.display = "block";
					}						
					
					if(strPageUrl.indexOf("DailyValues") == -1){	//not daily unit values page
						
						/*if(strFundView == "TD_VALUE_LIST"){
							document.location.href = fncGetFundParameters();
							break;
						}else{*/
						
							if (aryFundLayers[i] == "DIV_FUND_PERFORMANCE") // always show standard on fund performance 
								document.getElementById('idDeathBene').innerHTML = "Standard Death Benefit";
							else
								document.getElementById('idDeathBene').innerHTML = getDeathBenefit();							
							
							document.getElementById(aryFundLayers[i]).style.display = "block";
							fncDisplayDisclaimer(i);
							//fncChangeDuvFrameHeight("TD_VALUE_LIST");
							//parent.document.getElementById("IFRM_DUV").height = "570px";
						//}
					}else{
						if(strFundView != "TD_VALUE_LIST"){							
							document.location.href = document.frmFundInfo.selGetFund.value + "&divid=" + aryFundLayers[i];
							//fncChangeDuvFrameHeight("");
						}
					}
				}else if (document.getElementById(aryFundLinks[i])){
					document.getElementById(aryFundLinks[i]).style.textDecoration = "underline";
					document.getElementById(aryFundLinks[i]).style.color = "#3399CC";
					document.getElementById(aryFundLinks[i]).style.fontWeight = "bold";
					//document.getElementById(aryFundLayers[i]).style.display = "none";
					if(strFundView != "new"){
						if(strPageUrl.indexOf("DailyValues") == -1){
							document.getElementById(aryFundLayers[i]).style.display = "none"
						}
					}
				}
			}
		}
	}else{
		alert("Select a fund.");
	}
}

