/*
 * Pinesol.com FlowPlayer Video Parameters
 * Video: Pinesol Hear The Love Video 2009	
 * Updated: 7/21/2009
 * 
 */

$(document).ready(function(){

	$('a#video-player').flowplayer('/swf/flowplayer.commercial-3.0.7.swf',  { 
	
	<!-- Licences: Needed to remove Flowplayer logo from player  -->
	<!--	key: '@2dbd55033ec37efd8ed',  	pinesol.com Licence. Comment out when testing in Staging -->
		key: '#@2dbd55033ec37efd8ed',  		<!--staging.pinesol.com Licence. Comment out when going Live -->
	
		/* clip:{ 
			autoPlay: true  
		},*/											
	
		canvas: {backgroundColor: "#000000"},
	
		plugins: {
		   controls: {
		      volumeSliderColor: '#000000',
		      bufferGradient: 'none',
		      backgroundGradient: [0.6,0.3,0,0,0],
		      sliderColor: '#000000',
		      progressGradient: 'medium',
		      bufferColor: '#ede202',
		      tooltipTextColor: '#ffffff',
		      durationColor: '#e1e84f',
		      progressColor: '#043d00',
		      backgroundColor: '#1d8d07',
		      buttonOverColor: '#767b0a',
		      borderRadius: '25',
		      timeBgColor: '#555555',
		      sliderGradient: 'none',
		      tooltipColor: '#5F747C',
		      volumeSliderGradient: 'none',
		      timeColor: '#ecf349',
		      buttonColor: '#045315',
		      height: 24,
		      opacity: 1.0
		   }
		}						 
	});
	
	$('div#popupVideo').overlay({
		target: 'div#videoWrapper',
	
		// IE6/7 fix: in order to make video play and then stop playing inside
		// of an overlay in IE, we need to manually play & stop the flowplayer
		// using the onLoad & onClose handlers

		onLoad: function(content) {
			if (jQuery.browser.msie)
				$f('video-player').play();
		},
		
		onClose: function(content) {
			if (jQuery.browser.msie)
				$f('video-player').stop();
		}
	});
	
	$('div#popupPoll').overlay( {
		target: 'div#pollWrapper'
	});
	$('div#popupYoutube').overlay( {
		target: 'div#youtubeWrapper'
	});
});