// JavaScript Document
$f("player", "/videos/flowplayer/flowplayer-3.2.2.swf", {
		
	 playlist: [
	
		// this first PNG clip works as a splash image
		{
			url: '/images/video-initial-img.png', 
			scaling: 'orig'
		},
		
		// second clip is a video. when autoPlay is set to false the splash screen will be shown
		{
			url: '/videos/commercial1.mp4', 
			autoPlay: false, 
			
			// video will be buffered when splash screen is visible
			autoBuffering: true 
		}
		]		
	/*clip: {

		// use baseUrl so we can play with shorter file names
		baseUrl: 'http://nccu.fasterproductions.com',

		// use first frame of the clip as a splash screen
		autoPlay: false,
		autoBuffering: true
	} */
});


// get all links that are inside div#clips
var links = document.getElementById("clips").getElementsByTagName("a");

// loop those links and alter their click behaviour
for (var i = 0; i < links.length; i++) {
	links[i].onclick = function() {
		
		// play the clip specified in href- attribute with Flowplayer
		$f().play(this.getAttribute("href", 2));
		
		// by returning false normal link behaviour is skipped
		return false;
	}
}

