/* Security Scripts */

var G_SPLIT = ',';

function test()
{
    alert("Hello Rob");
}

function testEncryption(p_string)
{
  var l_encString = encryptString(p_string);

  var l_outWin = window.open("", "TestEncryption", 'toolbar,height=300,resizable=yes,scrollbars=yes');
  l_outWin.document.write("<B>Encrypted string:</B> '" + l_encString + "' <BR><BR>");
  l_outWin.document.write("<B>Decrypted string:</B> '" + decryptString(l_encString) + "' <BR><BR>");
}

function executeSecureCmd(p_str)
{
  eval(decryptString(p_str));
}

function encryptString(p_str)
{
  var l_encryptedStr = "";

  for (var a = 0; a < p_str.length; a++)
  {
    l_encryptedStr += (a > 0 ? G_SPLIT + p_str.charCodeAt(a) : "" + p_str.charCodeAt(a));    
  }

  return l_encryptedStr;
}

function decryptString(p_str)
{
  var l_decryptedStr = "";
  var l_encryptedArr = p_str.split(G_SPLIT);

  for (var a = 0; a < l_encryptedArr.length; a++)
  {
    l_decryptedStr += String.fromCharCode(l_encryptedArr[a]);
  } 

  return l_decryptedStr;
}




