<!--
function isthisie()
{window.location.href = "noie.shtml";}
-->

/*<!--[if IE]><p>You are using Internet Explorer.</p><![endif]-->*/

/*function screenResTest()
{
	var width = screen.width;
	var height = screen.height;

	if(width != 800 && width < 1024 && height != 600 && height < 768)
	{
		document.location = "badres.html";
	}
	else
	{
		document.write("Screen Resolution Test Passed");
	}
}

function printNav()
{
	var pageFileName = new Array();
	pageFileName[0] = "home.html";
	pageFileName[1] = "aboutme.html";
	pageFileName[2] = "aboutsite.html";
	pageFileName[3] = "contact.html";
	pageFileName[4] = "links.html";
	pageFileName[5] = "shitlist.html";
	pageFileName[6] = "officialfriends.html";
	pageFileName[7] = "photochop.html";
	pageFileName[8] = "rants.html";
	pageFileName[9] = "shamelessplugs.html";
	pageFileName[10] = "stopbush.html";
	pageFileName[11] = "updates.html";
	pageFileName[12] = "wallpaper.html";

	var displayName = new Array();
	displayName[0] = "Home";
	displayName[1] = "About Jared";
	displayName[2] = "About Orange Icon";
	displayName[3] = "Contact Info";
	displayName[4] = "Hyperlinks";
	displayName[5] = "My Shit List";
	displayName[6] = "Official Friends";
	displayName[7] = "PhotoChops";
	displayName[8] = "Rants 242";
	displayName[9] = "Shameless Plugs";
	displayName[10] = "STOP BUSH";
	displayName[11] = "Updates";
	displayName[12] = "Wallpaper";

	var printLine = new Array();

	var begLinkText = "<a href=\"";
	var midLinkText = "\">";
	var endLinkText = "</a>";
	var newLineText = "<br>";

	var i;
	var lastPage = 12;

	document.write("<div style=\"white-space: nowrap;\">");

	for(i = 0; i <= lastPage; i++)
	{
		if(location.href.indexOf(pageFileName[i]) == -1)
		{
			printLine[i] = (begLinkText + pageFileName[i] + midLinkText + displayName[i] + endLinkText);
			if(i != lastPage)
			{
				printLine[i] += newLineText;
			}
			
			//document.write(location.href.indexOf(pageFileName[i]))
			document.write(printLine[i]);
		}
		else if(location.href.indexOf(pageFileName[i]) != -1)
		{
			printLine[i] = displayName[i];
			if(i != lastPage)
			{
				printLine[i] += newLineText;
			}
			
			//document.write(location.href.indexOf(pageFileName[i]))
			document.write(printLine[i]);
		}
	}

	document.write("<p align=\"center\">Webmaster:<br><a href=\"mailto:jared [AT] orangeicon [DOT] com?subject=[ORANGEICON]Webmaster%20link.\">jared [AT] orangeicon [DOT] com</a></p></div>");
}

function getNumExt(num)
{
	var numLastDigit;
	var numString = "" + num;
	var dayExt;

	if(num >= 11 && num <= 13)
	{
		dayExt = "th";
	}
	else
	{
		numLastDigit = numString.substr((numString.length - 1), 1);

		switch (numLastDigit)
		{
			case "1":
				dayExt = "st";
				break;
			case "2":
				dayExt = "nd";
				break;
			case "3":
				dayExt = "rd";
				break;
			default:
				dayExt = "th";
				break;
		}
	}

	return dayExt;
}

function printITime()
{
	var now = new Date();
	var off = (now.getTimezoneOffset() + 60)*60;
	var theSeconds = (now.getHours() * 3600) + (now.getMinutes() * 60) + now.getSeconds() + off;
	var beat = Math.floor(theSeconds/86.4);
	var beatPlural;
	if(beat > 1000)
	{
		beat -= 1000;
	}

	if(beat < 0)
	{
		beat += 1000;
	}

	if(beat >= 2)
	{
		beatPlural = ".beats";
	}
	else
	{
		beatPlural = ".beat";
	}

	return "Internet Time @ " + beat + " " + beatPlural + " [<a href='http://www.timeanddate.com/time/internettime.html' target='Internet_Time'>?</a>]";
}

function printDate()
{
	var theDate = new Date();
	var currentYear = theDate.getFullYear();
	var currentMonthNum = theDate.getMonth();
	var currentMonth = "";
	var weekDayNum = theDate.getDay();
	var weekDay = "";
	var currentDay = theDate.getDate();
	var dayString = "" + currentDay;
	var dayExt = "";
	var myAge;
	var datePhrase = "";

	switch (weekDayNum)
	{
		case 0:
			weekDay = "Sunday";
			break;
		case 1:
			weekDay = "Monday";
			break;
		case 2:
			weekDay = "Tuesday";
			break;
		case 3:
			weekDay = "Wednesday";
			break;
		case 4:
			weekDay = "Thursday";
			break;
		case 5:
			weekDay = "Friday";
			break;
		case 6:
			weekDay = "Saturday";
			break;
	}

	switch (currentMonthNum)
	{
		case 0:
			currentMonth = "January";
			break;
		case 1:
			currentMonth = "February";
			break;
		case 2:
			currentMonth = "March";
			break;
		case 3:
			currentMonth = "April";
			break;
		case 4:
			currentMonth = "May";
			break;
		case 5:
			currentMonth = "June";
			break;
		case 6:
			currentMonth = "July";
			break;
		case 7:
			currentMonth = "August";
			break;
		case 8:
			currentMonth = "September";
			break;
		case 9:
			currentMonth = "October";
			break;
		case 10:
			currentMonth = "November";
			break;
		case 11:
			currentMonth = "December";
			break;
	}

	dayExt = getNumExt(currentDay);

	if((currentMonthNum + 1) == 6 && currentDay == 29)
	{
		myAge = (currentYear - 1984);
		datePhrase = "; Happy " + myAge + getNumExt(myAge) + " Birthday to me";
	}

	if((currentMonthNum + 1) == 7 && currentDay == 12)
	{
		datePhrase = "; Happy <a href=\"http://www.bcpl.net/~cbladey/orange.html\">Orange Day</a>";
	}

	if((currentMonthNum + 1) == 10 && currentDay == 31)
	{
		datePhrase = "; Happy Halloween";
	}

	if(weekDayNum == 5 && currentDay == 13)
	{
		datePhrase = "; Happy Friday the 13th";
	}

	datePhrase = weekDay + ", " + currentMonth + " " + currentDay + dayExt + ", " + currentYear + datePhrase;
	return datePhrase;
}

function printDay()
{
	var theDate = new Date();
	var weekDay = theDate.getDay();
	var returnText;
	switch (weekDay)
	{
		case 0:
			returnText = "Somehow it's Pizza Sunday: Eat pizza";
			break;
		case 1:
			returnText = "Mystery Monday: Eat anywhere you want";
			break;
		case 2:
			returnText = "Taco Tuesday: Eat tacos";
			break;
		case 3:
			returnText = "Wendy's Wednesday: Eat at Wendy's";
			break;
		case 4:
			returnText = "Thicecream Thursday: Eat ice cream";
			break;
		case 5:
			returnText = "Friendly's Friday: Eat at Friendly's";
			break;
		case 6:
			returnText = "Sakura Japan Saturday: Eat at Sakura Japan (Chinese food will also do)";
			break;
	}

	return returnText;
}

function printRandom()
{
	var Num = (Math.round(Math.random()*18));
	var randomThought = new Array();

	randomThought[0] = "I'll kill you!!!";
	randomThought[1] = "I hope this is not <i>Chris's</i> blood...";
	randomThought[2] = "I'm Optimus Prime, leader of the Autobots!";
	randomThought[3] = "I'm Rodimus Prime, leader of the Autobots!";
	randomThought[4] = "Help, I'm being repressed!";
	randomThought[5] = "Primary Objective: ATTAK! Secondary Objective: Reload!";
	randomThought[6] = "Hey, you're not authorized for this sector!";
	randomThought[7] = "I love the word 'oil'... I wish it meant something else so I could use it more often.";
	randomThought[8] = "Did you ever see that episode of Sailor Moon?";
	randomThought[9] = "You can run but you can't glide!!!";
	randomThought[10] = "Rip the system!";
	randomThought[11] = "Who let all of these lab monkeys out of their cages!?";
	randomThought[12] = "Watch out for Rebel spies...";
	randomThought[13] = "To select a unit, left-click it.";
	randomThought[14] = "This won't do at all...";
	randomThought[15] = "Hello? Who is this?";
	randomThought[16] = "Enter any 11 digit, prime number to continue...";
	randomThought[17] = "You have died. Press start to continue.";
	randomThought[18] = "Will you take the H.Gun Bullets?";
	randomThought[19] = "Fuck the President.";
	randomThought[20] = "The government lies to you.";

	return randomThought[Num];
}

function createWin(url, title, winWidth, winHeight)
{
	var leftPos = ((screen.width - winWidth) / 2);
	var topPos = ((screen.height - winHeight) / 2);
	popupWin = window.open(url,title,"width=" + winWidth + ",height=" + winHeight + ",resizable=yes,toolbar=no,scrollbars=yes,status=no,menubar=no,location=no,left=" + leftPos + ",top=" + topPos + "");
	window.popupWin.focus();
}

function printFooter()
{
	var topSide = "<p align=\"right\">+<a href=\"#top\">Head Topside</a>?<br>";
	var getMeOutOfHere = "+<a href=\"javascript:getMeOutOfHere();\">Get Out of Here</a>?</p>";

	document.write(topSide);
	document.write(getMeOutOfHere);
}

function getMeOutOfHere()
{
	var Num = (Math.round(Math.random()*18));
	var randomPage = new Array();
	var winWidth = (screen.width / 2);
	var winHeight = (screen.height / 2);
	var leftPos = ((screen.width - winWidth) / 2);
	var topPos = ((screen.height - winHeight) / 2);

	randomPage[0] = "http://maddox.xmission.com/";
	randomPage[1] = "http://www.rathergood.com/george/";
	randomPage[2] = "http://www.matazone.co.uk/halloween_special_2002.html";
	randomPage[3] = "http://www.mjnewton.demon.co.uk/drwho/roadcone.htm";
	randomPage[4] = "http://www.gumbopages.com/other-radio.html";
	randomPage[5] = "http://www.everypoet.com/haiku/default.htm";
	randomPage[6] = "http://www.wkyc.com/news/news_fullstory.asp?id=3828";
	randomPage[7] = "http://www.somethingawful.com/";
	randomPage[8] = "http://mr-31238.mr.valuehost.co.uk/assets/Flash/psychic.swf";
	randomPage[9] = "http://www.newgrounds.com/";
	randomPage[10] = "http://www.homestarrunner.com/";
	randomPage[11] = "http://www.natertots.com/message.html";
	randomPage[12] = "http://www.madsci.org/cgi-bin/cgiwrap/~lynn/jardin/SCG";
	randomPage[13] = "http://www.theonion.com";
	randomPage[14] = "http://www.thisisthefirstwebsitetouseall63characterssogofuckyourselfplease.com/";
	randomPage[15] = "http://www.foad.com/pi/index.html";
	randomPage[16] = "http://www.evolvefish.com/";
	randomPage[17] = "http://www.killyourself.com/";
	randomPage[18] = "http://www.lebonze.co.uk/stuff/move.htm";

	exitWin = window.open(randomPage[Num],"Goodbye","width=" + winWidth + ",height=" + winHeight + ",resizable=yes,toolbar=yes,scrollbars=yes,status=yes,menubar=yes,location=yes,left=" + leftPos + ",top=" + topPos + ",copyhistory=no");
	window.exitWin.focus();
}

function validateEmailForm()
{
	var errorNum = parseInt(document.emailform.errors.value);
	var name = document.emailform.name.value;
	var email = document.emailform.email.value;
	var subject = document.emailform.subject.value;
	var message = document.emailform.message.value;
	var mobileBool = document.emailform.mobile.checked;
	var emailSymbol = email.indexOf("@");
	var emailDot = email.indexOf(".");
	var emailComma = email.indexOf(",");
	var emailBlank = email.indexOf(" ");
	var dotSymbolCount = 0;
	var startSector = email.indexOf("@");

	//how many times did they screw up? If it's three strikes, they they're out!
	if(errorNum >= 3)
	{
		document.emailform.errors.value = "0";
		document.location.href = "donthurtyourself.html";
		return false;
	}

	//did they do ANYTHING!?
	if(name == "" && email == "" && subject == "" && message == "")
	{
		document.emailform.errors.value = (parseInt(document.emailform.errors.value) + 1);
		alert("OK, uhh... You didn't fill in a single thing. What the hell is your problem?");
		document.emailform.name.focus();
		return false;
	}

	//check for valid name
	if(name == "")
	{
		document.emailform.errors.value = (parseInt(document.emailform.errors.value) + 1);
		alert("<sarcasm>Wow, that's a nice name you got there...</sarcasm>");
		document.emailform.name.focus();
		return false;
	}

	//Check for valid email address characters
	if (email == "" || emailSymbol == -1 || emailDot == -1 || emailComma != -1  || emailBlank != -1)
	{
		document.emailform.errors.value = (parseInt(document.emailform.errors.value) + 1);
		alert("Please enter a valid email address!")
		document.emailform.email.focus();
		return false;
	}

	//Check for @ symbol as first or last character
	if (email.substring(0,1) == "@" || emailSymbol == email.length-1)
	{
		document.emailform.errors.value = (parseInt(document.emailform.errors.value) + 1);
		alert("The @ symbol cannot be the first or last character of an email address, please use a valid format!");
		document.emailform.email.focus();
		return false;
	}

	//Check for more than one @ symbol
	var emailSymbolCount = 0;
	for (i = 0; i < email.length; i++)
	{
		if (email.substring(i,i+1) == "@")
		{
			emailSymbolCount = emailSymbolCount + 1;
		}
	}
	if (emailSymbolCount > 1)
	{
		document.emailform.errors.value = (parseInt(document.emailform.errors.value) + 1);
		alert("Your email address contains " + emailSymbolCount + " @ symbols, please use a valid format!");
		document.emailform.email.focus();
		return false;
	}	

	//Check for more .com's
	for (i=startSector; i<email.length; i++)
	{
		if (email.substring(i,i+1) == ".")
		{
			dotSymbolCount += 1;
		}
	}

	if (dotSymbolCount < 1)
	{
		document.emailform.errors.value = (parseInt(document.emailform.errors.value) + 1);
		alert("Your email address does not contain a '.' symbol after the '@' symbol, please use a valid format!");
		document.emailform.email.focus();
		return false;
	}

	//make sure they left a nice email
	if(subject == "")
	{
		document.emailform.errors.value = (parseInt(document.emailform.errors.value) + 1);
		alert("You didn't enter a subject. Don't make me smack you, bitch!");
		document.emailform.subject.focus();
		return false;
	}

	//make sure they left a nice email
	if(message == "")
	{
		document.emailform.errors.value = (parseInt(document.emailform.errors.value) + 1);
		alert("The point is to submit an email... If this is the kind of crap I get from you before you even submit anything, let me offer some advice; don't bother submitting a email, because I'm sure by now that it sucks.");
		document.emailform.message.focus();
		return false;
	}

	if(mobileBool != true)
	{
		if(message.length >= 1000)
		{
			document.emailform.errors.value = (parseInt(document.emailform.errors.value) + 1);
			alert("Whoa, I asked for an email, not your life story! Easy on the text there buddy!");
			document.emailform.message.focus();
			return false;
		}
	}
	else
	{
		if(message.length >= 100)
		{
			document.emailform.errors.value = (parseInt(document.emailform.errors.value) + 1);
			alert("marking this message as a mobile one restricts the maximum character limit to 100! This kind of thing is meant for short conscise messages like 'Please call me, my car broke down' or 'Which combo did you want, 1 or 2?'");
			document.emailform.message.focus();
			return false;
		}
	}
}
-->*/

