/**
* Filename:       CS_AntiSpamEmail.js
* Author:         W.Onis
* Date:           12/08/2009
* Purpose:        making mailto links possible with spam prevention
* Description:    Use * instead of @ in href mailto. This function will change it to @ again
**/

window.addEvent('domready', function() {
var href_nodes = document.getElements('a');

    href_nodes.each(function(href_node)
    {
        href_node.addEvents(
        {
            'click': function()
            {
                if (href_node.href.contains('mailto') && href_node.href.contains('*'))
                {
                href_node.href = href_node.href.replace('*','@');
                }
            }
        });
    });
});