(function ($) { $(document).ready(function () { /* MSIE6 Flickering Image Fix */ try { doc.execCommand('BackgroundImageCache', false, true); } catch (e) {} $('select').Selectbox(); }); var MSIE = jQuery.browser.msie ? parseInt(jQuery.browser.version) : false; $.fn.Selectbox = function (options) { var settings = $.extend({ visible: 10 }, options), all_selects = this; function hideAll() { all_selects.each(function () { this.close(); }); } $('body').bind('click', function () { hideAll(); }); return this.each(function () { if (this.generated) { return; } var self = this, old_selectbox = $(this), select_width = parseInt(old_selectbox.width()), old_options = old_selectbox.find('option'), selected_index = self.selectedIndex, wrapper, value_holder, new_selectbox_string = ['
'); wrapper.append('' + old_options[selected_index].text + ''); wrapper.append(new_selectbox_string.join('')); value_holder = wrapper.find('a.value-holder'); value_holder.css('width', select_width + 'px'); value_holder.css('margin-right', '20px'); new_selectbox = wrapper.find('.new-selectbox'); new_selectbox.css('width', (wrapper.outerWidth() - 2) + 'px'); if (MSIE && (MSIE < 7)) { if (new_selectbox.is('div')) { new_selectbox.prepend('