// JavaScript Document
// Flowplayer configuration (less buttons and wicked background color) 
var playerConfig = { 
   controlBarBackgroundColor: '0x99cddc', 
   initialScale:'scale', 
   showMenu:false, 
   showVolumeSlider:false, 
   showMuteVolumeButton:false, 
   showFullScreenButton:false, 
   controlBarGloss:'high' 
} 
  
 
window.onload = function() { 
 
   // variable that holds the player API. it is initially null 
   var flowplayer = null;  
    
   /************* THE PLAYLIST ***************/ 
    
   // loop all links within DIV#playlist and customize their onClick event  
   var links = document.getElementById("playlist").getElementsByTagName("a");  
    
   for (var i = 0; i < links.length; i++) { 
 
      links[i].onclick = function() {  
    
         /* 
          * set links href attribute as the videoFile property in our  
          * configuration. of cource you can modify other properties as well 
          */ 
         playerConfig.videoFile = this.getAttribute("href"); 
          
         // if flowplayer is not loaded. load it now. 
         if (flowplayer == null) { 
          
            // create Flowplayer instance into DIV element whose id="player" 
            // Flash API is automatically returned (flashembed.js ver. 0.27) 
            flowplayer = flashembed("player",  
               {src:"FlowPlayerLight.swf",width: '180', height: '179', bgcolor:'#6F7485'},  
                
               // supply our (modified) configuration to the player 
               {config: playerConfig} 
            );  
             
         // flowplayer is already loaded - now we simply call setConfig() 
         } else {     
            flowplayer.setConfig(playerConfig);  
         } 
          
         // disable link's default behaviour 
         return false;  
      }      
   } 
    
   // when user presses splash image it triggers our first playlist entry 
   document.getElementById("splash").onclick = function()  { 
      links[0].onclick(); 
   } 
    
}