$(function() {
	
	// setup player normally
	$f("b2bsilver", "/flowplayer/flowplayer-3.1.5.swf", {		
		plugins: { 
			controls: {
				backgroundColor: "#000000",
				backgroundGradient: "none",
				autoHide: "always",
				durationColor: "#ffffff",
				progressColor: "#333333",
				progressGradient: "low",
				bufferColor: "#ffffff",
				bufferGradient:	 "low",
				sliderColor: "#ffffff",	
				sliderGradient: "low",
				buttonColor: "#ffffff",
				buttonOverColor: "#ccccccc",
				height: 24,
				opacity: 0.6, 
				play:true, 
				volume:true, 
				mute:true, 
				time:false, 
				stop:false,
				fullscreen:true,
      			useNativeFullScreen: true
			}
		}, canvas: {
			backgroundColor: "#000000",
			backgroundGradient: "none"
		}, clip : {            
			autoPlay: true, 
			autoBuffering: true 
		}, playlist : [
			{	
				url: '/apex/2009apex/images/vantageplus1.jpg',
				thumbnail: '/apex/2009apex/images/vantageplus1thumb.jpg',
				scaling: 'fit',
				width: 720,
				height: 640,
				onBegin: function() {
					this.getPlugin("controls").css({ opacity: 0, cursor: 'default' });
					this.getPlugin("play").css({ opacity: 0, cursor: 'default' }); 
					this.imageLoaded = false; 
				}, 
				onCuepoint: [0, function(clip, cuepoint) { 
					if (!this.imageLoaded) { 
						this.getPlugin("loading").show(); 
						this.pause(); 
					} 
				}], 
				onBufferFull: function() { 
					if (this.getState() == 4) { 
						this.imageLoaded = true;
						this.getPlugin("loading").hide(); 
					} 
				}
			},
			{	
				url: '/apex/2009apex/images/vantageplus.jpg',
				thumbnail: '/apex/2009apex/images/vantageplusthumb.jpg',
				scaling: 'fit',
				width: 661,
				height: 257,
				onBegin: function() {
					this.getPlugin("controls").css({ opacity: 0, cursor: 'default' });
					this.getPlugin("play").css({ opacity: 0, cursor: 'default' }); 
					this.imageLoaded = false; 
				}, 
				onCuepoint: [0, function(clip, cuepoint) { 
					if (!this.imageLoaded) { 
						this.getPlugin("loading").show(); 
						this.pause(); 
					} 
				}], 
				onBufferFull: function() { 
					if (this.getState() == 4) { 
						this.imageLoaded = true;
						this.getPlugin("loading").hide(); 
					} 
				}
			}
	   ]
	});
	
	/*
		here comes the magic plugin. It uses first div.clips element as the 
		root for as playlist entries. loop parameter makes clips play
		from the beginning to the end.
	*/
	$f("b2bsilver").playlist("#b2bsilverclips.clips:first", {loop:false});
	
});

