$().ready(function(){
	var hasFocus = null;
	
	var inactive = '#9ab9c6';
	var roll = '#586a7e';
	var active = '#254681';
	
	$('.button').hover(function() {
		$(this).animate({
			backgroundColor:active,
			borderTopColor:active,
			borderRightColor:active,
			borderBottomColor:active,
			borderLeftColor:active
		}, 250);
	}, function() {
		$(this).stop().animate({
			backgroundColor:roll,
			borderTopColor:roll,
			borderRightColor:roll,
			borderBottomColor:roll,
			borderLeftColor:roll
		}, 400);
	});
	
	$('label').hover(function() {
		if (hasFocus != $(this).attr('for')) {
			$(this).animate({backgroundColor: roll}, 250);
		}
	}, function() {
		if (hasFocus == $(this).attr('for')) {
			$(this).stop();
			//$(this).children('span').stop();
		} else {
			$(this).stop().animate({backgroundColor: inactive}, 400);
			//$(this).children('span').stop().animate({color: '#657abd'}, 400);
		}
	});

	$('input[type="text"]').add('textarea').focus(function() {
		$(this).parent().animate({backgroundColor: active}, 250);
		//$(this).parent().children('span').stop().animate({color: '#000000'}, 250);
		hasFocus = $(this).parent().attr('for');
	});
	
	$('input[type="text"]').add('textarea').blur(function() {
		$(this).parent().animate({backgroundColor: inactive}, 250);
		//$(this).parent().children('span').stop().animate({color: '#657abd'}, 250);
		hasFocus = null;
	});

	var container = $('ul#error');	
	// validate the form when it is submitted
	
});