// JavaScript Document

	function thisMovie(movieName) {
        var isIE = navigator.appName.indexOf("Microsoft") != -1;
        return (isIE) ? window[movieName] : document[movieName];
    }
	
	function openVideo(MOVIE)
	{
		if(thisMovie("Encelium_homepage")) { thisMovie("Encelium_homepage").stopMovie(); }
		
		var d = document.createDocumentFragment();
		var b = document.createElement("div");
			b.style.width =  com.jchristy.Geometry.getInnerWidth() + "px";
			b.style.height = com.jchristy.Geometry.getInnerHeight() + "px";
			b.id = "videoback";
		
		var c = document.createElement("div");
			c.innerHTML =  '<p id="close"><a href="javascript:void(closeVideo());">[ Close ]</a></p>';
			c.style.left = (com.jchristy.Geometry.getInnerWidth() / 2 - 330) + "px";
			if (com.jchristy.Support.browser.name != "MSIE 6") c.style.top = (com.jchristy.Geometry.getInnerHeight() / 2 + 220 + 10) + "px";
			c.id = "closebutton";
			
		var i = document.createElement("iframe");
			i.frameBorder = 0;
			i.src = "/video/video-player.html?movie=" + MOVIE;
			i.style.left = (com.jchristy.Geometry.getInnerWidth() / 2 - 330) + "px";
			if (com.jchristy.Support.browser.name != "MSIE 6") i.style.top = (com.jchristy.Geometry.getInnerHeight() / 2 - 220) + "px";
			i.id = "flashmovie";
		
		d.appendChild(b);
		d.appendChild(c);
		d.appendChild(i);
			
		var bodyTag = document.getElementsByTagName("body");
		
		bodyTag[0].appendChild(d);
	}
	function closeVideo()
	{
		if(thisMovie("Encelium_homepage")) { thisMovie("Encelium_homepage").startMovie(); }
		
		var bodyTag = document.getElementsByTagName("body");
			bodyTag[0].removeChild(document.getElementById("videoback"));
			bodyTag[0].removeChild(document.getElementById("closebutton"));
			bodyTag[0].removeChild(document.getElementById("flashmovie"));
		
	}
