
jQuery(function() {
	
	/**
	 * Form focus.
	 */
	$('input, textarea').focus(function() {
		$(this).parent('.input-wrapper').addClass('focus');
	}).blur(function() {
		$(this).parent('.input-wrapper').removeClass('focus');
	});
	
	/**
	 * Hides form error and focus underlying input element.
	 */
	$('.input-wrapper .error').one('click', function() { 
		$(this)
			.hide()
			.parent('.input-wrapper')
			.find('input, textarea')
			.focus();
	});
});

