(function($){
 $.fn.extend({
 
 	customStyle : function(options) {
	  if(!$.browser.msie || ($.browser.msie&&$.browser.version>6)){
	  return this.each(function() {
			var currentSelected = $(this).find(':selected');
			$(this).after('<span class="customStyleSelectBox '+$(this).attr('class')+'"><span class="customStyleSelectBoxInner"><b>'+currentSelected.text()+'</b></span></span>').css({position:'absolute', opacity:0,fontSize:$(this).next().css('font-size')});
			$(this).prepend('span.customStyleSelectBox');
			$(this).addClass('customSelectedSelect');
			$(this).appendTo($(this).next().find('span.customStyleSelectBoxInner'));
			
			var selectBoxSpan = $(this).find('span.customStyleSelectBoxInner');//.next();
			var selectBoxWidth = parseInt($(this).width()) - parseInt(selectBoxSpan.css('padding-left')) -parseInt(selectBoxSpan.css('padding-right'));			
			var selectBoxSpanInner = selectBoxSpan.find(':first-child');
			selectBoxSpan.css({display:'inline-block'});
			selectBoxSpanInner.css({width:selectBoxWidth, display:'inline-block'});
			var selectBoxHeight = parseInt(selectBoxSpan.height()) + parseInt(selectBoxSpan.css('padding-top')) + parseInt(selectBoxSpan.css('padding-bottom'));
			selectBoxHeight=20;
			w=$(this).parent().find('.customStyleSelectBoxInner').width();
			
			$(this).css('line-height', selectBoxHeight);
			$(this).height(selectBoxHeight).change(function(){
				// selectBoxSpanInner.text($(this).val()).parent().addClass('changed');   This was not ideal
			selectBoxSpanInner.html('<b>'+$(this).find(':selected').text()+'</b>').parent().addClass('changed');
				// Thanks to Juarez Filho & PaddyMurphy
			});
			
	  });
	  }
	}
 });
})(jQuery);
