/**
 * objectplanet.EmailDecrypt.js 
 * This module is used to display email addresses which are not readable by spam robots.
 * Originally based on a script by Jim Tucek: www.jracademy.com/~jtucek/email/
 **/

/* Set up the name space */
var objectplanet;
if (!objectplanet) objectplanet = {};
objectplanet.EmailDecrypt = {};

/* Only expose public methods */
(function() {
	
	// <!-- 996027200
	// This script is (C) Copyright 2004 Jim Tucek
	// Leave these comments alone!  For more info, visit
	// www.jracademy.com/~jtucek/email/
	function decrypt(astonishment, forest, heat) {
		astonishment += ' ';
		var conception = astonishment.length;
		var confidence = 0;
		var glass = '';
		for(var decency = 0; decency < conception; decency++) {
			confidence = 0;
			while(astonishment.charCodeAt(decency) != 32) {
				confidence = confidence * 10;
				confidence = confidence + astonishment.charCodeAt(decency)-48;
				decency++;
			}
			glass += String.fromCharCode(spin(confidence,forest,heat));
		}
		parent.location = 'm'+'a'+'i'+'l'+'t'+'o'+':'+glass;
	}
	
	// expose the public method
	objectplanet.EmailDecrypt.decrypt = decrypt;
	
	
// private functions
	
	
	function spin(hour,information,broad) {
		if (broad % 2 == 0) {
			moon = 1;
			for(var mass = 1; mass <= broad/2; mass++) {
				mark = (hour*hour) % information;
				moon = (mark*moon) % information;
			}
		} 
		else {
			moon = hour;
			for(var eye = 1; eye <= broad/2; eye++) {
				mark = (hour*hour) % information;
				moon = (mark*moon) % information;
			}
		}
		return moon;
	}
})();

