//
// $Id: Emails.js,v 1.1.1.1 2010/02/26 08:30:21 steve Exp $
//
var Emails = function() {

    this.init = function() {

        $('a.emailLink').each(
            function() {
                var elem    = $(this)
                var emailId = $(elem).html()
                $.ajax({
                         type:     'POST',
                         url:      AJAXURL,
                         data:     'Action=getEmail&Id=' + emailId,
                         dataType: 'json',
                         timeout:  40000,
                    error:
                        function() {
                            return false;
                        },
                    success:
                        function(data){
                            $(elem).attr('href', 'html/contact.html?height=480&width=480')
                            $(elem).html(data.Email)
                        }
                }) 

            })
    }
}
