
function popVideo(vid,vidURL) {
	// This function accepts a division ID (vid), either a string or the actual
	// object itself. vid is mandatory. 

	if (typeof(vid)=="string") { vid=document.getElementById(vid); vidURL=document.getElementById(vidURL); }
	if (vid&&typeof(vid)=="object") {
	// Make the video visible and set the zindex so its on top of everything else

	vid.style.zIndex='100'; 
	vid.style.display='inline';
	vidURL.style.display='none';
	var scrollTop = 0;
	if (document.documentElement && document.documentElement.scrollTop){
		scrollTop = document.documentElement.scrollTop;
	} else if (document.body){
		scrollTop = document.body.scrollTop;
	}
	// set the starting x and y position of the video
	vid.style.top=scrollTop+Math.floor((document.documentElement.clientHeight/2)-(vid.offsetHeight/2))+'px';
	vid.style.left=Math.floor((document.documentElement.clientWidth/2)-(vid.offsetWidth/2))+'px';
	}
return false;
}

function closeVideo(vid,vidURL) {
	// This function accepts a division ID (vid), either a string or the actual
	// object itself. vid is mandatory. 

//	if ((isplaying==vid)||(/^close$/i.test(vid))) { return false; }

	if (typeof(vid)=="string") { vid=document.getElementById(vid);vidURL=document.getElementById(vidURL); }
	if (vid&&typeof(vid)=="object") {
	// Make the video visible and set the zindex so its on top of everything else

	vid.style.zIndex='100'; 
	vid.style.display='none';
	vidURL.style.display="inline";
	var tmp=vid.innerHTML;
	vid.innerHTML='';
	vid.style.display='none';
	vid.innerHTML=tmp;

	var scrollTop = 0;
	if (document.documentElement && document.documentElement.scrollTop){
		scrollTop = document.documentElement.scrollTop;
	} else if (document.body){
		scrollTop = document.body.scrollTop;
	}
	// set the starting x and y position of the video
	vid.style.top=scrollTop+Math.floor((document.documentElement.clientHeight/2)-(vid.offsetHeight/2))+'px';
	vid.style.left=Math.floor((document.documentElement.clientWidth/2)-(vid.offsetWidth/2))+'px';
	}
return false;
}
