(function($) {
	
	/*
	 * prepareForm - Prepare form and adding events on Inputs to illustrate the input highlight
	 * $Version: 2008.10.05
	 *
	 * Example: $(element).prepareForm();
	 */
	$.fn.prepareForm = function(){
		var activeClass = "active";
		return this.each(function(){
			$(this).find("input:not(:button), textarea, select").each(function(){
				$(this)
					.focus(function(){
						if ($(this).hasClass("Radio")==true || $(this).hasClass("Check")==true){
						} else {
							$(this).addClass(activeClass);
						}
						$(this).parents("form").find("label[for='"+ $(this).attr("id") +"']").addClass(activeClass);
					})
					.blur(function(){
						if ($(this).hasClass("Radio")==true || $(this).hasClass("Check")==true){
						} else {
							$(this).removeClass(activeClass);
						}
						$(this).parents("form").find("label[for='"+ $(this).attr("id") +"']").removeClass(activeClass);
					});
			});
		});
	}

})(jQuery);

	/*
	 * textCountdown - CountDown
	 * $Version: 2008.06.02
	 *
	 * Example: $('.countdown').textCountdown();
	 */	
	$.fn.textCountdown = function(){
		var countdown = {
	        init: function() {
	            countdown.remaining = countdown.max - $(countdown.obj).val().length;
	            if (countdown.remaining <= 0) {
	                $(countdown.obj).val($(countdown.obj).val().substring(0,(countdown.max-1)));
	            }
	            $(countdown.obj).siblings(".remaining").html((countdown.remaining-1) + " characters remaining.");
	        },
	        max: null,
	        remaining: null,
	        obj: null
	    };
	    return this.each(function() {
	        $(this)
				.focus(function() {
		            var c = $(this).attr("class");
		            countdown.max = parseInt(c.match(/limit_[0-9]{1,}_/)[0].match(/[0-9]{1,}/)[0]);
		            countdown.obj = this;
		            iCount = setInterval(countdown.init,100);
		        }).blur(function() {
		            countdown.init();
		            clearInterval(iCount);
		        });
	    });
	}
