	// POPULATE TV TIMES IF AVAILABLE
	if (Times) {
		if (Times.tv.length >= 3) {
			showTimes(Times);
		}
	}
	
	var video_context = 'tournaments';
	
	// get tourn_id
	var tourn_id = '';
	var regex = new RegExp( "tournaments\/([a-z][0-9][0-9][0-9])" );
	var results = regex.exec( window.location.href );
	if (results){
		if (results.length >= 1) tourn_id = results[1];
	}	
	
	function roundTab (tab, pane) { this.tab = tab; this.pane = pane; }
	var tabs = new Array();
	tabs.push(new roundTab($('tourTournNav1'),$('tourTournGlance')) );
	tabs.push(new roundTab($('tourTournNav2'),$('tourTournVideo')) );
	tabs.push(new roundTab($('tourTournNav3'),$('tourTournPhotos')) );
	if ($('tourTournTickets') && $('tourTournNav4')) {
		tabs.push(new roundTab($('tourTournNav4'),$('tourTournTickets')) );
	}

	// SET CURRENT ROUND
	var currentRound;
	for (var t=0; t<=5; t++) {
		if ( !getElementByClass('tourPodHeader', 'div', e('tourTournGlance', 'round'+t)) ) {
			removeOption($('round'), t);
		} else {
			currentRound = t;
		}
	}
	if (currentRound) {
		selectOption($('round'), currentRound);
		roundSet(currentRound);
	} else {
		hide(tabs[1].tab); hide(tabs[1].pane); 
		hide(tabs[2].tab); hide(tabs[2].pane); 
	}
	
	// Triggered by Dropdown
	function roundChange() {
		currentRound = $('round').value;
		roundSet(currentRound);
	}
	
	// Function to change the current round
	function roundSet(r) {
		if (r > 5 || r < 0) return false;
		for (var t=0; t<=5; t++) {
			if (t==r) {
				show(e('tourTournGlance', 'round'+t));
			} else {
				hide(e('tourTournGlance', 'round'+t));
			}
		}
		openTab(0);
		
		// First check if assets exist
		if (window.Assets[r]) {
			if (Assets[r].videos.length > 0) {
				show(tabs[1].tab); show(tabs[1].pane); 
			} else {
				hide(tabs[1].tab); hide(tabs[1].pane); 
			}
			if (Assets[r].gallery.length > 0) {
				show(tabs[2].tab); show(tabs[2].pane); 
			} else {
				hide(tabs[2].tab); hide(tabs[2].pane); 
			}
		} else {
			hide(tabs[2].tab); hide(tabs[2].pane); 
			hide(tabs[1].tab); hide(tabs[1].pane); 
		}
	}
	
	// Meant for playing videos when a video window exists
	function play_video(video) {
		cvp_playVideo(video);
	}
	var tabsActive = true;
	function videoLoaded() { tabsActive = true; }
	
	var currentRoundVideo = 0;
	var currentRoundPhoto = 0;
	var playedVideoYet = false;

	// Open Tab function
	function openTab(t){
		if (!tabsActive) return false;
		for (var i=0;i<tabs.length;i++) {
			if (i==t) {
				tabs[i].tab.className = "tourTabNavItem TabNavactive";
				tabs[i].pane.className = "tourTournGlance show";
				tabs[i].tab.hideFocus = true;
				if (t==1) show(e('tourTournVideo','tourVideoContainer'));
				if (t==2) show(e('tourTournPhotos','tourPhotoContainer'));
			} else {
				tabs[i].tab.className = "tourTabNavItem";
				tabs[i].pane.className = "tourTournGlance hide";
				if (t!=1) hide(e('tourTournVideo','tourVideoContainer'));
				if (t!=2) hide(e('tourTournPhotos','tourPhotoContainer'));
			}
		}
			
		// IF VIDEO TAB, PLAY VIDEOS
		if (t==1) {
			$('tourVidDetailBlurb').update();	//clear the headline and description
			if (!playedVideoYet) {
				// FIRST TIME LOADING VIDEO
				currentRoundVideo = currentRound;
				getVideoThumbs(currentRoundVideo);
				playedVideoYet = true;
				playlist = Assets[currentRound].videos;
			} else if (playedVideoYet && currentRoundVideo != currentRound) {
				currentRoundVideo = currentRound;
				getVideoThumbs(currentRoundVideo);
				playlist = Assets[currentRoundVideo].videos;
			}
		}
		// IF PHOTOS TAB, SHOW PHOTOS
		if (t==2) {
			if (currentRoundPhoto != currentRound) {
				currentRoundPhoto = currentRound;
				if ( Assets[currentRound].gallery.length > 0 ) {
					$('photo_gallery').src = Assets[currentRound].gallery[0].url + '/include.html';
				}
			}
		}
	}

	// populate video thumbs
	function getVideoThumbs(r){
		tourLoadContent('video_thumbs_window', '/.element/ssi/auto/3.0/aps/sect/tournaments/'+tourn_id+'/round'+r+'.video_thumbs.html');
	}
	
	roundChange();