/*
 * Project:       Anti Spam
 * File:          antispam.js
 * Author:        SCHWEITZER Vincent
 * Contact me at: http://www.puread.net/contact.html
 * Web site:      http://www.puread.net/
 * Version:       1.0
 * Copyright:     2004 Puread
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2.1 of the License, or (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this library; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 *
 */
function antispam(mail_coded, description ) {
	var thiscode, thischar;
	var mail_coded_string = new String(mail_coded);
	var mail_array = mail_coded_string.split('|');
	var L = mail_array.length;
	var mail_decode = "";
	for (var x=0; x < L; x++) {
		thiscode = mail_array[x];
		thischar = String.fromCharCode( thiscode - L );
		mail_decode += thischar;
	}
	
	if (!description) description = mail_decode; // if empty description, mail is show
	var sortie = '<a href="mailto:'+mail_decode+'"' +'>' + description + '</a>';
	document.write(sortie);
}
