/**  launchgames.js         written by Scott Honey

	A library of functions that launch games for the Singing Syllbary project.  This file is meant as an integral part of the project, and is probably useless without the rest of the program surrounding it.  This file should be modified if there are new games added or the size of the game windows need to be changed.

VARIABLES:
	ARRAY gamewindow
		An array of possible windows -- needed at one time to sprout windows, now it might be useful for some sort of close all function.

FUNCTIONS:

	playGame(INTEGER)
		Plays the game number that was passed to it.  Launches the game.

	playGameSounds()
		Plays every sound in the Gameslist, sends a pop-up box to notify user if selected without any sounds in the gameslist.

*/



var gamewindow=new Array();

/* playGame(INTEGER)
	Plays the game number that was passed to it.  Launches the games.*/
function playGame(gameNumber){
  if (Gamesarray.length ==0) {alert("Error: You need to add sounds into your Gameslist before playing games...");}
  else { //gamewindow[gamewindow.length+1]="";
    if (gameNumber==1) {
    gamewindow[gamewindow.length+1]= window.open("game1.html","_blank","status=1,resizable=1,scrollbars=1,height=300,width=333, resizable=no");
    }
    if (gameNumber==2) {
    gamewindow[gamewindow.length+1]= window.open("game2.html","_blank","status=1,resizable=1,scrollbars=1,height=300,width=333, resizable=no");
    }
    if (gameNumber==3) {
    gamewindow[gamewindow.length+1]= window.open("game3.html","_blank","status=1,resizable=1,scrollbars=1,height=300,width=333, resizable=no");
    }
    if (gameNumber==4) {
      gamewindow[gamewindow.length+1]= window.open("game4.html","_blank","status=1,resizable=1,scrollbars=1,height=175,width=333, resizable=no");}
  }
 GAMESSELECT.location.href = "gamesselect.html";
}


/* playGameSounds()
	Plays every sound in the Gameslist, sends a pop-up box to notify user if selected without any sounds in the gameslist.*/
function playGameSounds(){
  if (Gamesarray.length ==0) {alert("Error: You need to add sounds into your Gameslist before listening...");}
  else 
    {playBunch(Testarray);
}}