// delmac audience jquery

//finding what fundcenter page we're on 
var url = window.location.href;
	if( url.match("FundOverviewCX") ) {
		page = "Overview";
		isfundcenter = "yes";
	} else if ( url.match("FundCharacteristicsCX") ) {
		page = "Characteristics";
		isfundcenter = "yes";
	} else if ( url.match("FundHoldingsCX") ) {
		page = "Holdings";
		isfundcenter = "yes";
	} else if ( url.match("FundLiteratureCX") ) {
		page = "Literature";
		isfundcenter = "yes";
	} else if ( url.match("FundPerformanceCX") ) {
		page = "Performance";
		isfundcenter = "yes";
	} else if ( url.match("FundFactsCX") ) {
		page = "Fund facts";
		isfundcenter = "yes";
	} else if ( url.match("FundDistributionsCX") ) {
		page = "Distributions";
		isfundcenter = "yes";
	} else if ( url.match("PrinterFriendly_Fund_InfoCX") ) {
		page = "fund_summary";
		isfundcenter = "yes";
	} else if ( url.match("FundFeaturesCX") ) {
		page = "Features";
		isfundcenter = "yes";
	} else if ( url.match("FundManagerCX") ) {
		page = "Fund managers";
		isfundcenter = "yes";
	} else if ( url.match("/prd/mut/dnn") ) {
		page = "Overview";
		isfundcenter = "yes";
	} else if ( url.match("/prd/mut/gro/") ) {
		page = "gro";
		isfundcenter = "no";
	} else if ( url.match("/prd/mut/fix/") ) {
		page = "fix";
		isfundcenter = "no";
	} else if ( url.match("/prd/mut/bln/") ) {
		page = "cor";
		isfundcenter = "no";
	} else if ( url.match("/prf/mut/") ) {
		page = "ag_prf";
		isfundcenter = "yes";
	} else{
		page = "";
		isfundcenter = "no";
	}
	

