$(window).load(function(){
    $('form .default-value')
	
		.addClass('quiet')
	
		.focus(function(){
			if ($(this).val() == $(this)[0].title){
				$(this).removeClass("quiet");
				if ($(this).parent("form")) $(this).parent("form").addClass("active-form");
					$(this).val("");
			}
		})
		
		.blur(function(){
			if ($(this).val() == ""){
				$(this).addClass("quiet");
				if ($(this).parent("form")) $(this).parent("form").removeClass("active-form");
					$(this).val($(this)[0].title);
			}
		})
		
		.blur()
		
		.parent('form').submit(function(event){
			$(this).parent().find('.default-value').each(function(){                
				if($(this).val() == $(this).attr('title')){
                    if (!$(this).hasClass('optional')){   //campul e optional, dar are default value
					    event.preventDefault();
					    $(this).effect('pulsate', { times:4 });
                    }
				}				
			});
		});
	
});

//function for equal heights
function sameHeights($element){
    var elementHeight = 0;
    $element.each(function(){ 
        var height = $(this).height();
        if(height>elementHeight){
            elementHeight = height;
        }        
    });
    
    $element.height(elementHeight);
}
