(function(n){n.fn.treeSelector=function(){var t=n(this);n(document).ready(function(){t.find("input[type=checkbox]").change(function(){var t=n(this).is(":checked"),r=n(this).parent().find("div"),u=r.find("input[type=checkbox]"),i;u.prop("checked",t).trigger("input");t||(i=n(this).parents("div.checkbox").children("input[type=checkbox]"),i.prop("checked",!1).trigger("input"))})});t.find(".collapse").on("show.bs.collapse",function(t){n(this).prev().find("span").addClass("glyphicon-chevron-up");n(this).prev().find("span").removeClass("glyphicon-chevron-down");t.stopPropagation()});t.find(".collapse").on("hide.bs.collapse",function(t){n(this).prev().find("span").removeClass("glyphicon-chevron-up");n(this).prev().find("span").addClass("glyphicon-chevron-down");t.stopPropagation()});return this}})(jQuery);$(document).ready(function(){function n(t,i,r){var f=t.children(".checkbox").children("input[type=hidden]:first-child()"),e=f.siblings("div.collapse"),s=e.find(".jobprofile-item"),u=!1,o=f.data("text").toLowerCase().indexOf(i)>=0||r;return s.each(function(){u=n($(this),i,o)||u}),o||u?(t.removeClass("hidden"),e.collapse("show"),!0):(t.addClass("hidden"),!1)}$("#removeRegions").click(function(){$("#regionsModal").find("input[type=checkbox]").prop("checked",!1)});$("#removeJobProfiles").click(function(){$("#jobProfilesModal").find("input[type=checkbox]").prop("checked",!1)});$(".jobprofiles").treeSelector();$("#jobProfilesFilterSearch").keyup(function(){var t=$(this).val();$(".root > .jobprofile-item").each(function(){n($(this),t.toLowerCase(),!1)})});$("#jobProfilesFilterClear").click(function(){$("#jobProfilesFilterSearch").val("");$(".jobprofile-item").removeClass("hidden")});$(".page-item").click(function(){this.className.indexOf("disabled")<0&&($("#pageNumber").val($(this).data("pagenumber")),$(this).closest("form").submit())});var t=function(){window.location.hash==="#search"&&$("#filter").focus()};$(window).on("hashchange",t);t()});$(document).ready(function(){$(".regions").treeSelector()});window.JobList=function(){function n(n,t,i){this.placeholder=n;this.template=t;this.model=i;this.InitializeList()}return n.prototype.InitializeList=function(){this.PopulateList(this.model)},n.prototype.UpdateList=function(n){this.placeholder.empty();this.model.Jobs=n;this.model.Pagination.CurrentPage=1;this.PopulateList(this.model)},n.prototype.PopulateList=function(n){this.placeholder.html(Mustache.render(this.template.html(),{DisplayRegionFilterOrJobProfileFilter:n.DisplayRegionFilter||n.DisplayJobProfileFilter,DisplayJobProfileFilter:n.DisplayJobProfileFilter,DisplayRegionFilter:n.DisplayRegionFilter,TotalJobsCount:n.TotalJobsCount,NotDisplayJobLocationAndDisplayRegionFilter:!n.DisplayJobLocation&&n.DisplayRegionFilter,DisplayJobLocation:n.DisplayJobLocation,DisplayJobDate:n.DisplayJobDate,DisplayCompanyPictures:n.DisplayCompanyPictures,Jobs:n.Jobs}))},n}()