function SearchHelper(){}(function(A){A("body").ready(function(){});SearchHelper.getJsonSearchParam=function(D,C,B,F){var E="{";if(!(D=="")){E=E.concat("'st':'"+D+"',");}if(!(C=="")){C=C.replace("'",'"');E=E.concat("'ss':'"+C+"',");}if(!(B=="")){E=E.concat("'pi':'"+B+"',");}if(!(F=="")){E=E.concat("'sb':'"+F+"',");
}E=E.concat("}");return E;};SearchHelper.invokeSearchControllerAdvanced=function(F,E,B,I,D){var H=SearchHelper.getJsonSearchParam(F,E,B,I);var G=A("#_webapp_path").val();var C="{'dsp':'all'}";if(A(D).is("*")){C=A(D).val();}window.location=G+"/search?sp="+H+"&asp="+C;};SearchHelper.invokeSearchController=function(E,D,B,H){var G=SearchHelper.getJsonSearchParam(E,D,B,H);
var F=A("#_webapp_path").val();var C="{'dsp':'all'}";if(A("#_asp").is("*")){C=A("#_asp").val();}window.location=F+"/search?sp="+G+"&asp="+C;};SearchHelper.performBrowse=function(C,B,F){var E=SearchHelper.getJsonSearchParam(C,B,"","");var D=A("#_webapp_path").val();window.location=D+"/search?sp="+E+"&asp="+F;
};SearchHelper.performSearch=function(E,D,B,H,C){var G="UNIVERSITY";if(E!=null){G=E;}var F="";if(D!=null){F=D;}if(F==""&&G=="ALL"){G="UNIVERSITY";}if(C==null||C==""){C="{}";}A("#search_container").html(A("#waiting_message").clone().html());forward.getWidget("search/default?sp="+SearchHelper.getJsonSearchParam(E,D,B,H)+"&asp="+C,function(I){A("#search_container").html(I);
});};SearchHelper.performCampusTalkSearch=function(D,C,B){A("#campustalk_search_container").html(A("#waiting_message").clone().html());forward.getWidget("search/campustalk?st="+D+"&ss="+C+"&pi="+B,function(E){A("#campustalk_search_container").html(E);});};SearchHelper.invokeCampusTalkSearchController=function(D,C,B){var E=A("#_webapp_path").val();
window.location=E+"/campustalksearch?st="+D+"&ss="+C+"&pi="+B;};SearchHelper.invokeCampusTalkQuestionAnswersController=function(C,B){forward.getWidget("campustalk/question_answers?id="+C+"&p="+B,function(D){A("#question_answers_container").html(D);});};SearchHelper.invokeProviderWidgetController=function(F,E,C,D,B){forward.getWidget(E+"?id="+C+"&t="+D+"&p="+B,function(G){A(F).html(G);
if(F=="#course_add_container"){ProviderHelper.enableProviderInnerSearch("#searchCourseInput","course");}if(D=="PROVIDER_UNIVERSITY"){UniversityHelper.enableCampusTalk(C);}if(D=="PROVIDER_GROUP"){Group.enableCampusTalk(C);}});};SearchHelper.invokeWidgetController=function(G,F,D,E,C,B){forward.getWidget(F+"?id="+D+"&p="+B+"&u="+C+"&t="+E,function(H){A(G).html(H);
if(E=="PROVIDER_UNIVERSITY"&&F=="article/list"){UniversityHelper.enableUniversityArticle(D);}if(E=="PROVIDER_UNIVERSITY"&&F=="content/list"){UniversityHelper.enableUniversityContent(D);}if(E=="PROVIDER_GROUP"&&F=="group/university"){Group.enableGroupTabInfo(D);}});};SearchHelper.invokeWidgetControllerWithQueryString=function(B,C){forward.getWidget(C,function(D){A(B).html(D);
});};SearchHelper.enableFullSearchLink=function(){A("#searchGo").click(function(){var C=escape(A("#searchStringInput").val());var B=A("#_webapp_path").val();window.location=B+"/fullsearch?ss="+C;});A("#searchStringInput").autocomplete("/autocomplete/fullsearch",{minChars:2,matchContains:true,matchSubset:false,extraParams:{type:function(){return"FULLSEARCH";
}},formatItem:function(D,C,B){return D[0];},formatResult:function(B){return B[0];}}).result(function(C,B){location.href=B[1];});};})(jQuery);