function isIphone() {
	var agent = navigator.userAgent;
	if(agent.match(/iP(od|hone)/i) || agent.match(/Android/i) || agent.match(/iPad/i)) {
		return true;
	} else {
		return false;
	}
}

function supportsHtml5Video() {
	if(!!document.createElement('video').canPlayType) {
		return true;
	} else {
		return false;
	}
}

function supportsHtml5Audio() {
	if(!!document.createElement('audio').canPlayType) {
		return true;
	} else {
		return false;
	}
}

function stopHideAllVideos()
{
	$$('div.takeatourContainer ul li').each(function(li){
		li.removeClassName('active');
	});
	removeVideo(current_video);
}

function addVideo(key, file, insertInto, visible, width, height) {
	if(typeof insertInto == 'undefined') {
		var insertInto = 'pictureContainer';
	}
	if(typeof visible == 'undefined') {
		var visible = false;
	}
	if(typeof width == 'undefined') {
		var width = 320;
	}
	if(typeof height == 'undefined') {
		var height = 240;
	}
	if(visible) {
		var styles = '';
	} else {
		var styles = 'display: none;';
	}

	var div = new Element('div', { id: key + '_container', 'class': 'videoContainer', style: styles });
	var btn = new Element('div', { id: key + '_btn', 'class': 'videoClose'});
	var video = createVideo(key, file, width, height);
	if(supportsHtml5Video()) {
		div.insert({top:video});
	} else {
		div.update(video);
	}
	div.insert({bottom:btn});
	$(insertInto).insert({bottom:div});

	Event.observe(key + '_btn', 'click', function(){
		close_video();
		var title = current_file;
		switch(current_file) {
			case 'grand_tour':
				title = 'Grand Tour';
				break;
			case 'family_activities':
				title = 'Family Activities';
				break;
			case 'adult_activities':
				title = 'Adult Acitivities';
				break;
			case 'whatsnew':
				title = 'What\'s New';
				break;
			case 'youth_activities':
				title = 'Youth Activities';
				break;
			case 'overview':
				title = 'Overview';
				break;
			case 'island_history':
				title = 'Island History';
				break;
		}
		add_ga_event('Video', 'Close', title);
	});

	if(isIphone()) {
		showVideo(current_video);
		playVideo(current_video);
	}
}

function createVideo(key, file, width, height) {
	if(supportsHtml5Video()) {
		return addHtml5Video(key, file, width, height);
	} else {
		return addFlashVideo(key, file, width, height);
	}
}

function addHtml5Video(key, file, width, height) {

	var video = new Element('video',  {id: key + '_video', width: width, height: height, controls: 'controls'});
	var source_mp4 = new Element('source', { src: 'videos/mp4/' + file + '.m4v', type: 'video/mp4'});
	var source_ogg = new Element('source', { src: 'videos/ogg/' + file + '.ogv', type: 'video/ogg'});
	video.insert({bottom :source_ogg})
	video.insert({bottom :source_mp4});
	return video;
}

function addFlashVideo(key, file, width, height) {
	var object = new Element('object', {width: width, height: height, type: 'application/x-shockwave-flash', data: 'HDVideoPlayer.swf?vid=/videos/mp4/' + file + '.m4v', classid: 'clsid:D27CDB6E-AE6D-11cf-96B8-444553540000', codebase: 'http://fpdownload.macromedia.com/get/flashplayer/current/swflash.cab' });
	var param = new Element('param', {name: 'movie', value: 'HDVideoPlayer.swf?vid=/videos/mp4/' + file + '.m4v'});

	var html = '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"id="HDVideoPlayer" width="' + width + '" height="' + height + '"codebase="http://fpdownload.macromedia.com/get/flashplayer/current/swflash.cab"><param name="movie" value="HDVideoPlayer.swf?vid=/videos/mp4/' + file + '.m4v" /></object>';
	return html;
}

function addAudio(key, file) {
	var div = new Element('div', { id: key + '_container', 'class': 'audioContainer', style: 'display: none;'});
	var audio = createAudio(key, file);
	if(audio != false) {
		div.insert({top:audio});
		$('mainContainer').insert({top:div});
	}
}

function createAudio(key, file) {
	if(supportsHtml5Audio()) {
		return addHtml5Audio(key, file);
	} else {
		return false;
	}
}

