(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="mformselect"><span class="customStyleSelectBoxInner">'+currentSelected.text()+'</span></span>').css({position:'absolute', opacity:0,fontSize:$(this).next().css('font-size')});
					var selectBoxSpan = $(this).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({display:'inline-block'});
					var selectBoxHeight = parseInt(selectBoxSpan.height()) + parseInt(selectBoxSpan.css('padding-top')) + parseInt(selectBoxSpan.css('padding-bottom'	));
					$(this).height(selectBoxHeight).change(function(){
					selectBoxSpanInner.text($(this).val()).parent().addClass('changed');
					});
				});  
			}
		}
	});
	
		$.fn.extend({ 
		customStyle2 : function(options) {
			if(!$.browser.msie || ($.browser.msie&&$.browser.version>6)){
				return this.each(function() {  
					var currentSelected = $(this).find(':selected');
					$(this).after('<span class="mformselect2"><span class="customStyleSelectBoxInner2">'+currentSelected.text()+'</span></span>').css({position:'absolute', opacity:0,fontSize:$(this).next().css('font-size')});
					var selectBoxSpan = $(this).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({display:'inline-block'});
					var selectBoxHeight = parseInt(selectBoxSpan.height()) + parseInt(selectBoxSpan.css('padding-top')) + parseInt(selectBoxSpan.css('padding-bottom'	));
					$(this).height(selectBoxHeight).change(function(){
					selectBoxSpanInner.text($(this).val()).parent().addClass('changed');
					});
				});  
			}
		}
	});
	
	$.fn.extend({
			customStyle3 : function(options) {
			if(!$.browser.msie || ($.browser.msie&&$.browser.version>6)){
				return this.each(function() {
					var currentSelected2 = $(this).find(':selected');
					$(this).after('<span class="langMenu"><span class="customStyleSelectBoxInner3">'+currentSelected2.text()+'</span></span>').css({position:'absolute', opacity:0,fontSize:$(this).next().css('font-size')});
					var selectBoxSpan2 = $(this).next();
					var selectBoxWidth2 = parseInt($(this).width()) - parseInt(selectBoxSpan2.css('padding-left')) -parseInt(selectBoxSpan2.css('padding-right'));			
					var selectBoxSpanInner2 = selectBoxSpan2.find(':first-child');
					selectBoxSpan2.css({display:'inline-block'});
					selectBoxSpanInner2.css({width:selectBoxWidth2, paddingRight:'10px', display:'inline-block'});
					var selectBoxHeight2 = parseInt(selectBoxSpan2.height()) + parseInt(selectBoxSpan2.css('padding-top')) + parseInt(selectBoxSpan2.css('padding-bottom'));
					$(this).height(selectBoxHeight2).change(function(){
					selectBoxSpanInner2.text($(this).val()).parent().addClass('changed');
					});	
				});
			}
		}
	});
})(jQuery);

$(function(){

//$('select.mformselect').customStyle();
//$('select.mformselect2').customStyle2();
//$('select.langMenu').customStyle3();

});
