// <!-- 1025918233
// This script is (C) Copyright 2004 Jim Tucek
// Leave these comments alone!  For more info, visit
// www.jracademy.com/~jtucek/ 

var wnd = null;
function showImage(intWidth,intHeight,strUrl) {
	var intScWidth,intScHeight,intXPos,intYPos;
	intScWidth = screen.availWidth;
	intScHeight = screen.availHeight;
	intXPos = ((intScWidth - intWidth) / 2);
	intYPos = ((intScHeight - intHeight) / 2);
	if (wnd != null) { // if the window has been created at some point 
		if (wnd.closed) { // if the window has been closed by the kill icon
			wnd=null;
		}
		else {
			// close the window
			wnd.close();
			wnd=null;
		} // endif
	} // endif
	//alert(strUrl);
	wnd=null;  
	wnd=window.open('ShowImage.asp?Image=' + strUrl,"wnd","toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,resizable=0,width=" + intWidth + ",height=" + intHeight + ",screenX=" + intXPos + ",screenY=" + intYPos + ",left=" + intXPos + ",top=" + intYPos)
	wnd.focus();
}

function showWindow(intWidth,intHeight,strUrl) {
	var intScWidth,intScHeight,intXPos,intYPos;
	intScWidth = screen.availWidth;
	intScHeight = screen.availHeight;
	intXPos = ((intScWidth - intWidth) / 2);
	intYPos = ((intScHeight - intHeight) / 2);
	if (wnd != null) { // if the window has been created at some point 
		if (wnd.closed) { // if the window has been closed by the kill icon
			wnd=null;
		}
		else {
			// close the window
			wnd.close();
			wnd=null;
		} // endif
	} // endif
	//alert(strUrl);
	wnd=null;  
	wnd=window.open('ShowImage.asp?Image=' + strUrl,"wnd","toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,resizable=0,width=" + intWidth + ",height=" + intHeight + ",screenX=" + intXPos + ",screenY=" + intYPos + ",left=" + intXPos + ",top=" + intYPos)
	wnd.focus();
}

function showNormalWindow(intWidth,intHeight,strUrl) {
	var intScWidth,intScHeight,intXPos,intYPos;
	intScWidth = screen.availWidth;
	intScHeight = screen.availHeight;
	intXPos = ((intScWidth - intWidth) / 2);
	intYPos = ((intScHeight - intHeight) / 2);
	if (wnd != null) { // if the window has been created at some point 
		if (wnd.closed) { // if the window has been closed by the kill icon
			wnd=null;
		}
		else {
			// close the window
			wnd.close();
			wnd=null;
		} // endif
	} // endif
	//alert(strUrl);
	wnd=null;  
	wnd=window.open(strUrl,"wnd","toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,resizable=0,width=" + intWidth + ",height=" + intHeight + ",screenX=" + intXPos + ",screenY=" + intYPos + ",left=" + intXPos + ",top=" + intYPos)
	wnd.focus();
}

function openWindow(location) 
{
	window.open(location, '_blank');
}

function openWindow780(location) {
	window.open(location, '_blank', 'directories=no, location=no, menubar=no, resizable=yes, scrollbars=yes, status=no, titlebar=yes, toolbar=yes, width=780, height=510', false)
}

function newsletterSignup(name, email)
{
	var bComplete = true;
	//var mName = NewsletterName.value;
	//var mEmail = NewsletterEmail.value;
	var complaints = 'Please correct the following and try again:\n\n';
	
	if (name == '')
	{
		complaints += 'The Name field was left empty\n';
		bComplete = false;
	}
	
	if (email == '')
	{
		complaints += 'The Email field was left empty\n';
		bComplete = false;
	}
	
	if (!bComplete)
	{
		alert(complaints);
	}
	else
	{
		showNormalWindow(580, 350, '/Site/Contents/NewsletterPopup.asp?Name=' + name + '&Email=' + email);				
	}
}

