$(document).ready(function() {

	if ( $("#ctrl_username").length > 0 ) {
	
		$("#ctrl_username").addClass("validate[required,custom[noSpecialCaracters],length[0,100]]");
	
	}

	if ( $("#ctrl_email").length > 0 ) {
	
		$("#ctrl_email").addClass("validate[required,custom[email],length[0,100]]");
	
	}

	if ( $("#ctrl_password").length > 0 ) {
	
		$("#ctrl_password").addClass("validate[required,custom[noSpecialCaracters],length[0,100]]");
	
	}	

	if ( $("#ctrl_password_confirm").length > 0 ) {
	
		$("#ctrl_password_confirm").addClass("validate[required,custom[noSpecialCaracters],length[0,100]]");
	
	}

	$("form").validationEngine(); // Form vallidation


		
		$("#teaser-container .equalize").equalHeights(); 
	});

(function($) {
	$.fn.equalHeights = function() {
		var targetHeight = 0;
		this.each(function() {
			if ($(this).height() > targetHeight)
				targetHeight = $(this).height();
		});
		this.each(function() {
			$('.image_container', this).css('position','absolute');
			$('.image_container', this).css('bottom','0px');
			$(this).height(targetHeight);
			
		});
		return this;
	};
})(jQuery);
