function GetXmlHttpObject(){var A=null;try{A=new XMLHttpRequest()}catch(B){try{A=new ActiveXObject("Msxml2.XMLHTTP")}catch(B){A=new ActiveXObject("Microsoft.XMLHTTP")}}return A}var jumpFund={defaultFieldValue:"Name, #, CUSIP or Symbol",baseSortValue:1000,searchTimer:0,searchWaitTime:0,numResultsDisplayed:8,animationSpeed:500,blurTimer:0,blurWaitTime:200,searchXPos:0,searchYPos:0,searchInputHeight:0,arrSearchResults:[],lastSearchString:null,currSelection:null,currPageNumber:0,inputField:null,responseCode:null,start:1,end:8,lastCount:0,mimChar:1,init:function(){var A=$$("input.jump_to_fund");for(i=0;i<A.length;i++){A[i].addEvent("focus",jumpFund.clearFieldDefault);A[i].addEvent("focus",jumpFund.startSearch);A[i].addEvent("blur",jumpFund.resetFieldDefault);A[i].addEvent("keyup",jumpFund.handleKeys);$(document.getElementsByTagName("body")[0]).addEvent("click",jumpFund.closeClick);A[i].value=jumpFund.defaultFieldValue}},clearFieldDefault:function(){if(this.value==jumpFund.defaultFieldValue){this.value=""}},resetFieldDefault:function(){if(this.value==""){this.value=jumpFund.defaultFieldValue}},startSearch:function(){jumpFund.inputField=this;searchString=this.value.toLowerCase().trim();searchString=searchString.replace(/[^A-Za-z0-9\s\"\.\;\,\-]/g,"");if(searchString.length>=jumpFund.mimChar&&searchString!=jumpFund.defaultFieldValue.toLowerCase().replace(/[^A-Za-z0-9\s\"\.\;\,]/g,"")){if(searchString!=jumpFund.lastSearchString){if(window.ie){jumpFund.start=0;jumpFund.end=7}else{jumpFund.start=1;jumpFund.end=8}jumpFund.start=1;jumpFund.end=8;jumpFund.lastCount=0;jumpFund.lastSearchString=searchString;jumpFund.searchYPos=this.getTop();jumpFund.searchXPos=this.getLeft();jumpFund.searchInputHeight=this.getSize().size.y;clearTimeout(jumpFund.searchTimer);jumpFund.searchTimer=setTimeout('jumpFund.displayResults("'+escape(searchString)+'")',jumpFund.searchWaitTime)}}else{jumpFund.hideResults()}},displayResults:function(J){if(!$("jump_fund_results")){var I=document.createElement("div");I.setAttribute("id","jump_fund_results");I.setAttribute("style","display: none;");$$("body")[0].appendChild(I);var D=document.createElement("img");D.setAttribute("src","images/point_up_brown.gif");D.setAttribute("id","jump_fund_point");I.appendChild(D);var C=document.createElement("ul");C.setAttribute("id","jump_fund_results_list");I.appendChild(C);$(C).addEvent("click",jumpFund.goToSelection);var E=document.createElement("span");E.setAttribute("id","jump_fund_results_total");I.appendChild(E);var B=document.createElement("a");B.setAttribute("id","jump_fund_results_previous");B.setAttribute("style","display:none");B.setAttribute("href","javascript:jumpFund.goPrev();");B.innerHTML="&lt; prev";I.appendChild(B);var F=document.createElement("a");F.setAttribute("id","jump_fund_results_next");F.setAttribute("style","display:none");F.setAttribute("href","javascript:jumpFund.goNext();");F.innerHTML="next &gt;";I.appendChild(F)}arrResultListItems=$$("#jump_fund_results li");if(arrResultListItems.length){for(i=0;i<arrResultListItems.length;i++){arrResultListItems[i].remove()}}xmlHttp=GetXmlHttpObject();if(xmlHttp==null){return }var G=document.getElementById("jumpRole").value;var H=document.getElementById("preferred").value;var A=contextPath+"JPMFController?formfilter=jumptofund&jump_to_fund="+J+"&jump_Role="+G+"&preferred_search="+H;xmlHttp.onreadystatechange=function(){if(xmlHttp.readyState==4){var K=xmlHttp.responseText;var L=K.split("|");jumpFund.responseCode=xmlHttp.status;jumpFund.lastCount=L[1];if(L[1]!=0&&jumpFund.responseCode!=403){jumpFund.arrSearchResults=L[0];document.getElementById("jump_fund_results_list").innerHTML="";document.getElementById("jump_fund_results_list").innerHTML=L[0];document.getElementById("jump_fund_results_list").style.display="block"}else{document.getElementById("jump_fund_results_previous").style.display="none";document.getElementById("jump_fund_results_next").style.display="none";document.getElementById("jump_fund_results_total").innerHTML="No Funds Found"}jumpFund.showResults()}};xmlHttp.open("GET",A,true);xmlHttp.send(null)},showResults:function(){var B=$("jump_fund_results");var A=$("master_container");var D=0;var E=A.getSize().size.x+A.getPosition().x;var C=(jumpFund.searchXPos-10)+320;if(C>E){D=C-E+10;$("jump_fund_point").setStyle("left",D+10)}if(window.ie){jumpFund.hideSelectLists()}hideFlashObj();if(B.getStyle("display")!="block"){B.setStyles({display:"block",opacity:0,zIndex:1000,left:(jumpFund.searchXPos-10)-D});B.effects({duration:jumpFund.animationSpeed,transition:Fx.Transitions.Quint.easeOut}).start({top:[jumpFund.searchYPos+70,jumpFund.searchYPos+jumpFund.searchInputHeight+10],opacity:[0,1]})}jumpFund.currSelection=null;jumpFund.currPageNumber=0;jumpFund.showResultsPage(1);hideFlashObj()},showResultsPage:function(C){if(window.ie){if(jumpFund.currPageNumber>0){currFirstNodeOnPage=(jumpFund.currPageNumber*jumpFund.numResultsDisplayed)-jumpFund.numResultsDisplayed;currLastNodeOnPage=currFirstNodeOnPage+jumpFund.numResultsDisplayed;for(i=currFirstNodeOnPage;i<currLastNodeOnPage;i++){if($("jump_fund_results_list").childNodes[i]){document.getElementById("jump_fund_results_list").childNodes[i].style.display="none"}}}}else{if(jumpFund.currPageNumber>0){currFirstNodeOnPage=(jumpFund.currPageNumber*jumpFund.numResultsDisplayed)-jumpFund.numResultsDisplayed+1;currLastNodeOnPage=currFirstNodeOnPage+jumpFund.numResultsDisplayed+1;for(i=currFirstNodeOnPage;i<currLastNodeOnPage;i++){if($("jump_fund_results_list").childNodes[i]){document.getElementById("jump_fund_results_list").childNodes[i].style.display="none"}}}}if(window.ie){firstNodeOnPage=(C*jumpFund.numResultsDisplayed)-jumpFund.numResultsDisplayed;lastNodeOnPage=firstNodeOnPage+jumpFund.numResultsDisplayed;for(i=firstNodeOnPage;i<lastNodeOnPage;i++){if($("jump_fund_results_list").childNodes[i]){document.getElementById("jump_fund_results_list").childNodes[i].style.display="block";document.getElementById("jump_fund_results_list").childNodes[i].onmouseover=jumpFund.mouseSelection;if(i==firstNodeOnPage){if(jumpFund.currSelection!=null){jumpFund.currSelection.className=""}document.getElementById("jump_fund_results_list").childNodes[i].className="selected";jumpFund.currSelection=document.getElementById("jump_fund_results_list").childNodes[i]}}else{break}}}else{firstNodeOnPage=(C*jumpFund.numResultsDisplayed)-jumpFund.numResultsDisplayed;lastNodeOnPage=firstNodeOnPage+jumpFund.numResultsDisplayed;for(i=firstNodeOnPage+1;i<lastNodeOnPage+1;i++){if($("jump_fund_results_list").childNodes[i]){document.getElementById("jump_fund_results_list").childNodes[i].style.display="block";document.getElementById("jump_fund_results_list").childNodes[i].addEvent("mouseover",jumpFund.mouseSelection);if(i==firstNodeOnPage+1){if(jumpFund.currSelection!=null){jumpFund.currSelection.className=""}document.getElementById("jump_fund_results_list").childNodes[i].className="selected";jumpFund.currSelection=document.getElementById("jump_fund_results_list").childNodes[i]}}else{break}}}var E=firstNodeOnPage+1;var A=(lastNodeOnPage>jumpFund.lastCount)?jumpFund.lastCount:lastNodeOnPage;var B="";if(jumpFund.lastCount>0){B="showing "+E+" - "+A+" of "+jumpFund.lastCount+" results"}else{B="No Funds Found"}var D=$("jump_fund_results_total");D.innerHTML=B;maxPageNum=Math.ceil(jumpFund.lastCount/jumpFund.numResultsDisplayed);if(C==maxPageNum||jumpFund.lastCount==0){document.getElementById("jump_fund_results_next").style.display="none"}else{document.getElementById("jump_fund_results_next").style.display="block"}if(C==1){document.getElementById("jump_fund_results_previous").style.display="none"}else{document.getElementById("jump_fund_results_previous").style.display="block"}jumpFund.currPageNumber=C},hideResults:function(){var A=$("jump_fund_results");if(A&&A.getStyle("display")!="none"){A.effects({duration:jumpFund.animationSpeed,transition:Fx.Transitions.Quad.easeOut,onComplete:function(){A.setStyles({left:-1000000,top:-1000000,display:"none"});jumpFund.inputField=null;jumpFund.lastSearchString=null}}).start({top:[jumpFund.searchYPos+70],opacity:[0]})}if(window.ie){jumpFund.showSelectLists()}showFlashObj()},waitHideResults:function(){jumpFund.blurTimer=setTimeout("jumpFund.hideResults()",jumpFund.blurWaitTime)},hideSelectLists:function(){var A=$$("select");for(i=0;i<A.length;i++){A[i].setStyle("visibility","hidden")}},showSelectLists:function(){var A=$$("select");for(i=0;i<A.length;i++){A[i].setStyle("visibility","visible")}},handleKeys:function(B){var A;if(!B){var B=window.event}if(B.keyCode){A=B.keyCode}else{if(B.which){A=B.which}}if(A==40){jumpFund.keySelection("down")}else{if(A==38){jumpFund.keySelection("up");setCaretToEnd(this)}else{if(A==13){jumpFund.goToSelection()}else{var C=jumpFund.startSearch.bind(this);C()}}}return false},mouseSelection:function(){jumpFund.setSelection(this)},keySelection:function(A){if(jumpFund.currSelection==null){if($("jump_fund_results_list")){if(window.ie){newSelection=$("jump_fund_results_list").childNodes[0]}else{newSelection=$("jump_fund_results_list").childNodes[1]}}else{newSelection=false}}else{if(A=="down"){newSelection=jumpFund.currSelection.nextSibling}else{if(A=="up"){newSelection=jumpFund.currSelection.previousSibling}}}if(newSelection){jumpFund.setSelection(newSelection)}},setSelection:function(A){if(jumpFund.currSelection!=null){jumpFund.currSelection.className=""}jumpFund.currSelection=A;A.className="selected";currSelectedPos=jumpFund.getSelectedIndex();if(currSelectedPos>=(jumpFund.currPageNumber*jumpFund.numResultsDisplayed)){newPageNum=jumpFund.currPageNumber+1;jumpFund.showResultsPage(newPageNum)}else{if(currSelectedPos<((jumpFund.currPageNumber*jumpFund.numResultsDisplayed)-jumpFund.numResultsDisplayed)){newPageNum=jumpFund.currPageNumber-1;jumpFund.showResultsPage(newPageNum)}}},goToSelection:function(){if(jumpFund.currSelection!=null){itemLink=jumpFund.currSelection.getElementsByTagName("A")[0];itemLink=itemLink.href;window.location=itemLink;jumpFund.waitHideResults()}},getSelectedIndex:function(){arrItems=$$("#jump_fund_results_list li");for(i=0;i<arrItems.length;i++){if(arrItems[i]==jumpFund.currSelection){return i;break}}},goNext:function(){clearTimeout(jumpFund.blurTimer);maxPageNum=Math.ceil(jumpFund.lastCount/jumpFund.numResultsDisplayed);nextPageNum=jumpFund.currPageNumber+1;if(nextPageNum<=maxPageNum){jumpFund.showResultsPage(nextPageNum)}},goPrev:function(){clearTimeout(jumpFund.blurTimer);prevPageNum=jumpFund.currPageNumber-1;jumpFund.showResultsPage(prevPageNum)},closeClick:function(B){var A=$("jump_fund_results");el=(B.target)?B.target:B.srcElement;if(el.id!="jump_fund_results_next"&&el.id!="jump_fund_results_previous"&&el.id!="jump_fund_results_total"&&el.id!="jump_fund_results_list"&&el!=jumpFund.inputField&&A&&A.style.display=="block"){jumpFund.waitHideResults()}},highlightSearchString:function(A){needleExp=new RegExp(jumpFund.lastSearchString,"gi");haystackMod=A.replace(needleExp,'<span class="found">'+jumpFund.lastSearchString+"</span>");return haystackMod}};window.addEvent("domready",jumpFund.init);function setCaretToEnd(C){if(C.createTextRange){var A=C.createTextRange();A.collapse(false);A.select()}else{if(C.setSelectionRange){C.focus();var B=C.value.length;C.setSelectionRange(B,B)}}}function validatejump(){for(var A=0;A<document.getElementById("jump_fund_results_list").childNodes.length;A++){if(document.getElementById("jump_fund_results_list").childNodes[A]){if(document.getElementById("jump_fund_results_list").childNodes[A].className=="selected"){document.location=document.getElementById("jump_fund_results_list").childNodes[A].getElementsByTagName("A")[0].href}}}};