var links = [];
var linkImages = [];
var linkOverImages = [];
var faces = [];
var bubbles = [];

function loaded() {
	links.push(document.getElementById("link0"));  // 0 AOGD
	links.push(document.getElementById("link1"));  // 1 SG
	links.push(document.getElementById("link2"));  // 2 ETC
	links.push(document.getElementById("link3"));  // 3 WP
	links.push(document.getElementById("link4"));  // 4 Blogger - Things That I've Finished
	links.push(document.getElementById("link5"));  // 5 Twitter - Jesse Schell
	links.push(document.getElementById("link6"));  // 6 G4 - DICE talk
	links.push(document.getElementById("link7"));  // 7 Wikipedia
	links.push(document.getElementById("link8"));  // 8 Email
	links.push(document.getElementById("link9"));  // 9 Blogger - Gamepocalypse
	links.push(document.getElementById("link10")); // 10 Twitter - Jesse's Dreams
	links.push(document.getElementById("link11")); // 11 Slideshare
	links.push(document.getElementById("link12")); // 12 Facebook
	links.push(document.getElementById("link13")); // 13 Twitter - Zapp News
	links.push(document.getElementById("link14")); // 14 Formspring
	links.push(document.getElementById("link15")); // 15 TED Talk: The future is beautiful
	links.push(document.getElementById("link16")); // 16 Visions of the Gamepocalypse
	links.push(document.getElementById("link17")); // 17 AR Will Define the 21st century
	links.push(document.getElementById("link18")); // 18 The Future of Virtual Characters


	document.body.className = "bodyloaded";
	document.getElementById("loadingDiv").style.display = "none";
	document.getElementById("mainDiv").style.display = "block";
}

