var srchhost="http://www.fanhouse.com/search-api/";function lookup(inputString){var inputString=inputString.toLowerCase();if(inputString.length<2){$('#suggestions').hide();$('ul#srchRsltsHdr').hide();$('#remItems').hide()}else{$('#suggestions').show();$('#autoSuggestionsList').empty();jQuery.getJSON(srchhost+"?version=2.2&start=0&rows=10&indent=on&q=sport-name%3A"+sportName+"+AND+category%3APLAYER+AND+"+inputString+"*&wt=json&json.wrf=?",function(data){ordList=$("<div></div>").appendTo("#autoSuggestionsList");$(data.response).each(function(j,result){var numFound=result['numFound'];if(numFound==0){$('#srchRsltsHdr').hide();$('#autoSuggestionsList').height(20);$('#autoSuggestionsList').html('<span class="noRsltsTxt">No results found for <b>'+inputString+'</b></span>')}else if(numFound==1){$('#srchRsltsHdr').show("slow");$('#remItems').hide("fast");$('#autoSuggestionsList').height(30)}else if(numFound==2){$('#srchRsltsHdr').show("slow");$('#remItems').hide("fast");$('#autoSuggestionsList').height(60)}else if(numFound==3){$('#srchRsltsHdr').show("slow");$('#remItems').hide("fast");$('#autoSuggestionsList').height(90)}else if(numFound==4){$('#srchRsltsHdr').show("slow");$('#remItems').hide("fast");$('#autoSuggestionsList').height(120)}else if(numFound==5){$('#srchRsltsHdr').show("slow");$('#remItems').hide("fast");$('#autoSuggestionsList').height(150)}else if(numFound==6){$('#srchRsltsHdr').show("slow");$('#autoSuggestionsList').height(175)}else{$('#srchRsltsHdr').show("slow");$('#remItems').empty();var rem=numFound-6;$('#remItems').show();$('#remItems').html('<span class="noRsltsTxt">'+rem+'</span> more');$('#autoSuggestionsList').height(175)}});$(data.response.docs).each(function(i,item){ordList.append('<ul class="srchItems"><li class="plyrNm"><a href="'+item['player-url']+'">'+item['player-first-name']+' '+item['player-last-name']+'</a></li><li class="plyrPstn">'+item['player-position']+'</li><li class="plyrTeam"><a href="'+item['team-url']+'">'+item['player-team-city']+' '+item['player-team-name']+'</a></li></ul>');$("#autoSuggestionsList ul.srchItems:even").addClass("altRw")})})}}function fill(thisValue){$('#inputString').val(thisValue);$('#suggestions').hide()}function setDefHighlight(){var currPath=location.pathname;$("#chnnlNav ul .chnnlNavTab").children("a").map(function(){var child=$(this);if(child.attr("href").length>0){var thisUrl=child.attr("href");var thisPath=thisUrl.substr((thisUrl.indexOf(".com")+4),thisUrl.length);if(thisPath.length<1){thisPath="/"}if((thisPath.indexOf(currPath)>-1&&currPath.length>1)||currPath==thisPath){child.parent(".chnnlNavTab").addClass("slctd")}}})}jQuery(document).ready(function(){$(".entry-title a").bind("mouseenter",function(e){$(this).addClass("hghLght")});$(".entry-title a").bind("mouseleave",function(e){$(this).removeClass("hghLght")});$(".sprtSubNav a").bind("mouseenter",function(e){$(this).addClass("hghLght")});$(".sprtSubNav a").bind("mouseleave",function(e){$(this).removeClass("hghLght")});if($("#chnnlHome").length>0){setDefHighlight()}else{$(".mainLnk").addClass("bttn")}$("#fhNav .subNav ul li:last").css('border-bottom','none');$(".fdbckLnk").mouseover(function(){$(this).addClass("bttn")}).mouseout(function(){$(this).removeClass("bttn")});$(".fhNavTab").mouseover(function(){$(this).addClass("slctd")}).mouseout(function(){$(this).removeClass("slctd")});$("#sprtSubNavTab").mouseover(function(){$("#sprtSubNav").show()});$("#sprtSubNavTab").mouseout(function(){$("#sprtSubNav").hide()});$("#scrsSubNavTab").mouseover(function(){$("#scrsSubNav").show()});$("#scrsSubNavTab").mouseout(function(){$("#scrsSubNav").hide()});$("#myNwsSubNavTab").mouseover(function(){$("#myNwsSubNav").show()});$("#myNwsSubNavTab").mouseout(function(){$("#myNwsSubNav").hide()});$("#htTpcsSubNavTab").mouseover(function(){$("#htTpcsSubNav").show()});$("#htTpcsSubNavTab").mouseout(function(){$("#htTpcsSubNav").hide()});$("#wrtrsSubNavTab").mouseover(function(){$("#wrtrsSubNav").show()});$("#wrtrsSubNavTab").mouseout(function(){$("#wrtrsSubNav").hide()});$("#fntsySubNavTab").mouseover(function(){$("#fntsySubNav").show()});$("#fntsySubNavTab").mouseout(function(){$("#fntsySubNav").hide()});$("#forumsSubNavTab").mouseover(function(){$("#forumsSubNav").show()});$("#forumsSubNavTab").mouseout(function(){$("#forumsSubNav").hide()});$("#shopSubNavTab").mouseover(function(){$("#shopSubNav").show()});$("#shopSubNavTab").mouseout(function(){$("#shopSubNav").hide()});$("#fhToGoSubNavTab").mouseover(function(){$("#fhToGoSubNav").show()});$("#fhToGoSubNavTab").mouseout(function(){$("#fhToGoSubNav").hide()});$("div#chnnlTms").hide();$(".chnnlNavTab").mouseover(function(){$(this).addClass("slctd")}).mouseout(function(){$(this).removeClass("slctd");setDefHighlight()});$("#srch").mouseover(function(){$("div#suggestBox").show()}).mouseout(function(){$("div#suggestBox").hide()});$("#chnnlPlyrs").mouseover(function(){$("div#plyrSrch").show()}).mouseout(function(){$("div#plyrSrch").hide()});$("#chnnlTeams").mouseover(function(){$("div#chnnlTeamsLst").show()}).mouseout(function(){$("div#chnnlTeamsLst").hide()})});