function addHtml5Audio(key, file) {

	var audio = new Element('audio',  {id: key + '_audio', controls: 'controls'});
	var source_mp3 = new Element('source', { src: 'audio/mp3/' + file + '.mp3', type: 'audio/mp3'});
	var source_ogg = new Element('source', { src: 'audio/ogg/' + file + '.ogg', type: 'audio/ogg'});
	audio.insert({bottom :source_mp3})
	audio.insert({bottom :source_ogg});
	return audio;
}

function showVideo(key) {
	if($(key + '_container')) {
		$(key + '_container').show();
	}
}

function playVideo(key) {
	if(key != '') {
		var video = $(key + '_video');
		removeAudio(current_audio);
		if(video) {
			if(supportsHtml5Video()) {
				video.play();
			}
		}
	}
}

function removeVideo(key) {
	if(key != '') {
		var div = $(key + '_container');
		if(div) {
			div.remove();
		}
	}
	current_video = '';
	current_file = '';
}

function playAudio(key) {
	if(key != '') {
		var audio = $(key + '_audio');
		if(audio) {
			if(supportsHtml5Audio()) {
				audio.play();
			}
		} else {

		}
	}
}

function close_video(){
	if(current_video != '') {
		var div = $(current_video + '_container');
		if(div) {
			div.remove();
		}
	}
}

function removeAudio(key) {
	if(key != '') {
		var div = $(key + '_container');
		if(div) {
			div.remove();
		}
	}
	current_audio = '';
}

function overlay_close() {
	current_audio = 'vo_transition';

	if(supportsHtml5Audio()) {
		$('vo_transition_container').remove();
		addAudio('vo_transition', 'vo_transition');
		playAudio('vo_transition');
	} else {
		$('vo_transition_container').show();
	}
}

function change_map(map) {
	current_map = map;

	if(map == 'all') {
		$$('div.head').each(function(div){
			div.setStyle({cursor: 'pointer'});
		});
	} else {
		$$('div.head').each(function(div){
			div.setStyle({cursor: 'default'});
		});

		$$('div.head-' + map).each(function(div){
			div.setStyle({cursor: 'pointer'});
		});
	}
}

var current_map = 'all';
var current_video = '';
var current_file = '';
var current_audio = '';

function add_ga_event(category, action, label) {
	var found = false;
	headList.each(function(head, s) {
		var key = head.get('key');
		if(!found) {
			if(key == label) {
				label = head.get('title');
				found = true;
			}
		}
	});
	if(show_gs) {
		_gaq.push(['_trackEvent', category, action, label]);
		if(typeof console != 'undefined') {
			console.log(category + ' | ' + action + ' | ' + label);
		}
	}
}

