$(function(){
	$(".egas-button:not(.ui-state-disabled)")
	.hover(
		function(){ 
			$(this).addClass("ui-state-hover"); 
		},
		function(){ 
			$(this).removeClass("ui-state-hover"); 
		}
	)
	.mousedown(function(){
			$(this).parents('.egas-buttonset-single:first').find(".egas-button.ui-state-active").removeClass("ui-state-active");
			if( $(this).is('.ui-state-active.egas-button-toggleable, .egas-buttonset-multi .ui-state-active') ){ $(this).removeClass("ui-state-active"); }
			else { $(this).addClass("ui-state-active"); }	
	})
	.mouseup(function(){
		if(! $(this).is('.egas-button-toggleable, .egas-buttonset-single .egas-button,  .egas-buttonset-multi .egas-button') ){
			$(this).removeClass("ui-state-active");
		}
	});
	$("input:text:not(#textQuery, #frmqry, #unamelgn),input:password:not(#passlgn),textarea").addClass("text ui-widget-content ui-corner-all")
		.hover(
		      function () {
		          $(this).addClass("textHover");
		        }, 
		        function () {
		        	$(this).removeClass("textHover"); 
		        }
		      )
       .focus(
				function () {
			      $(this).addClass("textFocus");
			   })
	   .blur(
				function () {
				   $(this).removeClass("textFocus");
				});
});