/**  lists.js         written by Scott Honey

	A library of functions that control the lists for the Singing Syllbary	program.  Netscape 3.0 or higher arrays and the array.js file is required to run this, and it's main use is for SS particular functions.  They would probably be useless in another program.

FUNCTIONS:


	intoFavoriteslist(STRING)
		adds another sound into the favoriteslist, and updates the screen

	hiddenIntoFavoriteslist(STRING)
		adds another sound into the favoriteslist, and DOES NOT update the screen

	multiIntoFavoriteslist(ARRAY)
		adds all of the sounds in the array into the favoriteslist, and updates the screen

	outofFavoritesList(INTEGER)
		removes a sound from the favorites list, using the location in the array.  Updates the screen.

	intoGameslist(STRING)
		adds another sound into the gameslist, and updates the screen

	killFavoriteslist
		removes all sounds from the favorites list

	 killGameslist
		removes all sounds from the games list

**/


/* intoFavoriteslist(STRING)
	adds another sound into the favoriteslist, and updates the screen*/
function intoFavoriteslist(sound) {
  old_length = Favoritesarray.length;
  Favoritesarray = arrayAdd(Favoritesarray,sound);
  if (Favoritesarray.length != old_length) 
    {redrawFavoritesarray();}
}

/* hiddenIntoFavoriteslist(STRING)
	adds another sound into the favoriteslist, and DOES NOT update the screen*/
function hiddenIntoFavoriteslist(sound) {
  Favoritesarray = arrayAdd(Favoritesarray,sound);
}


/* multiIntoFavoriteslist(ARRAY)
	adds all of the sounds in the array into the favoriteslist, and updates the screen*/
function multiIntoFavoriteslist(sounds) {
  for (var soundIndex = 1; soundIndex < sounds.length; soundIndex++) {
    Favoritesarray[Favoritesarray.length]= sounds[soundIndex]; 
  }
  redrawFavoritesarray();
}

/* outofFavoritesList(INTEGER)
	removes a sound from the favorites list, using the location in the array.  Updates the screen.*/
function outofFavoriteslist(soundIndex){
  Favoritesarray=arrayRemove(Favoritesarray,soundIndex);
  redrawFavoritesarray();
}

/* intoGameslist(STRING)
	adds another sound into the gameslist, and updates the screen*/
function intoGameslist(sound) {
  if (arrayAdd(Gamesarray,sound)) {redrawGamesarray();}
}


/* outofGamesList(INTEGER)
	removes a sound from the games list, using the location in the array.  Updates the screen.*/
function outofGameslist(soundindex){
  Gamesarray=arrayRemove(Gamesarray,soundindex);
  redrawGamesarray();
}

/* killFavoriteslist
	removes all sounds from the favorites list*/
function killFavoriteslist(){
	Favoritesarray=arrayClear();
	redrawFavoritesarray();
}

/* killGameslist
	removes all sounds from the games list*/
function killGameslist(){
	Gamesarray=arrayClear();
	redrawGamesarray();
}