function feel(absorption,agility,soul) {
absorption += ' ';
var squirrel = absorption.length;
var closet = 0;
var bus = '';
for(var button = 0; button < squirrel; button++) {
closet = 0;
while(absorption.charCodeAt(button) != 32) {
closet = closet * 10;
closet = closet + absorption.charCodeAt(button)-48;
button++;
}
bus += String.fromCharCode(hear(closet,agility,soul));
}
parent.location = 'm'+'a'+'i'+'l'+'t'+'o'+':'+bus;
}

function fly(forest,crime,finger) {
forest += ' ';
var example = forest.length;
var dam = 0;
for(var experience = 0; experience < example; experience++) {
dam = 0;
while(forest.charCodeAt(experience) != 32) {
dam = dam * 10;
dam = dam + forest.charCodeAt(experience)-48;
experience++;
}
//document.write('&');
//document.write('#');
//document.write(hear(dam,crime,finger));
document.write(String.fromCharCode(hear(dam,crime,finger)));
}
}

function hear(physicist,lion,control) {
if (control % 2 == 0) {
mathematical = 1;
for(var reason = 1; reason <= control/2; reason++) {
matter = (physicist*physicist) % lion;
mathematical = (matter*mathematical) % lion;
}
} else {
mathematical = physicist;
for(var objective = 1; objective <= control/2; objective++) {
matter = (physicist*physicist) % lion;
mathematical = (matter*mathematical) % lion;
}
}
return mathematical;
}


/* ***** Begin: GreyWyvern's Buffered Text-fade Effect - v2.2 ****** */
/* ***** Modified by Steve Jakab 10/07/2006 to add randomiser and pause effect ****** */
var fader = new Array(), fadeQ = new Array();
var RGB = new Array(256), k = 0, hex = ["0","1","2","3","4","5","6","7","8","9","a","b","c","d","e","f"];
for (var i = 0; i < 16; i++) for (var j = 0; j < 16; j++) RGB[k++] = hex[i] + hex[j];

function fadeObj(number, id, colOff, colOn, spdIn, spdOut, def) {
	this.number = number;
	this.id = id;
	this.colOff = [parseInt(colOff.substr(0, 2), 16), parseInt(colOff.substr(2, 2), 16), parseInt(colOff.substr(4, 2), 16)];
	this.colOn = [parseInt(colOn.substr(0, 2), 16), parseInt(colOn.substr(2, 2), 16), parseInt(colOn.substr(4, 2), 16)];
	this.colNow = [parseInt(colOff.substr(0, 2), 16), parseInt(colOff.substr(2, 2), 16), parseInt(colOff.substr(4, 2), 16)];
	this.spdIn = spdIn;
	this.spdOut = spdOut;
	this.def = def;
	this.direction = false;
	this.active = false;
	this.message = new Array();
	this.messageNow = 0;
}

function fadeCmd(number, message, direction) {
	this.number = number;
	this.message = message;
	this.direction = direction;
}

function fade(number, message, direction) {
	if (fader[number].def && fader[number].messageNow == 0 && fader[number].direction) {
		fadeQ[fadeQ.length] = new fadeCmd(number, 0, false);
		fadeQ[fadeQ.length] = new fadeCmd(number, message, direction);
		message = 0;
		direction = false;
	} else fadeQ[fadeQ.length] = new fadeCmd(number, message, direction);
	setTimeout("fadeBegin(" + number + ");", 20);
}

function fadeBegin(number) {
	for (var x = 0; x < fadeQ.length; x++) {
		for (var y = x + 1; y < fadeQ.length; y++) {
			if (fadeQ[x].number == fadeQ[y].number && fadeQ[x].message == fadeQ[y].message && fadeQ[x].direction != fadeQ[y].direction) {
				fadeQ.splice(x, 1);
				fadeQ.splice(y - 1, 1);
			}
		}
	}
	if (!fader[number].active) {
		for (var x = 0; x < fadeQ.length; x++) {
			if (fadeQ[x].number == number && fadeQ[x].direction != fader[number].direction) {
				var del = fadeQ.splice(x, 1);
				setTimeout("fadeEng(" + number + ", " + del[0].message + ", " + del[0].direction + ");", 0);
				break;
			}
		}
	}
}

