var musicDir = "";

menuTextArray["playlist_On"] =  '----- Select A Song -----';
menuTextArray["playlist_Off"] = menuTextArray["playlist_On"];

// set up picture array; numbers are automatically generated for the menu options
var musicArray = [];
var i=0;



// ---------- START MUSIC INFO -----------

// index of song (starting with 0)
var startSongIndex = 0;

// do you want to show captions? true or false
var bShowCaptions = true;

//					        RELATIVE PATH TO FILE		    TITLE
musicArray[i++] = ["music/kingoftheroad.mid","King of the Road"];
musicArray[i++] = ["music/Bare Necessities.mid","Bare Necessities"];
musicArray[i++] = ["music/comealittlebitcloser.mid","Come a Litle Bit Closer"];
musicArray[i++] = ["music/dustinthewind.mid","Dust in the Wind"];
musicArray[i++] = ["music/dontrocktheboat.mid","Don't Rock the Boat"];
musicArray[i++] = ["music/YMCA.mid","YMCA"];
musicArray[i++] = ["music/candyman.mid","Candy Man"];
musicArray[i++] = ["music/itneverrainsincalifornia.mid","It Never Rains in California"];
// musicArray[i++] = ["music/Against All Odds.mid","Against All Odds"];
// ---------- END MUSIC ARRAY -----------


var tempString = '';
tempString+='<bgsound id=soundID>';
tempString+='<EMBED NAME="soundFile" SRC="'+musicArray[startSongIndex][0]+'" HIDDEN="TRUE" AUTOSTART="FALSE" LOOP="TRUE" MASTERSOUND>';
document.write(tempString);

var formName = "form";
var fieldName = "playlist";
var optionValueArray = optionValueArray;
var optionTextArray = optionTextArray;
var selectedOptionValue = musicArray[startSongIndex][0];
var text_on = menuTextArray[fieldName+"_On"];
var text_off = menuTextArray[fieldName+"_Off"];
var selectMenuSize = 11;
var bAllowMultipleSelections = 0;
var bInitOptionFilled = 0;
var onchange = "var selectedValue=this.options[this.selectedIndex].value;if(!isset(selectedValue)){stopSound();}else{playSound(selectedValue);}";
var optionValueArray = [];
var optionTextArray = [];

for(var i=0; i < musicArray.length; i++){
	if(i==0){
		optionValueArray[optionValueArray.length] = "";
		optionTextArray[optionTextArray.length] = " -- No Music -- ";
	}
	var thisValue = musicArray[i][0];
	var thisText = bShowCaptions ? musicArray[i][1] : "";
	if(bShowCaptions && !isset(thisText)){
		var tempArray = thisValue.split("/");
		var fileName = tempArray[tempArray.length-1];
		var fileBase = fileName.substring(0,fileName.indexOf("."));
		var fileExt = fileName.substring(fileName.indexOf("."));
		//if(i==0){alert(fileBase+' '+fileExt);}
		thisText = createCaption(fileBase);
	}
	// set any additional data to option values here
	optionValueArray.push(thisValue);
	optionTextArray.push(thisText);
}

createDynamicMenu(null,formName,fieldName,optionTextArray,optionValueArray,selectedOptionValue,text_on,text_off,selectMenuSize,selectMenuSize,bAllowMultipleSelections,bInitOptionFilled,onchange);

if(isset(startSongIndex)){playSound(musicArray[startSongIndex][1]);}

