﻿// JScript File

var onClose = null;

function ShowVideo(videolink)
{
       var toplayer = document.getElementById("toplayer");
   	   var ivideo = document.getElementById("ivideo");
   	   toplayer.style.visibility="visible";
       ivideo.style.visibility="visible";
   	   toplayer.style.display="block";
       ivideo.style.display="block";       
       var iHeight = (document.height !== undefined) ? document.height : document.body.offsetHeight;
       var iWidth = (document.width !== undefined) ? document.width : document.body.offsetWidth;
        
       ivideo.style.position = "fixed";
       var winHeight;
       
        // the more standards compliant browsers (mozilla/netscape/opera/IE7) use window.innerWidth and window.innerHeight
         if (typeof window.innerWidth != 'undefined')
         {
              winHeight = window.innerHeight;
         }         
        // IE6 in standards compliant mode (i.e. with a valid doctype as the first line in the document)
         else if (typeof document.documentElement != 'undefined'
             && typeof document.documentElement.clientWidth !=
             'undefined' && document.documentElement.clientWidth != 0)
         {
               winHeight = document.documentElement.clientHeight;
         }
       
   	   toplayer.style.width=iWidth+"px";
   	   toplayer.style.height=iHeight+"px";
   	           
       ivideo.style.left = (iWidth/2 - 325)+"px";       
       ivideo.style.top = (winHeight/2 - 190/*document.body.scrollTop + 120*/)+"px";
        
//   	   toplayer.style.width=iWidth+"px";
//   	   toplayer.style.height=iHeight+"px";
//   	           
//       ivideo.style.left = (iWidth/2 - 370)+"px";
//       ivideo.style.top = (document.body.scrollTop+120)+"px";
       
       
       window.onresize = iVideoOnResize;
       document.getElementById("ivideoframe").src = "ivideo.aspx?videolink="+videolink;
}
  

  
function iVideoOnResize()
{
       var toplayer = document.getElementById("toplayer");
   	   var ivideo = document.getElementById("ivideo");
       var iHeight = (document.height !== undefined) ? document.height : document.body.offsetHeight;
       var iWidth = (document.width !== undefined) ? document.width : document.body.offsetWidth;
   	   
   	   ivideo.style.position = "fixed";
   	   var winHeight;
       
        // the more standards compliant browsers (mozilla/netscape/opera/IE7) use window.innerWidth and window.innerHeight
         if (typeof window.innerWidth != 'undefined')
         {
              winHeight = window.innerHeight;
         }         
        // IE6 in standards compliant mode (i.e. with a valid doctype as the first line in the document)
         else if (typeof document.documentElement != 'undefined'
             && typeof document.documentElement.clientWidth !=
             'undefined' && document.documentElement.clientWidth != 0)
         {
               winHeight = document.documentElement.clientHeight;
         }
   	   
   	   toplayer.style.width=iWidth+"px";
   	   toplayer.style.height=iHeight+"px";
       ivideo.style.left = (iWidth/2 - 325)+"px";
       ivideo.style.top = (winHeight/2 - 190)+"px";//"20px";
}  

function CloseVideo()
{
    document.getElementById("ivideoframe").src = "ivideodummy.aspx";     	
    var toplayer = document.getElementById("toplayer");
   	var ivideo = document.getElementById("ivideo");
   	toplayer.style.visibility="hidden"; 
    ivideo.style.visibility="hidden";  
    window.onresize = null;  	 
   	toplayer.style.display="none";
    ivideo.style.display="none";
    if (onClose != null)
    {
        onClose();
    }
}