YAHOO.namespace("emailverify");

YAHOO.emailverify.init = function() {
    YAHOO.util.Dom.addClass( "email-verify-error", "hide" );
    
    var email = YAHOO.util.Dom.get( "ezcoa-12_user_account_email" );
    if ( email.value != "" )
    {
        YAHOO.util.Dom.get( "confirm-email" ).value = email.value;
    }

    YAHOO.util.Event.addListener( "submit-button", "click", function( event ) { 
        var email = YAHOO.util.Dom.get( "ezcoa-12_user_account_email" );
        confirmEmail = YAHOO.util.Dom.get( "confirm-email" );
        
        if ( email.value == "" )
            return;
        
        if ( email.value != confirmEmail.value )
        {
            YAHOO.util.Dom.removeClass( "email-verify-error", "hide" );
            YAHOO.util.Dom.addClass( "validation-errors", "hide" );

            scroll( 0, YAHOO.util.Dom.getY("email-verify-error") - 100 );
            YAHOO.util.Event.preventDefault(event); 
        }
    });    
}

YAHOO.util.Event.onDOMReady( YAHOO.emailverify.init );
