$(function() {
	
$f("a.flowplayer", "layout/swf/flowplayer-3.1.5.swf", {

	
	// perform custom stuff before default click action
	onBeforeClick: function() {
		
		// unload previously loaded player
		$f().unload();
		
		// get wrapper element as jQuery object
		var wrap = $(this.getParent());
		
		// hide nested play button
		wrap.find("img").fadeOut();
		
		// start growing animation
		wrap.animate({width:495, height:287}, 500, function() {
		
			// when animation finishes we will load our player
			$f(this).load();
			
		});	
		
		// disable default click behaviour (player loading)
		return false; 
	}, 


	// unload action resumes to original state		
	onUnload: function() {
		$(this.getParent()).animate({width:190, height:150}, 500, function()  {
				
			// make play button visible again
			$(this).find("img").fadeIn();		
		});				
	}, 
	
	// when playback finishes perform our custom unload action
	onFinish: function() {
		this.unload();	
	},

plugins: {   
   
    // The controlbar is called "controls". By tweaking this, you can modify its look and feel   
    controls: {   
   
        // location of the controlbar plugin   
        url: 'layout/swf/flowplayer.controls-3.1.5.swf',   
   
        // display properties such as size, location and opacity     
        left: 0,   
        bottom: 0,   
        opacity: 0.95,   
   
        // styling properties (will be applied to all plugins)
        backgroundColor: '#666666',  
        backgroundGradient: 'none',    
        buttonColor: '#000000',  
        buttonOverColor: '#990000', 
   
        // controlbar specific settings   
        progressColor: '#f2b100', 
        bufferColor: '#cccccc',
        timeColor: '#cccccc',   
        all: false,   
        play: true,   
        scrubber: true,
        time: true,    
   
        // tooltips (since 3.1)   
        tooltips: {   
            buttons: true,  
            fullscreen: 'Enter fullscreen mode'   
        },
          
        tooltipColor: '#666666', 
        tooltipTextColor: '#cccccc' 
        
    } 
    
     
}
	
});


});
