// Making the homepage my marionette with Mouvement...

	// Mouvement-Enabled Hints
	var kashiImage = new Hint();
	var intDev = new Hint();
	var compliance = new Hint();
	var student = new Hint();
	var marketing = new Hint();

	// Mouvement launch sequence
	Page.onReady = function() {
		// Set up input watching for the comment field. (Mobile browsers only - this variable is fed through PHP).
		var hifi = false;
		var OSString = navigator.appVersion;
		if (OSString.indexOf("Win") != -1 || OSString.indexOf("Mac") != -1 || OSString.indexOf("X11") != -1 || OSString.indexOf("Linux") != -1) {
			hifi = true;
		}

		if (hifi) { /* High-fidelity mode activates only on a desktop browser as these effects are more resource intensive */
			kLogo = Page.preShine('kashmaniacLogo', true);
			
			var menuBtns = Array("mainHomeBtn", "mainBlogBtn", "mainPortfolioBtn", "mainKashiBtn", "mainContactBtn");
			var thisPage = 0;
			var i = menuBtns.length;
			while (i--) {
				var currentBtn = Page.grabItem(menuBtns[i]);
				currentBtn.display.alpha = 0;
				if (i !== thisPage) {
					Page.hoverFade(currentBtn, 100, 0, 0.25, 0.5);
					var menuImage = Page.grabItem(currentBtn.domElement.firstChild);
					menuImage.placeHolder = true;
					menuImage.move("nowhere", 76, 0.5);

					var slide = function(e) {
						var menuItem = (e.currentTarget !== undefined) ? e.currentTarget : e.srcElement;
						if (menuItem.tagName === 'IMG') {
							var mouveItem = Page.grabItem(menuItem);
						} else if (menuItem.tagName === 'DIV') {
							var mouveItem = Page.grabItem(menuItem.nextSibling);
						} else {
							var mouveItem = Page.grabItem(menuItem.lastChild);
						}
						
						if (e.type === "mouseover") {
							mouveItem.move("nowhere", 0, 0.5);
						} else {
							mouveItem.move("nowhere", 76, 0.5);
						}
					}
				
					if (currentBtn.domElement.addEventListener != undefined) {
						currentBtn.domElement.addEventListener('mouseover', slide, false);
						currentBtn.domElement.addEventListener('mouseout', slide, false);
					} else {
						currentBtn.domElement.attachEvent('onmouseover', slide);
						currentBtn.domElement.attachEvent('onmouseout', slide);
					}
				} else {
					currentBtn.display.alpha = 0;
					currentBtn.alpha(100, 0.5);
				}
			}

			kashiImage.display.width = 280;
			kashiImage.id = 0;
			kashiImage.bodyString = "<h3>Kashi Samaraweera</h3><p>Here's a picture of me, sitting on a train, listening to music. It was taken circa July 2008 on an Italian train connecting Rome to Venice.</p>";
		
			intDev.display.width = 240;
			intDev.id = 1;
			intDev.bodyString = "<h3>Interactive Developer</h3><p>Which is to say that I am a designer specialising in interactive media, such as the World Wide Web. I create websites on the premise that they\'re made to be interacted with.</p>";
		
			compliance.display.width = 250;
			compliance.id = 2;
			compliance.bodyString = "<h3>W3C Compliance</h3><p>Whilst I don't herald W3C Compliance as the high-water mark of a web designer's accomplishment, it is nice to know when a developer truly understands the code that he or she writes.</p><p>That being said, the CSS2.1 Validity Icon below is mostly novelty, it seems XHTML 1.1 was designed well enough to do practically anything and still comply where as CSS2.1 precludes a lot of what we take for granted in todays World Wide Web.</p>";

			student.display.width = 200;
			student.id = 3;
			student.bodyString = "<h3>B. Information Technology</h3><p>Completing a Bachelor of Information Technology (including a large amout of media studies) part-time at Macquaire University.</p><p>Expected completion: 2011.</p>";
			
			marketing.display.width = 300;
			marketing.id = 4;
			marketing.bodyString = "<h3>Marketing Assistant</h3><p>Under the employ of FulfilNET Australia, a leading SME internet advertising provider.</p>";
		}
		
		if (Page.isIE) {}

		setTimeout(function() {Page.play();}, Page.heartbeat);
	}