var fundExplorer={debug:false,currView:null,currGrouping:null,totalNumFunds:0,all_funds_ArrowPos:422,featured_funds_ArrowPos:67,four_five_star_funds_ArrowPos:250,style_box_funds_ArrowPos:623,arrowDuration:500,init:function(){(fundExplorer.debug)?alert("fundExplorer: Initializing"):null;var B=null;var C=false;if(Cookie.get("fundExplorerView")){fundExplorer.setView(Cookie.get("fundExplorerView"));B=Cookie.get("fundExplorerView");C=true}else{fundExplorer.setView("featured_funds");B="featured_funds"}if(Cookie.get("fundExplorerGrouping")){fundExplorer.setGrouping(Cookie.get("fundExplorerGrouping"))}else{fundExplorer.setGrouping("asset_class")}if(C==false&&Cookie.get("fundExplorerBoxLinkGroup")){fundExplorerBoxes.currBoxLinkGroup=Cookie.get("fundExplorerBoxLinkGroup");B=fundExplorerBoxes.currBoxLinkGroup+"_funds"}else{fundExplorerBoxes.currBoxLinkGroup="equity_style_boxes"}callAjaxToLoadFunds(B)},init1:function(){fundExplorer.changeView(fundExplorer.currView);fundExplorer.changeGrouping(fundExplorer.currGrouping);fundExplorerBoxes.changeBoxLinkGroup(fundExplorerBoxes.currBoxLinkGroup);fundExplorer.animateViewArrow("static");fundExplorer.updateHeadings();fundExplorer.toggleParenthesis();fundExplorer.showAssetColors();updateCountNew();if($("disclosure_lipper")){if(fundExplorer.currGrouping=="performance"){$("disclosure_lipper").style.display="block"}else{$("disclosure_lipper").style.display="none"}}},homepageInit:function(){if(Cookie.get("fundExplorerBoxLinkGroup")){fundExplorerBoxes.setBoxLinkGroup(Cookie.get("fundExplorerBoxLinkGroup"))}else{fundExplorerBoxes.setBoxLinkGroup("equity_style_boxes")}fundExplorerBoxes.changeBoxLinkGroup(fundExplorerBoxes.currBoxLinkGroup)},setView:function(B){(fundExplorer.debug)?alert("fundExplorer: setView"):null;fundExplorer.currView=B;setCookie("fundExplorerView",B,0,"/");fundExplorerBoxes.makeBoxesInactive()},setView1:function(B){(fundExplorer.debug)?alert("fundExplorer: setView1"):null;fundExplorer.currView=B;setCookie("fundExplorerView",B,0,"/");fundExplorerBoxes.makeBoxesInactive();callAjaxToLoadFunds(B)},changeView:function(F){(fundExplorer.debug)?alert("fundExplorer: changeView"):null;var H=$(fundExplorer.currView);var G=$(F);H.setStyle("display","none");G.setStyle("display","block");if(F=="four_five_star_funds"){$("grouping_performance").style.display="none"}else{$("grouping_performance").style.display="block"}if($("disclosure_morningstar")){if(F=="four_five_star_funds"){$("disclosure_morningstar").style.display="block"}else{$("disclosure_morningstar").style.display="none"}}var E=$$(".fund_view_selector");(fundExplorer.debug)?alert("fundExplorer: changeView set active link "+E.length+" iterations"):null;for(i=0;i<E.length;i++){if(E[i].id==F+"_selector"){E[i].addClass("selected")}else{E[i].removeClass("selected")}}E=null},setAndChangeView:function(F,D,E){(fundExplorer.debug)?alert("fundExplorer: setAndChangeView"):null;callTrackLink(document.location,D,E);setCookie("fundSection","BigBoxes",0,"/");sc_strTypeFEBox=E;fundExplorer.setView1(E);if(E=="four_five_star_funds"){if(Cookie.get("fundExplorerGrouping")){fundExplorer.setGrouping(Cookie.get("fundExplorerGrouping"))}else{fundExplorer.setGrouping("asset_class")}if(fundExplorer.currGrouping=="performance"){fundExplorer.setGrouping("asset_class")}}fundExplorer.hideAssetColors();fundExplorer.changeView(E);fundExplorer.changeGrouping(fundExplorer.currGrouping);fundExplorer.animateViewArrow("animate");updateCountNew();bigBoxCounterShow();fundExplorer.showAssetColors();fundExplorer.updateHeadings();if(fundExplorer.currGrouping=="style"){$("fund_showing_count").style.display="none";$("styleCount").style.display="block"}else{$("styleCount").style.display="none"}if($("disclosure_lipper")){if(fundExplorer.currGrouping=="performance"){$("disclosure_lipper").style.display="block"}else{$("disclosure_lipper").style.display="none"}}},animateViewArrow:function(E){(fundExplorer.debug)?alert("fundExplorer: animateViewArrow"):null;var D=$("point_down_arrow");var F=fundExplorer.currView;if(F=="all_funds"){newArrowPos=fundExplorer.all_funds_ArrowPos}else{if(F=="featured_funds"){newArrowPos=fundExplorer.featured_funds_ArrowPos}else{if(F=="four_five_star_funds"){newArrowPos=fundExplorer.four_five_star_funds_ArrowPos}else{if(F=="style_box_funds"){newArrowPos=fundExplorer.style_box_funds_ArrowPos}else{newArrowPos=0}}}}if(E=="animate"){D.effect("padding-left",{duration:fundExplorer.arrowDuration,transition:Fx.Transitions.Cubic.easeOut}).start(newArrowPos)}else{D.setStyle("padding-left",newArrowPos)}},setGrouping:function(B){(fundExplorer.debug)?alert("fundExplorer: setGrouping"):null;fundExplorer.currGrouping=B;setCookie("fundExplorerGrouping",B,0,"/");if(B=="style"){$("fund_showing_count").style.display="none";$("styleCount").style.display="block"}else{$("styleCount").style.display="none";if($("fund_showing_count01").style.display!="none"){$("fund_showing_count").style.display="none"}else{$("fund_showing_count").style.display="block"}}},changeGrouping:function(F){(fundExplorer.debug)?alert("fundExplorer: changeGrouping"):null;var E=$$(".funds_listings .grouping_"+fundExplorer.currGrouping);var H=$$(".funds_listings .grouping_"+F);(fundExplorer.debug)?alert("fundExplorer: changeGrouping curr grouping hide "+E.length+" iterations"):null;(fundExplorer.debug)?alert("fundExplorer: changeGrouping new grouping show "+H.length+" iterations"):null;for(i=0;i<E.length;i++){E[i].removeClass("active");E[i].addClass("inactive")}for(i=0;i<H.length;i++){H[i].removeClass("inactive");H[i].addClass("active")}E=null;H=null;var G=$$(".fund_grouping_selector");(fundExplorer.debug)?alert("fundExplorer: changeGrouping change active link "+G.length+" iterations"):null;for(i=0;i<G.length;i++){if(G[i].id=="grouping_"+F){G[i].addClass("active")}else{G[i].removeClass("active")}}G=null},setAndChangeGrouping:function(F,D,E){if(E=="style"){callTrackLink(document.location,D,E)}fundExplorer.hideAssetColors();fundExplorer.changeGrouping(E);fundExplorer.setGrouping(E);fundExplorer.showAssetColors();if($("disclosure_lipper")){if(fundExplorer.currGrouping=="performance"){$("disclosure_lipper").style.display="block"}else{$("disclosure_lipper").style.display="none"}}updateCountNew()},setAndChangeBoxLinkGroup:function(B){callTrackLink(document.location,B," ");fundExplorerBoxes.changeBoxLinkGroup(B);fundExplorerBoxes.setBoxLinkGroup(B)},updateHeadings:function(){(fundExplorer.debug)?alert("fundExplorer: updateHeadings"):null;var G=$$(".funds_listings li.heading");(fundExplorer.debug)?alert("fundExplorer: updateHeadings test headings "+G.length+" iterations"):null;for(i=0;i<G.length;i++){var E=false;var H=true;var F=G[i];while(E==false){F=F.getNext();if(F.hasClass("heading")||F.hasClass("divider")){E=true}else{if(F.getStyle("display")!="none"){E=true;H=false}}}if(H){G[i].className=G[i].className.replace("heading_","headingfaded_")}else{G[i].className=G[i].className.replace("headingfaded_","heading_")}}},toggleParenthesis:function(){(fundExplorer.debug)?alert("fundExplorer: toggleParenthesis"):null;var B=$$(".class_type");(fundExplorer.debug)?alert("fundExplorer: toggleParenthesis show or hide all "+B.length+" iterations"):null;if(fundExplorer.currView=="all_funds"&&fundExplorer.currGrouping=="performance"&&fundExplorer.currClass=="all_classes"){for(i=0;i<B.length;i++){B[i].setStyle("display","inline")}}else{if(fundExplorer.currView=="four_five_star_funds"&&fundExplorer.currGrouping=="performance"&&fundExplorer.currClass=="all_classes"){for(i=0;i<B.length;i++){B[i].setStyle("display","inline")}}}},hideAssetColors:function(){(fundExplorer.debug)?alert("fundExplorer: hideAssetColour"):null;arrAssetColors=$$("#"+fundExplorer.currView+" .grouping_"+fundExplorer.currGrouping+" .asset_class_color");(fundExplorer.debug)?alert("fundExplorer: hideAssetColour hide "+arrAssetColors.length+" iterations"):null;for(i=0;i<arrAssetColors.length;i++){arrAssetColors[i].setStyle("display","none")}},showAssetColors:function(){(fundExplorer.debug)?alert("fundExplorer: showAssetColour"):null;arrAssetColors=$$("#"+fundExplorer.currView+" .grouping_"+fundExplorer.currGrouping+" .asset_class_color");(fundExplorer.debug)?alert("fundExplorer: showAssetColour show "+arrAssetColors.length+" iterations"):null;for(i=0;i<arrAssetColors.length;i++){arrAssetColors[i].setStyle("display","block")}}};var fundExplorerBoxes={debug:false,currSelectedBox:null,currBoxLinkGroup:null,lastBoxLinkGroup:null,initializing:false,arrActiveBox:[],init:function(){fundExplorerBoxes.initializing=true;var B=null;if(Cookie.get("fundExplorerBoxLinkGroup")){fundExplorerBoxes.currBoxLinkGroup=Cookie.get("fundExplorerBoxLinkGroup");B=fundExplorerBoxes.currBoxLinkGroup+"_funds"}else{fundExplorerBoxes.currBoxLinkGroup="equity_style_boxes"}if(Cookie.get("fundExplorerGrouping")){fundExplorer.setGrouping(Cookie.get("fundExplorerGrouping"))}else{fundExplorer.setGrouping("asset_class")}if(fundExplorer.currGrouping=="style"){fundExplorer.setGrouping("asset_class")}if(Cookie.get("fundExplorerBoxLinkGroup")){fundExplorerBoxes.setBoxLinkGroup(Cookie.get("fundExplorerBoxLinkGroup"))}else{fundExplorerBoxes.setBoxLinkGroup("equity_style_boxes")}if(Cookie.get("fundExplorerSelectedBox")){fundExplorerBoxes.setSelectedBox(Cookie.get("fundExplorerSelectedBox"))}else{fundExplorerBoxes.setSelectedBox("equity_us_funds")}callAjaxToLoadFunds(B)},init1:function(){if(Cookie.get("fundExplorerGrouping")){fundExplorer.setGrouping(Cookie.get("fundExplorerGrouping"))}else{fundExplorer.setGrouping("asset_class")}if(fundExplorer.currGrouping=="style"){fundExplorer.setGrouping("asset_class")}if(Cookie.get("fundExplorerBoxLinkGroup")){fundExplorerBoxes.setBoxLinkGroup(Cookie.get("fundExplorerBoxLinkGroup"))}else{fundExplorerBoxes.setBoxLinkGroup("equity_style_boxes")}if(Cookie.get("fundExplorerSelectedBox")){fundExplorerBoxes.setSelectedBox(Cookie.get("fundExplorerSelectedBox"))}else{fundExplorerBoxes.setSelectedBox("equity_us_funds")}fundExplorer.changeGrouping(fundExplorer.currGrouping);fundExplorerBoxes.changeBoxLinkGroup(fundExplorerBoxes.currBoxLinkGroup);fundExplorerBoxes.toggleBox(fundExplorerBoxes.currSelectedBox,true);fundExplorerBoxes.animateViewArrowNew("animate",fundExplorerBoxes.currSelectedBox);fundExplorerBoxes.hideAllFundsDiv();fundExplorerBoxes.showAssetColors();fundExplorer.updateHeadings();updateCountNew();styleBoxCounterShow();fundExplorerBoxes.emptyMessage();fundExplorerBoxes.initializing=false;if($("disclosure_lipper")){if(fundExplorer.currGrouping=="performance"){$("disclosure_lipper").style.display="block"}else{$("disclosure_lipper").style.display="none"}}},setSelectedBox:function(B){(fundExplorerBoxes.debug)?alert("fundExplorerBoxes: setSelectedBox"):null;fundExplorerBoxes.currSelectedBox=B;fundExplorerBoxes.lastBoxLinkGroup=fundExplorerBoxes.currBoxLinkGroup;setCookie("fundExplorerSelectedBox",B,0,"/");setCookie("fundExplorerBoxLinkGroup",fundExplorerBoxes.currBoxLinkGroup,0,"/")},setSelectedBox1:function(B){(fundExplorerBoxes.debug)?alert("fundExplorerBoxes: setSelectedBox1"):null;fundExplorerBoxes.currSelectedBox=B;setCookie("fundExplorerSelectedBox",B,0,"/");setCookie("fundExplorerBoxLinkGroup",fundExplorerBoxes.currBoxLinkGroup,0,"/");if(fundExplorerBoxes.checkHasFundsLoaded(fundExplorerBoxes.currBoxLinkGroup)||fundExplorerBoxes.lastBoxLinkGroup!=fundExplorerBoxes.currBoxLinkGroup){callAjaxToLoadFunds(fundExplorerBoxes.currBoxLinkGroup+"_funds")}else{if(fundExplorerBoxes.lastBoxLinkGroup!=fundExplorerBoxes.currBoxLinkGroup){fundExplorerBoxes.toggleBox(B,true)}else{fundExplorerBoxes.toggleBox(B)}}fundExplorerBoxes.lastBoxLinkGroup=fundExplorerBoxes.currBoxLinkGroup},toggleBox:function(E,F){(fundExplorerBoxes.debug)?alert("fundExploreBoxes: toggleBox"):null;var G=$(E);var H=$(E+"_link");if(H.hasClass("selected")){H.removeClass("selected");if(G){G.removeClass("box_item_active");G.addClass("box_item_inactive")}if(F){fundExplorerBoxes.arrActiveBox[fundExplorerBoxes.arrActiveBox.length]=E+"||"+fundExplorerBoxes.currBoxLinkGroup}else{fundExplorerBoxes.arrActiveBox=removeArrayItems(fundExplorerBoxes.arrActiveBox,E+"||"+fundExplorerBoxes.lastBoxLinkGroup)}}else{if(!fundExplorerBoxes.initializing){if(G){G.injectTop(fundExplorerBoxes.currBoxLinkGroup+"_funds")}}H.addClass("selected");if(G){G.removeClass("box_item_inactive");G.addClass("box_item_active")}fundExplorerBoxes.arrActiveBox[fundExplorerBoxes.arrActiveBox.length]=E+"||"+fundExplorerBoxes.currBoxLinkGroup}},setAndToggleSelectedBox:function(H,J,E){setCookie("fundSection","SmallBoxes",0,"/");setCookie("fundExplorerBoxLinkGroup",fundExplorerBoxes.currBoxLinkGroup,0,"/");if(fundExplorerBoxes.lastBoxLinkGroup!=fundExplorerBoxes.currBoxLinkGroup){fundExplorerBoxes.makeBoxesInactive()}if(fundExplorer.currGrouping=="style"){fundExplorer.setGrouping("asset_class")}$("grouping_performance").style.display="block";fundExplorerBoxes.setSelectedBox1(E);fundExplorer.changeGrouping(fundExplorer.currGrouping);fundExplorerBoxes.changeBoxLinkGroup(fundExplorerBoxes.currBoxLinkGroup);fundExplorerBoxes.changeBoxView(fundExplorerBoxes.currBoxLinkGroup);fundExplorerBoxes.animateViewArrowNew("animate",E);fundExplorerBoxes.hideAllFundsDiv();fundExplorerBoxes.showAssetColors();fundExplorer.updateHeadings();updateCountNew();styleBoxCounterShow();var I="";var G="";for(var H=0;H<fundExplorerBoxes.arrActiveBox.length;H++){G=fundExplorerBoxes.arrActiveBox[H];G=G.split("||")[0];if(I.length>0){I=I+","+G}else{I=G}}sc_strTypeFEBox=I;callTrackLink(document.location,J,sc_strTypeFEBox);if($("disclosure_lipper")){if(fundExplorer.currGrouping=="performance"){$("disclosure_lipper").style.display="block"}else{$("disclosure_lipper").style.display="none"}}},animateViewArrowNew:function(E,D){(fundExplorer.debug)?alert("fundExplorer: animateViewArrow"):null;var F=$("point_down_arrow");if(D){newArrowPos=fundExplorer.style_box_funds_ArrowPos}else{newArrowPos=0}if(E=="animate"){F.effect("padding-left",{duration:fundExplorer.arrowDuration,transition:Fx.Transitions.Cubic.easeOut}).start(newArrowPos)}else{F.setStyle("padding-left",newArrowPos)}},hideAllFundsDiv:function(){(fundExplorerBoxes.debug)?alert("fundExploreBoxes: setBoxLinkGroup"):null;changeViewGroupingStyle();var B=$$(".fund_view_selector");(fundExplorer.debug)?alert("fundExplorer: changeView set active link "+arrSelectorLinks.length+" iterations"):null;for(i=0;i<B.length;i++){if(B[i].id=="all_funds_selector"||B[i].id=="featured_funds_selector"||B[i].id=="four_five_star_funds_selector"){B[i].removeClass("selected")}}arrSelectorLinks=null},setBoxLinkGroup:function(B){(fundExplorerBoxes.debug)?alert("fundExploreBoxes: setBoxLinkGroup"):null;fundExplorerBoxes.currBoxLinkGroup=B},changeBoxLinkGroup:function(D){(fundExplorerBoxes.debug)?alert("fundExplorerBoxes: changeBoxLinkGroup"):null;if($(fundExplorerBoxes.currBoxLinkGroup)){$(fundExplorerBoxes.currBoxLinkGroup).setStyle("display","none");$(D).setStyle("display","block")}if($("box_type_selector")){boxTypeSelector=$("box_type_selector");for(var C=0;C<boxTypeSelector.length;C++){if(boxTypeSelector[C].value==D){boxTypeSelector[C].selected=true}}}},changeBoxView:function(C){(fundExplorerBoxes.debug)?alert("fundExploreBoxes: changeBoxView"):null;var D=fundExplorerBoxes.currBoxLinkGroup;$(D+"_funds").setStyle("display","none");$(C+"_funds").setStyle("display","block")},setAndChangeBoxLinkGroup:function(B){callTrackLink(document.location,B," ");fundExplorerBoxes.hideAssetColors();fundExplorerBoxes.changeBoxLinkGroup(B);fundExplorerBoxes.changeBoxView(B);fundExplorerBoxes.setBoxLinkGroup(B);updateCountNew();fundExplorerBoxes.showAssetColors();fundExplorerBoxes.emptyMessage()},setAndChangeGrouping:function(F,D,E){callTrackLink(document.location,D,E);fundExplorerBoxes.hideAssetColors();fundExplorer.changeGrouping(E);fundExplorer.setGrouping(E);fundExplorerBoxes.showAssetColors();if($("disclosure_lipper")){if(fundExplorer.currGrouping=="performance"){$("disclosure_lipper").style.display="block"}else{$("disclosure_lipper").style.display="none"}}updateCountNew()},hideAssetColors:function(){if(window.ie){(fundExplorer.debug)?alert("fundExplorerBoxes: hideAssetColour"):null;arrAssetColors=$$("#"+fundExplorerBoxes.currBoxLinkGroup+"_funds .box_item_active .grouping_"+fundExplorer.currGrouping+" .asset_class_color");(fundExplorer.debug)?alert("fundExplorerBoxes: hideAssetColour hide "+arrAssetColours.length+" iterations"):null;for(i=0;i<arrAssetColors.length;i++){arrAssetColors[i].setStyle("display","none")}}},showAssetColors:function(){if(window.ie){(fundExplorer.debug)?alert("fundExplorerBoxes: hideAssetColour"):null;arrAssetColors=$$("#"+fundExplorerBoxes.currBoxLinkGroup+"_funds .box_item_active .grouping_"+fundExplorer.currGrouping+" .asset_class_color");(fundExplorer.debug)?alert("fundExplorerBoxes: hideAssetColour hide "+arrAssetColours.length+" iterations"):null;for(i=0;i<arrAssetColors.length;i++){arrAssetColors[i].setStyle("display","block")}}},emptyMessage:function(){(fundExplorerBoxes.debug)?alert("fundExploreBoxes: changeBoxView"):null;var B=$$("#"+fundExplorerBoxes.currBoxLinkGroup+" .selected");if(B.length<1){$("empty_message").setStyle("display","block")}else{$("empty_message").setStyle("display","none")}},makeBoxesInactive:function(){for(var B=fundExplorerBoxes.arrActiveBox.length-1;B>=0;B--){fundExplorerBoxes.toggleBox(fundExplorerBoxes.arrActiveBox[B].split("||")[0])}},checkHasFundsLoaded:function(G){var E=true;for(var H=0;H<fundExplorerBoxes.arrActiveBox.length;H++){var F=fundExplorerBoxes.arrActiveBox[H].split("||")[1];if(G==F){E=false;break}}return E}};function changeViewGroupingStyle(){var D=$("grouping_style");var C=$("grouping_asset_class");if(D){if(D.hasClass("active")){D.removeClass("active");D.addClass("inactive");if(C){C.removeClass("inactive");C.addClass("active")}}D.style.display="none"}}function removeArrayItems(E,F){var D=0;while(D<E.length){if(E[D]==F){E.splice(D,1);break}else{D++}}return E}var lastActiveFundsType=null;function callAjaxToLoadFunds(F){var G=contextPath+"JPMFController?formfilter=fundexplorer&feSection="+F;var H="fundsType="+F;var E=new JKL.ParseXML.Text(G,H,"GET");E.async(doAfterLoadFunds,F);E.parse();E=null}function doAfterLoadFunds(H,F){if(lastActiveFundsType!=null){var E=document.getElementById(lastActiveFundsType);if(E){E.style.display="none";E.innerHTML=""}}var G=document.getElementById(F);if(G){G.innerHTML="Loading...";G.style.display="block";G.innerHTML=H;lastActiveFundsType=F}E=null;G=null;totalNumberOfFunds(F);if(F=="featured_funds"||F=="four_five_star_funds"||F=="all_funds"){fundExplorer.init1()}else{fundExplorerBoxes.init1()}}function totalNumberOfFunds(G){var I=document.getElementById("total_fund_count");var F=document.getElementById("countFunds").innerHTML;I.innerHTML=F;var J=null;var H=null;if(G=="featured_funds"||G=="four_five_star_funds"||G=="all_funds"){J=document.getElementById("styleCount");H=document.getElementById("styleFundsCount").innerHTML;J.innerHTML=H}I=null;F=null;J=null;H=null}var visibleCount,visibleCount01;function updateCountNew(){(fundExplorer.debug)?alert("fundExplorerBoxes: updateCount"):null;var B=null;visibleCount=0;visibleCount01=0;arrCurrFunds01=$$("#"+fundExplorerBoxes.currBoxLinkGroup+"_funds .box_item_active .grouping_"+fundExplorer.currGrouping+" .fund");visibleCount01=arrCurrFunds01.length;B=null;B=$$("#"+fundExplorer.currView+" .grouping_"+fundExplorer.currGrouping+" .fund");visibleCount=B.length;B=null;$("fund_showing_count").innerHTML=visibleCount;$("fund_showing_count01").innerHTML=visibleCount01}function bigBoxCounterShow(){$("fund_showing_count").style.display="";$("fund_showing_count01").style.display="none"}function styleBoxCounterShow(){$("fund_showing_count").style.display="none";$("fund_showing_count01").style.display=""};