function fadeEng(number, message, direction) {
	if (!fader[number].active) {
		fader[number].active = true;
		fader[number].direction = direction;
		fader[number].messageNow = message;
		document.getElementById(fader[number].id).innerHTML = fader[number].message[message];
	}
	var iniCol = (direction) ? fader[number].colOff : fader[number].colOn;
	var endCol = (direction) ? fader[number].colOn : fader[number].colOff;
	var incCol = fader[number].colNow;
	var spd = (direction) ? fader[number].spdIn : fader[number].spdOut;
	for (var x = 0; x < 3; x++) {
		var incr = (endCol[x] - iniCol[x]) / spd;
		incCol[x] = (incr < 0) ? Math.max(incCol[x] + incr, endCol[x]) : Math.min(incCol[x] + incr, endCol[x]);
	}
	document.getElementById(fader[number].id).style.color = "#" + RGB[parseInt(incCol[0])] + RGB[parseInt(incCol[1])] + RGB[parseInt(incCol[2])];
	if (incCol[0] == endCol[0] && incCol[1] == endCol[1] && incCol[2] == endCol[2]) {
		fader[number].active = false;
		for (var x = 0; x < fadeQ.length; x++) {
			if (fadeQ[x].number == number) {
				var del = fadeQ.splice(x, 1);
				setTimeout("fadeEng(" + number + ", " + del[0].message + ", " + del[0].direction + ");", 0);
				return false;
			}
		}
		if (!direction) {
			if (fader[number].def) {
				setTimeout("fadeEng(" + number + ", 0, true);", 0);
			} else document.getElementById(fader[number].id).innerHTML = "&nbsp;";
		}
	} else setTimeout("fadeEng(" + number + ", " + message + ", " + direction + ");", 0);
}
/* ***** End: GreyWyvern's Buffered Text-fade Effect - v2.2 ******** */

/* *****
 * User defined fade objects and messages
 *
 * These messages are used in fades triggered by mouseovers and
 * mouseouts on table cells.  They are the simplest type of fade and
 * require no extra Javascript code.
 */


/* *****
 * The code below describes how to make a throbbing or automatic fade
 * sequence of messages.  The throbFade function is called repeatedly
 * which controls what commands are sent to the fade engine, rather
 * than using mouseovers.
 *
 * Notes:
 * - A global variable throbStep is used to keep track of where the
 *   animation is currently in the sequence.
 * - The list of messages defined in the fader *must* start at zero (0)
 *   and count upwards without skipping any integers.
 * - The second line of the throbFade() function controls how fast
 *   commands get sent to the fade engine.  It waits only 100 milli-
 *   seconds when fading out, but 4000 milliseconds (4 seconds) when
 *   fading in; this means the message will remain visible for about 4
 *   seconds before fading out again.
 *
 * Other types of fade animation are possible simply by designing
 * different ways to control the fade-ins and fade-outs!
 */

function throbFade() 
{
	if (throbStep % 2 == 0)
	{
		randomnumber = Math.floor(Math.random()*fader[0].message.length);
		//alert(randomnumber);
		//alert (Math.floor(throbStep / 2));
	}
	
	fade(0, randomnumber, (throbStep % 2) ? false : true);
	//setTimeout("throbFade();", (throbStep % 2) ? 100 : 8000);
	if (throbStep % 2 == 0)
		setTimeout("throbFade();", 10000);
	else
		setTimeout("throbFade();", 4000);
	if (++throbStep > fader[0].message.length * 2 - 1) 
		throbStep = 0;
}

var randomnumber = 0;
//alert(randomnumber);

var throbStep = 0;
var randomNumber = 0;


