if(document.images) {
	art=new Array()
	art[0]=new Image()
	art[0].src="screenshots/santa1.jpg"
	art[1]=new Image()
	art[1].src="screenshots/santa2.jpg"
	art[2]=new Image()
	art[2].src="screenshots/buttergame1.jpg"
	art[3]=new Image()
	art[3].src="screenshots/buttergame2.jpg"
	art[4]=new Image()
	art[4].src="screenshots/bubblesquids1.jpg"
	art[5]=new Image()
	art[5].src="screenshots/bubblesquids2.jpg"
	art[6]=new Image()
	art[6].src="screenshots/shadowofspace1.jpg"
	art[7]=new Image()
	art[7].src="screenshots/shadowofspace2.jpg"
	art[8]=new Image()
	art[8].src="screenshots/treasureadventure1.jpg"
	art[9]=new Image()
	art[9].src="screenshots/treasureadventure2.jpg"
	art[10]=new Image()
	art[10].src="screenshots/noughtsandcrosses1.jpg"
	art[11]=new Image()
	art[11].src="screenshots/noughtsandcrosses2.jpg"
	art[12]=new Image()
	art[12].src="screenshots/volloplanet1.jpg"
	art[13]=new Image()
	art[13].src="screenshots/volloplanet2.jpg"
	art[14]=new Image()
	art[14].src="screenshots/fruitmaze1.jpg"
	art[15]=new Image()
	art[15].src="screenshots/fruitmaze2.jpg"
	art[16]=new Image()
	art[16].src="screenshots/cephei1.jpg"
	art[17]=new Image()
	art[17].src="screenshots/cephei4.jpg"
	art[18]=new Image()
	art[18].src="screenshots/cyberamazon1.jpg"
	art[19]=new Image()
	art[19].src="screenshots/cyberamazon2.jpg"
	art[20]=new Image()
	art[20].src="screenshots/fruitmaze1.jpg"
	art[21]=new Image()
	art[21].src="screenshots/fruitmaze2.jpg"
}

//games[game][size]
var games=new Array()
for (i=0; i<5; i++) {
	games[i]=new Array()
}
	
games[0][1] = "<table><tr><td class='running_game_cell_data'><applet class='applet' code='BubbleSquids.class'"+	
		"archive = 'http://jalex.se/BubbleSquids/resources.jar'"+
		"width = 750 height = 550>"+
		"<param name='codebase_lookup' value='false'>"+
		"</applet></td></tr></table>"
games[1][1] = "<table><tr><td class='running_game_cell_data'><applet class='applet' code='Game.class'"+	
		"archive = 'http://jalex.se/Cephei/images/images.jar, http://jalex.se/Cephei/sounds/sounds.jar, http://jalex.se/Cephei/classes.jar'"+
		"width = 800 height = 600>"+
		"<param name='codebase_lookup' value='false'>"+
		"</applet></td></tr></table>"
games[2][1] = "<table><tr><td class='running_game_cell_data'>"+
		"<applet class='applet' code='ButterGame.class' archive = 'http://jalex.se/ButterGame/resources.jar' width = 730 height = 480>"+
		"<param name='codebase_lookup' value='false'></applet>"+
		"</td></tr></table>";
games[3][1] = "<table><tr><td class='running_game_cell_data'><applet class='applet' code='Game.class'"+	
		"archive = 'http://jalex.se/CyberAmazon/resources1x.jar'"+
		"width = 40 height = 30>"+
		"<param name='codebase_lookup' value='false'>"+
		"</applet></td></tr></table>"
games[3][4] = "<table><tr><td class='running_game_cell_data'><applet class='applet' code='Game.class'"+	
		"archive = 'http://jalex.se/CyberAmazon/resources4x.jar'"+
		"width = 160 height = 120>"+
		"<param name='codebase_lookup' value='false'>"+
		"</applet></td></tr></table>"
games[3][8] = "<table><tr><td class='running_game_cell_data'><applet class='applet' code='Game.class'"+	
		"archive = 'http://jalex.se/CyberAmazon/resources8x.jar'"+
		"width = 320 height = 240>"+
		"<param name='codebase_lookup' value='false'>"+
		"</applet></td></tr></table>"
games[3][16] = "<table><tr><td class='running_game_cell_data'><applet class='applet' code='Game.class'"+	
		"archive = 'http://jalex.se/CyberAmazon/resources16x.jar'"+
		"width = 640 height = 480>"+
		"<param name='codebase_lookup' value='false'>"+
		"</applet></td></tr></table>"	
games[4][2] = "<table><tr><td class='running_game_cell_data'><applet class='applet' code='Game.class'"+	
		"archive = 'http://jalex.se/FruitMaze/resources2x.jar'"+
		"width = 448 height = 448>"+
		"<param name='codebase_lookup' value='false'>"+
		"</applet></td></tr></table>"
games[4][3] = "<table><tr><td class='running_game_cell_data'><applet class='applet' code='Game.class'"+	
		"archive = 'http://jalex.se/FruitMaze/resources3x.jar'"+
		"width = 672 height = 672>"+
		"<param name='codebase_lookup' value='false'>"+
		"</applet></td></tr></table>"		
		