function inititalize() {

	if (navigator.appName.toLowerCase().search("explorer") >= 0) {
		document.getElementsByTagName("link")[0].href = "styleIE.css";
	}

	linkImages.push("img/link0.png");  // 0 AOGD
	linkImages.push("img/link1.png");  // 1 SG
	linkImages.push("img/link2.png");  // 2 ETC
	linkImages.push("img/link3.png");  // 3 WP
	linkImages.push("img/link4.png");  // 4 Blogger - Things That I've Finished
	linkImages.push("img/link5.png");  // 5 Twitter - Jesse Schell
	linkImages.push("img/link6.png");  // 6 G4 - DICE talk
	linkImages.push("img/link7.png");  // 7 Wikipedia
	linkImages.push("img/link8.png");  // 8 Email
	linkImages.push("img/link9.png");  // 9 Blogger - Gamepocalypse
	linkImages.push("img/link10.png"); // 10 Twitter - Jesse's Dreams
	linkImages.push("img/link11.png"); // 11 Slideshare
	linkImages.push("img/link12.png"); // 12 Facebook
	linkImages.push("img/link13.png"); // 13 Twitter - Zapp News
	linkImages.push("img/link14.png"); // 14 Formspring
	linkImages.push("img/link15.png"); // 15 TED Talk: The future is beautiful
	linkImages.push("img/link16.png"); // 16 Visions of the Gamepocalypse
	linkImages.push("img/link17.png"); // 17 AR Will Define the 21st century
	linkImages.push("img/link18.png"); // 18 The Future of Virtual Characters

	linkOverImages.push("img/linkover0.png");  // 0 AOGD
	linkOverImages.push("img/linkover1.png");  // 1 SG
	linkOverImages.push("img/linkover2.png");  // 2 ETC
	linkOverImages.push("img/linkover3.png");  // 3 WP
	linkOverImages.push("img/linkover4.png");  // 4 Blogger - Things That I've Finished
	linkOverImages.push("img/linkover5.png");  // 5 Twitter - Jesse Schell
	linkOverImages.push("img/linkover6.png");  // 6 G4 - DICE talk
	linkOverImages.push("img/linkover7.png");  // 7 Wikipedia
	linkOverImages.push("img/linkover8.png");  // 8 Email
	linkOverImages.push("img/linkover9.png");  // 9 Blogger - Gamepocalypse
	linkOverImages.push("img/linkover10.png"); // 10 Twitter - Jesse's Dreams
	linkOverImages.push("img/linkover11.png"); // 11 Slideshare
	linkOverImages.push("img/linkover12.png"); // 12 Facebook
	linkOverImages.push("img/linkover13.png"); // 13 Twitter - Zapp News
	linkOverImages.push("img/linkover14.png"); // 14 Formspring
	linkOverImages.push("img/linkover15.png"); // 15 TED Talk - The future is beautiful
	linkOverImages.push("img/linkover16.png"); // 16 Visions of the Gamepocalypse
	linkOverImages.push("img/linkover17.png"); // 17 AR Will Define the 21st century
	linkOverImages.push("img/linkover18.png"); // 18 The Future of Virtual Characters

	faces.push("img/jesse.png");  // Default
	faces.push("img/jesse0.png"); // 0 AOGD
	faces.push("img/jesse1.png"); // 1 SG
	faces.push("img/jesse2.png"); // 2 ETC
	faces.push("img/jesse3.png"); // 3 WP
	faces.push("img/jesse4.png"); // 4 Blogger - Things That I've Finished
	faces.push("img/jesse5.png"); // 5 Twitter - Jesse Schell
	faces.push("img/jesse6.png"); // 6 G4 - DICE talk
	faces.push("img/jesse7.png"); // 7 Wikipedia
	faces.push("img/jesse8.png"); // 8 Email
	faces.push("img/jesse4.png"); // 9 Blogger - Gamepocalypse
	faces.push("img/jesse5.png"); // 10 Twitter - Jesse's Dreams
	faces.push("img/jesse7.png"); // 11 Slideshare
	faces.push("img/jesse8.png"); // 12 Facebook
	faces.push("img/jesse5.png"); // 13 Twitter - Zapp News
	faces.push("img/jesse7.png"); // 14 Formspring
	faces.push("img/jesse6.png"); // 15 TED Talk - The future is beautiful
	faces.push("img/jesse6.png"); // 16 Visions of the Gamepocalypse
	faces.push("img/jesse6.png"); // 17 AR Will Define the 21st century
	faces.push("img/jesse6.png"); // 18 The Future of Virtual Characters

	bubbles.push("img/bubbles.png");   // Default
	bubbles.push("img/bubbles0.png");  // 0 AOGD
	bubbles.push("img/bubbles1.png");  // 1 SG
	bubbles.push("img/bubbles2.png");  // 2 ETC
	bubbles.push("img/bubbles3.png");  // 3 WP
	bubbles.push("img/bubbles4.png");  // 4 Blogger - Things That I've Finished
	bubbles.push("img/bubbles5.png");  // 5 Twitter - Jesse Schell
	bubbles.push("img/bubbles6.png");  // 6 G4 - DICE talk
	bubbles.push("img/bubbles7.png");  // 7 Wikipedia
	bubbles.push("img/bubbles8.png");  // 8 Email
	bubbles.push("img/bubbles9.png");  // 9 Blogger - Gamepocalypse
	bubbles.push("img/bubbles10.png"); // 10 Twitter - Jesse's Dreams
	bubbles.push("img/bubbles11.png"); // 11 Slideshare
	bubbles.push("img/bubbles12.png"); // 12 Facebook
	bubbles.push("img/bubbles13.png"); // 13 Twitter - Zapp News
	bubbles.push("img/bubbles14.png"); // 14 Formspring
	bubbles.push("img/bubbles15.png"); // 15 TED Talk - The future is beautiful
	bubbles.push("img/bubbles16.png"); // 16 Visions of the Gamepocalypse
	bubbles.push("img/bubbles17.png"); // 17 AR Will Define the 21st century
	bubbles.push("img/bubbles18.png"); // 18 The Future of Virtual Characters

}

function linkOver(i) {
	links[i].src = linkOverImages[i];
	document.getElementById("jesse").src = faces[i+1];
	document.getElementById("bubbles").src = bubbles[i+1];
}

function linkOut(i) {
	links[i].src = linkImages[i];
	document.getElementById("jesse").src = faces[0];
	document.getElementById("bubbles").src = bubbles[0];
}

function loadImages() {
	for (var i = 0; i < linkImages.length; i++) {
		document.write('<img class="loading" src="' + linkImages[i] + '">');
	}
	for (var i = 0; i < linkOverImages.length; i++) {
		document.write('<img class="loading" src="' + linkOverImages[i] + '">');
	}
	for (var i = 0; i < faces.length; i++) {
		document.write('<img class="loading" src="' + faces[i] + '">');
	}
	for (var i = 0; i < bubbles.length; i++) {
		document.write('<img class="loading" src="' + bubbles[i] + '">');
	}
}

inititalize();

