(function(a){a.extend({fixIESelectWidth:new function(){function k(a,d){d=a.srcElement||a.target;if(d==this&&a.type!="mouseover"){return false}d=this;clearTimeout(c["A"+d._timerId]);var e="_"+d._timerId;var f=function(){d.runtimeStyle.width=""};if(a.type=="mouseover"){f()}else{b[e]=setTimeout(f,100)}}function j(a){var d=this;if(e&&e!=d){k.call(e,a)}var f="_"+d._timerId;var g="A"+d._timerId;clearTimeout(b[f]);var h=function(){clearTimeout(c[g]);if(Math.abs(j-i)>3){i+=(j-i)/3;d.runtimeStyle.width=i+"px";c[g]=setTimeout(h,0)}else{d.runtimeStyle.width="auto";d.selectedIndex=Math.max(0,d.selectedIndex)}};var i=d.offsetWidth;d.runtimeStyle.width="auto";var j=d.offsetWidth;clearTimeout(c[g]);if(i<=j)h();else d.runtimeStyle.width="";if(!e||e!=d)d.focus();e=d}function i(a){this.runtimeStyle.width=""}function h(e){var f=this;var g=false;e=e||this;if(e.className.indexOf("wrapped")!=-1)g=true;if(g)var h=e.parentNode.runtimeStyle;else var h=e.runtimeStyle;if(g)var l=e.parentNode.parentNode.runtimeStyle;else var l=e.parentNode.runtimeStyle;l.fonSize=0;if(a.browser.msie&&a.browser.version=="6.0"&&e.parentNode.parentNode.className=="pr-review-sort-wrapper"){return false}if(g)var m=e.parentNode.parentNode.currentStyle.display.toLowerCase();else var m=e.parentNode.currentStyle.display.toLowerCase();if(m==""||m=="inline"||m=="inline-block"){l.display="inline-block";l.width=e.offsetWidth+"px";if(e.offsetWidth==0){l.width="106px";if(a.browser.msie&&a.browser.version=="6.0"){l.width="100px"}}l.height=e.offsetHeight+"px";l.position="relative";h.position="absolute";h.top=0;h.left=0}e._timerId=d+=1;e.selectedIndex=Math.max(0,e.selectedIndex);b["_"+e._timerId]=setTimeout("void(0)",0);c["A"+e._timerId]=setTimeout("void(0)",0);a(e).mouseover(j);a(e).click(k);a(e).change(i);a(e).blur(i)}function g(a){if(typeof console!="undefined"&&typeof console.debug!="undefined"){console.log(a)}else{alert(a)}}var b={};var c={};var d=0;var e;var f=!!(document.uniqueID&&typeof XMLHttpRequest!="undefined");this.construct=function(a){return this.each(function(){if(!document.uniqueID&&!window.createPopup){return this}h(this)})}}});a.fn.extend({fixIESelectWidth:a.fixIESelectWidth.construct})})(jQuery)
