$(function(){
   //switch input from text to password when focusing
    var pwd_fake = $('#pwd_fake');
    var pwd_real = $('#pwd_real');
    var fake = true;
    pwd_fake.focus(function(){
        if (!fake) return false;
        pwd_fake.toggle();
        pwd_real.show().focus();
        fake = false;
    });
    pwd_real.blur(function(){
        if (fake) return false;
        if (this.value.length == 0) {
            pwd_real.hide();
            pwd_fake.show().focus();
            fake = true;
        }
    });
    
    var mail = $('#mail');
    mail
    .focus(function(){
        if (this.value == 'Benutzername') {
            mail.select();
        }
    })
    .blur(function(){
        if (!this.value.length) this.value = 'Benutzername';
    });
    
    
    $('a').each(function(){
        if (this.href.substr(0,7) != 'mailto:') return true;
        var $this = $(this); // cache JQ-Object
        this.href = this.href.replace('(AT)','@').replace('(DOT)','.'); // replace in href
        $this.text( $this.text().replace('(AT)','@').replace('(DOT)','.') );
    });
});
