/*
Summary:  Encrypts an email to protect it from spambots.
Version:  1.0
Author:   Jim Tucek (Comments and particular prime numbers by John Bentley)
Depends on:
  Two prime numbers used to encrypt are seven(first prime) and forty seven(second prime).
  See http://www.jracademy.com/~jtucek/email/download.php

Usage Requirements:
  1. Encrypt your email using the two prime numbers on http://www.jracademy.com/~jtucek/email/download.php
  2. In your XHTML head <script type="text/javascript" src="script/emailProtector.js"></script>
  3. In XHTML Body choose one of
  <!-- Alternativly, you can have the script display the text of your email address -->
  <!-- which is less secure, but it's better than nothing and looks better -->
   Email <a href="javascript:%20void%20(0)" onclick='drink("9 193 34 241 317 256 75 271 228 316 193 75 125 294 34 193 228 193 75 125 55 84 93 211 34 184 93 55 304",329,221)' onmouseover="window.status=''; return true;" onmouseout="window.status=' '; return true;"><script type='text/javascript'>forsake("9 193 34 241 317 256 75 271 228 316 193 75 125 294 34 193 228 193 75 125 55 84 93 211 34 184 93 55 304",329,221)</script></a> 
  (A tad bit less secure, but looks better.  So, the question is whether you're shallow or not. ;)
  3. Copy the code numbers between the brackets from the gimme button eg ("9 193 ..",329,221) and subsitute into above link.
  4. Swap your fake function names for "drink" and "forsake" in above links and paste into HTML body.
  5. Escape script block properly. That is, with CDATA escaping.
  6. insert a suitable <noscript> message. Eg
      <noscript>
        The email address is not available when javascript is turned off. 
        This is because it the email uses javascript to encrypt it and 
        so avoid spambots harvesting it.
      </noscript>
   7. Note
*/

// <!-- 1389296061
// This script is (C) Copyright 2004 Jim Tucek
// Leave these comments alone!  For more info, visit
// www.jracademy.com/~jtucek/email/ 

function drink(agreement,year,apartment) {
agreement += ' ';
var asteroid = agreement.length;
var landing = 0;
var hand = '';
for(var heat = 0; heat < asteroid; heat++) {
landing = 0;
while(agreement.charCodeAt(heat) != 32) {
landing = landing * 10;
landing = landing + agreement.charCodeAt(heat)-48;
heat++;
}
hand += String.fromCharCode(grow(landing,year,apartment));
}
parent.location = 'm'+'a'+'i'+'l'+'t'+'o'+':'+hand;
}

function forsake(whine,rocket,emotion) {
whine += ' ';
var encounter = whine.length;
var enthusiasm = 0;
for(var time = 0; time < encounter; time++) {
enthusiasm = 0;
while(whine.charCodeAt(time) != 32) {
enthusiasm = enthusiasm * 10;
enthusiasm = enthusiasm + whine.charCodeAt(time)-48;
time++;
}
//document.write('&');
//document.write('#');
//document.write(grow(enthusiasm,rocket,emotion));
document.write(String.fromCharCode(grow(enthusiasm,rocket,emotion)));
}
}

function grow(extravagance,physicist,information) {
if (information % 2 == 0) {
lion = 1;
for(var butterfly = 1; butterfly <= information/2; butterfly++) {
wood = (extravagance*extravagance) % physicist;
lion = (wood*lion) % physicist;
}
} else {
lion = extravagance;
for(var nitrogen = 1; nitrogen <= information/2; nitrogen++) {
wood = (extravagance*extravagance) % physicist;
lion = (wood*lion) % physicist;
}
}
return lion;
}


