var video='<object width="480" height="385"><param name="movie" value="{video_add}"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="{video_add}" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="480" height="385"></embed></object>';

function FGvideo(c)
{
	var v=video.replace(/{video_add}/gi,c);
	var bsg=document.getElementsByTagName("body")[0];
	var c1=document.createElement("div");
	var v1=document.createElement("div");
	var v2=document.createElement("div");
	c1.setAttribute("id","video_base");
	bsg.appendChild(c1);
	v1.setAttribute("id","video_cnt");
	c1.appendChild(v1);
	v2.setAttribute("id","video");
	v1.appendChild(v2);
	bsg.insertBefore(c1,bsg.firstChild);
	//c1.onclick=function(){closeall();}
	//v1.onclick=function(){closeall();}
	c1.style.width="100%";
	c1.style.height= getDocHeight()+"px";
	c1.style.position="absolute";
	//c1.style.backgroundColor="#999999";
	//c1.style.opacity = (50 / 100);
	//c1.style.MozOpacity = (50 / 100);
	//c1.style.KhtmlOpacity = (50 / 100);
	//c1.style.filter = "alpha(opacity=50)";
	v1.style.position="relative";
	v1.style.height="455px";
	v1.style.width="500px";
	v1.style.margin="0 auto";
	v1.style.top=parseInt(posTop()+20)+"px";
	v2.style.textAlign="center";
	v2.style.paddingTop="30px";
	c1.style.zIndex="1000";
	v2.innerHTML=v;
	v2.innerHTML+='<div id="close" style="background-color:#CCCCCC; width:480px; margin:0 auto; margin-top:5px;" onmouseover="this.style.backgroundColor=\'#666666\';" onmouseout="this.style.backgroundColor=\'#CCCCCC\';"><a href="javascript:closeall();" style="text-decoration:none; color:#000000; display:block;" onmouseover="this.style.color=\'#FFFFFF\';" onmouseout="this.style.color=\'#000000\';">Click to close</a></div>';
	window.onscroll=function(){v1.style.top=parseInt(posTop()+20)+"px";}
	return false;
}

function posTop() {return typeof window.pageYOffset!='undefined' ? window.pageYOffset:document.documentElement && document.documentElement.scrollTop? document.documentElement.scrollTop: document.body.scrollTop?document.body.scrollTop:0;}
function pageHeight() {return window.innerHeight!=null? window.innerHeight: document.documentElement && document.documentElement.clientHeight ? document.documentElement.clientHeight:document.body!=null? document.body.clientHeight:null;} 
function getDocHeight() {
    var D = document;
    return Math.max(
        Math.max(D.body.scrollHeight, D.documentElement.scrollHeight),
        Math.max(D.body.offsetHeight, D.documentElement.offsetHeight),
        Math.max(D.body.clientHeight, D.documentElement.clientHeight)
    );
}
function closeall()
{
	var bsg=document.getElementsByTagName("body")[0];
	var c1=document.getElementById("video_base");
	bsg.removeChild(c1);
}
