﻿//Javascript
function showPlayer(videoFile){
    videoFile="../Videos/"+videoFile;
    setOverlayHeight();
    var overlay=document.getElementById('overlay').style.display='block';
    document.getElementById('closeButton').style.display='block';
    document.getElementById('popupPlayer').style.display='block';
    playVideo(videoFile);
}
function hidePlayer(){
    document.getElementById('overlay').style.display='';
    document.getElementById('closeButton').style.display='';
    var popupPlayer = document.getElementById('popupPlayer');
    popupPlayer.style.display='';
    popupPlayer.innerHTML='';
}

function setOverlayHeight(){
    var scrHeight=getScreenHeight();
    contentHeight=document.getElementById('centeredContainer').offsetHeight;
    var overlay=document.getElementById('overlay');
    if(contentHeight>scrHeight){
        overlay.style.height=contentHeight+'px';
    }
}
function getScreenHeight(){
    scrHeight=0;
    if(typeof( window.innerWidth ) == 'number') {
        scrHeight = window.innerHeight;
    }else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
        scrHeight = document.documentElement.clientHeight;
    }else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
        scrHeight = document.body.clientHeight;
    }
    return scrHeight;
}
function playVideo(videoFile){
	var fo = new SWFObject("../Flash/FLVPlayer_Progressive.swf", "FLVPlayer", "427", "240", "8", "#ffffff");
	fo.addParam("quality", "high");
	fo.addParam("wmode", "transparent");
	fo.addParam("allowScriptAccess", "always");
	fo.addVariable("skinName","../Flash/Clear_Skin_1");
	fo.addVariable("streamName",videoFile);
	fo.addVariable("autoPlay","true");
	fo.addVariable("&MM_ComponentVersion","1");
	fo.write("popupPlayer");
}
