(function(a){a.fn.fixSelect=function(c){var b=function(){return navigator.appVersion.indexOf("MSIE "+(arguments[0]||""))!=-1};return !b()?this:this.filter("select").each(function(){var e=a(this);var g=parseInt(e.width());var f=function(){var h=0;a("option",e).each(function(){var i=a(this).html().length*7;h=h<i?i:h});return h};var d={addAuto:function(){e.addClass("auto")},removeAuto:function(){e.removeClass("auto")},addClicked:function(){e.addClass("clicked")},removeClicked:function(){e.removeClass("clicked")},blur:function(){d.removeClicked();e.width(g);d.removeAuto()},mouseover:function(){var h=f();if(h>g){e.not(".auto").animate({width:h},100,d.addAuto)}},mouseout:function(){e.filter(".auto").not(".clicked").animate({width:g},100,d.removeAuto)},mousedown:function(){if(f()>g){d.addAuto()}},click:function(){if(e.not(".clicked")&&e.is(".auto")){d.addClicked()}}};e.addClass("fixed").wrap(a(c||"<div />").addClass("selectWrap").css({width:g=="auto"?null:g,"margin-top":e.css("margin-top"),"margin-right":e.css("margin-right"),"margin-bottom":e.css("margin-bottom"),"margin-left":e.css("margin-left")})).css({margin:0});e.change(d.removeAuto);e.blur(d.removeAuto);if(b(7)){e.mousedown(d.mousedown)}else{if(b(6)){e.click(d.click);e.mouseover(d.mouseover);e.mouseout(d.mouseout);e.change(d.blur);e.blur(d.blur)}}})}})(jQuery);