[jQuery] Email Validation Dies with 1.3 Upgrade

[jQuery] Email Validation Dies with 1.3 Upgrade


I wrote this function to check an input field. I can fire it when the
field blurs or when the form is submitted. If an .error is visible
when the submit button is clicked, it won't be submitted until they
are all gone.
When I try to update to 1.3 this function no longer works.
jQuery.fn.form_realemail = function () {
    return this.each(function (){
        if ($(this).attr('value') != "") {
                error2 = 0;
                if ($(this).is("[@value$='@hotmail.com']")) { error2 = 1; }
                if ($(this).is("[@value$='@gmail.com']")) { error2 = 1; }
                if ($(this).is("[@value$='@yahoo.com']")) { error2 = 1; }
                if ($(this).is("[@value$='@msn.com']")) { error2 = 1; }
                if ($(this).is("[@value*='@']")) { } else { error2 = 2; }
                if ($(this).is("[@value*='.']")) { } else { error2 = 2; }
                if (error2 == "0") {
                    $(this).parent().find('.error').hide();
                }
                if (error2 == "1") {
                    $(this).parent().find('.error').show();
                    $(this).parent().find('.error').text("Company Emails Only.");
                }
                if (error2 == "2") {
                    $(this).parent().find('.error').show();
                    $(this).parent().find('.error').text("Enter A Valid Email
Address.");
                }
        }
        if ($(this).attr('value') == "") {
            $(this).parent().find('.error').show();
            $(this).parent().find('.error').text("Email Address is Required.");
        }
    });
}