var isiPad = navigator.userAgent.match(/iPad/i) != null;

function createPlayer(file, image, w, h, tagID, auto_start) {
		auto_start = (typeof auto_start == 'undefined') ? false : auto_start;
		if(isiPad){
			play_ipad_video(file, image, w, h, tagID, auto_start);
			return true;
		}

	var flashvars = {
		file: file, 
		image: image,
		autostart: auto_start,
		frontcolor:"#ccffff",
		backcolor:"#666666",
		lightcolor:"#26abe4",
		showdigits:"total",
		fullscreen:"false",
		controlbar:"none",
		idlehide:"true",
		showicons:"true" 
	}
	var params = {
		allowfullscreen:"true", 
		allowscriptaccess:"always",
		wmode:"opaque"
	}
	var attributes = {
		id:"player1",  
		name:"player1"
	}
		swfobject.embedSWF("/js/DHXplayer/DHXplayer.swf", tagID, w, h, "9.0.115", "expressInstall.swf", flashvars, params, attributes);

}

function play_ipad_video(file, image, w, h, tagID, auto_start){
		
		iPadvideo='<video id="video"  controls="controls" width="'+w+'" height="'+h+'" poster=" '+image+' ">';
        iPadvideo+='<source src="'+file+'" type="video/mp4" />';
        iPadvideo+='</video>';
        document.getElementById(tagID).innerHTML=iPadvideo;

}	


