$.fn.customButton = function(options){
	
	opt = $.extend({rightWidth:13,height:23},options)
	_rightWidth = opt.rightWidth;
	var _height = opt.height;

	this.each(function(){

		var t = $(this);
		if(!t.hasClass("combo")){
			
			t.addClass("combo");
			var btnWidth = t.width()
			var clickfunction = t.attr('onclick');
			
			if(btnWidth <= 0){
				btnWidth = parseInt(parseFloat(t.css("width").split("px")[0]))
			}

			t.removeAttr("onclick")
			
			t.right = $("<div class='right'></div>").css({
				width:_rightWidth,
				height:_height,
				'float':'right',
				marginBottom:t.css('marginBottom')
			}).addClass(t[0].className)//.click(clickfunction)
			
			t.bounds = $("<div class='bounds'></div>").css({
				width:btnWidth,
				height:_height,
				cursor:'pointer',
				position:'relative',
				display:t.css('display'),
				marginBottom:t.css('marginBottom'),
				marginRight:t.css('marginRight'),
				marginTop:t.css('marginTop'),
				marginLeft:t.css('marginLeft'),
				top:t.css('top'),
				left:t.css('left')
			}).addClass(t[0].className)
			try{		
				if(t.css('margin').length > 0){
					t.bounds.css({margin:t.css('margin')})
				}
			}catch(e){}
			
			if(t.css("float").length >0){
				t.bounds.css({'float':t.css("float")});
			}	
			
			t.css({
				width:btnWidth-(_rightWidth*2),
				'float':'left',
				paddingLeft:_rightWidth,
				textAlign:'center',
				height:_height,
				lineHeight:_height+"px",
				marginRight:0,
				marginTop:0,
				marginLeft:0,
				top:0,
				overflow:'hidden',
				left:0
			}).wrap(t.bounds).after(t.right).addClass("left").show()
			t.parent().click(function(){
				if(!$(this).hasClass('dissabled') && clickfunction){
					clickfunction()
				}
			})
			t.attr('tabindex',0).focus(function(){
				t.css({'textDecoration':'underline'})
			}).blur(function(){
				t.css({'textDecoration':'none'})
			}).onEnter(clickfunction)
		}
		
	})
	
	return this;
}
