	$(document).ready(function() {
		var html = '<div class="video-js-box" >'+
					'<video class="video-js" width="558" height="257" controls preload autoplay poster="video/index-test-poster.jpg">'+
					  '<source src="video/maa-intro.mp4" type=\'video/mp4; codecs="avc1.42E01E, mp4a.40.2"\' />'+
				      '<source src="video/maa-intro.ogg" type=\'video/ogg; codecs="theora, vorbis"\' />'+
				      '<object id="video" class="vjs-flash-fallback" width="558" height="257" type="application/x-shockwave-flash" data="http://releases.flowplayer.org/swf/flowplayer-3.2.7.swf" >'+
				        '<param name="movie" value="http://releases.flowplayer.org/swf/flowplayer-3.2.7.swf" />'+
				        '<param name="wmode" value="transparent">'+
				        '<param name="flashvars" value=\'config={"playlist":["http://www.midlandsairambulance.com/video/index-test-poster.jpg", {"url": "http://www.midlandsairambulance.com/video/maa-intro.flv?v=001","autoPlay":true,"autoBuffering":true}]}\' />'+
				        '<a href="http://get.adobe.com/flashplayer/" ><img src="video/noflash.jpg" width="558" height="257" alt="Poster Image" title="No video playback capabilities." /></a>'+
				      '</object>'+
				    '</video>'+
				   '</div';
				    $('div.video-js-box').replaceWith(html);
				    setTimeout(function() {
				    	VideoJS.setupAllWhenReady();
				    },100);
				    
		$('#tabs li a').featureList({
			output		: '#output li',
			start_item	: 0,
			transition_interval: 0
		});
		
		$('.not-video-tab').live('click', function() {
			if($.browser.msie && ($.browser.version=="7.0" || $.browser.version=="6.0")) {
				//var obj = swfobject.getObjectById("video");
				//obj.removeSWF();
			}
		});
		
		$('#video-tab').live('click', function() {
			
			setTimeout(function() {
				if($.browser.msie && ($.browser.version=="7.0" || $.browser.version=="6.0")) {
					VideoJS.setupAllWhenReady();
					//var obj = swfobject.getObjectById("video");
					//obj.embedSWF();
				}	
			},100);
		});
		
		setTimeout(function(){

			  var html = 
				  '<div class="video-js-box" >'+
				  '<!-- Using the Video for Everybody Embed Code http://camendesign.com/code/video_for_everybody -->'+
				    '<video class="video-js" width="558" height="257" controls preload poster="video/index-test-poster.jpg">'+
				      '<source src="video/MAA-video.mp4" type=\'video/mp4; codecs="avc1.42E01E, mp4a.40.2"\' />'+
				      '<source src="video/MAA-video.ogg" type=\'video/ogg; codecs="theora, vorbis"\' />'+
				      '<!-- Flash Fallback. Use any flash video player here. Make sure to keep the vjs-flash-fallback class. -->'+
				      '<object id="video" class="vjs-flash-fallback" width="558" height="257" type="application/x-shockwave-flash" data="http://releases.flowplayer.org/swf/flowplayer-3.2.7.swf">'+
				        '<param name="movie" value="http://releases.flowplayer.org/swf/flowplayer-3.2.7.swf" />'+
				        '<param name="wmode" value="transparent">'+
				        '<param name="flashvars" value=\'config={"playlist":["http://www.midlandsairambulance.com/video/index-test-poster.jpg", {"url": "http://www.midlandsairambulance.com/video/MAA-video.flv?v=002","autoPlay":false,"autoBuffering":false}]}\' />'+
				        '<!-- Image Fallback. Typically the same as the poster image. -->'+
				        '<a href="http://get.adobe.com/flashplayer/" ><img src="video/noflash.jpg" width="558" height="257" alt="Poster Image" title="No video playback capabilities." /></a>'+
				      '</object>'+
				    '</video>' +
				   '</div>';
				   $('div.video-js-box').replaceWith(html);
				   
				   setTimeout(function() {
					   VideoJS.setupAllWhenReady();
				   },100);
			},10000);
			
		// Add VideoJS to all video tags on the page when the DOM is ready
	    
	});
