	$(function(){
		//all hover and click logic for buttons
		$(".ct-button:not(.ui-state-disabled)")
		.hover(
			function(){ 
				$(this).addClass("ui-state-hover"); 
			},
			function(){ 
				$(this).removeClass("ui-state-hover"); 
			}
		)
		.mousedown(function(){
				$(this).parents('.ct-buttonset-single:first').find(".ct-button.ui-state-active").removeClass("ui-state-active");
				if( $(this).is('.ui-state-active.ct-button-toggleable, .ct-buttonset-multi .ui-state-active') ){ $(this).removeClass("ui-state-active"); }
				else { $(this).addClass("ui-state-active"); }	
		})
		.mouseup(function(){
			if(! $(this).is('.ct-button-toggleable, .ct-buttonset-single .ct-button,  .ct-buttonset-multi .ct-button') ){
				$(this).removeClass("ui-state-active");
			}
		});
	});