
var playerConfig = {
   controlBarBackgroundColor: '0x99cddc',
   initialScale:'scale',
   loop:false,
   streamingServer: 'lighttpd'
 
};
 
window.onload = function() { 

	try{
   var flowplayer = null;
   var links = document.getElementById("playlist").getElementsByTagName("a"); 
	

	links[links.length] = document.getElementById("principal_spot");

   var i=0;
   var num_i_a=0;
   num_i_a=links.length;
   num_i_a++;
   for (i=0;i<num_i_a;i++) {

      links[i].onclick = function() { 

			para1 = this.getAttribute("rel");
			para1= dame_ruta(para1);
			para2 = this.getAttribute("rev");
			para3 = this.getAttribute("title");

			playerConfig.playList= [ { url: para1, overlay: para2 ,suggestedClipsInfoUrl: '<?php echo "http://".$_SERVER["SERVER_NAME"]."/media/suggestions/"?>'+para3  } ];

			if (flowplayer == null) {
				flowplayer = flashembed("player", 
					{src:"/files/videos/FlowPlayerLight.swf",    height:250,  width:"100%"
}, 
					{config: playerConfig}
				);	
				
			} else {  
				flowplayer.setConfig(playerConfig); 
			}
			return false; 
      }     
   }
	
	document.getElementById("player").onclick = function()  {
		links[0].onclick();
	} 
	
	//links[0].onclick();
}catch(e){};	

}



