function play_video()
	{
	var agent = navigator.userAgent.toLowerCase();
	if ((agent.indexOf('iphone') || agent.indexOf('ipod') || agent.indexOf('ipad')) == -1){
	document.getElementById("vid").player.play();
	}
	} 

function stop_video()
	{
	var agent = navigator.userAgent.toLowerCase();
	if (agent.indexOf('iphone') == -1){
	document.getElementById("vid").player.pause();
	document.getElementById("vid").player.video.currentTime = 0;
	document.getElementById("vid").player.fullscreenOff();
	}
	}
	
function switch_video(vidPath)
	{
	var theVid = document.getElementById("vid");
	var agent = navigator.userAgent.toLowerCase();
	theVid.player.pause();
	document.getElementById("mp4source").src = vidPath + "vid.mp4";
	document.getElementById("m4vsource").src = vidPath + "vid.m4v";
	document.getElementById("ogvsource").src = vidPath + "vid.ogv";
	theVid.poster = vidPath + "vid.jpeg";
	if (theVid.canPlayType('video/ogg; codecs="theora"')) { theVid.src = vidPath + "vid.ogv"; }
    if (theVid.canPlayType('video/mp4; codecs="avc1.42E01E, mp4a.40.2"')) { theVid.src = vidPath + "vid.mp4"; }
	theVid.load();
	play_video();
	}
