/** Button Borders **/
.button-border(@gradient, @color) when (@gradient = false) {
	border: 1px solid @color;
}
.button-border (@gradient, @color) when (default()) {
	border: none;
}

.button-border-gradient (@gradient, @top, @bottom) when (@gradient = true) {
	border: 1px;
	border-image: -webkit-linear-gradient(@top,@bottom) 1 1;
	border-image: linear-gradient(to bottom, @top, @bottom) 1 1;
	border-image: -o-linear-gradient(top, @top, @bottom) 1 1;
}
.button-border-gradient (@gradient, @top, @bottom) when (default()) {
}

/** Button Backgrounds **/
.button-background (@gradient, @color, @image) when (@gradient = false) {
	background: @color url(@image) 50% 50% repeat-x;
}
.button-background (@gradient, @color, @image) when (default()) {
	background: none;
}

.button-background-gradient (@gradient, @top, @bottom) when (@gradient = true) {
	background: @top;
	background: -webkit-linear-gradient(top,  @top 0%,@bottom 100%);
	background: -o-linear-gradient(top,  @top 0%,@bottom 100%);
	background: -ms-linear-gradient(top,  @top 0%,@bottom 100%);
	background: linear-gradient(to bottom,  @top 0%,@bottom 100%);
	filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='@top', endColorstr='@bottom',GradientType=0 );
}

.button-background-gradient (@gradient, @top, @bottom) when (default()) {
}

.button-layout() {
	.button-border(@button-gradient, @button-border-default);
	.button-border-gradient(@button-gradient, @button-border-gradient-top-default, @button-border-gradient-bottom-default);
	.button-background(@button-gradient, @button-background-color-default, @button-image-default);
	.button-background-gradient(@button-gradient, @button-background-gradient-top-default, @button-background-gradient-bottom-default);
	color: @button-color-default;
	font-family: Lucida Grande,Lucida Sans,Arial,sans-serif;
	display: inline-block;
	position: relative;
	line-height: normal;
	margin-right: .1em;
	cursor: pointer;
	vertical-align: middle;
	text-align: center;
	overflow: visible;
	font-size: 11px !important;
	padding: .4em 1em;
	font-weight: bold;
}

.button-hover() {
	.button-border(@button-gradient, @button-border-hover);
	.button-border-gradient(@button-gradient, @button-border-gradient-top-hover, @button-border-gradient-bottom-hover);
	.button-background(@button-gradient, @button-background-color-hover, @button-image-hover);
	.button-background-gradient(@button-gradient, @button-background-gradient-top-hover, @button-background-gradient-bottom-hover);
	color: @button-color-hover;
}

.button-active() {
	.button-border(@button-gradient, @button-border-active);
	.button-border-gradient(@button-gradient, @button-border-gradient-top-active, @button-border-gradient-bottom-active);
	.button-background(@button-gradient, @button-background-color-active, @button-image-active);
	.button-background-gradient(@button-gradient, @button-background-gradient-top-active, @button-background-gradient-bottom-active);
	color: @button-color-active;
}

.button-disabled() {
	opacity: .35;
	filter: Alpha(Opacity=35);
	.button-background(@button-gradient, @button-background-color-default, @button-image-default);
	.button-background-gradient(@button-gradient, @button-background-gradient-top-default, @button-background-gradient-bottom-default);
	.button-border(@button-gradient, @button-border-hover);
	.button-border-gradient(@button-gradient, @button-border-gradient-top-default, @button-border-gradient-bottom-default);
	cursor: not-allowed;
	color: @button-color-disabled;
}

/* BUTTON CSS */
.btn, button, input[type="button"], input[type="reset"], input[type="submit"], .btn:visited, button:visited, input[type="button"]:visited, input[type="reset"]:visited, input[type="submit"]:visited {
	.button-layout();
	border-radius: @button-border-radius;
}
.btn:hover, button:hover, input[type="button"]:hover, input[type="reset"]:hover, input[type="submit"]:hover{
	.button-hover();
}
.btn:focus, button:focus, input[type="button"]:focus, input[type="reset"]:focus, input[type="submit"]:focus{
	.button-hover();
}
.btn:active, button:active, input[type="button"]:active, input[type="reset"]:active, input[type="submit"]:active{
	.button-active();
}
.btn:disabled, button:disabled, input[type="button"]:disabled, input[type="reset"]:disabled, input[type="submit"]:disabled{
	.button-disabled();
}

/* RADIOSET/CHECKSET */
.radioset input[type="radio"], .radioset input[type="checkbox"] {
	display:none;
}
.radioset input[type="radio"] + label, .radioset input[type="checkbox"] ~ label {
	.button-layout();
	margin-right: -3px;
}
.radioset input[type="radio"] + label:first-of-type, .radioset input[type="checkbox"] ~ label:first-of-type {
	border-top-left-radius: @button-border-radius;
	border-bottom-left-radius: @button-border-radius;
}
.radioset input[type="radio"] + label:last-of-type, .radioset input[type="checkbox"] ~ label:last-of-type {
	border-top-right-radius: @button-border-radius;
	border-bottom-right-radius: @button-border-radius;
}
.radioset input[type="radio"] + label:hover, .radioset input[type="checkbox"] ~ label:hover {
	.button-hover();
}
.radioset input[type="radio"]:checked + label, .radioset input[type="checkbox"]:checked + label {
	.button-active();
}

.radioset input[type="radio"]:disabled + label, .radioset input[type="checkbox"]:disabled + label {
	.button-disabled();
}
