/* EMAIL ENCRYPTION SCRIPT */

// This script is (c) copyright 2008 by Dan Appleman under the
// GNU General Public License (http://www.gnu.org/licenses/gpl.html)
// This script is modified from an original script by Jim Tucek
// For more information, visit www.danappleman.com 
// Leave the above comments alone!
// see encryption_instructions.txt for explanation of usage

var decryption_cache = new Array();

function decrypt_string(crypted_string,n,decryption_key,just_email_address) {
	var cache_index = "'"+crypted_string+","+just_email_address+"'";

	if(decryption_cache[cache_index])					// If this string has already been decrypted, just
		return decryption_cache[cache_index];				// return the cached version.

	if(addresses[crypted_string])						// Is crypted_string an index into the addresses array
		var crypted_string = addresses[crypted_string];			// or an actual string of numbers?

	if(!crypted_string.length)						// Make sure the string is actually a string
		return "Error, not a valid index.";

	if(n == 0 || decryption_key == 0) {					// If the decryption key and n are not passed to the
		var numbers = crypted_string.split(' ');			// function, assume they are stored as the first two
		n = numbers[0];	decryption_key = numbers[1];			// numbers in crypted string.
		numbers[0] = ""; numbers[1] = "";				// Remove them from the crypted string and continue
		crypted_string = numbers.join(" ").substr(2);
	}

	var decrypted_string = '';
	var crypted_characters = crypted_string.split(' ');

	for(var i in crypted_characters) {
		var current_character = crypted_characters[i];
		var decrypted_character = exponentialModulo(current_character,n,decryption_key);
		if(just_email_address && i < 7)				// Skip 'mailto:' part
			continue;
		if(just_email_address && decrypted_character == 63)	// Stop at '?subject=....'
			break;
		decrypted_string += String.fromCharCode(decrypted_character);
	}
		decryption_cache[cache_index] = decrypted_string;			// Cache this string for any future calls

	return decrypted_string;
}

function decrypt_and_email(crypted_string,n,decryption_key) {
	if(!n || !decryption_key) { n = 0; decryption_key = 0; }
	if(!crypted_string) crypted_string = 0;

	var decrypted_string = decrypt_string(crypted_string,n,decryption_key,false);
	parent.location = decrypted_string;
}

function decrypt_and_echo(crypted_string,n,decryption_key) {
	if(!n || !decryption_key) { n = 0; decryption_key = 0; }
	if(!crypted_string) crypted_string = 0;

	var decrypted_string = decrypt_string(crypted_string,n,decryption_key,true);
	document.write(decrypted_string);
	return true;
}

// Finds base^exponent % y for large values of (base^exponent)
function exponentialModulo(base,exponent,y) {
	if (y % 2 == 0) {
		answer = 1;
		for(var i = 1; i <= y/2; i++) {
			temp = (base*base) % exponent;
			answer = (temp*answer) % exponent;
		}
	} else {
		answer = base;
		for(var i = 1; i <= y/2; i++) {
			temp = (base*base) % exponent;
			answer = (temp*answer) % exponent;
		}
	}
	return answer;
}

// Remove the comments below to improve spam resistance! 
// email addresses: 

 if(!addresses) var addresses = new Array();
