(function(a){a.fn.extend({customSelect:function(b){if(typeof document.body.style.maxHeight!="undefined"){var c={customClass:null,mapClass:true,mapStyle:true};var b=a.extend(c,b);return this.each(function(){var d=a(this);var f=a('');var e=a('').append(f);d.after(e);if(b.customClass){e.addClass(b.customClass)}if(b.mapClass){e.addClass(d.attr("class"))}if(b.mapStyle){e.attr("style",d.attr("style"))}d.bind("update",function(){d.change();var h=parseInt(d.outerWidth())-(parseInt(e.outerWidth())-parseInt(e.width()));e.css({display:"inline-block"});f.css({width:h,display:"inline-block"});var g=e.outerHeight();d.css({"-webkit-appearance":"menulist-button",width:e.outerWidth(),position:"absolute",opacity:0,height:g,fontSize:e.css("font-size")})}).change(function(){var g=d.find(":selected");var h=g.html()||" ";f.html(h).parent().addClass("customSelectChanged");setTimeout(function(){e.removeClass("customSelectOpen")},60)}).bind("mousedown",function(){e.toggleClass("customSelectOpen")}).focus(function(){e.addClass("customSelectFocus")}).blur(function(){e.removeClass("customSelectFocus customSelectOpen")}).trigger("update")})}}})})(jQuery);