// JScript File

function updateClock ( ) {
	var currentTime = new Date ( );

	//need to change this if statement so that it reflects the date of the comp
	if (currentTime.getDate ( ) < 21) {
	var currentHours = 24 - currentTime.getHours ( );
	var currentMinutes = 60 - currentTime.getMinutes ( );
	var currentSeconds = 60 - currentTime.getSeconds ( );
	
	// Pad the minutes and seconds with leading zeros, if required
	currentMinutes = ( currentMinutes < 10 ? "0" : "" ) + currentMinutes;
	currentSeconds = ( currentSeconds < 10 ? "0" : "" ) + currentSeconds;
	
	
	// Compose the string for display
	var currentTimeString = "Approximate time remaining: " + currentHours + ":" + currentMinutes + ":" + currentSeconds;
	
	// Update the time display
	document.getElementById("clock").firstChild.nodeValue = currentTimeString;
	}
}
  
function SwitchVideo(whichVideo) {
	if (whichVideo==1) {
		document.getElementById('framecontent').src="http://www.youtube.com/v/29dlJCjmF5Y?fs=1&amp;hl=en_US";
		document.getElementById('frametitle').textContent="Character Creation";
		document.getElementById('frametext').textContent="This video tutorial will help you to create and customize a new character.";
	}
	if (whichVideo==2) {
		document.getElementById('framecontent').src="http://www.youtube.com/v/DhXsHUvM9bs?fs=1&amp;hl=en_US";
		document.getElementById('frametitle').textContent="Main Menu";
		document.getElementById('frametext').textContent="This video tutorial introduces new players to the main menu.";
	}
	if (whichVideo==3) {
		document.getElementById('framecontent').src="http://www.youtube.com/v/y5aBghpUfVY?fs=1&amp;hl=en_US";
		document.getElementById('frametitle').textContent="Saving and Deleting";
		document.getElementById('frametext').textContent="This video tutorial shows the basics for saving and deleting your character.";
	}
	if (whichVideo==4) {
		document.getElementById('framecontent').src="http://www.youtube.com/v/zDLnZP-tPjE?fs=1&amp;hl=en_US";
		document.getElementById('frametitle').textContent="Managing Your Gear";
		document.getElementById('frametext').textContent="This video tutorial gives you a detailed look at the gear management section of the main menu.";
	}
	if (whichVideo==5) {
		document.getElementById('framecontent').src="http://www.youtube.com/v/B2e-wjHHIKw?fs=1&amp;hl=en_US";
		document.getElementById('frametitle').textContent="Managing Your Character";
		document.getElementById('frametext').textContent="This video tutorial gives you a detailed look at the character profile section of the main menu.";
	}
	if (whichVideo==6) {
		document.getElementById('framecontent').src="http://www.youtube.com/v/yxQxTGy7a3M?hl=en&fs=1";
		document.getElementById('frametitle').textContent="Talking to Other Characters";
		document.getElementById('frametext').textContent="This brief tutorial explains how to talk to other non-player characters.";
	}
	if (whichVideo==7) {
		document.getElementById('framecontent').src="http://www.youtube.com/v/pe4VRVWqB58?hl=en&fs=1";
		document.getElementById('frametitle').textContent="Skills Menu";
		document.getElementById('frametext').textContent="This tutorial explains the importance of skills and how to access your skills menu.";
	}
	if (whichVideo==8) {
		document.getElementById('framecontent').src="http://www.youtube.com/v/jWjdm4Ajlxk?fs=1&amp;hl=en_US";
		document.getElementById('frametitle').textContent="The Previewer";
		document.getElementById('frametext').textContent="This tutorial gives you a detailed look at the previewer and explains how to use it.";
	}
	if (whichVideo==9) {
		document.getElementById('framecontent').src="http://www.youtube.com/v/EsnN2pa9OSA?fs=1&amp;hl=en_US";
		document.getElementById('frametitle').textContent="Groundschool";
		document.getElementById('frametext').textContent="This tutorial explains some of the things you should know before you leave the ground.";
	}
	if (whichVideo==10) {
		document.getElementById('framecontent').src="http://www.youtube.com/v/9u3UpiyB_Ik?hl=en&fs=1";
		document.getElementById('frametitle').textContent="Leaving the Ground";
		document.getElementById('frametext').textContent="This video shows you the basics for starting a climb.";
	}
	if (whichVideo==11) {
		document.getElementById('framecontent').src="http://www.youtube.com/v/qjKcnqUT9ew?hl=en&fs=1";
		document.getElementById('frametitle').textContent="Placing Gear";
		document.getElementById('frametext').textContent="This tutorial explains how to place gear to protect yourself while you climb.";
	}
	if (whichVideo==12) {
		document.getElementById('framecontent').src="http://www.youtube.com/v/WvWDp76EUsg?hl=en&fs=1";
		document.getElementById('frametitle').textContent="Resting and Chalking";
		document.getElementById('frametext').textContent="This video explains how to regain energy and grip by making use of rests and chalking up.";
	}
	if (whichVideo==13) {
		document.getElementById('framecontent').src="http://www.youtube.com/v/bPv-TSgBLbw?hl=en&fs=1";
		document.getElementById('frametitle').textContent="Cruxes";
		document.getElementById('frametext').textContent="This tutorial gives a brief overview of the basic crux types in the game.";
	}
}
