
function SetUpWebsite()
{
	if (document.documentElement.clientWidth < 985)
	{
		document.getElementById('webpage_background').style.width = "985px";
		document.getElementById('footerSetter').style.width = "985px";
	} else {
		document.getElementById('webpage_background').style.width = "";
		document.getElementById('footerSetter').style.width = "";
	}		
}

//THIS NEXT PART OF CODE IS FOR THE FLASHY LIKE TOP TITLE AREA
var words = ["THE", "ONE", "THE", "ONLY", "adamschricker"];

function movieIntro()
{
	wordMinSize = 0;
	wordMaxSize = 300;
	currentWord = 0;
	currentWordSize = 0;
	firedFlashFunction = "no";
	document.getElementById('words').innerHTML = words[currentWord];
	changeWordSize("grow", wordMaxSize);
}

function changeWordSize(direction, targetSize)
{
	if (direction == "grow")
	{
		currentWordSize += 2;
		document.getElementById('words').style.fontSize = currentWordSize + "px";
		if (document.getElementById('words').offsetWidth > 985) { document.getElementById('containerTable').style.marginLeft = "-" + Math.floor((document.getElementById('words').offsetWidth - 985) / 2) + "px"; }
		if (document.getElementById('words').offsetHeight > 100) { document.getElementById('containerTable').style.marginTop = "-" + Math.floor((document.getElementById('words').offsetHeight - 100) / 2) + "px"; }
		changeWordSize_timeout = setTimeout("changeWordSize('grow', " + targetSize + ");", 10);
		if (currentWordSize > targetSize && firedFlashFunction == "no")
		{
			firedFlashFunction = "yes";
			flash();
		}
	}
	if (direction == "shrink")
	{
		currentWordSize -= 2;
		document.getElementById('words').style.fontSize = currentWordSize + "px";
		if (document.getElementById('words').offsetWidth > 985) { document.getElementById('containerTable').style.marginLeft = "-" + Math.floor((document.getElementById('words').offsetWidth - 985) / 2) + "px"; }
		if (document.getElementById('words').offsetHeight > 100) { document.getElementById('containerTable').style.marginTop = "-" + Math.floor((document.getElementById('words').offsetHeight - 100) / 2) + "px"; }
		changeWordSize_timeout = setTimeout("changeWordSize('shrink', " + targetSize + ");", 10);
		if (currentWordSize < targetSize)
		{
			clearTimeout(changeWordSize_timeout);
			setTimeout("document.getElementById('container').innerHTML = '<div id=\"title\"></div>';", 1000);
		}
	}
}

function changeWord()
{
	currentWord++;
	if (currentWord < words.length)
	{
		if (currentWord < (words.length - 1))
		{
			currentWordSize = wordMinSize;
			document.getElementById('words').style.fontSize = currentWordSize + "px";
			document.getElementById('words').innerHTML = words[currentWord];
			document.getElementById('containerTable').style.marginLeft = "0px";
			document.getElementById('containerTable').style.marginTop = "0px";
			changeWordSize("grow", wordMaxSize);
		} else if (currentWord = (words.length - 1)) {
			currentWordSize = 500;
			document.getElementById('words').style.fontSize = currentWordSize + "px";
			document.getElementById('words').innerHTML = words[currentWord];
			document.getElementById('containerTable').style.marginLeft = "-" + Math.floor((document.getElementById('words').offsetWidth - 985) / 2) + "px";
			document.getElementById('containerTable').style.marginTop = "-" + Math.floor((document.getElementById('words').offsetHeight - 100) / 2) + "px";
			changeWordSize("shrink", 100);
		}
	}
}

function flash(flashDirection)
{
	var flashStages = ["000", "111", "222", "333", "444", "555", "666", "777", "888", "999", "aaa", "bbb", "ccc"];
	if (flashDirection == null) { flashDirection = "up"; flashStage = "0"; }
	if (flashDirection == "up")
	{
		flashStage++;
		if (flashStage < flashStages.length)
		{
			document.getElementById('words').style.backgroundColor = "#" + flashStages[flashStage];
			flash_timeout = setTimeout("flash('" + flashDirection + "');", 10);
		} else {
			clearTimeout(changeWordSize_timeout);
			firedFlashFunction = "no";
			clearTimeout(flash_timeout);
			flashDirection = "down";
			changeWord();
		}
	}
	if (flashDirection == "down")
	{ 
		flashStage--;
		if (flashStage > 0)
		{
			document.getElementById('words').style.backgroundColor = "#" + flashStages[flashStage];
			flash_timeout = setTimeout("flash('" + flashDirection + "');", 10);
		} else {
			document.getElementById('words').style.backgroundColor = "#" + flashStages[flashStage];
			clearTimeout(flash_timeout);
		}
	}
}

function resize_contentbox(i)
{
	box = i.parentNode.parentNode.parentNode.parentNode;
	if (box.offsetHeight < 35)
	{
		i.innerHTML = 'click to close';
		box.style.height = 'auto';
	} else {
		i.innerHTML = 'click to open';
		box.style.height = '20px';
	}
}


