/* Copyright (c) 2001 Jock Dempsey, anvilfire.com ALL RIGHTS RESERVED */
/* ================================================================== */
/*   Any unauthorized use of this code or components of the code      */
/* including the methods of the algorithims is copyright ingringement */
/*        and invasion of privacy under international law.            */
/* ================================================================== */

var vlevel = 0

function AF_sendIt(word) 
    {

	var stage1 = denumerate(word);

    if (vlevel != '030') var address = deshell01(stage1);

	location.href="mailto:"+address;
	
    }


function deshell01(word)
    {

    var temp = word;
	newparts_array = new Array;
	parts_array = new Array;

	newparts_array = temp.split(",");

    if (newparts_array.length == 0 ) { newparts_array[0] = temp }

    var codedpos = newparts_array[0].indexOf(".",0) ;     

    var codedpos2 = newparts_array[0].indexOf(".",codedpos + 1) ;     

    parts_array[0] = newparts_array[0].substring(0, codedpos); 

    parts_array[1] = newparts_array[0].substring(codedpos +1 , codedpos2); 

    parts_array[2] = newparts_array[0].substring(codedpos2, newparts_array[0].length); 

    var eaddress = parts_array[1] + "@" + parts_array[0] + parts_array[2];

    if (newparts_array.length > 1 ) { eaddress = eaddress + '?subject=' + newparts_array[1]};

    word = eaddress;
    
    return word

    }


function denumerate(word)
	{
	
	 var temp = word
	 var l = word.length/3;
	 var triplet = ""
	 var detriplet = ""
	 vlevel = temp.substring(0, 3);
	
	if (vlevel == '010') var sumnum = 171;
	if (vlevel == '020') var sumnum = 255;
	
	 for (i=1; i<l; i++)
	    { bitpos = (i + 1)*3
	    
	    triplet = temp.substring(bitpos-3, bitpos);     
	    detriplet = detriplet + String.fromCharCode(sumnum - triplet)
	    }
	
	   word = detriplet
	   return word
	
	}

