//This file contains all Javascript that refers to the Media Page for Ensemble a la Carte
//By D. Cheng & T. Gill


//Picture section

function go(form) 
{
location=form.selectmenu.value
}


//Music section

//Define Variables
var optionals = 4; // This is the number of categories, including the first, blank, category.
var play_media=1; //Set 1 to Play music selections, 0 for no.

//Define array: option_array is where you place your composition names
var option_array = new Array();
//
option_array[0] = new Array("--Your Selection--"); // This is the first (blank) category. Don't mess with it.
//
option_array[1] = new Array("--Your Selection--",
"A Summer Song for Flute, Clarinet and Bassoon");
//
option_array[2] = new Array("--Your Selection--",
"Trio for Oboe, Clarinet and Bassoon: Decide",
"Trio for Oboe, Clarinet and Bassoon: Final");
//
option_array[3] = new Array("--Your Selection--",
"Trois Pieces Breves: I Allegro",
"Trois Pieces Breves: II Andante");
//
option_array[4] = new Array("--Your Selection--",
"Kvintet Op. 43: I Allegro ben moderato",
"Kvintet Op. 43: II Minuet",
"Kvintet Op. 43: III Praeludium, Tema con variazioni");
//
option_array[5] = new Array("--Your Selection--",
"Music II for Wind Quintet");
//
option_array[6] = new Array("--Your Selection--",
"sample1",
"sample2",
"sample3");


//Define array: text_array - descriptions of your compositions
var text_array = new Array();
//
text_array[0] = new Array("Music Selections beautifully played by Ensemble a la Carte!"); // These are general instructions. Change them if you want, or keep them if you don't.
//
text_array[1] = new Array("Recorded by David Rubinstein: A Midsummer Night Dream.", // Note that the first entry here is a general description of this category. After than, they're descriptions of each link. Make sure that you don't put the first link first; the general description must be first.
"A Summer Song for Flute, Clarinet and Bassoon. Be sure to visit David's website at http://www.wonderful-music.com to view a complete discography, contact and Bio information, and much much more");
//
text_array[2] = new Array("Composed by George Auric",
"Trio for Oboe, Clarinet and Bassoon - Decide.",
"Trio for Oboe, Clarinet and Bassoon - Final.");
//
text_array[3] = new Array("Composed by Jacques Ibert",
"I Allegro",
"II Andante");
//
text_array[4] = new Array("Composed by Charles Nielsen",
"I Allegro",
"II Minuet",
"Praeludium, Tema con variazioni");
//
text_array[5] = new Array("Composed by Brian Wilbur Grundstrom",
"Music II for Wind Quintet");
//
text_array[6] = new Array("sample composer",
"blank");


//Define url_array: Links to the MP3 music file

var url_array = new Array();

//
url_array[0] = new Array("#"); // The first category. This should have no items other than "#".
//
url_array[1] = new Array("#", // The second category; the first "real" category. Note the initial #. That is the category which says "Please select a link." It doesn't need a URL. Start putting the other URL's in after that first line.
"http://www.ensemblealc.com/audio/David Rubinstein, A Summer Song for Flute, Clarinet and Bassoon.mp3");
//
url_array[2] = new Array("#",
"http://www.ensemblealc.com/audio/G Auric - Trio for Oboe, Clarinet and Bassoon - Decide.mp3",
"http://www.ensemblealc.com/audio/G Auric - Trio for Oboe, Clarinet and Bassoon - Final.mp3");
//
url_array[3] = new Array("#",
"http://www.ensemblealc.com/audio/J Ibert - I Allegro.mp3",
"http://www.ensemblealc.com/audio/J Ibert - II Andante.mp3");
//
url_array[4] = new Array("#",
"http://www.ensemblealc.com/audio/C Nielsen - Kvintet Op 43 - I Allegro.mp3",
"http://www.ensemblealc.com/audio/C Nielsen - Kvintet Op 43 - II Minuet.mp3",
"http://www.ensemblealc.com/audio/C Nielsen - Kvintet Op 43 - III Praeludium.mp3");
//
url_array[5] = new Array("#",
"http://www.ensemblealc.com/audio/BW Grundstrom - Music II for Wind Quintet.mp3");
//
url_array[6] = new Array("#",
"http://www.ensemblealc.com/audio/",
"http://www.ensemblealc.com/audio/");


function switch_select()

{
  for (loop = window.document.form_1.select_2.options.length-1; loop > 0; loop--)
  {
    window.document.form_1.select_2.options[loop] = null;
  }
  
  for (loop = 0; loop < option_array[window.document.form_1.select_1.selectedIndex].length; loop++)
  {
    window.document.form_1.select_2.options[loop] = new Option(option_array[window.document.form_1.select_1.selectedIndex][loop]);
  }
  
  window.document.form_1.select_2.selectedIndex = 0;
}
  
function switch_text()

{
  window.document.form_1.textarea_1.value = text_array[window.document.form_1.select_1.selectedIndex][window.document.form_1.select_2.selectedIndex];
}

function box()

{
  if (window.document.form_1.select_2.selectedIndex == 0)
  {
	window.defaultStatus = "Please select a composer and composition before clicking OK.";
	
  } else {
    if (play_media==1)
	window.open(url_array[window.document.form_1.select_1.selectedIndex][window.document.form_1.select_2.selectedIndex],"media");

  } 
}

function set_orig()

{
  window.document.form_1.select_1.selectedIndex = 0;
  window.document.form_1.select_2.selectedIndex = 0;
}

window.onload=set_orig;