$(function() {
	
	// setup player normally
	$f("mcpgold", "/flowplayer/flowplayer-3.1.5.swf", {		
		plugins: { 
			controls: {
				backgroundColor: "#000000",
				backgroundGradient: "none",
				autoHide: "always",
				durationColor: "#ffffff",
				progressColor: "#333333",
				progressGradient: "low",
				bufferColor: "#ffffff",
				bufferGradient:	 "low",
				sliderColor: "#ffffff",	
				sliderGradient: "low",
				buttonColor: "#ffffff",
				buttonOverColor: "#ccccccc",
				height: 24,
				opacity: 0.6, 
				play:true, 
				volume:true, 
				mute:true, 
				time:false, 
				stop:false,
				fullscreen:true,
      			useNativeFullScreen: true
			}
		}, canvas: {
			backgroundColor: "#000000",
			backgroundGradient: "none"
		}, clip : {            
			autoPlay: true, 
			autoBuffering: true 
		}, playlist : [
			{	
				url: '/apex/2009apex/images/environmentallearning.jpg',
				thumbnail: '/apex/2009apex/images/environmentallearningthumb.jpg',
				scaling: 'fit',
				width: 716,
				height: 400,
				onBegin: function() {
					this.getPlugin("controls").css({ opacity: 0, cursor: 'default' });
					this.getPlugin("play").css({ opacity: 0, cursor: 'default' }); 
					this.imageLoaded = false; 
				}, 
				onCuepoint: [0, function(clip, cuepoint) { 
					if (!this.imageLoaded) { 
						this.getPlugin("loading").show(); 
						this.pause(); 
					} 
				}], 
				onBufferFull: function() { 
					if (this.getState() == 4) { 
						this.imageLoaded = true;
						this.getPlugin("loading").hide(); 
					} 
				}
			},
			{	
				url: '/apex/2009apex/images/environmentallearning1.jpg',
				thumbnail: '/apex/2009apex/images/environmentallearning1thumb.jpg',
				scaling: 'fit',
				width: 720,
				height: 442,
				onBegin: function() {
					this.getPlugin("controls").css({ opacity: 0, cursor: 'default' });
					this.getPlugin("play").css({ opacity: 0, cursor: 'default' }); 
					this.imageLoaded = false; 
				}, 
				onCuepoint: [0, function(clip, cuepoint) { 
					if (!this.imageLoaded) { 
						this.getPlugin("loading").show(); 
						this.pause(); 
					} 
				}], 
				onBufferFull: function() { 
					if (this.getState() == 4) { 
						this.imageLoaded = true;
						this.getPlugin("loading").hide(); 
					} 
				}
			},
			{	
				url: '/apex/2009apex/images/environmentallearning2.jpg',
				thumbnail: '/apex/2009apex/images/environmentallearning2thumb.jpg',
				scaling: 'fit',
				width: 720,
				height: 435,
				onBegin: function() {
					this.getPlugin("controls").css({ opacity: 0, cursor: 'default' });
					this.getPlugin("play").css({ opacity: 0, cursor: 'default' }); 
					this.imageLoaded = false; 
				}, 
				onCuepoint: [0, function(clip, cuepoint) { 
					if (!this.imageLoaded) { 
						this.getPlugin("loading").show(); 
						this.pause(); 
					} 
				}], 
				onBufferFull: function() { 
					if (this.getState() == 4) { 
						this.imageLoaded = true;
						this.getPlugin("loading").hide(); 
					} 
				}
			}
	   ]
	});
	
	/*
		here comes the magic plugin. It uses first div.clips element as the 
		root for as playlist entries. loop parameter makes clips play
		from the beginning to the end.
	*/
	$f("mcpgold").playlist("#mcpgoldclips.clips:first", {loop:false});
	
});

$(function() {
	
	// setup player normally
	$f("mcpsilver", "/flowplayer/flowplayer-3.1.5.swf", {		
		plugins: { 
			controls: {
				backgroundColor: "#000000",
				backgroundGradient: "none",
				autoHide: "always",
				durationColor: "#ffffff",
				progressColor: "#333333",
				progressGradient: "low",
				bufferColor: "#ffffff",
				bufferGradient:	 "low",
				sliderColor: "#ffffff",	
				sliderGradient: "low",
				buttonColor: "#ffffff",
				buttonOverColor: "#ccccccc",
				height: 24,
				opacity: 0.6, 
				play:true, 
				volume:true, 
				mute:true, 
				time:false, 
				stop:false,
				fullscreen:true,
      			useNativeFullScreen: true
			}
		}, canvas: {
			backgroundColor: "#000000",
			backgroundGradient: "none"
		}, clip : {            
			autoPlay: false, 
			autoBuffering: false 
		}, playlist : [
			{
				autoPlay: true,
				url: '/apex/2009apex/media/laketranpreview.jpg',
				width: 720,
				height: 405,
				onBegin: function() {
					this.getPlugin("controls").css({ opacity: 0, cursor: 'default' });
				}
			},
			{
				url: '/apex/2009apex/media/laketran.flv',
				width: 720,
				height: 405,
				onBegin: function() {
					this.getPlugin("controls").css({ opacity: .6, cursor: 'pointer', bottom: 0 });
					this.getPlugin("play").css({ opacity: .6, cursor: 'pointer' }); 
				}
			}
	   ]
	});
	
});
