function enc (text)
{
        var key = "ABCDEFGHIJKLMNOPQRSTUVWXYZ!:/\&-_+.";
        var text        = new String (text);
        var textrot     = new String();
        var rot         = 13;

        for(var i = 0; i < text.length; i++)
        {
                var codechar    = text.substring(i, i + 1)
                var pos = key.indexOf(codechar.toUpperCase())

                if(pos >= 0)
                {
                        /* pos = (pos + (key.length + 1) / 2) % (key.length + 1); */
                        pos = pos + rot;
                        if (pos > (key.length + 1)) pos = pos - (key.length + 1);

                        codechar        = (codechar == codechar.toUpperCase()) ?
                                                key.substring(pos, pos + 1) :
                                                key.substring(pos, pos + 1).toLowerCase()
                }
                textrot = textrot + codechar
        }
        return textrot
}

function deenc (text)
{
        var key = "ABCDEF/GHIJK=L\"MNOPQRSTUVWXYZ0732415986 <>:";
        var text        = new String (text);
        var textrot     = new String();
        var rot         = 9;

        for(var i = 0; i < text.length; i++)
        {
                var codechar    = text.substring(i, i + 1);
		//document.write ("codechar=" + codechar + "<br>");
                var pos = key.indexOf(codechar.toUpperCase());
		//document.write ("pos1=" + pos + "<br>");

                if(pos >= 0)
                {
                        pos = pos - rot;
			//document.write ("pos2=" + pos + "<br>");
                        if (pos < 0) pos = pos + (key.length + 1) - 1;
			//document.write ("pos3=" + pos + "<br>");
			//document.write ("test=" + key.substr (pos, 1) + "<br>");

                        codechar        = (codechar.match(/A-Z/)) ?
                                                key.substr(pos, 1) :
                                                key.substr(pos, 1).toLowerCase();
                }
                textrot = textrot + codechar;
        }
        return textrot;
}