var headList = new Array();
headList[0] = $H();
headList[1] = $H({ key: 'A', x: 584, y: 170, map: 'red', title: 'Arrival Plaza', text: 'Disembark your Disney cruise ship and step onto Castaway Cay for the myriad pleasures that await you.', has_video: true, is_photo_icon: false   });
headList[2] = $H({ key: 'B', x: 560, y: 157, map: 'red', title: 'Post Office', text: 'Purchase Castaway Cay stamps to mail postcards and other greetings with Castaway Cay\'s unique postmark. (U.S. currency required.)', has_video: false, is_photo_icon: false   });
headList[3] = $H({ key: 'C', x: 533, y: 149, map: 'red', title: 'Marge\'s Barges and Sea Charters Dock', text: 'Charter a fishing boat, go parasailing, book a glass bottom boat cruise and more from this shore excursions departure point. (Subject to availability, pre-reserve online.)', has_video: false, is_photo_icon: false   });
headList[4] = $H({ key: 'D', x: 467, y: 179, map: 'red', title: 'Boating Harbor', text: 'Enjoy watercraft such as kayaks and paddleboats.', has_video: true, is_photo_icon: false   });
headList[5] = $H({ key: 'E', x: 406, y: 132, map: 'red', title: 'Scuttle\'s Cove (Children\'s Area)', text: 'Children delight in sandy play and activities led by Disney counselors.', has_video: true, is_photo_icon: false   });
headList[6] = $H({ key: 'F', x: 413, y: 155, map: 'red', title: 'Boat Beach', text: 'Rent your own watercraft and take a guided tour through paradise while learning about the tropical marine life and compelling history of the region.', has_video: false, is_photo_icon: false   });
headList[7] = $H({ key: 'G', x: 393, y: 133, map: 'red', title: 'Monstro Point', text: 'Kids excavate giant whale bones with archeology dig tools at this play area in Scuttle\'s Cove.', has_video: false, is_photo_icon: false   });
headList[8] = $H({ key: 'H', x: 402, y: 152, map: 'red', title: 'Castaway Ray\'s Stingray Adventure', text: 'Get up-close to pet and feed the stingrays.', has_video: true, is_photo_icon: false  });
headList[9] = $H({ key: 'I', x: 399, y: 166, map: 'red', title: 'Gil\'s Fins and Boats', text: 'Snorkel, Tube, and Float Rentals', has_video: true, is_photo_icon: false  });
headList[10] = $H({ key: 'J1', x: 367, y: 144, map: 'red', title: '', old_title: 'Gazebos', text: 'Sit in the shade for a spell and participate in such entertainment as hula dancing with Lilo and Stitch, crab racing, and a Disney Character dance party at either of the two Gazebos.', has_video: true, is_photo_icon: false  });
headList[11] = $H({ key: 'K1', x: 343, y: 152, map: 'red', title: 'Castaway Family Beach 1', text: 'Gather the family for beach games and sandcastle building at this all-ages spot.  This part of the beach offers close proximity to boat rentals, children\'s programming and the snorkeling lagoon.', has_video: true, is_photo_icon: false  });
headList[12] = $H({ key: 'L', x: 352, y: 187, map: 'red', title: 'Snorkeling Lagoon', text: 'Snorkel and swim amidst tropical fish.', has_video: true, is_photo_icon: false  });
headList[13] = $H({ key: 'M', x: 317, y: 163, map: 'red', title: 'Swimming Lagoon', text: 'Splash about, body surf, or drift on floats or in inner tubes in the gentle waves of crystalline water.', has_video: false, is_photo_icon: false  });
headList[14] = $H({ key: 'N', x: 314, y: 136, map: 'red', title: 'In-Da-Shade Games', text: 'Play basketball, billiards, table tennis, and more.', has_video: true, is_photo_icon: false  });
headList[15] = $H({ key: 'O', x: 271, y: 152, map: 'red', title: 'Flippers and Floats', text: 'Rent inner tubes, snorkels, masks and fins to enhance your experience of the azure water.', has_video: false, is_photo_icon: false  });
headList[16] = $H({ key: 'P', x: 260, y: 182, map: 'red', title: 'Pelican Plunge (Water Slide)', text: 'Take the plunge on this new floating platform where you can slide and splash to your heart\'s content.', has_video: true, is_photo_icon: false  });
headList[17] = $H({ key: 'Q', x: 261, y: 137, map: 'red', title: 'Hideout', text: 'A secluded area on the island just for Teens. Close to the beach, activities and refreshments, teens can gather, kick back, listen to music and watch the action at nearby beach volleyball and soccer areas.', has_video: false, is_photo_icon: false  });
headList[18] = $H({ key: 'R', x: 255, y: 152, map: 'red', title: 'Bike Rentals', text: 'Enjoy a two-wheeled adventure and explore the island\'s nature trails.', has_video: true, is_photo_icon: false  });
headList[19] = $H({ key: 'S', x: 247, y: 145, map: 'red', title: 'Beach Sports', text: 'Tetherball, volleyball and soccer.', has_video: false, is_photo_icon: false  });
headList[20] = $H({ key: 'T', x: 236, y: 141, map: 'red', title: 'Spring-A-Leak', text: 'A large family water play area helps guests cool off while immersing them in watery fun.  A "splash pad" is the focal point. Shade is provided so adults can either relax and have a seat or join in the fun.', has_video: false, is_photo_icon: false  });
headList[21] = $H({ key: 'U', x: 172, y: 196, map: 'red', title: 'Beach Cabanas 1-17', text: 'Premium rental cabanas provide luxury and optional personalized services.', has_video: true, is_photo_icon: false  });
headList[22] = $H({ key: 'V', x: 84, y: 151, map: 'red', title: 'The Windsock Hut', text: 'Float rentals for the adults-only beach.', has_video: false, is_photo_icon: false  });
headList[23] = $H({ key: 'W', x: 91, y: 131, map: 'red', title: 'Massage Cabanas', text: 'Adults 18 years & older can indulge in a variety of singles and couples body treatments in the privacy of rustic beachside cabanas. ', has_video: true, is_photo_icon: false  });
headList[24] = $H({ key: 'X', x: 93, y: 111, map: 'red', title: 'Serenity Bay', text: 'Escape to this secluded adults only oasis where those 18 and older can unwind in true quietude.', has_video: true, is_photo_icon: false  });
headList[25] = $H({ key: 'Y', x: 108, y: 105, map: 'red', title: 'Beach Cabanas 18-21', text: 'Private rental cabanas exclusively for adults provide the ultimate in upscale seclusion on Serenity Bay Beach.', has_video: false, is_photo_icon: false  });
headList[26] = $H({ key: 'Z', x: 185, y: 67, map: 'red', title: 'Bike Trail & Observation Tower', text: 'Park your bike and climb the new observation tower for a breathtaking view of the island.', has_video: false, is_photo_icon: false  });
headList[27] = $H({ key: 'J2', x: 234, y: 168, map: 'red', title: '', old_title: 'Character Greetings', text: 'Throughout the day, meet and greet favorite Disney Characters on Castaway Cay.', has_video: false, is_photo_icon: false  });
headList[28] = $H({ key: 'K2', x: 235, y: 190, map: 'red', title: 'Castaway Family Beach 2', text: 'Enjoy pristine white sand, relax in the shade or take a dip in the lagoon.  The majority of the private beach cabanas dot this side of the Family Beach.', has_video: true, is_photo_icon: false  });
headList[29] = $H({ key: '01', x: 386, y: 139, map: 'blue', title: 'Pop\'s Props and Boat Repair', text: 'Enjoy meals from Cookie\'s BBQ in this outdoor eating area which also features a kids-only food line.', has_video: false, is_photo_icon: false  });
headList[30] = $H({ key: '02', x: 372, y: 135, map: 'blue', title: 'Dig In', text: 'Sit in this shaded eating area across from Monstro Point while delighting in goodies from Cookies BBQ.', has_video: false, is_photo_icon: false  });
headList[31] = $H({ key: '03', x: 357, y: 126, map: 'blue', title: 'Cookies BBQ', text: 'Bite into island grilled burgers, BBQ ribs, BBQ chicken, and other picnic fare served al fresco beside Castaway Family Beach.', has_video: false, is_photo_icon: false  });
headList[32] = $H({ key: '04', x: 351, y: 142, map: 'blue', title: 'Conched Out Bar', text: 'Sip draft beer, frozen specialty drinks, and cocktails with a delightful view of Castaway Family Beach.', has_video: false, is_photo_icon: false  });
headList[33] = $H({ key: '05a', x: 339, y: 127, map: 'blue', title: 'Outdoor & Covered Seating', text: 'Enjoy multiple outdoor and covered seating spaces throughout the island to savor a meal.', has_video: false, is_photo_icon: false  });
headList[34] = $H({ key: '05b', x: 222, y: 157, map: 'blue', title: 'Outdoor & Covered Seating', text: 'Enjoy multiple outdoor and covered seating spaces throughout the island to savor a meal.', has_video: false, is_photo_icon: false  });
headList[35] = $H({ key: '05c', x: 117, y: 150, map: 'blue', title: 'Outdoor & Covered Seating', text: 'Enjoy multiple outdoor and covered seating spaces throughout the island to savor a meal.', has_video: false, is_photo_icon: false  });
headList[36] = $H({ key: '06', x: 336, y: 136, map: 'blue', title: 'Gumbo Limbo', text: '', has_video: false, is_photo_icon: false  });
headList[37] = $H({ key: '07', x: 287, y: 177, map: 'blue', title: 'Heads Up Bar', text: 'Find frozen specialty drinks, cocktails, and beer on the pier overlooking the Swimming Lagoon.', has_video: false, is_photo_icon: false  });
headList[38] = $H({ key: '08', x: 236, y: 159, map: 'blue', title: 'Grouper', text: '', has_video: false, is_photo_icon: false  });
headList[39] = $H({ key: '09', x: 232, y: 178, map: 'blue', title: 'Sand Bar', text: 'Frozen specialty drinks, cocktails and beer', has_video: false, is_photo_icon: false  });
headList[40] = $H({ key: '10', x: 206, y: 167, map: 'blue', title: 'Cookie\'s Too BBQ', text: 'Lunch buffet serving all-you-care-to-eat barbeque, island spiced rotisserie chicken, burgers, grilled fish, fresh salads, flatbreads, ice cream, soda and more, in a covered pavilion steps from the Family Beach.', has_video: false, is_photo_icon: false  });
headList[41] = $H({ key: '11', x: 71, y: 150, map: 'blue', title: 'Castaway Air Bar', text: 'Offers frozen specialty drinks, cocktails, and beer for adults at Serenity Bay Beach. ', has_video: false, is_photo_icon: false  });
headList[42] = $H({ key: '12', x: 392, y: 150, map: 'purple', title: 'She Sells…and Everything Else', text: 'Buy exclusive Castaway Cay logo-ed merchandise and other souvenir items', has_video: true, is_photo_icon: false  });
headList[43] = $H({ key: '14', x: 267, y: 145, map: 'purple', title: 'Buy The Seashore', text: 'Find a variety of Castaway Cay-exclusive items along with towels, sunscreen and other beach essentials - a complement to the island\'s other merchandise location.', has_video: false, is_photo_icon: false  });
headList[44] = $H({ key: '15', x: 296, y: 139, map: 'purple', title: 'Bahamian Retail', text: 'Discover and buy finely made Bahamian arts and crafts at this noteworthy gift shop.', has_video: false, is_photo_icon: false  });
headList[45] = $H({ key: '16', x: 517, y: 136, map: 'orange', title: 'Kargo Handling Tram Stop', text: 'The tram stop nearest the Arrival Plaza', has_video: false, is_photo_icon: false   });
headList[46] = $H({ key: '17', x: 421, y: 127, map: 'orange', title: 'Scuttle\'s Cove Tram Stop', text: 'The tram stop for the kids\' area.', has_video: false, is_photo_icon: false   });
headList[47] = $H({ key: '18', x: 274, y: 136, map: 'orange', title: 'Pelican Point Tram Stop', text: 'The tram stop to transport you to Serenity Bay.', has_video: false, is_photo_icon: false  });
headList[48] = $H({ key: '19', x: 95, y: 145, map: 'orange', title: 'Serenity Bay Tram Stop', text: 'The tram stop for the adults-only area.', has_video: false, is_photo_icon: false   });
headList[49] = $H({ key: 'n16', x: 507, y: 142, map: 'all', title: 'Photo Op', text: 'Snap a funny photo as the catch of an oversized fish in a scene of "reel" reversal.', has_video: false, is_photo_icon: true   });
headList[50] = $H({ key: 'nG', x: 282, y: 169, map: 'all', title: 'Photo Op', text: 'Snap a photo of Mt. Rustmore featuring fun images of Mickey, Pluto, Donald, and Goofy.', has_video: false, is_photo_icon: true  });
headList[51] = $H({ key: 'nF', x: 414, y: 147, map: 'all', title: 'Photo Op', text: 'Snap a photo of Mt. Rustmore featuring fun images of Mickey, Pluto, Donald, and Goofy.', has_video: false, is_photo_icon: true   });

