﻿
	
		var flashvars = {};
		var params = {
			menu: "false",
			allowScriptAccess: "always",
			scale: "noscale"
		};
		var attributes = {};
	
		swfobject.embedSWF("youtubeplayer.swf", "flashcontent", "760", "430", "9.0.0", "assets/swf/expressInstall.swf", flashvars, params, attributes);
		
		//init the youTubeLoader javascript methods
		SWFID = "flashcontent"
			
	</script>
	<script type="text/javascript">
		
		// Big thanks to Google, Lisa Larson-Kelley @ flashconnections.com and the FlashCodersNY.org list for establishing the javascript demo foundation.
		
		function updateHTML(elmId, value) {
          document.getElementById(elmId).innerHTML = value;
        }

        function setytplayerState(newState) {
          updateHTML("playerstate", newState);
        }

		// PLEASE NOTE: For the purpose of this demo:
		// This method is called from the onYouTubePlayerReady method inside _assets/js/youTubeLoader.js
        function secondaryOnYouTubePlayerReady(playerId) {
          ytplayer = document.getElementById(SWFID);
          setInterval(updateytplayerInfo, 250);
          updateytplayerInfo();
          ytplayer.addEventListener("onStateChange", "onytplayerStateChange");
        }

		// PLEASE NOTE: For the purpose of this:
		// This method is called from the onytplayerStateChange method inside _assets/js/youTubeLoader.js
        function secondaryOnytplayerStateChange(newState) {
          setytplayerState(newState);
        }

        function updateytplayerInfo() {
          updateHTML("bytesloaded", getBytesLoaded());
          updateHTML("bytestotal", getBytesTotal());
          updateHTML("videoduration", getDuration());
          updateHTML("videotime", getCurrentTime());
          updateHTML("startbytes", getStartBytes());
          updateHTML("volume", getVolume());
        }
		
		function alertEmbed () {
			alert( getEmbedCode() );
		}
		
		function alertVideoUrl () {
			alert( getVideoUrl() );
		}
		
		function unloadVideo () {
			stop();
			clearVideo();
		}
			
	
