function renderVideo(video_id, video_width, video_height, mp4_file, webm_file, ogv_file, jpg_file) {
	var ua = navigator.userAgent.toLowerCase();
	
	if(ua.indexOf('android') != -1 || ua.indexOf('ipad') != -1 || ua.indexOf('iphone') != -1 || ua.indexOf('ipod') != -1) {
        
		function html_5_video_string() {
			var video_string = '';
			video_string += '<video id="' + video_id + '-object" width="' + video_width + '" height="' + video_height + '" controls="controls" preload="none">';
			video_string += '<source type=\'video/webm; codecs="vp8, vorbis"\' src="' + webm_file + '" />';
			video_string += '<source type=\'video/ogg; codecs="theora, vorbis"\' src="' + ogv_file + '" />';
			video_string += '<source type="video/mp4" src="' + mp4_file + '" />';
			video_string += '</video>';
			
			return video_string;
		}
		
		$('#'+video_id).html(html_5_video_string());

	} else {

        var flashvars = { file:mp4_file, image:jpg_file, autostart:'false' };
        var params = { allowfullscreen:'true', allowscriptaccess:'always', wmode:'opaque' };
        var attributes = { id: video_id + '-object', name: video_id + '-object'};
        swfobject.embedSWF('/jwplayer/player-licensed.swf', video_id, video_width, video_height, '9.0.115', 'false', flashvars, params, attributes);

	}
	
}                
