
$(function() {
	
$f("a.player1", {
	src: '/scripts/flowplayer-3.1.5.swf', bgcolor:'#ebebeb', wmode: 'opaque',
     onFail: function() { 
	 	document.getElementById("row").style.display ='none';
    }

	
	
	
	}, {
		
	canvas: { 
        backgroundColor:'#ebebeb', 
		backgroundGradient: 'none' 
    },	  
	
	screen: { 
        height:323, 
        top:0         
    },

	plugins:  { 
		bwcheck: {  
		    url: '/scripts/flowplayer.bwcheck-3.1.3.swf',  
		    netConnectionUrl: '/scripts/bw-check.swf',
		    defaultBitrate: 500,
			//rememberBitrate: false,
		   bitrates: [500,1000],
			//bitrates: { low: 250, mid: 500, high: 1000 }, 
		     //{0} is filename, {1} is bitrate, {2} is extension
			
		     urlPattern: '{0}-{1}.{2}',
            onBwDone: function(url, chosenBitrate, bitrate) { 
				//alert("Your speed is: " +bitrate+ "\nVideo file served: " +url);
                //var el = document.getElementById("info"); 
                //el.innerHTML = "Your speed is: " +bitrate+ " Video file served: " +url; 
				x=1;
            } 

		},

   	 	controls: {             
       		backgroundGradient: 'none',
			backgroundColor: 'transparent',
			all:false,
			mute: false,
			autoHide: 'always'             
        }



	},

   clip: { 
	    //autoPlay: true,
		urlResolvers: 'bwcheck',
		autoBuffering: true,
		onBegin: function() {
			//alert("onBegin");	
		},
		onFinish: function() {
			//this.unload();	
		}

    },

	// 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:575, height:323}, 1000, 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		
	
	// when playback finishes perform our custom unload action
	onError: function() {
		alert(errorMessage);	
	}
});


//$f(0).load();



});


