<!--
/*
+----------------------------------------------------------------------------------------------
| gotopage 3.0 - Content Management by Rosman
| Copyright (c) 2003 - 2005 Rosman (http://www.rosman.co.at)
|
| Author(s): Johan Rosman <johan@rosman.co.at>
| Credits:   Peter-Paul Koch (http://www.quirksmode.org)
+----------------------------------------------------------------------------------------------
| Purpose
| spam protection: asign e-mail addresses to 'email links'
| email links are recognised by:
|    class == mail
|    id is set (and it is supposed to be the user part of the email
|               address: <id> at <domain>)
| a subject can be specified by setting
|    href = "?subject=my subject"
+----------------------------------------------------------------------------------------------
| Dependencies
| event.js, class.js
+----------------------------------------------------------------------------------------------
| Version   Date         Comment
| 3.04      2005/10/11   issue 135: include a subject
| 3.03      2005/09/23   issue 24, new register event handling
| 3.02      2005/06/10   onload concept, usage of class.js
| 3.01      2004/03/31   initial version
+----------------------------------------------------------------------------------------------
*/

if ( !window._email ) {
/*
+----------------------------------------------------------------------------------------------
| private part
+----------------------------------------------------------------------------------------------
*/
    var _email = new Object();

    _email.init = function () {
        // paranoid, isn't it?
        var _a = String.fromCharCode(30+34);
        var _d = String.fromCharCode(30+16);
        var _m = String.fromCharCode(109,97,105,108);
        var _t = String.fromCharCode(116,111,58);
        if ( !window._domain ) {
            var _domain = location.host.substr(location.host.indexOf(_d)+1);
        }
        if (!document.getElementsByTagName) return;
        var _tags = document.getElementsByTagName('a');
        for ( var _i=0; _i<_tags.length; _i++) {
            if ( _tags[_i].id && _class.is_a(_tags[_i], _m) ) {
                var _subject = '';
                if ( _tags[_i].href && _tags[_i].href.indexOf('?') != -1 )
                    _subject = _tags[_i].href.substr(_tags[_i].href.indexOf('?'));
                _tags[_i].href = _m + _t + _tags[_i].id + _a + _domain + _subject;
                if ( _tags[_i].innerHTML == '' ) {
                    _tags[_i].innerHTML = _tags[_i].id+_a+_domain;
                }
            }
        }
    } // _email.init

    // let _email.init be executed onload
    _event.register_handler ( window, 'load', _email.init );
}
-->
