function fixIESelectWidth(el) { var e; var initialWidth = 0; var init = function() { e = document.getElementById(el); initialWidth = e.style.width; if( ieversion <= 6 ) { e.onmouseover = expandSelect; } else { e.onmousedown = expandSelect; } e.onblur = contractSelect; e.onchange = onChange; } var expandSelect = function() { e.style.width = 'auto'; }; var contractSelect = function() { e.style.width = initialWidth; return false; } var onChange = function() { e.style.width = initialWidth; window.updateResults(); return false; } /* Only for IE */ if (/MSIE (\d+\.\d+);/.test(navigator.userAgent)) { //test for MSIE x.x; var ieversion = new Number(RegExp.$1); // capture x.x portion and store as a number init(); } }