var MailLink = Class.create ( { initialize: function( link_id, name, server ) { var link = $( link_id ); if( !link ) { return; } this.name = name; this.server = server; link.href = "#"; var self = this; link.onclick = function() { self.call(); }; }, call: function() { document.location.href = "mailto:" + this.name + '@' + this.server; return false; } });