
	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.</p>";
				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></a>";
				mainDisp += "<div style='float:right'>Fat Ninja is one of the more popular one shot comics posted as of yet. Hopefully he will become a regular recurring character.</div>";
				mainDisp += "<p style=''>Five O'clock Shadow is Christopher Davis' latest pet project, but one that he is desperately forcing himself to stick with. Even if FOCS does not succeed in the eyes of the internet, Chris will use this project to help him hone his artistic abilities and help him stick with future projects better.</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 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 = "Online Game: A fun and bizarre world where players can train pets to battle with, play games for prizes, build a home full of neat stuff, and rise in power among your fellow players.";
				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 "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';
	}
