	
	
	function onYouTubePlayerReady(playerId) {
      var videoID = $('.videoHidden').val();
      ytplayer = document.getElementById("ytPlayer");
	  ytplayer.cueVideoById(videoID);
    }

      function playVideo() {
        if (ytplayer) {
          ytplayer.playVideo();
        }
      }
      
      function pauseVideo() {
        if (ytplayer) {
          ytplayer.pauseVideo();
        }
      }
      
      function muteVideo() {		  
        if(ytplayer.isMuted()) {
          ytplayer.unMute();
        }else{
          ytplayer.mute();
        }
      }

      function stopVideo() {
        if(ytplayer) {
          ytplayer.stopVideo();
        }
      }
		function loadVideo(IDVideo) {
		  //alert(IDVideo);
		  videoID = IDVideo;
 		  if(ytplayer) {
			ytplayer.cueVideoById(videoID);
		  }
		}	
		function loadPlayer() {
		
		// Lets Flash from another domain call JavaScript
		var params = { 
			allowScriptAccess: "always",
			wmode: "transparent" 		
		};
		// The element id of the Flash embed
		var atts = { id: "ytPlayer" };
	
        swfobject.embedSWF("http://www.youtube.com/apiplayer?" +
                           "&enablejsapi=1&playerapiid=player1", 
                           "videoDiv", "498", "297", "8", null, null, params, atts);
	}
      function _run() {
        loadPlayer();
      }
      google.setOnLoadCallback(_run);      // This function is automatically called by the player once it loads
	// All of the magic handled by SWFObject (http://code.google.com/p/swfobject/)
// JavaScript Document
