 //Set show id for controller function
var showId = '--';

jQuery(document).ready(function($) {

	// variable declarations
	var concertListImg = '<div id="activeConcertArrow" class="activeConcertArrow"></div>';

	// functions
	function swapConcert() {
		pauseAllJPlayers();
		$('.concertsPopOut').hide();
		var removeConcert = $('#activeConcertArrow').parent().attr('id');
		var addConcert = 	$(this).attr('id');
		if(removeConcert != addConcert) {
			$('.concertSidebar li').unbind('click', swapConcert);
			// toggle activeConcertArrow
			$('#activeConcertArrow').parent().removeClass('activeConcert');
			$('#activeConcertArrow').remove();
			$(this).prepend(concertListImg);
			$(this).addClass('activeConcert');
			// toggle concertContent
			$('div.concertContent.'+removeConcert).fadeOut('fast',function(){
				$('div.concertContent.'+addConcert).fadeIn(function() { $('.concertSidebar li').bind('click', swapConcert); });
			});
		}
	}

	function showPopOut() {
		pauseAllJPlayers();
		$('.concertsPopOut').hide();
		var popOutDiv = $(this).children().eq(0);
		//popOutDiv.show(function() {
		//	if(popOutDiv.hasClass('popOutMusic'))
		//		popOutDiv.children().eq(2).jPlayer('play');
		//});
		popOutDiv.show();
		if(popOutDiv.hasClass('popOutMusic')) {
			//alert(showId);
			$(showId).jPlayer('play');
		}

	}
	function hidePopOut() {
		pauseAllJPlayers();
		$(this).parent('.concertsPopOut').hide();
		$(showId).jPlayer('pause');
		return false;
	}

	function pauseAllJPlayers() {
		$("div[id$='_jPlayer']").each(function(){
			$(this).jPlayer('pause');
		});
	}

	// inital page setup
	var Anchor = jQuery.url.attr("anchor");
	if(Anchor != null) {
		var Anchor = Anchor.split('.');
		$('#'+Anchor[1]).addClass('activeConcert').prepend(concertListImg);
		$('div.concertContent.'+Anchor[1]).fadeIn();
	}
	else {
		var firstConcert = $('.concertSidebar li').eq(0);
		var artist = firstConcert.attr('id');
		firstConcert.addClass('activeConcert').prepend(concertListImg);
		$('div.concertContent.'+artist).fadeIn();
	}

	// jPlayer

	//var duewestPlayTime = $("#duewest_jplayer_play_time");
	//var duewestTotalTime = $("#duewest_jplayer_total_time");
	//$("#duewest_jPlayer").jPlayer({
	//	ready: function () {
	//		this.element.jPlayer("setFile", "concerts/music/duewest.mp3")
	//	},
	//	swfPath: "http://www.tuacahn.org/scripts",
	//	volume: 50
	//})
	//.jPlayer("cssId", "play", "duewest_jplayer_play")
	//.jPlayer("cssId", "pause", "duewest_jplayer_pause")
	//.jPlayer("cssId", "stop", "duewest_jplayer_stop")
	//.jPlayer("cssId", "loadBar", "duewest_jplayer_load_bar")
	//.jPlayer("cssId", "playBar", "duewest_jplayer_play_bar")
	//.jPlayer("cssId", "volumeMin", "duewest_jplayer_volume_min")
	//.jPlayer("cssId", "volumeMax", "duewest_jplayer_volume_max")
	//.jPlayer("cssId", "volumeBar", "duewest_jplayer_volume_bar")
	//.jPlayer("cssId", "volumeBarValue", "duewest_jplayer_volume_bar_value")
	//.jPlayer("onProgressChange", function(loadPercent, playedPercentRelative, playedPercentAbsolute, playedTime, totalTime) {
	//	duewestPlayTime.text($.jPlayer.convertTime(playedTime));
	//	duewestTotalTime.text($.jPlayer.convertTime(totalTime));
	//});

	//Initiate Playlist Variable as empty, will be popluated after jPlayer is inititiated. 
	var myPlayList = '';
	
	
	
	//Check to see if we are on the Tarzan page. 
	if($("#tarzan_jPlayer").attr('id') != undefined){
		var tarzanPlayTime = $("#tarzan_jplayer_play_time");
		var tarzanTotalTime = $("#tarzan_jplayer_total_time");
		var playItem = 0;
		
		showId = '#tarzan_jPlayer';
		
		$("#tarzan_jPlayer").jPlayer({
			ready: function () {
				//Set Playlist for show
				myPlayList = [
					{name:"Son Of Man",mp3:"images/tarzan/music/son_of_man_30.mp3"},
					{name:"Trashin' The Camp",mp3:"images/tarzan/music/Trashin-The-Camp_30.mp3"}
				];
				
				displayPlayList('#tarzan_jPlayer');
				if ( $.browser.msie ) {
					if(parseInt($.browser.version, 10) >= 9){
						//If IE version 9 or above set autoplay to true
						playListInit(true, '#tarzan_jPlayer');
					} else {
						//If IE version 8 or below set autoplay to false
						playListInit(false, '#tarzan_jPlayer');
					}
				} else if($.browser.mozilla){
					//If brower is Firefox/Mozilla set autoplay to false
					playListInit(false, '#tarzan_jPlayer');
				} else {
					//for all other types of browsers (mostly webkit [Chrome / Safari]) set autoplay to true
					playListInit(true, '#tarzan_jPlayer');
				}
	
				//this.element.jPlayer("setFile", "images/tarzan/music/son_of_man.mp3")
			},
			swfPath: "http://www.tuacahn.org/scripts",
			volume: 50
		})
		.jPlayer("cssId", "play", "tarzan_jplayer_play")
		.jPlayer("cssId", "pause", "tarzan_jplayer_pause")
		.jPlayer("cssId", "stop", "tarzan_jplayer_stop")
		.jPlayer("cssId", "loadBar", "tarzan_jplayer_load_bar")
		.jPlayer("cssId", "playBar", "tarzan_jplayer_play_bar")
		.jPlayer("cssId", "volumeMin", "tarzan_jplayer_volume_min")
		.jPlayer("cssId", "volumeMax", "tarzan_jplayer_volume_max")
		.jPlayer("cssId", "volumeBar", "tarzan_jplayer_volume_bar")
		.jPlayer("cssId", "volumeBarValue", "tarzan_jplayer_volume_bar_value")
		.jPlayer("onProgressChange", function(loadPercent, playedPercentRelative, playedPercentAbsolute, playedTime, totalTime) {
			tarzanPlayTime.text($.jPlayer.convertTime(playedTime));
			tarzanTotalTime.text($.jPlayer.convertTime(totalTime));
		})
		.jPlayer("onSoundComplete", function() {
			playListNext();
		});
	}
	
	
	//Check to see if we are on the Cats page. 
	if($("#cats_jplayer").attr('id') != undefined){
		var catsPlayTime = $("#cats_jplayer_play_time");
		var catsTotalTime = $("#cats_jplayer_total_time");
		var playItem = 0;
		
		showId = '#cats_jplayer';
	
		$("#cats_jplayer").jPlayer({
			ready: function () {
				//Set Playlist for show
				myPlayList = [
					{name:"Macavity: The Mystery Cat",mp3:"images/cats/music/Macavity_30.mp3"},
					{name:"Memory",mp3:"images/cats/music/Memory_30.mp3"}
				];
				
				displayPlayList('#cats_jplayer');
				if (navigator.userAgent.indexOf("Firefox")!=-1 || navigator.userAgent.indexOf("MSIE")!=-1) {
					playListInit(true, '#cats_jplayer'); // Parameter is a boolean for autoplay.
				} else {
					playListInit(false, '#cats_jplayer'); // Parameter is a boolean for autoplay.
				}
	
				//this.element.jPlayer("setFile", "images/tarzan/music/son_of_man.mp3")
			},
			swfPath: "http://www.tuacahn.org/scripts",
			volume: 50
		})
		.jPlayer("cssId", "play", "cats_jplayer_play")
		.jPlayer("cssId", "pause", "cats_jplayer_pause")
		.jPlayer("cssId", "stop", "cats_jplayer_stop")
		.jPlayer("cssId", "loadBar", "cats_jplayer_load_bar")
		.jPlayer("cssId", "playBar", "cats_jplayer_play_bar")
		.jPlayer("cssId", "volumeMin", "cats_jplayer_volume_min")
		.jPlayer("cssId", "volumeMax", "cats_jplayer_volume_max")
		.jPlayer("cssId", "volumeBar", "cats_jplayer_volume_bar")
		.jPlayer("cssId", "volumeBarValue", "cats_jplayer_volume_bar_value")
		.jPlayer("onProgressChange", function(loadPercent, playedPercentRelative, playedPercentAbsolute, playedTime, totalTime) {
			catsPlayTime.text($.jPlayer.convertTime(playedTime));
			catsTotalTime.text($.jPlayer.convertTime(totalTime));
		})
		.jPlayer("onSoundComplete", function() {
			playListNext();
		});
	
	}
	
	//Check to see if we are on the Crazy for you page. 
	if($("#crazy_jplayer").attr('id') != undefined){
		var catsPlayTime = $("#crazy_jplayer_play_time");
		var catsTotalTime = $("#crazy_jplayer_total_time");
		var playItem = 0;
		
		showId = '#crazy_jplayer';
	
		$("#crazy_jplayer").jPlayer({
			ready: function () {
				//Set Playlist for show
				myPlayList = [
					{name:"I Got Rhythm",mp3:"images/crazyForYou/music/I_Got_Rhythm_30.mp3"},
					{name:"Someone Watch Over Me",mp3:"images/crazyForYou/music/Someone_Watch_Over_Me_30.mp3"}
				];
				
				displayPlayList('#crazy_jplayer');
				if (navigator.userAgent.indexOf("Firefox")!=-1 || navigator.userAgent.indexOf("MSIE")!=-1) {
					playListInit(true, '#crazy_jplayer'); // Parameter is a boolean for autoplay.
				} else {
					playListInit(false, '#crazy_jplayer'); // Parameter is a boolean for autoplay.
				}
	
				//this.element.jPlayer("setFile", "images/tarzan/music/son_of_man.mp3")
			},
			swfPath: "http://www.tuacahn.org/scripts",
			volume: 50
		})
		.jPlayer("cssId", "play", "crazy_jplayer_play")
		.jPlayer("cssId", "pause", "crazy_jplayer_pause")
		.jPlayer("cssId", "stop", "crazy_jplayer_stop")
		.jPlayer("cssId", "loadBar", "crazy_jplayer_load_bar")
		.jPlayer("cssId", "playBar", "crazy_jplayer_play_bar")
		.jPlayer("cssId", "volumeMin", "crazy_jplayer_volume_min")
		.jPlayer("cssId", "volumeMax", "crazy_jplayer_volume_max")
		.jPlayer("cssId", "volumeBar", "crazy_jplayer_volume_bar")
		.jPlayer("cssId", "volumeBarValue", "crazy_jplayer_volume_bar_value")
		.jPlayer("onProgressChange", function(loadPercent, playedPercentRelative, playedPercentAbsolute, playedTime, totalTime) {
			catsPlayTime.text($.jPlayer.convertTime(playedTime));
			catsTotalTime.text($.jPlayer.convertTime(totalTime));
		})
		.jPlayer("onSoundComplete", function() {
			playListNext();
		});
	
	}
	
	//Check to see if we are on the Tarzan page. 
	if($("#grease_jPlayer").attr('id') != undefined){
		var greasePlayTime = $("#grease_jplayer_play_time");
		var greaseTotalTime = $("#grease_jplayer_total_time");
		var playItem = 0;
	
		showId = '#grease_jPlayer';
		
		$("#grease_jPlayer").jPlayer({
			ready: function () {
				//Set Playlist for show
				myPlayList = [
				    {name:"Summer Nights",mp3:"images/grease/music/summernights.mp3"},
					{name:"You're The One That I Want",mp3:"images/grease/music/youretheonethatiwant.mp3"}
				];
				
				displayPlayList('#grease_jPlayer');
				if (navigator.userAgent.indexOf("Firefox")!=-1 || navigator.userAgent.indexOf("MSIE")!=-1) {
					playListInit(true, '#grease_jPlayer'); // Parameter is a boolean for autoplay.
				} else {
					playListInit(false, '#grease_jPlayer'); // Parameter is a boolean for autoplay.
				}
	
				//this.element.jPlayer("setFile", "images/grease/music/son_of_man.mp3")
			},
			swfPath: "http://www.tuacahn.org/scripts",
			volume: 50
		})
		.jPlayer("cssId", "play", "grease_jplayer_play")
		.jPlayer("cssId", "pause", "grease_jplayer_pause")
		.jPlayer("cssId", "stop", "grease_jplayer_stop")
		.jPlayer("cssId", "loadBar", "grease_jplayer_load_bar")
		.jPlayer("cssId", "playBar", "grease_jplayer_play_bar")
		.jPlayer("cssId", "volumeMin", "grease_jplayer_volume_min")
		.jPlayer("cssId", "volumeMax", "grease_jplayer_volume_max")
		.jPlayer("cssId", "volumeBar", "grease_jplayer_volume_bar")
		.jPlayer("cssId", "volumeBarValue", "grease_jplayer_volume_bar_value")
		.jPlayer("onProgressChange", function(loadPercent, playedPercentRelative, playedPercentAbsolute, playedTime, totalTime) {
			greasePlayTime.text($.jPlayer.convertTime(playedTime));
			greaseTotalTime.text($.jPlayer.convertTime(totalTime));
		})
		.jPlayer("onSoundComplete", function() {
			playListNext();
		});
	}
	
	//Check to see if we are on the Hairspray page. 
	if($("#hairspray_jPlayer").attr('id') != undefined){
		var hairsprayPlayTime = $("#hairspray_jplayer_play_time");
		var hairsprayTotalTime = $("#hairspray_jplayer_total_time");
		var playItem = 0;
	
		showId = '#hairspray_jPlayer';
		
		$("#hairspray_jPlayer").jPlayer({
			ready: function () {
				//Set Playlist for show
				myPlayList = [
				    {name:"Good Morning Baltimore",mp3:"images/hairspray/music/GoodMorningBaltimore.mp3"},
					{name:"You Can't Stop the Beat",mp3:"images/hairspray/music/YouCantStoptheBeat.mp3"}
				];
				
				displayPlayList('#hairspray_jPlayer');
				
				if (navigator.userAgent.indexOf("Firefox")!=-1 || navigator.userAgent.indexOf("MSIE")!=-1) {
					playListInit(true, '#hairspray_jPlayer'); // Parameter is a boolean for autoplay.
				} else {
					playListInit(false, '#hairspray_jPlayer'); // Parameter is a boolean for autoplay.
				}
	
				//this.element.jPlayer("setFile", "images/hairspray/music/son_of_man.mp3")
			},
			swfPath: "http://www.tuacahn.org/scripts",
			volume: 50
		})
		.jPlayer("cssId", "play", "hairspray_jplayer_play")
		.jPlayer("cssId", "pause", "hairspray_jplayer_pause")
		.jPlayer("cssId", "stop", "hairspray_jplayer_stop")
		.jPlayer("cssId", "loadBar", "hairspray_jplayer_load_bar")
		.jPlayer("cssId", "playBar", "hairspray_jplayer_play_bar")
		.jPlayer("cssId", "volumeMin", "hairspray_jplayer_volume_min")
		.jPlayer("cssId", "volumeMax", "hairspray_jplayer_volume_max")
		.jPlayer("cssId", "volumeBar", "hairspray_jplayer_volume_bar")
		.jPlayer("cssId", "volumeBarValue", "hairspray_jplayer_volume_bar_value")
		.jPlayer("onProgressChange", function(loadPercent, playedPercentRelative, playedPercentAbsolute, playedTime, totalTime) {
			hairsprayPlayTime.text($.jPlayer.convertTime(playedTime));
			hairsprayTotalTime.text($.jPlayer.convertTime(totalTime));
		})
		.jPlayer("onSoundComplete", function() {
			playListNext();
		});
	}
	
	//Check to see if we are on the Wizard of Oz page. 
	if($("#wizardofoz_jPlayer").attr('id') != undefined){
		var wizardofozPlayTime = $("#wizardofoz_jplayer_play_time");
		var wizardofozTotalTime = $("#wizardofoz_jplayer_total_time");
		var playItem = 0;
	
		showId = '#wizardofoz_jPlayer';
		
		$("#wizardofoz_jPlayer").jPlayer({
			ready: function () {
				//Set Playlist for show
				myPlayList = [
				    {name:"Over The Rainbow",mp3:"images/wizard/music/OvertheRainbow.mp3"},
					{name:"We're Off to See The Wizard",mp3:"images/wizard/music/WereOfftoSeeTheWizard.mp3"}
				];
				
				displayPlayList('#wizardofoz_jPlayer');
				
				if (navigator.userAgent.indexOf("Firefox")!=-1 || navigator.userAgent.indexOf("MSIE")!=-1) {
					playListInit(true, '#wizardofoz_jPlayer'); // Parameter is a boolean for autoplay.
				} else {
					playListInit(false, '#wizardofoz_jPlayer'); // Parameter is a boolean for autoplay.
				}
	
				//this.element.jPlayer("setFile", "images/wizardofoz/music/son_of_man.mp3")
			},
			swfPath: "http://www.tuacahn.org/scripts",
			volume: 50
		})
		.jPlayer("cssId", "play", "wizardofoz_jplayer_play")
		.jPlayer("cssId", "pause", "wizardofoz_jplayer_pause")
		.jPlayer("cssId", "stop", "wizardofoz_jplayer_stop")
		.jPlayer("cssId", "loadBar", "wizardofoz_jplayer_load_bar")
		.jPlayer("cssId", "playBar", "wizardofoz_jplayer_play_bar")
		.jPlayer("cssId", "volumeMin", "wizardofoz_jplayer_volume_min")
		.jPlayer("cssId", "volumeMax", "wizardofoz_jplayer_volume_max")
		.jPlayer("cssId", "volumeBar", "wizardofoz_jplayer_volume_bar")
		.jPlayer("cssId", "volumeBarValue", "wizardofoz_jplayer_volume_bar_value")
		.jPlayer("onProgressChange", function(loadPercent, playedPercentRelative, playedPercentAbsolute, playedTime, totalTime) {
			wizardofozPlayTime.text($.jPlayer.convertTime(playedTime));
			wizardofozTotalTime.text($.jPlayer.convertTime(totalTime));
		})
		.jPlayer("onSoundComplete", function() {
			playListNext();
		});
	}
	
	//Check to see if we are on the Little Mermaid page. 
	if($("#littlemermaid_jPlayer").attr('id') != undefined){
		var littlemermaidPlayTime = $("#littlemermaid_jplayer_play_time");
		var littlemermaidTotalTime = $("#littlemermaid_jplayer_total_time");
		var playItem = 0;
	
		showId = '#littlemermaid_jPlayer';
		
		$("#littlemermaid_jPlayer").jPlayer({
			ready: function () {
				//Set Playlist for show
				myPlayList = [
				    {name:"Part Of Your World",mp3:"images/littlemermaid/music/part-of-your-world.mp3"},
					{name:"Under the Sea",mp3:"images/littlemermaid/music/under-the-sea.mp3"}
				];
				
				displayPlayList('#littlemermaid_jPlayer');
				
				if (navigator.userAgent.indexOf("Firefox")!=-1 || navigator.userAgent.indexOf("MSIE")!=-1) {
					playListInit(true, '#littlemermaid_jPlayer'); // Parameter is a boolean for autoplay.
				} else {
					playListInit(false, '#littlemermaid_jPlayer'); // Parameter is a boolean for autoplay.
				}
	
				//this.element.jPlayer("setFile", "images/littlemermaid/music/son_of_man.mp3")
			},
			swfPath: "http://www.tuacahn.org/scripts",
			volume: 50
		})
		.jPlayer("cssId", "play", "littlemermaid_jplayer_play")
		.jPlayer("cssId", "pause", "littlemermaid_jplayer_pause")
		.jPlayer("cssId", "stop", "littlemermaid_jplayer_stop")
		.jPlayer("cssId", "loadBar", "littlemermaid_jplayer_load_bar")
		.jPlayer("cssId", "playBar", "littlemermaid_jplayer_play_bar")
		.jPlayer("cssId", "volumeMin", "littlemermaid_jplayer_volume_min")
		.jPlayer("cssId", "volumeMax", "littlemermaid_jplayer_volume_max")
		.jPlayer("cssId", "volumeBar", "littlemermaid_jplayer_volume_bar")
		.jPlayer("cssId", "volumeBarValue", "littlemermaid_jplayer_volume_bar_value")
		.jPlayer("onProgressChange", function(loadPercent, playedPercentRelative, playedPercentAbsolute, playedTime, totalTime) {
			littlemermaidPlayTime.text($.jPlayer.convertTime(playedTime));
			littlemermaidTotalTime.text($.jPlayer.convertTime(totalTime));
		})
		.jPlayer("onSoundComplete", function() {
			playListNext();
		});
	}
	
	//Check to see if we are on the Spelling Bee Page page. 
	if($("#spellingbee_jPlayer").attr('id') != undefined){
		var spellingbeePlayTime = $("#spellingbee_jplayer_play_time");
		var spellingbeeTotalTime = $("#spellingbee_jplayer_total_time");
		var playItem = 0;
	
		showId = '#spellingbee_jPlayer';
		
		$("#spellingbee_jPlayer").jPlayer({
			ready: function () {
				//Set Playlist for show
				myPlayList = [
				    {name:"The 25th Annual Putnam Country Spelling Bee",mp3:"images/SpellingBee/music/The-25th-Annual-Putnam-County-Spelling-Bee.mp3"},
					{name:"The I Love You Song",mp3:"images/SpellingBee/music/The-I-Love-You-Song.mp3"}
				];
				
				displayPlayList('#spellingbee_jPlayer');
				
				if ( $.browser.msie ) {
					if(parseInt($.browser.version, 10) >= 9){
						//If IE version 9 or above set autoplay to true
						playListInit(false, '#spellingbee_jPlayer');
					} else {
						//If IE version 8 or below set autoplay to false
						playListInit(true, '#spellingbee_jPlayer');
					}
				} else if($.browser.mozilla){
					//If brower is Firefox/Mozilla set autoplay to false
					playListInit(true, '#spellingbee_jPlayer');
				} else {
					//for all other types of browsers (mostly webkit [Chrome / Safari]) set autoplay to true
					playListInit(false, '#spellingbee_jPlayer');
				}
	
				//this.element.jPlayer("setFile", "images/spellingbee/music/son_of_man.mp3")
			},
			swfPath: "http://www.tuacahn.org/scripts",
			volume: 50
		})
		.jPlayer("cssId", "play", "spellingbee_jplayer_play")
		.jPlayer("cssId", "pause", "spellingbee_jplayer_pause")
		.jPlayer("cssId", "stop", "spellingbee_jplayer_stop")
		.jPlayer("cssId", "loadBar", "spellingbee_jplayer_load_bar")
		.jPlayer("cssId", "playBar", "spellingbee_jplayer_play_bar")
		.jPlayer("cssId", "volumeMin", "spellingbee_jplayer_volume_min")
		.jPlayer("cssId", "volumeMax", "spellingbee_jplayer_volume_max")
		.jPlayer("cssId", "volumeBar", "spellingbee_jplayer_volume_bar")
		.jPlayer("cssId", "volumeBarValue", "spellingbee_jplayer_volume_bar_value")
		.jPlayer("onProgressChange", function(loadPercent, playedPercentRelative, playedPercentAbsolute, playedTime, totalTime) {
			spellingbeePlayTime.text($.jPlayer.convertTime(playedTime));
			spellingbeeTotalTime.text($.jPlayer.convertTime(totalTime));
		})
		.jPlayer("onSoundComplete", function() {
			playListNext();
		});
	}
	
	//Check to see if we are on the Aladdin Page page. 
	if($("#aladdin_jPlayer").attr('id') != undefined){
		var aladdinPlayTime = $("#aladdin_jplayer_play_time");
		var aladdinTotalTime = $("#aladdin_jplayer_total_time");
		var playItem = 0;
	
		showId = '#aladdin_jPlayer';
		
		$("#aladdin_jPlayer").jPlayer({
			ready: function () {
				//Set Playlist for show
				myPlayList = [
				    {name:"A Whole New World",mp3:"images/aladdin/music/A-Whole-New-World.mp3"},
					{name:"One Jump Ahead",mp3:"images/aladdin/music/On-Jump-Ahead.mp3"}
				];
				
				displayPlayList('#aladdin_jPlayer');
				
				if ( $.browser.msie ) {
					if(parseInt($.browser.version, 10) >= 9){
						//If IE version 9 or above set autoplay to true
						playListInit(false, '#aladdin_jPlayer');
					} else {
						//If IE version 8 or below set autoplay to false
						playListInit(true, '#aladdin_jPlayer');
					}
				} else if($.browser.mozilla){
					//If brower is Firefox/Mozilla set autoplay to false
					playListInit(true, '#aladdin_jPlayer');
				} else {
					//for all other types of browsers (mostly webkit [Chrome / Safari]) set autoplay to true
					playListInit(false, '#aladdin_jPlayer');
				}
	
				//this.element.jPlayer("setFile", "images/aladdin/music/son_of_man.mp3")
			},
			swfPath: "http://www.tuacahn.org/scripts",
			volume: 50
		})
		.jPlayer("cssId", "play", "aladdin_jplayer_play")
		.jPlayer("cssId", "pause", "aladdin_jplayer_pause")
		.jPlayer("cssId", "stop", "aladdin_jplayer_stop")
		.jPlayer("cssId", "loadBar", "aladdin_jplayer_load_bar")
		.jPlayer("cssId", "playBar", "aladdin_jplayer_play_bar")
		.jPlayer("cssId", "volumeMin", "aladdin_jplayer_volume_min")
		.jPlayer("cssId", "volumeMax", "aladdin_jplayer_volume_max")
		.jPlayer("cssId", "volumeBar", "aladdin_jplayer_volume_bar")
		.jPlayer("cssId", "volumeBarValue", "aladdin_jplayer_volume_bar_value")
		.jPlayer("onProgressChange", function(loadPercent, playedPercentRelative, playedPercentAbsolute, playedTime, totalTime) {
			aladdinPlayTime.text($.jPlayer.convertTime(playedTime));
			aladdinTotalTime.text($.jPlayer.convertTime(totalTime));
		})
		.jPlayer("onSoundComplete", function() {
			playListNext();
		});
	}
	
	//Check to see if we are on the white christmas Page page. 
	if($("#whitechristmas_jPlayer").attr('id') != undefined){
		var whitechristmasPlayTime = $("#whitechristmas_jplayer_play_time");
		var whitechristmasTotalTime = $("#whitechristmas_jplayer_total_time");
		var playItem = 0;
	
		showId = '#whitechristmas_jPlayer';
		
		$("#whitechristmas_jPlayer").jPlayer({
			ready: function () {
				//Set Playlist for show
				myPlayList = [
				    {name:"White Christmas",mp3:"images/whitechristmas/music/White-Christmas.mp3"},
					{name:"Blue Skies",mp3:"images/whitechristmas/music/Blue-Skies.mp3"}
				];
				
				displayPlayList('#whitechristmas_jPlayer');
				
				if ( $.browser.msie ) {
					if(parseInt($.browser.version, 10) >= 9){
						//If IE version 9 or above set autoplay to true
						playListInit(false, '#whitechristmas_jPlayer');
					} else {
						//If IE version 8 or below set autoplay to false
						playListInit(true, '#whitechristmas_jPlayer');
					}
				} else if($.browser.mozilla){
					//If brower is Firefox/Mozilla set autoplay to false
					playListInit(true, '#whitechristmas_jPlayer');
				} else {
					//for all other types of browsers (mostly webkit [Chrome / Safari]) set autoplay to true
					playListInit(false, '#whitechristmas_jPlayer');
				}
	
				//this.element.jPlayer("setFile", "images/whitechristmas/music/son_of_man.mp3")
			},
			swfPath: "http://www.tuacahn.org/scripts",
			volume: 50
		})
		.jPlayer("cssId", "play", "whitechristmas_jplayer_play")
		.jPlayer("cssId", "pause", "whitechristmas_jplayer_pause")
		.jPlayer("cssId", "stop", "whitechristmas_jplayer_stop")
		.jPlayer("cssId", "loadBar", "whitechristmas_jplayer_load_bar")
		.jPlayer("cssId", "playBar", "whitechristmas_jplayer_play_bar")
		.jPlayer("cssId", "volumeMin", "whitechristmas_jplayer_volume_min")
		.jPlayer("cssId", "volumeMax", "whitechristmas_jplayer_volume_max")
		.jPlayer("cssId", "volumeBar", "whitechristmas_jplayer_volume_bar")
		.jPlayer("cssId", "volumeBarValue", "whitechristmas_jplayer_volume_bar_value")
		.jPlayer("onProgressChange", function(loadPercent, playedPercentRelative, playedPercentAbsolute, playedTime, totalTime) {
			whitechristmasPlayTime.text($.jPlayer.convertTime(playedTime));
			whitechristmasTotalTime.text($.jPlayer.convertTime(totalTime));
		})
		.jPlayer("onSoundComplete", function() {
			playListNext();
		});
	}

	// event handlers
	$('.concertSidebar li').bind('click', swapConcert);
	$('li.seatingAreaButton, li.mapDirectionsButton, .playSampleButton').bind('click', showPopOut);
	$('.popOutClose').bind('click', hidePopOut);
	
	// Playlist Specific Functions
	

	$("#jplayer_previous").click( function() {
		playListPrev();
		$(this).blur();
		return false;
	});

	$("#jplayer_next").click( function() {
		playListNext();
		$(this).blur();
		return false;
	});

	
	function displayPlayList() {
		$("#jplayer_playlist ul").empty();
		for (i=0; i < myPlayList.length; i++) {
			var listItem = (i == myPlayList.length-1) ? "<li class='jplayer_playlist_item_last'>" : "<li>";
			listItem += "<a href='#' id='jplayer_playlist_item_"+i+"' tabindex='1'>"+ myPlayList[i].name +"</a></li>";
			$("#jplayer_playlist ul").append(listItem);
			$("#jplayer_playlist_item_"+i).data( "index", i ).click( function() {
				var index = $(this).data("index");
				if (playItem != index) {
					playListChange( index );
				} else {
					$(showId).jPlayer("play");
				}
				$(this).blur();
				return false;
			});
		}
	}
	
	function playListInit(autoplay) {
		if(autoplay) {
			playListChange( playItem );
		} else {
			playListConfig( playItem );
		}
	}

	function playListConfig( index ) {
		$("#jplayer_playlist_item_"+playItem).removeClass("jplayer_playlist_current").parent().removeClass("jplayer_playlist_current");
		$("#jplayer_playlist_item_"+index).addClass("jplayer_playlist_current").parent().addClass("jplayer_playlist_current");
		playItem = index;
		$(showId).jPlayer("setFile", myPlayList[playItem].mp3, myPlayList[playItem].ogg);
	}

	function playListChange( index ) {
		playListConfig( index );
		$(showId).jPlayer("play");
	}

	function playListNext() {
		var index = (playItem+1 < myPlayList.length) ? playItem+1 : 0;
		playListChange( index );
	}

	function playListPrev() {
		var index = (playItem-1 >= 0) ? playItem-1 : myPlayList.length-1;
		playListChange( index );
	}
	
	$('.gallery_holder a').lightBox();

	
	$('.showPhotoButton').click(function(){
		$('.show_gallery:first').trigger('click');								 
	});
	
	



});

