// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
// Popup Window
// options example: 'height=565,width=400,left=10,top=10,resizable=no,scrollbars=no,toolbar=no,status=no'

var newwindow='';
function popup(url,windowname,options){
	newwindow=window.open(url,windowname,options);
	if (window.focus) {newwindow.focus()}
}

// clear the content field prompt text & change text color
function clickclear(thisfield, defaulttext, theClass) {
	if (thisfield.value == defaulttext) {
		thisfield.value = '';
	}
}
// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
// Slideshow 
// Author : Stephen Griffin, www.i-code.co.uk  

function changeImage() {
	var list = document.getElementById('optionlist');
	document.mainimage.src = list.options[list.selectedIndex].value;
}

function prevImage() {
	var list = document.getElementById('optionlist');
	if(list.selectedIndex == 0) {
		list.selectedIndex = list.options.length-1;
	}
	else {
		list.selectedIndex--;
	}
	changeImage();
}

function nextImage(){
	var list = document.getElementById('optionlist');
	if(list.selectedIndex == list.options.length-1)	{
		list.selectedIndex = 0;
	}
	else {
		list.selectedIndex++;
	}
	changeImage();
}

// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
// Email address decoder
// This script is (C) Copyright 2004 Jim Tucek
// www.jracademy.com/~jtucek/email/ 

function forego() {
	var cliff = '1536 2426 1103 484 504 487 906 1536 2426 1103 484 504 487 2357 504 2458';
	var agility = 2501;
	var agriculture = 343;
	cliff += ' ';
	var previous = cliff.length;
	var landing = 0;
	var credibility = '';
	for(var decade = 0; decade < previous; decade++) {
		landing = 0;
		while(cliff.charCodeAt(decade) != 32) {
			landing = landing * 10;
			landing = landing + cliff.charCodeAt(decade)-48;
			decade++;
		}
		credibility += String.fromCharCode(send(landing,agility,agriculture));
	}
	parent.location = 'm'+'a'+'i'+'l'+'t'+'o'+':'+credibility;
}

function quit(discord,fruit,history) {
	discord += ' ';
	var hour = discord.length;
	var language = 0;
	for(var hieroglyphic = 0; hieroglyphic < hour; hieroglyphic++) {
		language = 0;
		while(discord.charCodeAt(hieroglyphic) != 32) {
			language = language * 10;
			language = language + discord.charCodeAt(hieroglyphic)-48;
			hieroglyphic++;
		}
		document.write(String.fromCharCode(send(language,fruit,history)));
	}
}

function send(lake,broad,male) {
	if (male % 2 == 0) {
		way = 1;
		for(var minimum = 1; minimum <= male/2; minimum++) {
			butterfly = (lake*lake) % broad;
			way = (butterfly*way) % broad;
		}
	} else {
		way = lake;
		for(var night = 1; night <= male/2; night++) {
			butterfly = (lake*lake) % broad;
			way = (butterfly*way) % broad;
		}
	}
	return way;
}