function submitMessage(id) {
	document.formMessage.action = id;
	document.formMessage.submit();	
}

function ModifMixFinal(id, type) {
	if (type == 'add') {
		submitMessage('index.php?page=JamOnline&code=addtopic&MixF=' + id);
	}
	if (type == 'edit') {
		submitMessage('index.php?page=JamOnline&code=edittopic&MixF=' + id);
	}
}

function ErreurToLoading() {
	//document.getElementById('erreur').style.display='none';	
	document.getElementById('loading').style.display='block';
}


function addListeVideo() {
	if(document.getElementById('listeVideoNom').value != "") {
		document.getElementById('soumettreListeVideo').submit();
	}else{
		document.getElementById('listeVideoNom').focus();
	}	
}




/* CHROMLESS VIDEO YOUTUBE */

function updateHTML(elmId, value) {
          document.getElementById(elmId).innerHTML = value;
        }

        function setytplayerState(newState) {
          updateHTML("playerstate", newState);
        }

        function onytplayerStateChange(newState) {
          setytplayerState(newState);
        }

        function updateytplayerInfo() {
          /*updateHTML("bytesloaded", getBytesLoaded());
          updateHTML("bytestotal", getBytesTotal());
          updateHTML("videoduration", getDuration());
          updateHTML("videotime", getCurrentTime());
          updateHTML("startbytes", getStartBytes());
          updateHTML("volume", getVolume());*/
        }

        // functions for the api calls
        function loadNewVideo(id, startSeconds) {
          if (ytplayer) {
            ytplayer.loadVideoById(id, parseInt(startSeconds));
          }
        }

        function cueNewVideo(id, startSeconds) {
          if (ytplayer) {
            ytplayer.cueVideoById(id, startSeconds);
          }
        }
      

        function stop() {
          if (ytplayer) {
            ytplayer.stopVideo();
          }
        }

        function getPlayerState() {
          if (ytplayer) {
            return ytplayer.getPlayerState();
          }
        }


        function getBytesLoaded() {
          if (ytplayer) {
            return ytplayer.getVideoBytesLoaded();
          }
        }

        function getBytesTotal() {
          if (ytplayer) {
            return ytplayer.getVideoBytesTotal();
          }
        }

        function seekTo(seconds) {
	      if (ytplayer) {
	            ytplayer.seekTo(seconds, true);
	      }
	    }
			
		function getDuration() {
	      if (ytplayer) {
	        return ytplayer.getDuration();
	      }
	    }
			
		function getCurrentTime() {
	      if (ytplayer) {
	         return ytplayer.getCurrentTime();
	      }
	    }

        function getStartBytes() {
          if (ytplayer) {
            return ytplayer.getVideoStartBytes();
          }
        }

        function mute() {
          if (ytplayer) {
            ytplayer.mute();
          }
        }

        function unMute() {
          if (ytplayer) {
            ytplayer.unMute();
          }
        }
        
        function getEmbedCode() {
          alert(ytplayer.getVideoEmbedCode());
        }

        function getVideoUrl() {
          alert(ytplayer.getVideoUrl());
        }
        
        function setVolume(newVolume) {
          if (ytplayer) {
            ytplayer.setVolume(newVolume);
          }
        }

        function getVolume() {
          if (ytplayer) {
            return ytplayer.getVolume();
          }
        }

        function clearVideo() {
          if (ytplayer) {
            ytplayer.clearVideo();
          }
        }