function artShow(imagePos,imageNbr) {
	var title = new Array();
	title[2] = "<h3>THE BUTTER GAME</h3>2007"+
				"<p>How fast are you at putting butter on a sandwish? Show your skills in this cool game!</p>"+
				"<p><a href='javascript:void(0)' onclick='javascript:window.open(\"http://jalex.se/highscoresbuttergame.php\",\"newwindow\",\"width=370,height=337,directories=no,location=no,menubar=no,scrollbars=no,status=no,toolbar=no,resizable=no\")'><b>View highscores</b></a><br/>"+
				"<a href='#' onclick='runGame(2);'><b>Play game</b></a></p>";
	title[4] = "<h3>BUBBLE SQUIDS</h3>2008"+
				"<p>You need to feed the hungry bubble squids with the amount of bubbles it wants before the time runs out. The more bubbles a squid \"eats\" the higher points you get.<br/><br/> The first levels are easy, but it soon gets much harder where both planning and speed are required. Can you make it to the final level 11?</p>"+
				"<p><a href = 'javascript: void(0)' onclick='javascript:window.open(\"http://jalex.se/highscoresbubblesquids.php\",\"newwindow\",\"width=370,height=337,directories=no,location=no,menubar=no,scrollbars=no,status=no,toolbar=no,resizable=no\");'><b>View highscores</b></a><br/>"+
				"<a href='#' onclick='runGame(0);'><b>Play game</b></a></p>";
	title[16] = "<h3>CEPHEI - HOSTILE PLANET</h3>2008-2010"+
				"<p>Gamma Cephei is a binary star system, approximately 45 light-years away from our own solar system. Recently a new planet has been discovered that might contain life. You have been sent away to Gamma Cephei in order to find out more about this planet. But it turns out that the planet is populated by evil robots...</p>"+
				"<p>Start game - Left mouse button or Enter <br/>"+
				"Move - Arrow keys <br/>"+
				"Fire - X <br/>"+
				"Super bomb - Space <br/>"+
				"Pause - P <br/>"+
				"Sound on/off - M <br/>"+
				"Quit - Ctrl + Q, or Esc </p>"+
				"<p><a href = 'javascript: void(0)' onclick='javascript:window.open(\"http://jalex.se/highscorescephei.php\",\"newwindow\",\"width=370,height=337,directories=no,location=no,menubar=no,scrollbars=no,status=no,toolbar=no,resizable=no\");'><b>View highscores</b></a><br/>"+
				"<a href='#' onclick='runGame(1);'><b>Play game</b></a></p>";
	title[18] = "<h3>CYBER AMAZON</h3>2010"+
				"<p>The year is 2417. Aggressive robots are taking over the world. Only one friendly robot, the Cyber Amazon, can rescue the world. The game consists of 9 levels and 4 bosses.</p>"+
				"<p>Start game - Left mouse button or enter <br/>"+
				"Move left and right - Arrow keys<br/>"+
				"Jump - C<br/>"+
				"Fire - X <br/>"+
				"Pause - P <br/>"+
				"Sound on/off - M <br/>"+
				"Quit - Q or Esc </p>"+
				"<p><a href='#' onclick='runGame(3,1);'><b>Play game</b></a><br/>"+
				"<a href='#' onclick='runGame(3,4);'><b>Play game (resized 4 times)</b></a><br/>"+
				"<a href='#' onclick='runGame(3,8);'><b>Play game (resized 8 times)</b></a><br/>"+
				"<a href='#' onclick='runGame(3,16);'><b>Play game (resized 16 times)</b></a></p>";
	title[20] = "<h3>Fruit Maze</h3>2011"+
				"<p>Putte is a prisoner of the terrible fruit troll Glufs, and he is forced to feed him the fruits he wants.</p>"+
				"<p>It is a puzzle game and the idea is a bit like the classic game Sokoban. You give Glufs the fruits he wants by moving them to him. What kind of fruits he wants is shown in the top bar. The first levels are very easy but they soon become more difficult. There are 13 levels in total, and you can choose which levels you want to play at the start menu, or just hit enter to play them in order.</p>"+
				"<p>Start game - Left mouse button or enter <br/>"+
				"Move left, right, up and down - Arrow keys<br/>"+
				"Restart current level </p>"+
				"<p><a href='#' onclick='runGame(4,2);'><b>Play game</b></a><br/>"+
				"<a href='#' onclick='runGame(4,3);'><b>Play game (resized 2 times)</b></a><br/>";
				

	if(document.images){
		if(imagePos != -1){
			document.images[document.images.length-1].src=art[imageNbr].src;
			document.images[document.images.length-2].src=art[imageNbr+1].src;
			document.getElementById("gameinfo").innerHTML = title[imageNbr];
		}
		else{
			empty=new Image();
			empty.src="layout/loading.png";
			document.images[document.images.length-1].src=empty.src;
			document.images[document.images.length-2].src=empty.src;
		}
	}
}

function runGame(game,size) {
	if(size == undefined) {
		size = 1;
	}
	document.getElementById("game_view").style.display = "none";
	document.getElementById("running_game_view").style.display = "block";
	document.getElementById("running_game_view").innerHTML = games[game][size];
}
