// Use the lovely jQuery to highlight active fields
$(document).ready(function(){
	
	// Add class on form field focus
	$("input,textarea").focus(function() {
		$(this).parent().addClass("fieldFocus")
		
		// If there's some help text in the field, copy it to the help panel
		if ( $(this).next("span.helpText").length > 0 ) {
			$("#formHelp").show('fast')
			$("#formHelpText").html($(this).siblings("span.helpText").html())
		}
	});
	
	$("input,textarea").blur(function() {
		$(this).parent().removeClass("fieldFocus")
		
		// Hide the help panel's form text
		$("#formHelp").hide('fast')
	});

	
	// Use the 'example' plugin to convert hint text
	$("input").example(function() {
		return $(this).siblings("span.hint").html(); 
	});


});
