//<![CDATA[
		   
$(document).ready(function() {

	//Wrap input and textareas with additional spans to add sliding doors background images
	$("select.text,input.text").wrap('<span class="input-right"><span class="input-left"></span></span>');
	$("textarea.text").wrap('<span class="textarea-right"><span class="textarea-left"></span></span>');
	
	//Hide the help text so it is revealed on focus
	$("span.help").hide();
	
	//Fade in help text (if it exists) when focusing on form fields
	$("input.text,select.text,textarea.text").each(function() {
		if ($(this).parent().parent().next("span.help").length > 0) {
			$(this).focus(function() {
				$(this).parent().parent().siblings("span.error").hide();
				$(this).parent().parent().next("span.help").fadeIn();
			}).blur(function() {
				$(this).parent().parent().next("span.help").fadeOut();
				$(this).parent().parent().siblings("span.error").show();
			});
		}
  	});
	
});
  
//]]>