Event.observe(window, 'unload', function() {
	stopHideAllVideos();
});

Event.observe(window, 'load', function() {

	overlay_close();

	$('header').removeClassName('header_blue').removeClassName('header_orange').removeClassName('header_purple').removeClassName('header_red');

	Event.observe('mickeyRed', 'click', function(){
		$('header').removeClassName('header_blue').removeClassName('header_orange').removeClassName('header_purple').addClassName('header_red');
		change_map('red');
		add_ga_event('Maptype', 'Click', 'Attractions');
	});
	Event.observe('mickeyBlue', 'click', function(){
		$('header').addClassName('header_blue').removeClassName('header_orange').removeClassName('header_purple').removeClassName('header_red');
		change_map('blue');
		add_ga_event('Maptype', 'Click', 'Food & Beverage');
	});
	Event.observe('mickeyPurple', 'click', function(){
		$('header').removeClassName('header_blue').removeClassName('header_orange').addClassName('header_purple').removeClassName('header_red');
		change_map('purple');
		add_ga_event('Maptype', 'Click', 'Merchandise');
	});
	Event.observe('mickeyOrange', 'click', function(){
		$('header').removeClassName('header_blue').addClassName('header_orange').removeClassName('header_purple').removeClassName('header_red');
		change_map('orange');
		add_ga_event('Maptype', 'Click', 'Service (This & That)');
	});
	Event.observe('mickeyBrown', 'click', function(){
		$('header').removeClassName('header_blue').removeClassName('header_orange').removeClassName('header_purple').removeClassName('header_red');
		change_map('all');
		add_ga_event('Maptype', 'Click', 'All');
	});

	var header = $('header');
	headList.each(function(head, s){
		var title = head.get('title');
		var text = head.get('text');
		var key = head.get('key');
		if(title != '' && text != '' && typeof key != 'undefined') {
			var key = head.get('key');
			var map = head.get('map');
			var div_x = head.get('x') - 12;
			var div_y = head.get('y');
			var img_x = div_x - 94;
			var img_y = div_y - 94;
			var div_id = 'p' + key + '_div';
			var img_id = 'p' + key + '_img';
			var detailPicture_src = 'images/pictures/' + key + '.jpg';
			var is_photo_icon = head.get('is_photo_icon');
			var has_video = head.get('has_video');
			var div = new Element('div', { id: div_id, style: 'width: 8px; height: 8px; position: absolute; left: ' + div_x + 'px; top: ' + div_y + 'px;', 'class': 'head head-' + map });
			header.insert({top:div});
			if(!is_photo_icon && !isIphone()) {
				var img = new Element('img', { id: img_id, src: 'images/portholes/porthole_' + key + '.png', style: 'display: none; position: absolute; left: ' + img_x + 'px; top: ' + img_y + 'px; cursor: pointer; z-index: 200;'});
				header.insert({top:img});
			}
			$(div_id).observe('click', function(){
				stopHideAllVideos();
				if(!is_photo_icon) {
					if(map == current_map || current_map == 'all') {
						if(!isIphone()) {
							$(img_id).show();
						}
						$('postCardTitle').update(title);
						$('postCardText').update(text);
						$('detailPicture').src = detailPicture_src;
						if(has_video) {
							$('learnMore').show();
							removeVideo(current_video);
							current_video = 'v' + key;
							current_file = key;
							if(isIphone()) {
								addVideo(current_video, current_file);
								showVideo(current_video);
								playVideo(current_video);
							}
						} else {
							$('learnMore').hide();
						}
					}
				} else {
					$('postCardTitle').update(title);
					$('postCardText').update(text);
					$('detailPicture').src = detailPicture_src;
					$('learnMore').hide();
				}
				add_ga_event('Attractions', 'Click', title);
			});
			if(!is_photo_icon && !isIphone()) {
				$(img_id).observe('mouseout', function(){
					$(img_id).hide();
				});
			}
		}
	});

	Event.observe('overview', 'click', function(){
		var a = $('overview');
		stopHideAllVideos();
		var key = a.id;
		current_video = 'v' + key;
		current_file = key;
		addVideo(current_video, current_file);
		showVideo(current_video);
		playVideo(current_video);
		add_ga_event('Flag', 'Click', 'Overview');
	});

	Event.observe('island_history', 'click', function(){
		var a = $('island_history');
		stopHideAllVideos();
		var key = a.id;
		current_video = 'v' + key;
		current_file = key;
		addVideo(current_video, current_file);
		showVideo(current_video);
		playVideo(current_video);
		add_ga_event('Flag', 'Click', 'Island History');
	});

	Event.observe('whatsNew', 'click', function(){
		var a = $('whatsNew');
		stopHideAllVideos();
		var key = 'whatsnew';
		current_video = 'v' + key;
		current_file = key;
		addVideo(current_video, current_file);
		showVideo(current_video);
		playVideo(current_video);
		add_ga_event('Flag', 'Click', 'What\'s New');
	});

	$$('div.takeatourContainer ul li a').each(function(a){
		Event.observe(a, 'click', function(){
			stopHideAllVideos();
			a.up('li').addClassName('active');
			var key = a.id;
			if(key == 'whatsNewTicket') {
				key = 'whatsnew';
			}

			var title = key;
			switch(key) {
				case 'grand_tour':
					title = 'Grand Tour';
					break;
				case 'family_activities':
					title = 'Family Activities';
					break;
				case 'adult_activities':
					title = 'Adult Acitivities';
					break;
				case 'whatsnew':
					title = 'What\'s New';
					break;
				case 'youth_activities':
					title = 'Youth Activities';
					break;
			}

			current_video = 'v' + key;
			current_file = key;
			addVideo(current_video, current_file);
			showVideo(current_video);
			playVideo(current_video);
			add_ga_event('Tour', 'Click', title);
		});
	});

	if(isIphone()) {
		$('learnMore').hide();
	} else {
		Event.observe('learnMore', 'click', function(){
			addVideo(current_video, current_file);
			showVideo(current_video);
			playVideo(current_video);
			add_ga_event('Video', 'Click', current_file);
		});
	}
});
