function buttonGlow(button)
	{
	if (button.className == 'submit') {button.className = 'submitover';}
	if (button.className == 'reset' ) {button.className = 'resetover' ;}
	}

function buttonDim(button)
	{
	if (button.className == 'submitover') {button.className = 'submit';}
	if (button.className == 'resetover' ) {button.className = 'reset' ;}
	}

var minSize = 50;
var maxSize = 400;

function dragResizeImage(dragEvent,which)
	{
	posX = which.offsetLeft;
	posY = which.offsetTop;
	var newXsize = dragEvent.x; newXsize = newXsize - posX;
	var newYsize = dragEvent.y; newYsize = newYsize - posY;
	if (newXsize >= maxSize) {newXsize = maxSize;}
	if (newYsize >= maxSize) {newYsize = maxSize;}
	if (newXsize <= minSize) {newXsize = minSize;}
	if (newYsize <= minSize) {newYsize = minSize;}
	which.width=newXsize;
	which.height=newYsize;
	}

var colArray = new Array;
colArray[''] = '#ff0000';
colArray['#ff0000'] = '#ff2a00';
colArray['#ff2a00'] = '#ff5500';
colArray['#ff5500'] = '#ff7f00';
colArray['#ff7f00'] = '#ffaa00';
colArray['#ffaa00'] = '#ffd400';
colArray['#ffd400'] = '#ffff00';
colArray['#ffff00'] = '#d4ff00';
colArray['#d4ff00'] = '#aaff00';
colArray['#aaff00'] = '#7fff00';
colArray['#7fff00'] = '#55ff00';
colArray['#55ff00'] = '#2aff00';
colArray['#2aff00'] = '#00ff00';
colArray['#00ff00'] = '#00ff2a';
colArray['#00ff2a'] = '#00ff55';
colArray['#00ff55'] = '#00ff7f';
colArray['#00ff7f'] = '#00ffaa';
colArray['#00ffaa'] = '#00ffd4';
colArray['#00ffd4'] = '#00ffff';
colArray['#00ffff'] = '#2ad4ff';
colArray['#2ad4ff'] = '#55aaff';
colArray['#55aaff'] = '#7f7fff';
colArray['#7f7fff'] = '#aa55ff';
colArray['#aa55ff'] = '#d42aff';
colArray['#d42aff'] = '#ff00ff';
colArray['#ff00ff'] = '#ff00d4';
colArray['#ff00d4'] = '#ff00aa';
colArray['#ff00aa'] = '#ff007f';
colArray['#ff007f'] = '#ff0055';
colArray['#ff0055'] = '#ff002a';
colArray['#ff002a'] = '#ff0000';

function animateTwo(link)
	{
	var l = document.links[link];
	if (colArray[l.style.color])
		{l.style.color = colArray[l.style.color];}
	else
		{l.style.color = colArray[''];}
	setTimeout("animateTwo(" + link + ")",100);
	}

function animate(link,color)
	{
	var l = document.links[link];
	var h = l.innerHTML;
	var t = l.innerText;
	var p = h.indexOf('\<'); //'
	var s = '';
	if (p > -1)
		{s = t.substr(0,p+1);}
	if (p == t.length)
		{
		l.innerHTML = t;
		setTimeout("animate(" + link + ",'" + color + "')",5000);
		}
	else
		{
		s = s + '<font color="' + color + '">' + t.substr(p+1,1) + '</font>' + t.substr(p+2);
		l.innerHTML = s;
		setTimeout("animate(" + link + ",'" + color + "')",20);
		}
	}

function findFlashers()
	{
	for (var l=0; l<document.links.length; l++)
		{
		if (document.links[l].className == 'goldFlash')
			{setTimeout("animateTwo(" + l + ")",l*66);}
		if (document.links[l].className == 'expandFlash')
			{setTimeout("animateTwo(" + l + ")",l*66);}
		}
	}

function clipCopy(stuff) 
	{
	cliptext.value = stuff;
	var clipRange = cliptext.createTextRange();
	clipRange.execCommand("Copy");
	alert("'" + stuff + "' copied to the clipboard");
	}

function toggleInner(h)
	{
	var tbody = h.parentNode.parentNode;
	h.style.width = (h.clientWidth-10)+'px';

	var tables = tbody.getElementsByTagName('table');
	for (var t=0; t<tables.length; t++)
		{
		var theTable = tables[t];

		if (theTable.style.display == 'none')
			{theTable.style.display = 'block';}
		else
			{theTable.style.display = 'none';}

		}
	}

function toggleSpoiler(h)
	{
	var s = h.parentNode;
	var t = s.getElementsByTagName('div')[1];

	if (t.style.display == 'block')
		{t.style.display = 'none';}
	else
		{t.style.display = 'block';}
	}


function toggleNav(o)
	{
	var uls = o.parentNode.getElementsByTagName('ul');
	var s = uls[0].style;
	if (s.display == 'block')
		{s.display = 'none';}
	else
		{s.display = 'block';}
	}

function openNav(current)
	{
	var uls = document.getElementById('nav').getElementsByTagName('ul');
	for (var ul=0; ul<uls.length; ul++)
		{
		if (uls[ul].parentNode.id == 's'+current)
			{uls[ul].style.display = 'block';}
		}
	}