addresses.push("8249 8243 5327 4377 3447 7713 5896 7179 2448 2564 1081 3371 7713 343 843 3447 3371 7713 5302 5848 5949 3371 7713 5896 1411 3447 5404 4377 5404 1693 3447 4377 7713 4918 1693 7179 5327");
addresses.push("8249 8243 5327 4377 3447 7713 5896 7179 2448 5204 3447 7713 7713 5204 4377 1809 1936 3371 1809 4377 5848 2972 2696 1936 7713 3447 1693 343 4377 1666 3447 5404 5492 4121 4918 1693 7179 5327");
addresses.push("8249 8243 5327 4377 3447 7713 5896 7179 2448 5204 1809 7179 3008 3371 1809 6935 5404 3290 7179 5848 2972 2696 1936 7713 3447 1693 343 4377 1666 3447 5404 5492 4121 4918 1693 7179 5327");
addresses.push("8249 8243 5327 4377 3447 7713 5896 7179 2448 5204 2800 3371 1081 7713 3371 1809 5848 2972 2696 1936 7713 3447 1693 343 4377 1666 3447 5404 5492 4121 4918 1693 7179 5327");
addresses.push("8249 8243 5327 4377 3447 7713 5896 7179 2448 6947 4377 7796 5896 2696 1809 3371 5848 2972 2696 1936 7713 3447 1693 343 4377 1666 3447 5404 5492 4121 4918 1693 7179 5327");
addresses.push("8249 8243 5327 4377 3447 7713 5896 7179 2448 6947 7179 5327 5327 3371 1809 1693 3447 4377 7713 6935 5404 3290 7179 5848 2972 2696 1936 7713 3447 1693 343 4377 1666 3447 5404 5492 4121 4918 1693 7179 5327");
addresses.push("8249 8243 5327 4377 3447 7713 5896 7179 2448 6947 7179 5404 4121 2696 5327 3371 1809 6935 5404 3290 7179 5848 2972 2696 1936 7713 3447 1693 343 4377 1666 3447 5404 5492 4121 4918 1693 7179 5327");
addresses.push("8249 8243 5327 4377 3447 7713 5896 7179 2448 6947 2696 4121 5896 7179 5327 3371 1809 343 3371 1809 1666 3447 1693 3371 5848 2972 2696 1936 7713 3447 1693 343 4377 1666 3447 5404 5492 4121 4918 1693 7179 5327");
addresses.push("8249 8243 5327 4377 3447 7713 5896 7179 2448 6176 1809 343 1880 430 7179 4121 3371 5404 1936 3371 1809 5492 5848 2972 2696 1936 7713 3447 1693 343 4377 1666 3447 5404 5492 4121 4918 1693 7179 5327");
addresses.push("8249 8243 5327 4377 3447 7713 5896 7179 2448 18 4121 1693 1809 7179 6597 5848 2972 2696 1936 7713 3447 1693 343 4377 1666 3447 5404 5492 4121 4918 1693 7179 5327");
addresses.push("8249 8243 5327 4377 3447 7713 5896 7179 2448 3868 430 5848 2972 2696 1936 7713 3447 1693 343 4377 1666 3447 5404 5492 4121 4918 1693 7179 5327");
addresses.push("8249 8243 5327 4377 3447 7713 5896 7179 2448 950 4377 1693 3008 1880 3447 7713 7713 3371 1809 5848 5949 3371 7713 5896 1411 3447 5404 4377 5404 1693 3447 4377 7713 4918 1693 7179 5327");
addresses.push("8249 8243 5327 4377 3447 7713 5896 7179 2448 950 4377 1693 3008 1880 3447 7713 7713 3371 1809 5848 2972 2696 1936 7713 3447 1693 343 4377 1666 3447 5404 5492 4121 4918 1693 7179 5327");
addresses.push("8249 8243 5327 4377 3447 7713 5896 7179 2448 950 4377 4121 7179 5404 2800 4377 3008 4121 5327 4377 5404 5848 5949 3371 7713 5896 1411 3447 5404 4377 5404 1693 3447 4377 7713 4918 1693 7179 5327");
addresses.push("8249 8243 5327 4377 3447 7713 5896 7179 2448 950 950 4377 4121 3008 3447 3371 6597 3447 1693 5259 5848 2972 2696 1936 7713 3447 1693 343 4377 1666 3447 5404 5492 4121 4918 1693 7179 5327");
addresses.push("8249 8243 5327 4377 3447 7713 5896 7179 2448 950 7179 2564 5404 5404 2800 4377 4121 843 3447 5404 5492 5896 7179 5404 5848 2972 2696 1936 7713 3447 1693 343 4377 1666 3447 5404 5492 4121 4918 1693 7179 5327");
addresses.push("8249 8243 5327 4377 3447 7713 5896 7179 2448 950 7179 3371 5949 7713 4377 4121 4121 5327 4377 5404 5848 2972 2696 1936 7713 3447 1693 343 4377 1666 3447 5404 5492 4121 4918 1693 7179 5327");
addresses.push("8249 8243 5327 4377 3447 7713 5896 7179 2448 950 7179 5404 2293 3371 3447 5896 5259 5848 2972 2696 1936 7713 3447 1693 343 4377 1666 3447 5404 5492 4121 4918 1693 7179 5327");
addresses.push("8249 8243 5327 4377 3447 7713 5896 7179 2448 548 3371 5404 1880 7179 1809 5492 4377 5404 5848 2972 2696 1936 7713 3447 1693 343 4377 1666 3447 5404 5492 4121 4918 1693 7179 5327");
addresses.push("8249 8243 5327 4377 3447 7713 5896 7179 2448 7568 7179 4377 5404 4121 5848 2972 2696 1936 7713 3447 1693 343 4377 1666 3447 5404 5492 4121 4918 1693 7179 5327");
addresses.push("8249 8243 5327 4377 3447 7713 5896 7179 2448 1880 4377 1809 1693 3371 7713 5949 1809 7179 3371 5404 5848 2972 2696 1936 7713 3447 1693 343 4377 1666 3447 5404 5492 4121 4918 1693 7179 5327");
addresses.push("8249 8243 5327 4377 3447 7713 5896 7179 2448 1880 3447 1693 843 4377 3371 7713 1411 1809 7179 7713 7179 1666 3371 5848 2972 2696 1936 7713 3447 1693 343 4377 1666 3447 5404 5492 4121 4918 1693 7179 5327");
addresses.push("8249 8243 5327 4377 3447 7713 5896 7179 2448 343 950 7179 5404 3371 4121 5848 2972 2696 1936 7713 3447 1693 343 4377 1666 3447 5404 5492 4121 4918 1693 7179 5327");
addresses.push("8249 8243 5327 4377 3447 7713 5896 7179 2448 343 5896 3371 7796 843 3371 5404 1880 3447 7713 4121 5896 3371 3447 5404 5848 2972 2696 1936 7713 3447 1693 343 4377 1666 3447 5404 5492 4121 4918 1693 7179 5327");
addresses.push("8249 8243 5327 4377 3447 7713 5896 7179 2448 343 2696 7796 7796 7179 1809 5896 5848 2972 2696 1936 7713 3447 1693 343 4377 1666 3447 5404 5492 4121 4918 1693 7179 5327");
addresses.push("8249 8243 5327 4377 3447 7713 5896 7179 2448 4301 1809 3447 343 843 7179 843 4377 5327 5848 2972 2696 1936 7713 3447 1693 343 4377 1666 3447 5404 5492 4121 4918 1693 7179 5327");
addresses.push("8249 8243 5327 4377 3447 7713 5896 7179 2448 2564 1809 3447 1880 3447 7713 7713 3371 1809 5848 5949 3371 7713 5896 1411 3447 5404 4377 5404 1693 3447 4377 7713 4918 1693 7179 5327");
addresses.push("8249 8243 5327 4377 3447 7713 5896 7179 2448 1880 3447 3008 3371 343 4377 7713 5327 3447 3371 1809 3447 5848 5949 3371 7713 5896 1411 3447 5404 4377 5404 1693 3447 4377 7713 4918 1693 7179 5327");
addresses.push("8249 8243 5327 4377 3447 7713 5896 7179 2448 430 343 1693 4377 1809 1936 7179 1809 7179 2696 5492 843 5848 5949 3371 7713 5896 1411 3447 5404 4377 5404 1693 3447 4377 7713 4918 1693 7179 5327");
addresses.push("8249 8243 5327 4377 3447 7713 5896 7179 2448 1880 4377 1809 3447 4377 1880 7179 1809 5327 4377 5404 5302 7179 5848 5949 3371 7713 5896 1411 3447 5404 4377 5404 1693 3447 4377 7713 4918 1693 7179 5327");
addresses.push("8249 8243 5327 4377 3447 7713 5896 7179 2448 430 3447 1693 843 343 843 7179 1809 3371 5848 5949 3371 7713 5896 1411 3447 5404 4377 5404 1693 3447 4377 7713 4918 1693 7179 5327");
addresses.push("8249 8243 5327 4377 3447 7713 5896 7179 2448 430 3447 1693 843 343 843 7179 1809 3371 5848 5949 3371 7713 5896 2972 1809 7179 7796 3371 1809 5896 3447 3371 4121 4918 1693 7179 5327");
addresses.push("8249 8243 5327 4377 3447 7713 5896 7179 2448 6176 2564 7713 1936 4377 5404 3371 4121 3371 5848 2972 2696 1936 7713 3447 1693 343 4377 1666 3447 5404 5492 4121 4918 1693 7179 5327");
addresses.push("8249 8243 5327 4377 3447 7713 5896 7179 2448 18 6947 7179 843 3371 5404 5848 2972 2696 1936 7713 3447 1693 343 4377 1666 3447 5404 5492 4121 4918 1693 7179 5327");
addresses.push("8249 8243 5327 4377 3447 7713 5896 7179 2448 613 3371 3447 7713 6947 1809 4377 1666 3371 5404 5848 2972 2696 1936 7713 3447 1693 343 4377 1666 3447 5404 5492 4121 4918 1693 7179 5327");
addresses.push("8249 8243 5327 4377 3447 7713 5896 7179 2448 7568 6176 4377 1666 3447 4121 5848 2972 2696 1936 7713 3447 1693 343 4377 1666 3447 5404 5492 4121 4918 1693 7179 5327");
addresses.push("8249 8243 5327 4377 3447 7713 5896 7179 2448 1880 3447 5492 2696 3371 7713 5848 2972 2696 1936 7713 3447 1693 343 4377 1666 3447 5404 5492 4121 4918 1693 7179 5327");
addresses.push("8249 8243 5327 4377 3447 7713 5896 7179 2448 1880 4377 1809 1693 3868 3447 1809 4121 1693 843 5848 2972 2696 1936 7713 3447 1693 343 4377 1666 3447 5404 5492 4121 4918 1693 7179 5327");
addresses.push("8249 8243 5327 4377 3447 7713 5896 7179 2448 2564 613 7179 1666 4377 3008 5848 2972 2696 1936 7713 3447 1693 343 4377 1666 3447 5404 5492 4121 4918 1693 7179 5327");
addresses.push("8249 8243 5327 4377 3447 7713 5896 7179 2448 6176 1813 1809 5896 2696 5404 7179 5848 2972 2696 1936 7713 3447 1693 343 4377 1666 3447 5404 5492 4121 4918 1693 7179 5327");
addresses.push("8249 8243 5327 4377 3447 7713 5896 7179 2448 6176 343 5896 3371 3447 5404 1936 3371 1809 5492 5848 2972 2696 1936 7713 3447 1693 343 4377 1666 3447 5404 5492 4121 4918 1693 7179 5327");
addresses.push("8249 8243 5327 4377 3447 7713 5896 7179 2448 5204 199 3447 5327 3447 5404 3447 4121 3008 3447 5848 2972 2696 1936 7713 3447 1693 343 4377 1666 3447 5404 5492 4121 4918 1693 7179 5327");
addresses.push("8249 8243 5327 4377 3447 7713 5896 7179 2448 3868 430 5848 5949 3371 7713 5896 1411 3447 5404 4377 5404 1693 3447 4377 7713 4918 1693 7179 5327");
addresses.push("8249 8243 5327 4377 3447 7713 5896 7179 2448 3868 430 5848 5949 3371 7713 5896 3868 7179 7713 5302 3447 5404 5492 4121 4918 1693 7179 5327");
addresses.push("8249 8243 5327 4377 3447 7713 5896 7179 2448 3868 430 5848 5949 3371 7713 5896 2972 1809 7179 7796 3371 1809 5896 3447 3371 4121 4918 1693 7179 5327");
