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;}}

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.jpg";

    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();
}

function ie_play_video()
{}
function checkJsForPageReady(){return true;}
function ie_stop_video()
{swfobject.removeSWF("videoFallback");}
function ie_switch_video(vidPath)
{if(swfobject.hasFlashPlayerVersion("6")){var c=document.getElementById("videoFallback");if(!c){var d=document.createElement("div");d.setAttribute("id","videoFallback");document.getElementById("vid").appendChild(d);}
    var att = { data: "/Futureofwork/FOWVideos/fallbackVideo.swf", width: "800", height: "418" }; var par = { menu: "false", flashvars: "videoPath=" + vidPath + "/vid.mp4", wmode: "transparent" }; var id = "videoFallback"; swfobject.createSWF(att, par, id);
} 
}	
