Encryption in few simple functions
<p>Hi I have this program written but when i press the button nothing happens do you know why?</p>

<pre><code>&lt;HTML&gt;
&lt;HEAD&gt;

&lt;TITLE&gt; 
    Alberti's Disks
&lt;/TITLE&gt;

&lt;SCRIPT LANGUAGE = "JavaScript"&gt;

var plainArray = ['A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z'];

var cipherArray = ['a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z'];
//this function shifts all elements of the array

function right(letterArray)
{
  var rightShiftArray = new Array (26);
  for (var count = 0; count &lt; 25; count++)
      {
          rightShiftArray[count + 1] = letterArray[count];
      }
            rightShiftArray[0] = letterArray[25];
            return rightShiftArray;
}
 //this function rotates cipher alphabet

        function rotateToPosition(signalCharacter, indexCharacter, plainAlphabet, cipherAlphabet) 
        {
        var rotateArray = new Array (26);
           rotateArray = cipherAlphabet;
           while (rotateArray[0] != indexCharacter)
               {
                   rotateArray = right(rotateArray);
               }
           return rotateArray;
        }
    //this function encrypts given word using index character
    function encrypt(plainText, signalCharacter, indexCharacter, plainAlphabet, cipherAlphabet)
    {
       var encryptedString = signalCharacter;
       //i is what will hold the results of the encrpytion until it can be appended to encryptedString
       var i;
       // rotate array to signal character position
       var rotateArray = rotateToPosition(signalCharacter, indexCharacter, plainAlphabet, cipherAlphabet);
       for (var count = 0; count &lt; plainText.length; count++)
       {
           var singleLetter = plainText.charAt(count);
           i = cipherAlphabet[singleLetter];
           encryptedString = encryptedString + rotateArray[i];
       }

       return encryptedString;
    }

    function testEncryption()
    {
        // encrypts word JAVASCRIPT using given index characters

       var codeText;
       codeText = encrypt('JAVASCRIPT', 'X', 'n', plainArray, cipherArray);
       window.alert(codeText);


    &lt;/SCRIPT&gt;

    &lt;/HEAD&gt;

    &lt;BODY&gt;
    &lt;FORM NAME = "Form"&gt;
        &lt;P&gt;
        &lt;INPUT TYPE = "button" NAME = "testButton"  VALUE ="Test Encryption"
                ONCLICK = " testEncryption() ;"&gt;    
        &lt;/P&gt;
    &lt;/FORM&gt;


    &lt;/BODY&gt;

    &lt;/HTML&gt;
</code></pre>
