document.documentElement.className = 'js'; $.extend({URLEncode:function(c){var o='';var x=0;c=c.toString();var r=/(^[a-zA-Z0-9_.]*)/; while(x1 && m[1]!=''){o+=m[1];x+=m[1].length; }else{if(c[x]==' ')o+='+';else{var d=c.charCodeAt(x);var h=d.toString(16); o+='%'+(h.length<2?'0':'')+h.toUpperCase();}x++;}}return o;}, URLDecode:function(s){var o=s;var binVal,t;var r=/(%[^%]{2})/; while((m=r.exec(o))!=null && m.length>1 && m[1]!=''){b=parseInt(m[1].substr(1),16); t=String.fromCharCode(b);o=o.replace(m[1],t);}return o;} }); document.documentElement.className = 'js'; $(document).ready(function(){ $("#con_Nav").css({'zIndex':'1000'}); $("#con_Nav > ul > li > ul").css({'margin-top':'5px'}); $("#con_Nav > ul > li").hover( function(){ //$(this).children("ul").cildren("li").css({'padding-top':'7px'}); $(this).children("ul").show(); }, function(){ $("#con_Nav > ul > li > ul").hide(); } ); //chooses the type of search experts vs site $("#search-submit").click(function () { if ($("input[@name='group1']:checked").val() == "experts") { window.location = "http://www.nera.com/Experts.htm?" + "submitExp=Submit&keyword=" + $("#search1").val(); } else { var myval = $("#search1").val(); window.location = "http://www.nera.com/Search.htm?start=0&q=" + escape(myval) } }); $('#search1').keyup(function(e) { if(e.keyCode == 13) { if ($("input[@name='group1']:checked").val() == "experts") { window.location = "http://www.nera.com/Experts.htm?" + "submitExp=Submit&keyword=" + $("#search1").val(); } else { var myval = $("#search1").val(); window.location = "http://www.nera.com/Search.htm?start=0&q=" + escape(myval) } } }); $("#btn_submit_pub").click(function () { var q = "Nera Publications"; var ty = "Publication"; var pt = $("#Select1").val(); var dt = $("#Select2").val(); var au = $("#Select3").val(); var pa = $("#pa").val(); var fa = $("select[name='farea']:visible").val(); var findex = $("#findex").val(); var pindex = $("#pindex").val(); var aindex = $("#aindex").val(); if(fa == null){ var fa = "" } var pafa = pa + ":" + fa window.location = "67_208.htm?start=0&q=" + q + "&ty=" + ty + "&pt=" + pt + "&dt=" + dt + "&au=" + au + "&pafa=" + pafa + "&findex=" + findex + "&pindex=" + pindex + "&aindex=" + aindex }); //Clear the search box text $("#search1").focus(function () { $(this).val(""); }); //Hide extra Experts var myList = $(".rightExp").children("li"); for(var i = 0; i < myList.length + 1; i++) { if(i > 7) {$(".rightExp li:nth-child("+i+")").addClass("hidden"); $(".viewall").removeClass("hidden"); } } //HIDING EXTRA MENU ITEMS $("div#sidebar2_all div.subMenu").each(function() { var listItems = $(this).find("ul li a"); for(var i = 0; i < listItems.length + 1; i++) { if (i > 6 ) { $(this).find("ul li:nth-child("+i+")").addClass("hidden"); $(".viewall").removeClass("hidden"); } } });$(".subMenu").css({'display' : 'none'}); $("#Nav_Right > li > a").click(function(){ $(this).next("div.subMenu").toggle(); return false; }); $("ul#Nav_Right > li").each(function() { //skip the header with firstBlue class if ( $(this).attr("class") == "firstBlue" ) { return "continue"; } if ( $(this).find("div.subMenu > ul > li").size() <= 1 ) { if ($(this).find("div.subMenu > ul > li.viewall").size() > 0) { $(this).hide(); } else if ( ($(this).find("div.subMenu > ul > li.viewall").size() == 0) && ($(this).find("div.subMenu > ul > li").size() == 1) ){ return "continue"; } else { $(this).hide(); } } }); //hide header with firstblue class if list under it is empty if ( $("ul#Nav_Right > li:not(:hidden) ").size() >= 2 ) { //do nothing } else { $("ul#Nav_Right > li.firstBlue").hide(); }//Variables for total results display var totals = $(".total").children("td"); var arrTotal = totals.map(function(){ return this.innerHTML; }) //Set dropdown indexes $("#title").change(function () { var ttindex = $("#title option").index($("#title option:selected")); $("#tindex").val(ttindex); }); $("#practice").change(function () { var tpindex = $("#practice option").index($("#practice option:selected")); $("#pindex").val(tpindex); }); $("#farea").change(function () { var tfindex = $("#farea option").index($("#farea option:selected")); $("#findex").val(tfindex); }); $("#office").change(function () { var toindex = $("#office option").index($("#office option:selected")); $("#oindex").val(toindex); }); $("#language").change(function () { var tlindex = $("#language option").index($("#language option:selected")); $("#lindex").val(tlindex); }); var z = 0 var resultMinus = 0 //Set traverse variables var searchFormRows = $(".hilight"); var first = searchFormRows.children(".name").children("a").children(".first"); var cacheFirst = first.map(function(){ return this.innerHTML.toLowerCase(); }); var last = searchFormRows.children(".name").children("a").children(".last"); var cacheLast = last.map(function(){ return this.innerHTML.toLowerCase(); }); var altfirst = searchFormRows.children(".name").children("a").children(".altfirst"); var cacheAltFirst = altfirst.map(function(){ return this.innerHTML.toLowerCase(); }); var altlast = searchFormRows.children(".name").children("a").children(".altlast"); var cacheAltLast = altlast.map(function(){ return this.innerHTML.toLowerCase(); }); // Filter results on first and last name searchFormRows.each(function(i){ if (cacheFirst[i].search(firstName) != 0 && cacheAltFirst[i].search(firstName) != 0 && firstName != "" ) { $(this).addClass("hidden"); resultMinus = resultMinus + 1 } else if(cacheLast[i].search(lastName) != 0 && cacheAltLast[i].search(lastName) != 0 && lastName != "" ){ $(this).addClass("hidden"); resultMinus = resultMinus + 1 } }); // total count totals.each(function(i){ z = z + parseInt(arrTotal[i]) }); resultTotal = z - resultMinus $("#counter").text(resultTotal); //Special Cases //Dunbar if(lastName == "dunbar") { $("#results-table tr:nth-child(1)").after(" \ Dr. Fred Dunbar

\ As of September 2009, Dr. Fred Dunbar has been appointed as Economic Fellow in the
Office of Economic Analysis of the US Securities and Exchange Commission.

\ See our related press release. \ For inquiries related to finding an economic expert, please contact:

\ Dr. Robert Mackay
\ Senior Vice President and Chair of NERA's Global Securities and Finance Practice
\ + 1 202 466 9291
\ robert.mackay@nera.com \ "); } function showFocusArea() { //index of the selected element var cur_index = $("#practice option").index($("#practice option:selected")); //clearing up the dropdown list $("select#farea").html(''); //creating new option elements and inserting them the Focus Area dropdown $("ul.hidden li." + cur_index).each(function() { var li_value = $(this).text(); $("select#farea").append('"'); }); //showing or hiding caption and dropdown list var fa = $("#practice option:selected").val(); if (fa != "") { $(".fa").show(); $("select#farea").show(); } else { $(".fa").hide(); $("select#farea").hide(); } } $(".fa").hide(); //SHOWING SEARCH TERMS //POPULATING FORM WITH SELECTED ELEMENTS if (tindex != "") { $("form #title option[selected]").removeAttr("selected"); $("form #title option:nth-child("+(parseFloat(tindex)+1)+")").attr("selected", "selected"); } if (pindex != "") { $("form #practice option[selected]").removeAttr("selected"); $("form #practice option:nth-child("+(parseFloat(pindex)+1)+")").attr("selected", "selected"); showFocusArea(); } else { $(".fa").hide(); } if (findex != "") { //$(".fa").show(); $("form #farea option[selected]").removeAttr("selected"); $("form #farea option:nth-child("+(parseFloat(findex)+1)+")").attr("selected", "selected"); } if (oindex != "") { $("form #office option[selected]").removeAttr("selected"); $("form #office option:nth-child("+(parseFloat(oindex)+1)+")").attr("selected", "selected"); } if (lindex != "") { $("form #language option[selected]").removeAttr("selected"); $("form #language option:nth-child("+(parseFloat(lindex)+1)+")").attr("selected", "selected"); } $("#practice").change(function () { showFocusArea(); }); //stripping double quotes from text inputs $("form.jqtransform").submit(function() { $("input#fname").val( $("input#fname").val().replace(/"/g, "") ); $("input#lname").val( $("input#lname").val().replace(/"/g, "") ); $("input#keyword").val( $("input#keyword").val().replace(/"/g, "") ); }); //RESET BUTTON CLICK $("form.jqtransform input.btn_clear").click(function() { $("select#title option:nth-child(1)").attr("selected", "selected"); $("select#practice option:nth-child(1)").attr("selected", "selected"); $("select#language option:nth-child(1)").attr("selected", "selected"); $("select#office option:nth-child(1)").attr("selected", "selected"); $("select#farea option:nth-child(1)").attr("selected", "selected"); $(".fa").hide(); $("#farea").hide(); $("input#tindex").val(""); $("input#pindex").val(""); $("input#findex").val(""); $("input#oindex").val(""); $("input#lindex").val(""); $("input#fname").val(""); $("input#lname").val(""); $("input#keyword").val(""); }); });