jQuery.html5vids = ( (!jQuery.browser.msie && document.createElement( 'video' ).canPlayType( 'video/mp4' ) != '') ) ? true : false;

function videoSwap(selecta) {
		jQuery( selecta ).each( function()
		{
			id = jQuery( this ).attr( 'id' ) + '-flash';
			w = jQuery( this ).attr( 'width' );
			h = jQuery( this ).attr( 'height' );
			c = jQuery( this ).attr( 'class' );

			flashvars =
			{
				file: jQuery( this ).attr( 'src' ),
				id: id,
				controlbar: 'none',
				width: w,
				height: h,
				volume: '90',
				mute: false
			};
				
			if( jQuery( this ).attr( 'controls' ) && jQuery( this ).hasClass('ipadplay') != true )
				flashvars.controlbar = 'over';
				
			if( jQuery( this ).attr( 'poster' ) )
				flashvars.image = jQuery( this ).attr( 'poster' );
			
			params =
			{
				allowscriptaccess: 'always',
				allowfullscreen: 'true',
				wmode: 'transparent'
			};
			
			attributes =
			{
				id: id,
				name: id,
				styleclass: c
			};	
			
			
			
			swfobject.embedSWF( BD + '/js/player.swf', jQuery( this ).attr( 'id' ), w, h, '9', BD + '/js/express-install-flash.swf', flashvars, params, attributes );
		});
		
	}
	
var player;
function playerReady( obj ){ player = document.getElementById( obj['id'] ); }

jQuery(document).ready(function(){
	
	// Begin jQuery video loading scripts
	// This detects HTML 5

	if( !jQuery.html5vids )
	{
	videoSwap('video');
	}
	

	// End video initalisation script

});
