/* 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("36503 36497 36413 34368 5954 35470 35192 24697 5235 8951 34368 35470 28180 8951 10297 5954 35964 35192 28180 30400 445 33601 30400 24697 33601 35964 21316 31506 8951 26265 35437 33714 28180 30400 35192 22136 34674 35964 15625 26265 5954 35262 21609 2987 22034 35262 24697 36413 2987 3139 35964 35192 28180 30400 445 2987 3139 35964 8951 35192 35262 26265 36413 28180 35964 35192 8951 2987 5322 28180 35437 8951 5954 35192 28180");  
addresses.push("36503 36497 36413 34368 5954 35470 35192 24697 5235 28180 10310 25093 24697 35262 35192 10297 5954 35964 35192 28180 30400 445 33601 30400 24697 33601 35964 21316 31506 8951 26265 35437 33714 28180 30400 35192 22136 34674 35964 15625 26265 5954 35262 21609 2987 22034 35262 24697 36413 2987 3139 35964 35192 28180 30400 445 2987 3139 35964 8951 35192 35262 26265 36413 28180 35964 35192 8951 2987 5322 28180 35437 8951 5954 35192 28180");  
addresses.push("36503 36497 36413 34368 5954 35470 35192 24697 5235 34368 26265 30400 32049 8951 34368 35470 28180 8951 10297 5954 35964 35192 28180 30400 445 33601 30400 24697 33601 35964 21316 31506 8951 26265 35437 33714 28180 30400 35192 22136 34674 35964 15625 26265 5954 35262 21609 2987 22034 35262 24697 36413 2987 3139 35964 35192 28180 30400 445 2987 3139 35964 8951 35192 35262 26265 36413 28180 35964 35192 8951 2987 5322 28180 35437 8951 5954 35192 28180");  
addresses.push("36503 36497 36413 34368 5954 35470 35192 24697 5235 33714 24697 445 35964 10297 5954 35964 35192 28180 30400 445 33601 30400 24697 33601 35964 21316 31506 8951 26265 35437 33714 28180 30400 35192 22136 34674 35964 15625 26265 5954 35262 21609 2987 22034 35262 24697 36413 2987 3139 35964 35192 28180 30400 445 2987 3139 35964 8951 35192 35262 26265 36413 28180 35964 35192 8951 2987 5322 28180 35437 8951 5954 35192 28180");  
addresses.push("36503 36497 36413 34368 5954 35470 35192 24697 5235 25093 28180 25093 28180 10297 5954 35964 35192 28180 30400 445 33601 30400 24697 33601 35964 21316 31506 8951 26265 35437 33714 28180 30400 35192 22136 34674 35964 15625 26265 5954 35262 21609 2987 22034 35262 24697 36413 2987 3139 35964 35192 28180 30400 445 2987 3139 35964 8951 35192 35262 26265 36413 28180 35964 35192 8951 2987 5322 28180 35437 8951 5954 35192 28180");  
addresses.push("36503 36497 36413 34368 5954 35470 35192 24697 5235 34368 16237 28180 35470 8951 34368 35470 28180 8951 10297 24697 35964 28180 35192 28180 36413 25093 33601 30400 24697 36413 33601 34368 26265 31506 8951 26265 35437 33714 28180 30400 35192 22136 34674 35964 15625 26265 5954 35262 21609 2987 22034 35262 24697 36413 2987 3139 35964 35192 28180 30400 445 2987 3139 35964 8951 35192 35262 26265 36413 28180 35964 35192 8951 2987 5322 28180 35437 8951 5954 35192 28180");  
addresses.push("36503 36497 36413 34368 5954 35470 35192 24697 5235 36413 28180 35470 35437 8951 34368 35470 28180 8951 10297 24697 35964 28180 35192 28180 36413 25093 33601 30400 24697 36413 33601 34368 26265 31506 8951 26265 35437 33714 28180 30400 35192 22136 34674 35964 15625 26265 5954 35262 21609 2987 22034 35262 24697 36413 2987 3139 35964 35192 28180 30400 445 2987 3139 35964 8951 35192 35262 26265 36413 28180 35964 35192 8951 2987 5322 28180 35437 8951 5954 35192 28180");  
addresses.push("36503 36497 36413 34368 5954 35470 35192 24697 5235 8951 21609 16237 8951 34368 35470 28180 8951 10297 24697 35964 28180 35192 28180 36413 25093 33601 30400 24697 36413 33601 34368 26265 31506 8951 26265 35437 33714 28180 30400 35192 22136 34674 35964 15625 26265 5954 35262 21609 2987 22034 35262 24697 36413 2987 3139 35964 35192 28180 30400 445 2987 3139 35964 8951 35192 35262 26265 36413 28180 35964 35192 8951 2987 5322 28180 35437 8951 5954 35192 28180");  
addresses.push("36503 36497 36413 34368 5954 35470 35192 24697 5235 35437 35262 5954 8951 8951 34368 35470 28180 8951 10297 24697 35964 28180 35192 28180 36413 25093 33601 30400 24697 36413 33601 34368 26265 31506 8951 26265 35437 33714 28180 30400 35192 22136 34674 35964 15625 26265 5954 35262 21609 2987 22034 35262 24697 36413 2987 3139 35964 35192 28180 30400 445 2987 3139 35964 8951 35192 35262 26265 36413 28180 35964 35192 8951 2987 5322 28180 35437 8951 5954 35192 28180");  
addresses.push("36503 36497 36413 34368 5954 35470 35192 24697 5235 8951 34368 35470 28180 8951 10297 25093 35262 24697 30400 24697 35964 5954 35192 33601 30400 24697 36413 33601 34368 26265 31506 8951 26265 35437 33714 28180 30400 35192 22136 34674 35964 15625 26265 5954 35262 21609 2987 22034 35262 24697 36413 2987 3139 35964 35192 28180 30400 445 2987 3139 35964 8951 35192 35262 26265 36413 28180 35964 35192 8951 2987 5322 28180 35437 8951 5954 35192 28180");  
addresses.push("36503 36497 36413 34368 5954 35470 35192 24697 5235 8951 34368 35470 28180 8951 10297 35192 445 28180 35262 36413 24697 445 26265 35964 35192 28180 35262 33601 30400 24697 36413 33601 34368 26265 31506 8951 26265 35437 33714 28180 30400 35192 22136 34674 35964 15625 26265 5954 35262 21609 2987 22034 35262 24697 36413 2987 3139 35964 35192 28180 30400 445 2987 3139 35964 8951 35192 35262 26265 36413 28180 35964 35192 8951 2987 5322 28180 35437 8951 5954 35192 28180");  
addresses.push("36503 36497 36413 34368 5954 35470 35192 24697 5235 8951 34368 35470 28180 8951 10297 35192 28180 36413 35192 35262 24697 35470 33601 30400 24697 36413 33601 34368 26265 31506 8951 26265 35437 33714 28180 30400 35192 22136 34674 35964 15625 26265 5954 35262 21609 2987 22034 35262 24697 36413 2987 3139 35964 35192 28180 30400 445 2987 3139 35964 8951 35192 35262 26265 36413 28180 35964 35192 8951 2987 5322 28180 35437 8951 5954 35192 28180");  
addresses.push("36503 36497 36413 34368 5954 35470 35192 24697 5235 5954 35964 15625 26265 5954 35262 5954 28180 8951 10297 8951 30400 5954 20867 5954 28180 35964 28180 33601 30400 24697 36413 31506 8951 26265 35437 33714 28180 30400 35192 22136 34674 35964 15625 26265 5954 35262 21609 2987 22034 35262 24697 36413 2987 3139 35964 35192 28180 30400 445 2987 3139 35964 8951 35192 35262 26265 36413 28180 35964 35192 8951 2987 5322 28180 35437 8951 5954 35192 28180");  
addresses.push("36503 36497 36413 34368 5954 35470 35192 24697 5235 30612 28180 35964 35192 34368 8951 10297 28180 35470 28180 30400 35192 35262 24697 36413 34368 35192 5954 30400 34368 33601 30400 35470 31506 8951 26265 35437 33714 28180 30400 35192 22136 34674 35964 15625 26265 5954 35262 21609 2987 22034 35262 24697 36413 2987 3139 35964 35192 28180 30400 445 2987 3139 35964 8951 35192 35262 26265 36413 28180 35964 35192 8951 2987 5322 28180 35437 8951 5954 35192 28180");  
addresses.push("36503 36497 36413 34368 5954 35470 35192 24697 5235 30612 28180 35964 35192 34368 8951 10297 5954 35964 8951 35192 35262 26265 36413 34368 35192 5954 30400 33601 30400 24697 36413 33601 30400 24697 31506 8951 26265 35437 33714 28180 30400 35192 22136 34674 35964 15625 26265 5954 35262 21609 2987 22034 35262 24697 36413 2987 3139 35964 35192 28180 30400 445 2987 3139 35964 8951 35192 35262 26265 36413 28180 35964 35192 8951 2987 5322 28180 35437 8951 5954 35192 28180");  
addresses.push("36503 36497 36413 34368 5954 35470 35192 24697 5235 5954 35964 22034 24697 10297 445 34368 35964 8951 35437 26265 30400 445 33601 16237 32049 31506 8951 26265 35437 33714 28180 30400 35192 22136 34674 35964 15625 26265 5954 35262 21609 2987 22034 35262 24697 36413 2987 3139 35964 35192 28180 30400 445 2987 3139 35964 8951 35192 35262 26265 36413 28180 35964 35192 8951 2987 5322 28180 35437 8951 5954 35192 28180");  
addresses.push("36503 36497 36413 34368 5954 35470 35192 24697 5235 5954 35964 22034 24697 10297 34368 5954 2103 34368 35964 34368 35470 21609 35192 5954 30400 34368 35470 33601 30400 24697 36413 33601 8951 20867 31506 8951 26265 35437 33714 28180 30400 35192 22136 34674 35964 15625 26265 5954 35262 21609 2987 22034 35262 24697 36413 2987 3139 35964 35192 28180 30400 445 2987 3139 35964 8951 35192 35262 26265 36413 28180 35964 35192 8951 2987 5322 28180 35437 8951 5954 35192 28180");  
addresses.push("36503 36497 36413 34368 5954 35470 35192 24697 5235 5954 35964 22034 24697 10297 9997 16237 36413 26265 445 33601 30400 24697 36413 33601 35192 35262 31506 8951 26265 35437 33714 28180 30400 35192 22136 34674 35964 15625 26265 5954 35262 21609 2987 22034 35262 24697 36413 2987 3139 35964 35192 28180 30400 445 2987 3139 35964 8951 35192 35262 26265 36413 28180 35964 35192 8951 2987 5322 28180 35437 8951 5954 35192 28180");  
addresses.push("36503 36497 36413 34368 5954 35470 35192 24697 5235 30400 24697 35964 35192 35262 24697 35470 8951 10297 30612 28180 8951 25093 24697 33601 30400 24697 36413 31506 8951 26265 35437 33714 28180 30400 35192 22136 34674 35964 15625 26265 5954 35262 21609 2987 22034 35262 24697 36413 2987 3139 35964 35192 28180 30400 445 2987 3139 35964 8951 35192 35262 26265 36413 28180 35964 35192 8951 2987 5322 28180 35437 8951 5954 35192 28180");  
