
	var IE = document.all?true:false;
	if (!IE) 
		document.captureEvents(Event.MOUSEMOVE)
	document.onmousemove = getMouseXY;
	var tempX = 0;
	var tempY = 0;
	var featArt;
	var maxPhotos = 41;

	function loadMe(){
		setPage(1);
		reposWin();
		picFeat();
	}

	function reposWin(){
		document.getElementById('myWin').style.left = ((document.documentElement.scrollWidth/2) - (document.getElementById('myWin').scrollWidth/2))+"px";
		if (((document.documentElement.scrollWidth/2) - (document.getElementById('myWin').scrollWidth/2)) < 0)
			document.getElementById('myWin').style.left = "0px";
	}

	function getMouseXY(e) {
		if (IE) { // grab the x-y pos.s if browser is IE
			tempX = event.clientX + document.body.scrollLeft;
			tempY = event.clientY + document.body.scrollTop;
		}
		else {  // grab the x-y pos.s if browser is NS
			tempX = e.pageX;
			tempY = e.pageY;
		}  
		if (tempX < 0){tempX = 0;}
		if (tempY < 0){tempY = 0;}  
		return true;
	}

	function setPage(pageNum){
		var mainDisp = "";
		switch(pageNum){
			case 'AoD':
				mainDisp = "<p>Random Featured Photo</p>";
				mainDisp += "<p align=center><img src='Photography/Photo_10" + featArt + ".jpg' width=450 class='feature' id='myFeat' alt='Featured Work'></p>";
				mainDisp += "<div style='float:right'><span class='pageButton' onclick='setPhoto()'>Another Random Photo</span><span class='pageButton' onclick='setPage(1)'>Back</span></div>";
				break;
			case 1:		// MAIN PAGE THAT LOADS WITH THE SITE ------------------------
				mainDisp = "<p>Welcome to Rhizdii Entertainment. Here you will find an assortment of creative fields to which I have devoted myself. Currently I do not specialize in any single area and enjoy dabbling in a multitude of creative fields including: Game design, writing stories, doing photography, and web design.</p>";
				mainDisp += "<img src='chris.jpg' width=130 height=150 style='float:left; margin-right: 10px; border: 2px solid black;'><p>Christopher Davis - The man behind Rhizdii Entertainment is a history major with an entrepeneurial spirit. Unfortunately he enjoys devoting himself to too many projects simultaneously and takes a while to finish anything. As a result the website you see before you is the culmination of everything he has worked on. While there is a lot here, you may notice that not many of the projects in any of the sections are actually complete.</p>";
				mainDisp += "<div style='float:right'><span class='pageButton' onclick='setPage(2)'>Next</span></div>";
				mainDisp += "<div><span class='pageButton' onclick='setPage(3)'>View my Curriculum Vitae</span></div>";
				break;
			case 2:		// INFO ABOUT RHIZDII FROM THE MAIN PAGE'S NEXT BUTTON -------
				mainDisp = "<p>Rhizdii Entertainment was officially started on September 12, 1999 by Christopher Davis. Its original goal was to design and code computer games but slowly changed as its focus turned to table games. While we still work to create fantastic and entertaining games, we are also exploring other fields as you can see on the right.</p>";
				mainDisp += "<p>Contact: <a href='mailto:rhizdii@hotmail.com'>rhizdii@hotmail.com</a></p><br><br>";
				mainDisp += "<div class='fine'>Rhizdii Entertainment: Copyright &copy; 1999-2010</div></p>";
				mainDisp += "<div style='float:right'><span class='pageButton' onclick='setPage(1)'>Back</span></div>";
				break;
			case "Focs":	// FIVE O'CLOCK SHADOW BLURB ----------------------------------
				mainDisp = "<p>Five O'clock Shadow: <a href='http://www.focscomic.com/' target='newWin'>(Http://www.focscomic.com/)</a><br> A quirky comic about the random musings that come into my mind. FOCS features friends, random thoughts, and weird ideas. It uses a mixture of recurring characters and plotlines, humorous one panel splash pages, and one shot newspaper style comics as well.<br>";
				mainDisp += "<a href='http://www.focscomic.com/'><img src='http://i159.photobucket.com/albums/t160/rhizdii/strip_8.jpg' width=500 title='This is Fat Ninja' border=0 style='position:relative; left:0px'></a></p>";
				mainDisp += "<p>Fat Ninja is one of the more popular one shot comics posted as of yet. Hopefully he will become a regular recurring character.</p>";
				mainDisp += "<div style='float:right'><span class='pageButton' onclick='setPage(1)'>Back</span></div>";
				break;
			case "rhizdii":	// WEB DESIGN BLURB ----------------------------------
				mainDisp = "<p>I started designing web pages when I was a young teenager, sitting at home bored, looking at other people's web pages. As this has always been a hobby for me, I have no professional training. I only took one class in web design ever and was dissapointed to learn I already knew everything the class had to offer. I have some friends who work for companies doing some form of web management and use them as references to figure out what to teach myself every so often in order to keep up with my understanding of the new tools for web design.</p>";
				mainDisp += "<p>I have a strong working knowledge of HTML, PHP, and Javascript. I have an understanding of XML and have utilized it in some of the pages that I've designed (as listed at the right). I'd like to learn Flash programming so I could create more interactive web pages eventually.</p>";
				mainDisp += "<p>I understand that for professional web pages there can be a lot more to a website than simply what the end user sees, and I do enjoy programming those 'hidden aspects', but I much prefer the front end design of websites. This particular website utilizes some fun programming aspects just to test myself in what I can think up and create using HTML, PHP, Javascript, and XML.</p>";
				mainDisp += "<div style='float:right'><span class='pageButton' onclick='setPage(1)'>Back</span></div>";
				break;
			case "Senet":	// SENET GAME--------------------------------------
				myUrl = "location.href='senet/senet.htm'";
				mainDisp = "<p>Senet is an ancient Egyptian game that was first created over 5000 years ago. The game evolved over the years, but the basic concepts remained the same. Players take turn rolling five sticks, each marked on one side. Each mark showing counts as a '1', but if no marks are showing the total is '5'. Players travel along the path of the board in a backwards 'S' pattern, symbolizing the journey of the soul into the underworld. The first player to move all their pieces off the board has successfully made the trip into the underworld and wins.</p>";
				mainDisp += "<p>The actual game rules were eventually lost, but have been reconstructed through interpretations of hieroglyphs and other drawings. The rules are still incomplete and disputed among scholars, though general guidelines do exist. As a result, I have created a game which implements rules from multiple sources, creating a dynamic game which seems to allow for the most complete and fun experience.</p>";
				mainDisp += "<p>I love recreating ancient games and carved a portion of a log into a functioning Senet game board. After completing the physical Senet game I decided to program a Javascript version for people to play online. Click below to play. There is no AI for the game, so two people are required to play.</p>";
				mainDisp += "<div style='float:right'><span class='pageButton' onclick='setPage(1)'>Back</span></div>";
				mainDisp += "<div><span class='pageButton' onclick="+myUrl+">Play Senet!</span></div>";
				break;
			case "Fallen Realm":	// Fallen Realm-----------------------------
				myUrl = "location.href='fallenrealm/fallen.htm'";
				mainDisp = "<p>Fallen Realm is a board game version of Rune Wars that was originally developed in 2005. Players navigate a hexagonal grid map with an army at their disposal. The goal is to either defeat the opposing player's general or conquer the map.</p>";
				mainDisp += "<p>In the javascript version of the game, players take turns training soldiers, attacking Outposts, and fighting each other. Players can win the game by either gaining control of all of the Outposts on the map, or defeating their opponent&apos;s Commander. Players must learn resource management skills and move strategically across the map in order to defeat their opponents.</p>";
				mainDisp += "<p>A playable version of Fallen Realm is available! The game is still incomplete, but all of the major functionality is there. The game has not been fully tested yet, so bugs do exist. Additionally not all units or controls have been finished.<br>Known Issues: This game is not currently supported by Internet Explorer and is only known to work in Firefox.</p>";
				mainDisp += "<p>Updates: A new recursive function has been added to give the game true path finding for units. Archers have been added into the game, functionality is there, but has not been fully tested. Still working on enabling units to simultaneously move off of one tile, allowing another to move into that space in the same turn.</p>";
				mainDisp += "<div style='float:right'><span class='pageButton' onclick='setPage(1)'>Back</span></div>";
				mainDisp += "<div><span class='pageButton' onclick="+myUrl+">Play Fallen Realm v0.8!</span></div>";
				break;
			case 3: // LOAD MY CV
				setPage(1);
				location.href = "Curriculum Vitae - Christopher Davis 2010.pdf";
				break;
		}
		document.getElementById("mainWin").innerHTML = mainDisp;
	}

	function noFloat(item){
		document.getElementById("floater").style.visibility = "hidden";
		item.style.color = "#6fc";
	}
	function goFloat(item, value){

		if (value == 1)
			item.style.color = "#d6f";
		var myText = "";
		document.getElementById("floater").style.visibility = "visible";
		document.getElementById("floater").style.left = tempX+10;
		document.getElementById("floater").style.top = tempY+10;

		switch(item.id){
			case "op1": myText = "An extensive battle themed board game in which players train an army to take control of the board and defeat their enemies.";
				break;
			case "op2": myText = "Online Game: An adventure where players manage a town of their own. Raise an army to attack other players or defeat dark forces that threaten the community. Ally yourself with your neighbors and turn your town into a kingdom.";
				break;
			case "op3": myText = "Table Game: Cast spells, raise an army, and defeat your foes in this fun tabletop game. A throw of the runes can never be predicted, but it can always be controlled.";
				break;
			case "op4": myText = "Comic: This light-hearted comedic strip follows the adventures of four misguided misfit roommates who believe they exist in a fantasy realm where their makebelieve powers will enable them to save the world... the strange thing is, they may actually succeed.";
				break;
			case "op5": myText = "Story: A betrayed assassin finds herself in a desperate struggle to save her life as she uncovers a plot that could destroy not just her guild, but the entire kingdom itself.";
				break;
			case "op6": myText = "Professional Photos: While not actually available for professional photography. I did do the wedding photos for a friend.";
				break;
			case "op7": myText = "Portraits & Still Lifes: A select portion of the photography I have done for the pure enjoyment and beauty of doing it.";
				break;
			case "op8": myText = "Drawings: Some of my favorite pieces of artwork that I have drawn and painted over the years.";
				break;
			case "op9": myText = "CG Scenes: Though limited mostly to abstracts and generic space scenes I have dabbled in some CG art.";
				break;
			case "op10": myText = "Table Game: Build a fleet of ships to protect your claim and destroy the competition in this turnbased space mining game."
				break;
			case "op11": myText = "Table Game: There is only one pocket-sized piece to this highly portable game. Designed to be quick fun for a multitude of players in any situation (available for free online).";
				break;
			case "op12": myText = "Comic: A quirky comic about friends, fun, and the most random thoughts that pop into my mind. FOCS is updated Mondays and Fridays. ";
				break;
			case "op13": myText = "Click to learn about my web design history / experience. ";
				break;
			case "op14": myText = "Five O'clock Shadow is a web comic which I designed the website for. It uses XML to access information on the various comics and php and javascript to generate the various pages. ";
				break;
			case "op15": myText = "League of Mad Scientists is another web comic which I designed the website for. It's an older design which is currently being updated and currently only uses javascript and php. A future version will implement XML. ";
				break;
			case "op16": myText = "Shrouded Grove is a website designed for Bethany Leino. It showcases her various art projects she works on. The page uses php so that miss Leino can update the content of her site easily without the need for diving into the code of the site. The various galleries implement some interesting XML and javascript as well. ";
				break;
			case "op17": myText = "Senet is an ancient Egyptian game that was first created over 5000 years ago.";
				break;
			case "feature": myText = "Random Featured Artwork";
				break;
		}
		document.getElementById("floater").innerHTML = myText;
	}

	function picFeat(){
		featArt = (Math.floor(Math.random()*maxPhotos)+1);
		if (featArt<10)
			featArt = '0'+featArt;
		document.getElementById('feature').src = 'Photography/thumbs/thumb_10'+featArt+'.jpg';
	}

	function setPhoto(){
		document.getElementById('myFeat').src = 'pics/loading.jpg';
		featArt = (Math.floor(Math.random()*maxPhotos)+1);
		if (featArt<10)
			featArt = '0'+featArt;
		document.getElementById('myFeat').src = 'Photography/Photo_10'+featArt+'.jpg';
	}

	function fadeThis(item){
		if (item.style.opacity != .85){
			item.style.opacity = "0.85";
			item.style.filter = "alpha(opacity=85)";
		}
		else{
			item.style.opacity = "0.65";
			item.style.filter = "alpha(opacity=65)";
		}
	}
