(function( $ ){
    // lavalamp
    jQuery.fn.lavaLamp = function() {
        return this.each(function(){
            obj = this;
            $("#lavamenu").animate(
                {width:$(obj).outerWidth()+5,marginLeft:$(obj).position().left},
                {duration:300, queue:false,"easing": "linear",complete:function(){$("#lavamenu").show();}}
            );
        });
    };
    //tratamento do foco em campo com txt de descricao
    jQuery.fn.txtFocus = function(txt) {
        return this.each(function(){
            var classOn = "ativo";
            //obj = this;
            $(this).focusin(function(){
                $(this).addClass("ativo");
                if ( $(this).not( $("select") ) ) {
                    $(this).val( ($(this).val() == txt)?"":$(this).val() );
                }
            }).focusout(function(){
                if ( $(this).val() == "" ) {
                    $(this).removeClass(classOn).val(txt);
                }
            });
            //).hasClass('foo')
            if ( $(this).val() == "" ) {
                if ( $(this).is("textarea,input") ) {
                    $(this).val(txt);
                }
            } else if ( $(this).val() != txt ) {
                $(this).addClass(classOn);
            }
        });
    };

})( jQuery );

function validaMail(email) {
    er = /^([\w-]+(\.[\w-]+)*)@(( [\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(\.[a-z]{2})?)$/i;
    return ( er.test(email) );
};

