function enkoder()
{

    str1 = "mailto:"+document.getElementById("email").value;
    subject = document.getElementById("about").value;
    if(subject.length > 0)
    {
       str1 = str1+"?subject="+encodeURI(subject);
    }

    str2 = document.getElementById("hover").value;
    str3 = document.getElementById("link").value;
    
    bufferlength = str1.length+str2.length+str3.length+3;
    text = new Array(bufferlength);

    j = 0;
    for(i=0; i<str1.length; ++i, ++j)
    {
        text[j] = str1.charCodeAt(i);
    }
    text[j++]=0;

    for(i=0; i<str2.length; ++i, ++j)
    {
        text[j] = str2.charCodeAt(i);
    }
    text[j++]=0;

    for(i=0; i<str3.length; ++i, ++j)
    {
        text[j] = str3.charCodeAt(i);
    }
    text[j++]=0;

    seed = 512;
    for(i=0;i<bufferlength;++i)
    {
        seed ^= text[i];
    }
    for(i=0;i<bufferlength;++i)
    {
        text[i] ^= seed;
    }


    str4 = document.getElementById("email").value.replace(/@/g," &lt;at&gt; ")
    str4 = str4.replace(/\.com/g," &lt;dot&gt; c_o_m" ).replace(/\./g," &lt;dot&gt; " );

    output = "<html><head><title>\"E\"-ddress encoder framework page</title>\n";
    output += "<script type=\"text/javascript\">\n";
    output += "var data=new Array(\n"

    lines = (bufferlength+7)/8;
    for(l=0; l<lines; ++l)
    {
        for(j=0; j<8;++j)
        {
            index = l*8+j;
            if(index>=bufferlength)
                continue;
            output += text[index];
            if(index<bufferlength-1)
                output += ",";
        }
        output += "\n";
    }


    str6 = document.getElementById("id").value;
    str5 = document.getElementById("fn").value;
    output += ");\n";
    output += "function "+str5+"(){if(!document.layers){\n";
    output += "var m = document.getElementById('"+str6+"');while(m.firstChild) {m.removeChild(m.firstChild);}\n";
    output += "var a = document.createElement('a');\n";
        
    output += "var idx=0, n=data[data.length-1];var mailtext= '';\n";
    output += "while( data[idx]!=n ) {mailtext+=String.fromCharCode(data[idx++]^n);}idx++;a.setAttribute('href', mailtext);mailtext= '';\n";
    output += "while( data[idx]!=n ) {mailtext+=String.fromCharCode(data[idx++]^n);}idx++;a.setAttribute('title', mailtext);mailtext= '';\n";
    output += "while( data[idx]!=n ) {mailtext+=String.fromCharCode(data[idx++]^n);}idx++;a.appendChild(document.createTextNode(mailtext));\n";
    output += "m.appendChild(a)};};\n";
    output += "</sc"+"ript></head><body>\n";
    output += "<p id=\""+str6+"\">"+str4+"</p>\n";
    output += "<script type=\"text/javascript\">"+str5+"()</sc"+"ript>\n";
    output += "</body></html>\n";

    document.getElementById("code").value = output;

}

