/* 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;
}


 if(!addresses) var addresses = new Array();
addresses.push("17513 17509 10977 9484 7873 15931 1283 6193 14281 10182 3372 10182 5854 1283 6770 8624 6770 14208 7873 15931 15931 13288 9538 15931 10977 10182 4990 7873 1283 9484 1283 7873 6193 5854 8687 6193 8240 13398 7684 6770 9538 10063 11328 10182 585 1283 9474 7769 5854 13288 6193 8240 10977 9484 1283 7873 6193 5854 7268 6193 5854 7268 1283 6681 10182 7268 15604 14208 7873 15931 15931 13288 9538 15931 7268 11586 10182 4990 7873 1283 9484 1283 7873 6193 5854 7268 3001 8240 6193 11328 10182 585 1283");  
addresses.push("17513 17509 10977 9484 7873 15931 1283 6193 14281 11328 9484 6770 6193 5854 8624 6770 14208 7873 15931 15931 13288 9538 15931 10977 10182 4990 7873 1283 9484 1283 7873 6193 5854 8687 6193 8240 13398 7684 6770 9538 10063 11328 10182 585 1283 9474 7769 5854 13288 6193 8240 10977 9484 1283 7873 6193 5854 7268 6193 5854 7268 1283 6681 10182 7268 15604 14208 7873 15931 15931 13288 9538 15931 7268 11586 10182 4990 7873 1283 9484 1283 7873 6193 5854 7268 3001 8240 6193 11328 10182 585 1283"); 
addresses.push("17513 17509 10977 9484 7873 15931 1283 6193 14281 11328 9484 585 2808 9538 10182 15931 7873 5854 8624 6770 14208 7873 15931 15931 13288 9538 15931 10977 10182 4990 7873 1283 9484 1283 7873 6193 5854 8687 6193 8240 13398 7684 6770 9538 10063 11328 10182 585 1283 9474 7769 5854 13288 6193 8240 10977 9484 1283 7873 6193 5854 7268 6193 5854 7268 1283 6681 10182 7268 15604 14208 7873 15931 15931 13288 9538 15931 7268 11586 10182 4990 7873 1283 9484 1283 7873 6193 5854 7268 3001 8240 6193 11328 10182 585 1283"); 
addresses.push("17513 17509 10977 9484 7873 15931 1283 6193 14281 10977 9484 8240 4825 13025 8624 6770 14208 7873 15931 15931 13288 9538 15931 10977 10182 4990 7873 1283 9484 1283 7873 6193 5854 8687 6193 8240 13398 7684 6770 9538 10063 11328 10182 585 1283 9474 7769 5854 13288 6193 8240 10977 9484 1283 7873 6193 5854 7268 6193 5854 7268 1283 6681 10182 7268 15604 14208 7873 15931 15931 13288 9538 15931 7268 11586 10182 4990 7873 1283 9484 1283 7873 6193 5854 7268 3001 8240 6193 11328 10182 585 1283"); 
addresses.push("17513 17509 10977 9484 7873 15931 1283 6193 14281 5854 10182 15931 15931 4825 8624 6770 14208 7873 15931 15931 13288 9538 15931 10977 10182 4990 7873 1283 9484 1283 7873 6193 5854 8687 6193 8240 13398 7684 6770 9538 10063 11328 10182 585 1283 9474 7769 5854 13288 6193 8240 10977 9484 1283 7873 6193 5854 7268 6193 5854 7268 1283 6681 10182 7268 15604 14208 7873 15931 15931 13288 9538 15931 7268 11586 10182 4990 7873 1283 9484 1283 7873 6193 5854 7268 3001 8240 6193 11328 10182 585 1283"); 
addresses.push("17513 17509 10977 9484 7873 15931 1283 6193 14281 8240 6193 5854 6770 1283 7873 15931 15931 10977 9484 5854 8624 9484 7873 10977 8687 585 6193 10977 7684 6770 9538 10063 11328 10182 585 1283 9474 7769 5854 13288 6193 8240 10977 9484 1283 7873 6193 5854 7268 6193 5854 7268 1283 6681 10182 7268 15604 14208 7873 15931 15931 13288 9538 15931 7268 11586 10182 4990 7873 1283 9484 1283 7873 6193 5854 7268 3001 8240 6193 11328 10182 585 1283"); 
addresses.push("17513 17509 10977 9484 7873 15931 1283 6193 14281 11328 9484 10063 7873 15931 6193 585 14208 8624 11328 9484 11020 9484 5854 15931 7873 5854 14208 1317 1283 8240 9484 5854 6770 8687 585 6193 10977 7684 6770 9538 10063 11328 10182 585 1283 9474 7769 5854 13288 6193 8240 10977 9484 1283 7873 6193 5854 7268 6193 5854 7268 1283 6681 10182 7268 15604 14208 7873 15931 15931 13288 9538 15931 7268 11586 10182 4990 7873 1283 9484 1283 7873 6193 5854 7268 3001 8240 6193 11328 10182 585 1283"); 
addresses.push("17513 17509 10977 9484 7873 15931 1283 6193 14281 8240 6193 5854 8624 6770 14208 7873 15931 15931 13288 9538 15931 10977 10182 4990 7873 1283 9484 1283 7873 6193 5854 8687 6193 8240 13398 7684 6770 9538 10063 11328 10182 585 1283 9474 7769 5854 13288 6193 8240 10977 9484 1283 7873 6193 5854 7268 6193 5854 7268 1283 6681 10182 7268 15604 14208 7873 15931 15931 13288 9538 15931 7268 11586 10182 4990 7873 1283 9484 1283 7873 6193 5854 7268 3001 8240 6193 11328 10182 585 1283"); 
addresses.push("17513 17509 10977 9484 7873 15931 1283 6193 14281 15931 7873 5854 4990 9484 8624 6770 14208 7873 15931 15931 13288 9538 15931 10977 10182 4990 7873 1283 9484 1283 7873 6193 5854 8687 6193 8240 13398 7684 6770 9538 10063 11328 10182 585 1283 9474 7769 5854 13288 6193 8240 10977 9484 1283 7873 6193 5854 7268 6193 5854 7268 1283 6681 10182 7268 15604 14208 7873 15931 15931 13288 9538 15931 7268 11586 10182 4990 7873 1283 9484 1283 7873 6193 5854 7268 3001 8240 6193 11328 10182 585 1283"); 
addresses.push("17513 17509 10977 9484 7873 15931 1283 6193 14281 4990 9484 5854 8624 6770 14208 7873 15931 15931 13288 9538 15931 10977 10182 4990 7873 1283 9484 1283 7873 6193 5854 8687 6193 8240 13398 7684 6770 9538 10063 11328 10182 585 1283 9474 7769 5854 13288 6193 8240 10977 9484 1283 7873 6193 5854 7268 6193 5854 7268 1283 6681 10182 7268 15604 14208 7873 15931 15931 13288 9538 15931 7268 11586 10182 4990 7873 1283 9484 1283 7873 6193 5854 7268 3001 8240 6193 11328 10182 585 1283"); 
addresses.push("17513 17509 10977 9484 7873 15931 1283 6193 14281 13398 8240 10182 13398 8624 6770 14208 7873 15931 15931 13288 9538 15931 10977 10182 4990 7873 1283 9484 1283 7873 6193 5854 8687 6193 8240 13398 7684 6770 9538 10063 11328 10182 585 1283 9474 7769 5854 13288 6193 8240 10977 9484 1283 7873 6193 5854 7268 6193 5854 7268 1283 6681 10182 7268 15604 14208 7873 15931 15931 13288 9538 15931 7268 11586 10182 4990 7873 1283 9484 1283 7873 6193 5854 7268 3001 8240 6193 11328 10182 585 1283"); 
addresses.push("17513 17509 10977 9484 7873 15931 1283 6193 14281 10063 6193 10063 1283 6193 8240 7873 9484 5854 8624 585 6193 6502 8687 5854 10182 1283 7684 6770 9538 10063 11328 10182 585 1283 9474 7769 5854 13288 6193 8240 10977 9484 1283 7873 6193 5854 7268 6193 5854 7268 1283 6681 10182 7268 15604 14208 7873 15931 15931 13288 9538 15931 7268 11586 10182 4990 7873 1283 9484 1283 7873 6193 5854 7268 3001 8240 6193 11328 10182 585 1283"); 
addresses.push("17513 17509 10977 9484 7873 15931 1283 6193 14281 11020 6193 15931 15931 4825 10182 8624 585 6193 10977 585 9484 6770 1283 8687 5854 10182 1283 7684 6770 9538 10063 11328 10182 585 1283 9474 7769 5854 13288 6193 8240 10977 9484 1283 7873 6193 5854 7268 6193 5854 7268 1283 6681 10182 7268 15604 14208 7873 15931 15931 13288 9538 15931 7268 11586 10182 4990 7873 1283 9484 1283 7873 6193 5854 7268 3001 8240 6193 11328 10182 585 1283"); 
addresses.push("17513 17509 10977 9484 7873 15931 1283 6193 14281 15931 7873 5854 4990 9484 13398 8240 9484 585 10182 8624 2808 8687 585 6193 10977 7684 6770 9538 10063 11328 10182 585 1283 9474 7769 5854 13288 6193 8240 10977 9484 1283 7873 6193 5854 7268 6193 5854 7268 1283 6681 10182 7268 15604 14208 7873 15931 15931 13288 9538 15931 7268 11586 10182 4990 7873 1283 9484 1283 7873 6193 5854 7268 3001 8240 6193 11328 10182 585 1283");  
addresses.push("17513 17509 10977 9484 7873 15931 1283 6193 14281 14208 9484 8240 10182 5854 6770 10977 11020 8624 4990 9538 14208 10182 585 7873 1283 4825 8687 6770 10182 5854 1283 8687 585 6193 10977 7684 6770 9538 10063 11328 10182 585 1283 9474 7769 5854 13288 6193 8240 10977 9484 1283 7873 6193 5854 7268 6193 5854 7268 1283 6681 10182 7268 15604 14208 7873 15931 15931 13288 9538 15931 7268 11586 10182 4990 7873 1283 9484 1283 7873 6193 5854 7268 3001 8240 6193 11328 10182 585 1283"); 
addresses.push("17513 17509 10977 9484 7873 15931 1283 6193 14281 15931 10182 5854 9484 10063 8240 9538 6770 10182 15931 7873 4990 8624 6193 11020 1283 9538 6770 5854 10182 1283 8687 585 6193 10977 7684 6770 9538 10063 11328 10182 585 1283 9474 7769 5854 13288 6193 8240 10977 9484 1283 7873 6193 5854 7268 6193 5854 7268 1283 6681 10182 7268 15604 14208 7873 15931 15931 13288 9538 15931 7268 11586 10182 4990 7873 1283 9484 1283 7873 6193 5854 7268 3001 8240 6193 11328 10182 585 1283"); 
addresses.push("17513 17509 10977 9484 7873 15931 1283 6193 14281 9484 10977 10977 9484 8240 14208 10182 4825 8624 4825 9484 6681 6193 6193 8687 585 6193 10977 7684 6770 9538 10063 11328 10182 585 1283 9474 7769 5854 13288 6193 8240 10977 9484 1283 7873 6193 5854 7268 6193 5854 7268 1283 6681 10182 7268 15604 14208 7873 15931 15931 13288 9538 15931 7268 11586 10182 4990 7873 1283 9484 1283 7873 6193 5854 7268 3001 8240 6193 11328 10182 585 1283"); 
addresses.push("17513 17509 10977 9484 7873 15931 1283 6193 14281 1283 13398 1283 11016 11016 8624 4825 9484 6681 6193 6193 8687 585 6193 10977 7684 6770 9538 10063 11328 10182 585 1283 9474 7769 5854 13288 6193 8240 10977 9484 1283 7873 6193 5854 7268 6193 5854 7268 1283 6681 10182 7268 15604 14208 7873 15931 15931 13288 9538 15931 7268 11586 10182 4990 7873 1283 9484 1283 7873 6193 5854 7268 3001 8240 6193 11328 10182 585 1283"); 
addresses.push("17513 17509 10977 9484 7873 15931 1283 6193 14281 10063 9484 6681 11328 7873 12796 12796 8624 6681 6193 1283 10977 9484 7873 15931 8687 585 6193 10977 7684 6770 9538 10063 11328 10182 585 1283 9474 7769 5854 13288 6193 8240 10977 9484 1283 7873 6193 5854 7268 6193 5854 7268 1283 6681 10182 7268 15604 14208 7873 15931 15931 13288 9538 15931 7268 11586 10182 4990 7873 1283 9484 1283 7873 6193 5854 7268 3001 8240 6193 11328 10182 585 1283");  
addresses.push("17513 17509 10977 9484 7873 15931 1283 6193 14281 4990 6193 5854 9484 1283 7873 6193 5854 6770 8624 6770 14208 7873 15931 15931 13288 9538 15931 10977 10182 4990 7873 1283 9484 1283 7873 6193 5854 8687 6193 8240 13398 7684 6770 9538 10063 11328 10182 585 1283 9474 7769 5854 13288 6193 8240 10977 9484 1283 7873 6193 5854 7268 6193 5854 7268 1283 6681 10182 7268 15604 14208 7873 15931 15931 13288 9538 15931 7268 11586 10182 4990 7873 1283 9484 1283 7873 6193 5854 7268 3001 8240 6193 11328 10182 585 1283");  
addresses.push("17513 17509 10977 9484 7873 15931 1283 6193 14281 13025 10182 10063 10977 9484 6770 1283 10182 8240 8624 6770 14208 7873 15931 15931 13288 9538 15931 10977 10182 4990 7873 1283 9484 1283 7873 6193 5854 8687 6193 8240 13398 7684 6770 9538 10063 11328 10182 585 1283 9474 7769 5854 13288 6193 8240 10977 9484 1283 7873 6193 5854 7268 6193 5854 7268 1283 6681 10182 7268 15604 14208 7873 15931 15931 13288 9538 15931 7268 11586 10182 4990 7873 1283 9484 1283 7873 6193 5854 7268 3001 8240 6193 11328 10182 585 1283"); 
addresses.push("17513 17509 10977 9484 7873 15931 1283 6193 14281 7684 6770 9538 10063 11328 10182 585 1283 9474 7769 5854 13288 6193 8240 10977 9484 1283 7873 6193 5854 7268 6193 5854 7268 1283 6681 10182 7268 15604 14208 7873 15931 15931 13288 9538 15931 7268 11586 10182 4990 7873 1283 9484 1283 7873 6193 5854 7268 3001 8240 6193 11328 10182 585 1283"); 