// start of jquery
$(document).ready(function(){

var overview_len = $("h1:contains('Overview')").length;
if(overview_len>0){
	page = "Overview";
	isfundcenter = "yes";
}

//Replacing all Shareholder lit links on fund centers
if(isfundcenter == "yes"){
	var new_lit_lnk = "<a href='http://www.lfg.com/LincolnPageServer?LFGPage=/lfg/delmac/shr/rpt/index.html' class='l4-item'>Shareholder literature</a>";
	var new_pros_lnk = "<a href='http://www.lfg.com/LincolnPageServer?LFGPage=/lfg/delmac/shr/rpt/index.html' class='l4-item'>Prospectus</a>";
	$(".l4-item:contains('Shareholder literature')").replaceWith(new_lit_lnk);		
	$(".l4-item:contains('Prospectus')").replaceWith(new_pros_lnk);
}

//replaceing prospectus disclosure on all funds until SW#3903 is completed
$("p b:contains('Carefully consider')").not("#lit_pg").replaceWith("<b class='bodyText'>Carefully consider the Fund's investment objectives, risk factors, charges, and expenses before investing. This and other information can be found in the Fund's prospectus, which may be obtained by visiting <a href='http://www.lfg.com/lfg/delmac/shr/rpt/index.html'>www.delawareinvestments.com/literature</a> or calling 800 523-1918. Investors should read the prospectus carefully before investing.</b>");

/*Expire: searches all "a" tags with title attributes
(which should be in yyyymmdd format)and if they are 
less than or equal to today's date they are hidden*/
$("a")
	.filter(function (index) {
		  return ($(this).attr("title") != "") && ($(this).attr("title") <= today);//today is defined at the top
		})
	.hide();

/*adding column to fund facts table for waiver dates from an xml file
and adding a disclosure depending on if its Contractual or Voluntary*/
if(page == "Fund facts"||page == "fund_summary"||page == "inst_prf"){

	if(page == "Fund facts"||page == "fund_summary"){
		var pg_fnd_cod = url.substr(url.length - 2).toUpperCase();
		
		//adding footnote and link to it for cdsc as per Jim Oneal for foundation equity fund
		if (pg_fnd_cod == 'G8'){
			var aclsmxcdsc = $('b:contains("Max CDSC")').parent().next().text();
			var new_aclsmxcdsc = aclsmxcdsc + "<a href='#mxcdscdis'><sup>1</sup></a>";
			$('b:contains("Max CDSC")').parent().next().html(new_aclsmxcdsc);
			var mxcdscdis = "<a name='mxcdscdis'/><p class='legalText'><sup>1</sup> A purchase of Class A shares of $1 million or more may be made at net asset value (NAV). However, if you buy the shares through a financial advisor who is paid a commission, a contingent deferred sales charge will apply to redemptions made within one year of purchase (Limited CDSC). Additional Class A purchase options that involve a contingent deferred sales charge (CDSC) may be permitted from time to time and will be disclosed in the Prospectus if they are available.</p>";
			$('b:contains("Max CDSC")').parents('table:first').after(mxcdscdis);
		} //end if G8
		
		//per compliance code 5452; will be fixed with SW#3907
		$("b:contains('CDSC')").replaceWith("<b class='bodyText'>Max contingent deferred sales charge (CDSC)</b>");
		
	}else if(page == "inst_prf"){
		var inst_ary = url.split("/");
		if(inst_ary.length > 11){
			var plcment = inst_ary.length -1;
			var pg_fnd_cod = inst_ary[plcment];
		}else{
			var pg_fnd_cod = inst_ary[8];
		}
	}//end if page == "Fund facts"||page == "fund_summary"
	
	$.ajax({
		url: 'http://www.lfg.com/lfg/delmac/includes/fund_exp_limits_dis.xml',
		type: 'GET',
		dataType: 'xml',
		timeout: 1000,
		success: function(data){
			$(data).find('Fund').each(function() {
				var $fund = $(this);
				var xml_fund_code = $fund.find('fund_code').text();
				var expns_dis = $fund.find('disclosure').text();

				//if the fund code from the xml doc matches the fund of the page we're on then display the dates
				if(xml_fund_code == pg_fnd_cod){
					var dis_para = "<p class='legalText'>"+expns_dis+"</p>";
					var dis_para_ishr = "<p id='fees_waivers' class='disclosure_482'>"+expns_dis+"</p>";
					$("b:contains('Gross expense ratio')").parents("table:first").after(dis_para);
					$("#ishare-expenses").after(dis_para_ishr);
				}
			});//ending .each function
		}
	}); //ending ajax to bring in xml
	
	//hiding the printer friendly button because the jquery above doesn't print w/it.
	$('img[src$="/lfg/img/common/b_printfriendly.gif"]').parents('a:first').hide();
	
}//end fund facts page if for waivers info

if(page == "ag_prf"){
	$('#231').parent().hide();
	$('#231').parent().next().hide();
	$('#231').parent().next().next().hide();
	$('#231').parent().next().next().next().hide();
	$('#231').parent().next().next().next().next().hide();
	$('#231').parent().next().next().next().next().next().hide();
	$('#231').parent().next().next().next().next().next().next().hide();
	$('#231').parent().next().next().next().next().next().next().next().hide();
	$('#231').parent().next().next().next().next().next().next().next().next().hide();
	$("p:contains('Lincoln National')").replaceWith("<p class='bodyText'>The Fund is distributed by <b class='bodyText'>Delaware Distributors, L.P.</b>, an affiliate of DMHI, and MGL.</p>");
}

//Portfolio Characteristics; if we're on the characteristics page then run
if(page == "Characteristics"){
	$.getScript("http://www.lfg.com/lfg/delmac/js/port_char.js");
};
	
//adding SEC Yield without waiver for All funds
if(page=="Distributions"){
	var delcb = $("h1:contains('Delaware Core Bond')").html();
	var delhyo = $("h1:contains('Delaware High-Yield Opportunities')").html();
	var delcpb = $("h1:contains('Delaware Core Plus Bond')").html();
	var dellmtdiv = $("h1:contains('Delaware Limited-Term Diversified')").html();
	var deltfpa = $("h1:contains('Delaware Tax-Free Pennsylvania')").html();
	var deltfusa = $("h1:contains('Delaware Tax-Free USA Fund')").html();
	var deltfusitr = $("h1:contains('Delaware Tax-Free USA Intermediate')").html();
	var deldivinc = $("h1:contains('Delaware Diversified Income')").html();
	var delextdur = $("h1:contains('Delaware Extended Duration Bond')").html();
	var delcorp = $("h1:contains('Delaware Corporate Bond')").html();
	var deltfmin = $("h1:contains('Delaware Tax-Free Minnesota Fund')").html();
	var deltfminint = $("h1:contains('Delaware Tax-Free Minnesota Intermediate')").html();
	var delminhymb = $("h1:contains('Delaware Minnesota High-Yield')").html();
	var deltfaz = $("h1:contains('Delaware Tax-Free Arizona')").html();
	var delcal = $("h1:contains('Delaware Tax-Free California')").html();
	var delcol = $("h1:contains('Delaware Tax-Free Colorado')").html();
	var deltfid = $("h1:contains('Delaware Tax-Free Idaho')").html();
	var deltfny = $("h1:contains('Delaware Tax-Free New York')").html();
	var delnathymb = $("h1:contains('Delaware National High-Yield Municipal')").html();
	var delinpb = $("h1:contains('Delaware Inflation Protected Bond')").html();
	var dellcv = $("h1:contains('Delaware Large Cap Value')").html();
	var delreit = $("h1:contains('Delaware REIT')").html();
	var deldivdinc = $("h1:contains('Delaware Dividend Income')").html();
	var delintval = $("h1:contains('Delaware International Value Equity')").html();
	var delemgmrk = $("h1:contains('Delaware Emerging Markets')").html();
	var delglbval = $("h1:contains('Delaware Global Value')").html();
	var delval = $("h1:contains('Delaware Value')").html();
	var delgrwap = $("h1:contains('Growth Allocation Fund')").html();
	var delconap = $("h1:contains('Conservative Allocation Fund')").html();
	var delmodap = $("h1:contains('Moderate Allocation Fund')").html();

	if(delcb != null){
		var secyield_nowav = "<tr><td class='bodyText' width='50%'><b class='bodyText'>SEC yield without waiver</b> (Class A as of 02/28/10)</td><td class='bodyText' width='50%'>0.42%</td></tr>"
		$("b.bodyText:contains('SEC yield')").append(' with waiver');
		$("b.bodyText:contains('SEC yield')").parents('tr:first').after(secyield_nowav);
	}else if(delhyo != null){
		var secyield_nowav = "<tr><td class='bodyText' width='50%'><b class='bodyText'>SEC yield without waiver</b> (Class A as of 02/28/10)</td><td class='bodyText' width='50%'>8.71%</td></tr>"
		$("b.bodyText:contains('SEC yield')").append(' with waiver');
		$("b.bodyText:contains('SEC yield')").parents('tr:first').after(secyield_nowav);
	}else if(delcpb != null){
		var secyield_nowav = "<tr><td class='bodyText' width='50%'><b class='bodyText'>SEC yield without waiver</b> (Class A as of 02/28/10)</td><td class='bodyText' width='50%'>3.64%</td></tr>"
		$("b.bodyText:contains('SEC yield')").append(' with waiver');
		$("b.bodyText:contains('SEC yield')").parents('tr:first').after(secyield_nowav);
	}else if(dellmtdiv != null){
		var secyield_nowav = "<tr><td class='bodyText' width='50%'><b class='bodyText'>SEC yield without waiver</b> (Class A as of 02/28/10)</td><td class='bodyText' width='50%'>2.27%</td></tr>"
		$("b.bodyText:contains('SEC yield')").append(' with waiver');
		$("b.bodyText:contains('SEC yield')").parents('tr:first').after(secyield_nowav);
	}else if(deltfpa != null){
		var secyield_nowav = "<tr><td class='bodyText' width='50%'><b class='bodyText'>SEC yield without waiver</b> (Class A as of 02/28/10)</td><td class='bodyText' width='50%'>3.81%</td></tr>"
		$("b.bodyText:contains('SEC yield')").append(' with waiver');
		$("b.bodyText:contains('SEC yield')").parents('tr:first').after(secyield_nowav);
	}else if(deltfusa != null){
		var secyield_nowav = "<tr><td class='bodyText' width='50%'><b class='bodyText'>SEC yield without waiver</b> (Class A as of 02/28/10)</td><td class='bodyText' width='50%'>3.40%</td></tr>"
		$("b.bodyText:contains('SEC yield')").append(' with waiver');
		$("b.bodyText:contains('SEC yield')").parents('tr:first').after(secyield_nowav);
	}else if(deltfusitr != null){
		var secyield_nowav = "<tr><td class='bodyText' width='50%'><b class='bodyText'>SEC yield without waiver</b> (Class A as of 02/28/10)</td><td class='bodyText' width='50%'>2.46%</td></tr>"
		$("b.bodyText:contains('SEC yield')").append(' with waiver');
		$("b.bodyText:contains('SEC yield')").parents('tr:first').after(secyield_nowav);
	}else if(deldivinc != null){
		var secyield_nowav = "<tr><td class='bodyText' width='50%'><b class='bodyText'>SEC yield without waiver</b> (Class A as of 02/28/10)</td><td class='bodyText' width='50%'>4.99%</td></tr>"
		$("b.bodyText:contains('SEC yield')").append(' with waiver');
		$("b.bodyText:contains('SEC yield')").parents('tr:first').after(secyield_nowav);
	}else if(delextdur != null){
		var secyield_nowav = "<tr><td class='bodyText' width='50%'><b class='bodyText'>SEC yield without waiver</b> (Class A as of 02/28/10)</td><td class='bodyText' width='50%'>5.03%</td></tr>"
		$("b.bodyText:contains('SEC yield')").append(' with waiver');
		$("b.bodyText:contains('SEC yield')").parents('tr:first').after(secyield_nowav);
	}else if(delcorp != null){
		var secyield_nowav = "<tr><td class='bodyText' width='50%'><b class='bodyText'>SEC yield without waiver</b> (Class A as of 02/28/10)</td><td class='bodyText' width='50%'>4.69%</td></tr>"
		$("b.bodyText:contains('SEC yield')").append(' with waiver');
		$("b.bodyText:contains('SEC yield')").parents('tr:first').after(secyield_nowav);
	}else if(deltfmin != null){
		var secyield_nowav = "<tr><td class='bodyText' width='50%'><b class='bodyText'>SEC yield without waiver</b> (Class A as of 02/28/10)</td><td class='bodyText' width='50%'>2.57%</td></tr>"
		$("b.bodyText:contains('SEC yield')").append(' with waiver');
		$("b.bodyText:contains('SEC yield')").parents('tr:first').after(secyield_nowav);
	}else if(deltfminint != null){
		var secyield_nowav = "<tr><td class='bodyText' width='50%'><b class='bodyText'>SEC yield without waiver</b> (Class A as of 02/28/10)</td><td class='bodyText' width='50%'>2.09%</td></tr>"
		$("b.bodyText:contains('SEC yield')").append(' with waiver');
		$("b.bodyText:contains('SEC yield')").parents('tr:first').after(secyield_nowav);
	}else if(delminhymb != null){
		var secyield_nowav = "<tr><td class='bodyText' width='50%'><b class='bodyText'>SEC yield without waiver</b> (Class A as of 02/28/10)</td><td class='bodyText' width='50%'>3.27%</td></tr>"
		$("b.bodyText:contains('SEC yield')").append(' with waiver');
		$("b.bodyText:contains('SEC yield')").parents('tr:first').after(secyield_nowav);
	}else if(deltfaz != null){
		var secyield_nowav = "<tr><td class='bodyText' width='50%'><b class='bodyText'>SEC yield without waiver</b> (Class A as of 02/28/10)</td><td class='bodyText' width='50%'>3.24%</td></tr>"
		$("b.bodyText:contains('SEC yield')").append(' with waiver');
		$("b.bodyText:contains('SEC yield')").parents('tr:first').after(secyield_nowav);
	}else if(delcal != null){
		var secyield_nowav = "<tr><td class='bodyText' width='50%'><b class='bodyText'>SEC yield without waiver</b> (Class A as of 02/28/10)</td><td class='bodyText' width='50%'>3.97%</td></tr>"
		$("b.bodyText:contains('SEC yield')").append(' with waiver');
		$("b.bodyText:contains('SEC yield')").parents('tr:first').after(secyield_nowav);
	}else if(delcol != null){
		var secyield_nowav = "<tr><td class='bodyText' width='50%'><b class='bodyText'>SEC yield without waiver</b> (Class A as of 02/28/10)</td><td class='bodyText' width='50%'>3.22%</td></tr>"
		$("b.bodyText:contains('SEC yield')").append(' with waiver');
		$("b.bodyText:contains('SEC yield')").parents('tr:first').after(secyield_nowav);
	}else if(deltfid != null){
		var secyield_nowav = "<tr><td class='bodyText' width='50%'><b class='bodyText'>SEC yield without waiver</b> (Class A as of 02/28/10)</td><td class='bodyText' width='50%'>2.57%</td></tr>"
		$("b.bodyText:contains('SEC yield')").append(' with waiver');
		$("b.bodyText:contains('SEC yield')").parents('tr:first').after(secyield_nowav);
	}else if(deltfny != null){
		var secyield_nowav = "<tr><td class='bodyText' width='50%'><b class='bodyText'>SEC yield without waiver</b> (Class A as of 02/28/10)</td><td class='bodyText' width='50%'>2.92%</td></tr>"
		$("b.bodyText:contains('SEC yield')").append(' with waiver');
		$("b.bodyText:contains('SEC yield')").parents('tr:first').after(secyield_nowav);
	}else if(delnathymb != null){
		var secyield_nowav = "<tr><td class='bodyText' width='50%'><b class='bodyText'>SEC yield without waiver</b> (Class A as of 02/28/10)</td><td class='bodyText' width='50%'>4.80%</td></tr>"
		$("b.bodyText:contains('SEC yield')").append(' with waiver');
		$("b.bodyText:contains('SEC yield')").parents('tr:first').after(secyield_nowav);
	}else if(delinpb != null){
		var secyield_nowav = "<tr><td class='bodyText' width='50%'><b class='bodyText'>SEC yield without waiver</b> (Class A as of 02/28/10)</td><td class='bodyText' width='50%'>-1.00%</td></tr>"
		$("b.bodyText:contains('SEC yield')").append(' with waiver');
		$("b.bodyText:contains('SEC yield')").parents('tr:first').after(secyield_nowav);
	}else if(dellcv != null){
		var secyield_nowav = "<tr><td class='bodyText' width='50%'><b class='bodyText'>SEC yield without waiver</b> (Class A as of 02/28/10)</td><td class='bodyText' width='50%'>1.71%</td></tr>"
		$("b.bodyText:contains('SEC yield')").append(' with waiver');
		$("b.bodyText:contains('SEC yield')").parents('tr:first').after(secyield_nowav);
	}else if(delintval != null){
		var secyield_nowav = "<tr><td class='bodyText' width='50%'><b class='bodyText'>SEC yield without waiver</b> (Class A as of 02/28/10)</td><td class='bodyText' width='50%'>1.18%</td></tr>"
		$("b.bodyText:contains('SEC yield')").append(' with waiver');
		$("b.bodyText:contains('SEC yield')").parents('tr:first').after(secyield_nowav);
	}else if(delreit != null){
		var secyield_nowav = "<tr><td class='bodyText' width='50%'><b class='bodyText'>SEC yield without waiver</b> (Class A as of 02/28/10)</td><td class='bodyText' width='50%'>0.72%</td></tr>"
		$("b.bodyText:contains('SEC yield')").append(' with waiver');
		$("b.bodyText:contains('SEC yield')").parents('tr:first').after(secyield_nowav);
	}else if(delemgmrk != null){
		var secyield_nowav = "<tr><td class='bodyText' width='50%'><b class='bodyText'>SEC yield without waiver</b> (Class A as of 02/28/10)</td><td class='bodyText' width='50%'>18.00%</td></tr>"
		$("b.bodyText:contains('SEC yield')").append(' with waiver');
		$("b.bodyText:contains('SEC yield')").parents('tr:first').after(secyield_nowav);
	}else if(deldivdinc != null){
		var secyield_nowav = "<tr><td class='bodyText' width='50%'><b class='bodyText'>SEC yield without waiver</b> (Class A as of 02/28/10)</td><td class='bodyText' width='50%'>4.13%</td></tr>"
		$("b.bodyText:contains('SEC yield')").append(' with waiver');
		$("b.bodyText:contains('SEC yield')").parents('tr:first').after(secyield_nowav);
	}else if(delval != null){
		var secyield_nowav = "<tr><td class='bodyText' width='50%'><b class='bodyText'>SEC yield without waiver</b> (Class A as of 02/28/10)</td><td class='bodyText' width='50%'>1.57%</td></tr>"
		$("b.bodyText:contains('SEC yield')").append(' with waiver');
		$("b.bodyText:contains('SEC yield')").parents('tr:first').after(secyield_nowav);
	}else if(delconap != null){
		var secyield_nowav = "<tr><td class='bodyText' width='50%'><b class='bodyText'>SEC yield without waiver</b> (Class A as of 02/28/10)</td><td class='bodyText' width='50%'>2.59%</td></tr>"
		$("b.bodyText:contains('SEC yield')").append(' with waiver');
		$("b.bodyText:contains('SEC yield')").parents('tr:first').after(secyield_nowav);
	}else if(delmodap != null){
		var secyield_nowav = "<tr><td class='bodyText' width='50%'><b class='bodyText'>SEC yield without waiver</b> (Class A as of 02/28/10)</td><td class='bodyText' width='50%'>2.11%</td></tr>"
		$("b.bodyText:contains('SEC yield')").append(' with waiver');
		$("b.bodyText:contains('SEC yield')").parents('tr:first').after(secyield_nowav);
	}else if(delgrwap != null){
		var secyield_nowav = "<tr><td class='bodyText' width='50%'><b class='bodyText'>SEC yield without waiver</b> (Class A as of 02/28/10)</td><td class='bodyText' width='50%'>0.94%</td></tr>"
		$("b.bodyText:contains('SEC yield')").append(' with waiver');
		$("b.bodyText:contains('SEC yield')").parents('tr:first').after(secyield_nowav);
	}else if(delglbval != null){
		var secyield_nowav = "<tr><td class='bodyText' width='50%'><b class='bodyText'>SEC yield without waiver</b> (Class A as of 02/28/10)</td><td class='bodyText' width='50%'>0.49%</td></tr>"
		$("b.bodyText:contains('SEC yield')").append(' with waiver');
		$("b.bodyText:contains('SEC yield')").parents('tr:first').after(secyield_nowav);
	}
}

/***************************************************************************/
/****************Finding the cport code for each fund***********************/
/***************************************************************************/
	//Figures out what fund you are in for fund center pages by fund code
	//Internet Explorer changes anchor tags to uppercase
	if(navigator.appName == "Microsoft Internet Explorer"){
		var fund_code_href = $("a.l4-item:first").attr("href");
	}else{
		var fund_code_href = $("a:contains('Account features')").attr("href");
	}

	if(fund_code_href != null ||page == "fund_summary"){
		if(fund_code_href != null){
			var fund_code = fund_code_href.substr(fund_code_href.length - 2);
		}else{
			var fund_code = url.substr(url.length - 2);
		}
		//Amer Serv, Grwth Opps, Trend
		if(fund_code == "FB" ||fund_code == "DF" ||fund_code == "D3"){
			if(page == "Overview"){
				//moving the disclosure on the overview pg below the strat per Jim O
				var fund_evnt_dis = $('#fund_specific_emergency').html();
				$('#fund_specific_emergency').hide();
				var fund_evnt_dis_html = "<tr><td colspan='3' class='legalText'>" +fund_evnt_dis+ "</td></tr>";
				$("h4:contains('Main investment strategies')").parents("tr:first").siblings().eq(3).after(fund_evnt_dis_html);
			}
			//emergency message not showing up on these pages
			if(page == "Holdings" ||page == "Literature" ||page == "Performance" ||page == "Distributions" ||page == "Features" ||page == "Fund managers"){
				$('.legalText:first').before("<p class='legalText'>On January 21, 2010, the Board of Trustees of the Fund approved certain name, investment strategy, policy, and other changes to the Fund.  In connection with these changes, the management team has also changed.  These changes could cause a significant turnover in the portfolio initially.  For more complete information regarding these changes, including information concerning the implementation of these events,  please obtain a copy of the Fund's prospectus, which contains a supplement dated January 21, 2010.  These changes are significant and may affect future performance, as well as create tax implications.  A prospectus, along with the supplement, may be obtained by calling 800 523-1918.</p>")	
			}
		}
		//Healthcare need to remove 2/24/2010
		if(fund_code == "G4"){
			if(page == "Performance"){
				$(".legalText").eq(1).after("<p class='legalText'>Performance \"at NAV\" assumes that no front-end or contingent deferred sales charge applied or the investment was not redeemed. Performance \"at offer\" assumes that a front-end or contingent deferred sales charge applied to the extent applicable.<p/><p class='legalText'>Class A shares have a current maximum up-front sales charge of 5.75% and are subject to an annual distribution fee. Class C shares are subject to a 1.00% annual distribution and service fee and will be subject to a contingent deferred sales charge of 1.00% if redeemed within the first 12 months. Class I shares and Class R shares are only available to certain eligible investors. Please see the prospectus and statement of additional information for a more complete explanation.<p/>")
			}
		}

		//Small cap growth
		if(fund_code == "DZ"){
			$('h1').after('<h3>(Closed to new investors)</h3>');
			if(page == "Literature"){
				//hiding fact sheet
				$(".three:eq(2)").hide();
			}
			//emergency message not showing up on these pages
			if(page == "Holdings" ||page == "Literature" ||page == "Performance" ||page == "Distributions" ||page == "Features" ||page == "Fund managers"){
				$('.legalText:first').before("<p class='legalText'>On Jan 21, 2010, the Board of Trustees of the Fund approved to a proposal to liquidate and dissolve the Fund. The liquidation and dissolution is expected to take effect on or about March 22, 2010. Effective at the close of business on Jan 21, 2010, the Delaware Small Cap Growth Fund was closed to new investors. The Fund will continue to accept purchases from existing shareholders (including reinvested dividends or capital gains) until the last business day before the proposed liquidation. Please read the prospectus and supplement for more important information. Please request a prospectus by calling 800 523-1918.</p>")	
			}			
		}
		
		//Tax Free Money
		if(fund_code == "D6"){
			$('h1').after('<h3>(Closed to new investors)</h3>');
			//emergency message not showing up on these pages
			if(page == "Holdings" ||page == "Literature" ||page == "Performance" ||page == "Distributions" ||page == "Features" ||page == "Fund managers"){
				$('.legalText:first').before("<p class='legalText'>On Feb 17, 2010, the Board of Trustees of the Fund approved to a proposal to liquidate and dissolve the Fund. The liquidation and dissolution is expected to take effect on or about April 23, 2010. Effective at the close of business on Feb 22, 2010, the Delaware Tax-Free Money Fund&reg; was closed to new investors. The Fund will continue to accept purchases from existing shareholders (including reinvested dividends or capital gains) until the last business day before the proposed liquidation. Please read the prospectus and supplement for more important information. Please request a prospectus by calling 800 523-1918.</p>")	
			}			
		}
		
		//if Foundation Equity
		if(fund_code == "G8"){
			if(page == "fund_summary"){
				//replacing disclosure to remove the B-share sentance per crn#4870, can remove when support wizard ticket are created and completed
				$("#482").children().eq(1).replaceWith("<p class='disclosure'>Performance includes reinvestment of all distributions and is subject to change. Expenses may have been subsidized. Had they not, performance would be lower. For more information, please call 800 523-1918. Class A shares have a maximum up-front sales charge of 5.75% and are subject to an annual distribution fee. Class C shares are subject to a 1.00% annual distribution and service fee and will be subject to a contingent deferred sales charge of 1.00% if redeemed within the first 12 months. Class R shares are subject to an annual distribution fee. Please see the fee table in the Fund's prospectus for more information.</p>");
			}//end of fund summary if
			$("p:contains('Mutual funds, annuities')").replaceWith("<p class='legalText'>Please be sure to consult your financial advisor when making investments. Mutual funds are not insured by the FDIC or any other government agency; are not deposits or other obligations of, or guaranteed by, any bank or affiliate; and are subject to investment risks, including the possible loss of principal amount invested.</p>");
			$("p:contains('Quoted performance')").replaceWith("<p class='legalText'><b>The performance quoted represents past performance and does not guarantee future results. Investment return and principal value of an investment will fluctuate so that shares, when redeemed, may be worth more or less than their original cost. Current performance may be lower or higher than the performance quoted.</b></p>");
		}//foundation equity end
		//if Core Bond Fund
		if(fund_code == "DU"){
			if(page == "fund_summary"){
				$("#482").children().eq(1).replaceWith("<p class='disclosure'>Performance includes reinvestment of all distributions and is subject to change. Expenses may have been subsidized. Had they not, performance would be lower. For more information, please call 800 523-1918. Class A shares have a maximum up-front sales charge of 5.75% and are subject to an annual distribution fee. Class C shares are subject to a 1.00% annual distribution and service fee and will be subject to a contingent deferred sales charge of 1.00% if redeemed within the first 12 months. Class R shares are subject to an annual distribution fee. Please see the fee table in the Fund's prospectus for more information.</p>");
			}
		}//end of core bond
		
		//if Foundation conservative
		if(fund_code == "NF"){
			var new_pros_lnk = "<a target='CW' href='http://prospectus-express.newriver.com/get_template.asp?clientid=delawarell&doctype=spro&fundid=245918107' class='l4-item'>Summary prospectus</a>";
			
			$(".l4-item:contains('Prospectus')").replaceWith(new_pros_lnk);
		}

		//if Foundation Growth
		if(fund_code == "NH"){
			var new_pros_lnk = "<a target='CW' href='http://prospectus-express.newriver.com/get_template.asp?clientid=delawarell&doctype=spro&fundid=245918883' class='l4-item'>Summary prospectus</a>";
			
			$(".l4-item:contains('Prospectus')").replaceWith(new_pros_lnk);
		}

		//if Foundation Mod
		if(fund_code == "NG"){
			var new_pros_lnk = "<a target='CW' href='http://prospectus-express.newriver.com/get_template.asp?clientid=delawarell&doctype=spro&fundid=245918503' class='l4-item'>Summary prospectus</a>";
			
			$(".l4-item:contains('Prospectus')").replaceWith(new_pros_lnk);
		}

		//if Global REIT
		if(fund_code == "G5"){
			var new_pros_lnk = "<a target='CW' href='http://prospectus-express.newriver.com/get_template.asp?clientid=delawarell&doctype=spro&fundid=24610D103' class='l4-item'>Summary prospectus</a>";
			
			$(".l4-item:contains('Prospectus')").replaceWith(new_pros_lnk);
		}

		//if Healthcare
		if(fund_code == "G4"){
			var new_pros_lnk = "<a target='CW' href='http://prospectus-express.newriver.com/get_template.asp?clientid=delawarell&doctype=spro&fundid=24610E101' class='l4-item'>Summary prospectus</a>";
			
			$(".l4-item:contains('Prospectus')").replaceWith(new_pros_lnk);
		}

		//Foundation Equity Fund
		if(fund_code == "G8"){
			var new_pros_lnk = "<a target='CW' href='http://prospectus-express.newriver.com/summary.asp?clientid=delawarell&doctype=spro&fundid=245918792' class='l4-item'>Summary prospectus</a>";
			
			$(".l4-item:contains('Prospectus')").replaceWith(new_pros_lnk);
		}

		//Mid Cap Value
		if(fund_code == "G6"){
			var new_pros_lnk = "<a target='CW' href='http://prospectus-express.newriver.com/summary.asp?clientid=delawarell&doctype=spro&fundid=246093868' class='l4-item'>Summary prospectus</a>";
			
			$(".l4-item:contains('Prospectus')").replaceWith(new_pros_lnk);
		}

		//Diversified Income 
		if(fund_code == "NE"){
			var new_pros_lnk = "<a target='CW' href='http://prospectus-express.newriver.com/summary.asp?clientid=delawarell&doctype=spro&fundid=246248744' class='l4-item'>Summary prospectus</a>";
			
			$(".l4-item:contains('Prospectus')").replaceWith(new_pros_lnk);
		}

		//US Growth 
		if(fund_code == "FJ"){
			var new_pros_lnk = "<a target='CW' href='http://prospectus-express.newriver.com/summary.asp?clientid=delawarell&doctype=spro&fundid=245917505' class='l4-item'>Summary prospectus</a>";
			
			$(".l4-item:contains('Prospectus')").replaceWith(new_pros_lnk);
		}

		//Diversified Floating Rate
		if(fund_code == "GA"){
			var new_pros_lnk = "<a target='CW' href='http://prospectus-express.newriver.com/summary.asp?clientid=delawarell&doctype=spro&fundid=246248744' class='l4-item'>Summary prospectus</a>";
			
			$(".l4-item:contains('Prospectus')").replaceWith(new_pros_lnk);
		}

		//Infrastructure fund
		if(fund_code == "M9"){
			if(page == "fund_summary"){
				$('#482').children().eq(1).replaceWith("<p class='legalText'>Performance \"at NAV\" assumes that no front-end or contingent deferred sales charge applied or the investment was not redeemed. Performance \"at offer\" assumes that a front-end or contingent deferred sales charge applied to the extent applicable.<p/><p class='legalText'>Class A shares have a current maximum up-front sales charge of 5.75% and are subject to an annual distribution fee. Class C shares are subject to a 1.00% annual distribution and service fee and will be subject to a contingent deferred sales charge of 1.00% if redeemed within the first 12 months. Class I shares and Class R shares are only available to certain eligible investors. Please see the prospectus and statement of additional information for a more complete explanation.<p/>");
			}
		}


	}//******fund_code_href null (cport code) end**********
	
	//if performance is in the h1 the length will be 1 else length will be 0
	var prf_h1 = $("h1:contains('Performance')").length;
	
	//Hiding double digit returns disclosure if there are not double digit returns
	if(page == "prf"||prf_h1 == 1){
		//initially hiding the dd return
		$("p:contains('double-digit')").addClass("ddreturns").hide();
		//looping through each row that contains class
		$("b:contains('Class')").each(function() {
			//looping through each td that contains a % symbol
			$(this).parents("tr:first").next().children("td:contains('%')").each(function() {
				var percent_fields = $(this).text();
				var percent_splt_ary = percent_fields.split(".");
				var percent_no_dec = percent_splt_ary[0];
				//parsing out the percentage and determining if its greater or equal to 20
				//20% is the cut-off for dd return disclosure per compliance
				var percent_val = parseInt(percent_no_dec);
				if(percent_val >= 20){
					$(".ddreturns").show();	
				}
			});//end of % td .each function
			$(this).parents("tr:first").next().next().children("td:contains('%')").each(function() {
				var percent_fields = $(this).text();
				var percent_splt_ary = percent_fields.split(".");
				var percent_no_dec = percent_splt_ary[0];
				var percent_val = parseInt(percent_no_dec);
				if(percent_val >= 20){
					$(".ddreturns").show();	
				}
			});//end of 2nd % td .each function
		});//end of class row .each
				
	}//end of performance "if" for dd returns

});//document . ready end