/* 
		MIIKE VIDEO PLAYER - COPYRIGHT MIIKE.CO.UK 
	 	ALL RIGHTS RESERVED 2006-2011
	 	EXTENDED LICENCEE: ANGEL BUSINESS COMMUNICATIONS
*/


											/* buttons */
											
											function doPlay(){
                      
                       				// do the playing call
                       				player.sendEvent('PLAY');
                       				// change the button
                       				document.getElementById("play_control").innerHTML="<img onclick=\"doPause();\" oncontextmenu=\"return false;\"  class=\"playerButton\" src=\"/siteContent/images/player_pause.png\" border=\"0\"/>";   // the img may have to be in divs to replace the onclick function also in one tag
                      
                      }
                      function doPause(){
                      
                       				// do the pause call
                       				player.sendEvent('PLAY');
                       				// change the button
                       				document.getElementById("play_control").innerHTML="<img onclick=\"doPlay();\" oncontextmenu=\"return false;\"  class=\"playerButton\" src=\"/siteContent/images/player_play.png\" border=\"0\"/>";   // the img may have to be in divs to replace the onclick function also in one tag
                      
                      }
                      function doStop(){
                       				player.sendEvent('STOP');
                       				// change the button
                       				document.getElementById("play_control").innerHTML="<img onclick=\"doPlay();\" oncontextmenu=\"return false;\"  class=\"playerButton\" src=\"/siteContent/images/player_play.png\" border=\"0\"/>";   // the img may have to be in divs to replace the onclick function also in one tag
                      
                       				
                       				
                      }
                      function showPlaylist(){
                              document.getElementById("thePlaylist").style.display="block";
                              document.getElementById("playlist_control").innerHTML="<img onclick=\"hidePlaylist();\" title=\"Hide playlist\" oncontextmenu=\"return false;\" class=\"playerButton\" src=\"/siteContent/images/player_playlist.png\" border=\"0\"/>";
                      }
                      function hidePlaylist(){
                              document.getElementById("thePlaylist").style.display="none";
                              document.getElementById("playlist_control").innerHTML="<img onclick=\"showPlaylist();\" title=\"Show playlist\" oncontextmenu=\"return false;\" class=\"playerButton\" src=\"/siteContent/images/player_playlist.png\" border=\"0\"/>";
                      }
                      function doNext(){
                              player.sendEvent('NEXT');
                              
                              superNext();
                              
                              /*
                              var currentVideo=document.getElementById("theCurrentVideo").value;
                              
                              currentVideo++;
                             
														  /////////////////////////////////////////////////////////
														  // some adaptation required here for dynamical videos
														  /////////////////////////////////////////////////////////
														  
                                if(currentVideo>4){
                                	var currentVideo=0;
                              }
                              
                             
                              
															document.getElementById("plVideo0").className="sidePlaylistItem";
														  document.getElementById("plVideo1").className="sidePlaylistItem";
														  document.getElementById("plVideo2").className="sidePlaylistItem";
														  document.getElementById("plVideo3").className="sidePlaylistItem";
														  document.getElementById("plVideo4").className="sidePlaylistItem";

														 	document.getElementById("plVideo"+currentVideo).className="sidePlaylistItemSelected";
														 	
														 	document.getElementById("theCurrentVideo").value=currentVideo;
                              */
                              
                      }
                      function doPrev(){
                              player.sendEvent('PREV');
                              
                              superPrev();
                              
                              
                              /*
                              var currentVideo=document.getElementById("theCurrentVideo").value;
                              
                              currentVideo--;
                              
                              
                              /////////////////////////////////////////////////////////
														  // some adaptation required here for dynamical videos
														  /////////////////////////////////////////////////////////
                              
                              if(currentVideo<0){
                                	var currentVideo=4;
                              }
                            
                              
															document.getElementById("plVideo0").className="sidePlaylistItem";
														  document.getElementById("plVideo1").className="sidePlaylistItem";
														  document.getElementById("plVideo2").className="sidePlaylistItem";
														  document.getElementById("plVideo3").className="sidePlaylistItem";
														  document.getElementById("plVideo4").className="sidePlaylistItem";

														 	document.getElementById("plVideo"+currentVideo).className="sidePlaylistItemSelected";
														 	
														 	document.getElementById("theCurrentVideo").value=currentVideo;
                              */
                              
                      }
                      function doVolumeUp(){
                              player.sendEvent('VOLUME', currentVolume+10);
                      }
                      function doVolumeDown(){
                       	      player.sendEvent('VOLUME', currentVolume-10);
                      }
                      function doMute(){
                       				player.sendEvent('MUTE');
                      }
                      function doFastForward(){
                              player.sendEvent('SEEK', currentPosition+5);
                      }
                      function doRewind(){
                              player.sendEvent('SEEK', currentPosition-5);
                      }
                      function gotoVideo(videoID){
                       			 
														 	player.sendEvent('ITEM',videoID);

															/* this below also needs scaling like the above 2 funcitons superNext and superPrev */

														  document.getElementById("plVideo0").className="sidePlaylistItem";
														  document.getElementById("plVideo1").className="sidePlaylistItem";
														  document.getElementById("plVideo2").className="sidePlaylistItem";
														  document.getElementById("plVideo3").className="sidePlaylistItem";
														  document.getElementById("plVideo4").className="sidePlaylistItem";

														 	document.getElementById("plVideo"+videoID).className="sidePlaylistItemSelected";
														 	
														 	document.getElementById("theCurrentVideo").value=videoID;
	
                      }
                      function setThumbBorder(videoID){
                       			document.getElementById("thumb"+videoID).style.borderColor="#a9cc47";
                      }
                      function doFullScreen(){
                      		player.sendEvent('fullscreen');
                      }
                      
                      function rightclickbutton(){
                       				alert("(C) Copyright 2011\n\nAngel Business Communications Video Player\n\nAuthor: Mike Hewitt\nVersion: 1.3\nWebsite: www.angelbc.com");
                      }
                
                      

                      
                      
                      
                      
