/* preload images */
function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
function MM_jumpMenu(targ,selObj,restore){ //v3.0
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}


/* EMAIL ENCRYPTION SCRIPT */

// This script is (c) copyright 2006 Jim Tucek under the
// GNU General Public License (http://www.gnu.org/licenses/gpl.html)
// For more information, visit www.jracademy.com/~jtucek/email/ 
// Leave the above comments alone!
// CODE USED: P: 101  Q: 31
// 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;
}

// email addresses: 

if(!addresses) var addresses = new Array();
addresses.push("3131 2143 1806 2806 830 1201 3129 1404 2495 282 2740 830 1327 808 1964 2935 830 3129 1750 3073 1327 1404 830 781 808 1404 439 456 808 781 3129 2935 209 781 1404 1806");  // #0 , university at - voiceobjects.com
addresses.push("3131 2143 1806 2806 830 1201 3129 1404 2495 2322 808 1327 2935 282 534 534 1404 1964 3129 3073 1327 1404 830 781 808 1404 439 456 808 781 3129 2935 209 781 1404 1806"); // #1 devsupport at - voiceobjects.com
addresses.push("3131 2143 1806 2806 830 1201 3129 1404 2495 1404 534 3129 1404 282 3129 3073 1327 1404 830 781 808 1404 439 456 808 781 3129 2935 209 781 1404 1806"); // #2 optout at - voiceobjects.com
addresses.push("3131 2143 1806 2806 830 1201 3129 1404 2495 534 1964 1404 2322 282 781 3129 1806 2806 2740 2806 330 808 1806 808 2740 3129 3073 1327 1404 830 781 808 1404 439 456 808 781 3129 2935 209 781 1404 1806 0"); // #3  productmanagement at -voiceobjects.com
addresses.push("3131 2143 1806 2806 830 1201 3129 1404 2495 830 2740 506 1404 3073 1327 1404 830 781 808 1404 439 456 808 781 3129 2935 209 781 1404 1806"); // #4 info at
addresses.push("3131 2143 1806 2806 830 1201 3129 1404 2495 2322 808 1327 830 2740 506 1404 3073 1327 1404 830 781 808 1404 439 456 808 781 3129 2935 209 781 1404 1806 1675 2935 282 439 456 808 781 3129 1735 406 1035 342 409 808 1327 808 1201 1404 534 808 1964 342 2241 1404 1964 3129 2806 1201"); //#5 devinfo with VO Developer Portal as subject
addresses.push("3131 2143 1806 2806 830 1201 3129 1404 2495 2322 808 1327 830 2740 506 1404 3073 1327 1404 830 781 808 1404 439 456 808 781 3129 2935 209 781 1404 1806"); // #6 devinfo with no subject
