var btDropDownList=function(){return function(n){var t={baseChosen:n.fn.chosen,chosen:function(t){typeof this.baseChosen!="undefined"&&this.baseChosen(t);var i=n(this).attr("data-maxWidth");i!=undefined&&n(this).next(".chosen-container").css("max-width",i+"px")}};n.extend(n.fn,t)}(jQuery),{onChange:function(n,t,i,r){var f=$(n),e,u;f.data("previousvalue",n.value);typeof Global!="undefined"&&f.attr(Global.Constants.Subs.AlertOnExpiredCertAttr)==="true"&&(e=btDropDownList.getListItem(f,f.val()).first(),e.attr(Global.Constants.Subs.ExpiredCertAttr)==="true"&&setTimeout(function(){btMaster.btAlert(e.text()+" has an expired insurance certificate.")},10));t!==undefined&&(u=$("#"+t),n.value!=="-1"?(u.removeClass("drop-down--edit-link-disable"),u.attr("onclick",$("#"+r).val()),u.attr("title",i)):(u.addClass("drop-down--edit-link-disable"),u.attr("onclick","return false;"),u.attr("title",Global.Constants.DropDownFactory.DropDownFactoryConstants.DropdownEditDisabledTitle)))},enableListItem:function(n,t){n!=null&&(n.attr("style","color: black"),n.attr("style","background-color: white"),n.removeAttr("disabled"));t!=null&&t.css("display","list-item")},showListItem:function(n,t){n!=null&&(n.attr("style","color: black"),n.attr("style","background-color: white"),n.removeAttr("disabled"));t!=null&&t.removeAttr("disabled")},disableListItem:function(n,t){n!=null&&(n.attr("style","color: gray"),n.attr("style","background-color: silver"),n.attr("disabled","disabled"));t!=null&&t.css("display","none")},showChosenListItem:function(n,t){this.getListItem(n,t).removeAttr("disabled","disabled")},showChosenListItemInView:function(n,t){this.getListItem(n,t).show()},hideChosenListItem:function(n,t){this.getListItem(n,t).attr("disabled","disabled")},hideChosenListItemFromView:function(n,t){this.getListItem(n,t).hide()},hideListItem:function(n,t){n!=null&&(n.attr("style","color: gray"),n.attr("style","background-color: silver"),n.attr("disabled","disabled"));t!=null&&t.attr("disabled","true")},getListItem:function(n,t){return $(n).find(btStringHandler.format("option[value='{0}']",t))},getChosenListItem:function(n,t){return $(n).parent().find("ul.chosen-results").children().filter(function(){return $.text([this])===$(t).text()})},getSelectedListItem:function(n){return $(n).find(":selected")},setSelectedListItem:function(n,t){$(n).val(t);btDropDownList.refresh($(n))},setSelectedListItemWithAnimation:function(n,t,i){var r=$("div"+n+"_chosen.chosen-container.chosen-container-single").find("a.chosen-single"),u=i?"":r.css("background-color"),f=i?"":r.css("border-color");r.stop(!0,!0).animate({"border-color":"#dfa03d","background-color":"#feffb6"},{duration:50}).animate({"background-color":u},1e3,function(){r.css("border-color",f);r.css("background-color",u)});$(n).val(t);btDropDownList.refresh($(n))},setSelectedIndex:function(n,t){$(n).prop("selectedIndex",t);btDropDownList.refresh($(n))},disable:function(n,t){btDropDownList.refresh($(n).prop("disabled",t))},refresh:function(n){$(n).trigger("chosen:updated")},addGroupedItemElement:function(n,t,i,r){var e='optgroup[label="'+t+'"]',u=$(n).find(e),f;u.html()==null&&(f='<optgroup label="'+t+'"><\/optgroup>',r>-1?$(n).find("optgroup").eq(r).before(f):$(n).append(f),u=$(n).find(e));u.append(i)},addGroupedItem:function(n,t,i,r,u){var f='<option value="'+r+'">'+i+"<\/option>";btDropDownList.addGroupedItemElement(n,t,$(f),u)},addItem:function(n,t,i){var r=$(n),u=$('<option value="'+i+'">'+t+"<\/option>");r.append(u)},clearItems:function(n){$(n).empty()}}}()