$(function() { 
	if ((screen.width>=321) && (screen.height>=481)) {
	var video = document.getElementsByTagName("video")[0];
	var videoSrc = $('source').attr('src');
	var poster = $('video').attr('poster');
	var flash = $('<embed type="application/x-shockwave-flash" src="flash/player.swf" width="640" height="360" allowscriptaccess="always" allowfullscreen="true" wmode="transparent"/>').attr('flashvars', 'file='+videoSrc+'&image='+poster+'&stretching=fill');
	if ( !video.play ) { 
	$('video').replaceWith(flash); 
	}
	var quicktime = video.canPlayType("video/mp4");
	if (quicktime == "" in navigator.plugins){ 
	$('video').replaceWith(flash); }
		 if ( video.play ) { 
	video.addEventListener("play", function() { video.play(); }, true);
	video.addEventListener("pause", function() { video.pause(); }, true);
	video.addEventListener("canplaythrough", function() { video.play(); }, true);		
	}
	}
});
