var winW = 630, winH = 460;
	function getWindowSize(){
		if (parseInt(navigator.appVersion)>3) {
		 if (navigator.appName=="Netscape") {
		  winW = window.innerWidth;
		  winH = window.innerHeight;
		 }
		 if (navigator.appName.indexOf("Microsoft")!=-1) {
		  winW = document.body.offsetWidth;
		  winH = document.body.offsetHeight;

		 }
		}
	}
//----------------------------------	
	function hide()
	{   
		document.getElementById('grayBG').style.display = 'none'; 
		document.getElementById('popup').style.display = 'none';
	}
//----------------------------------	
	function show()
	{
		getWindowSize();
		
		document.getElementById('grayBG').style.display = 'block';
		var popup = document.getElementById('popup');
		popup.style.display = 'block';
		popupW = popup.offsetWidth; 
		popupH = popup.offsetHeight;
		
		popup.style.left = (winW/2 - popupW/2)+"px" ;
		popup.style.top = "200px";
		
	}

//----------------------------------------------------------------------------

function GetXmlHttpObject()
{ 
	var objXMLHttp=null;
	
	if (window.XMLHttpRequest)
	{
		objXMLHttp=new XMLHttpRequest();
	}
	else if (window.ActiveXObject)
	{
		objXMLHttp=new ActiveXObject("Microsoft.XMLHTTP");
	}
	return objXMLHttp;
}
//--------------------------------------------------------------------------
function getRelevantVideoPlayer(name){
   
    xmlHttp=GetXmlHttpObject();
    if (xmlHttp)
    {
	
        var url="/video.php";
        parrams="name="+name;
        
        xmlHttp.onreadystatechange=getRelevantVideoPlayer_stateChanged;
        xmlHttp.open("POST",url,true);
        xmlHttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
        xmlHttp.setRequestHeader("Content-length", parrams.length);
        xmlHttp.setRequestHeader("Connection", "close");
        xmlHttp.send(parrams);
    }
    else
    {
        alert ("Browser does not support HTTP Request");
    } 
}
//#############################################
function getRelevantVideoPlayer_stateChanged()
{ 
    if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
    {   
        var player = xmlHttp.responseText;  

        document.getElementById("popup").innerHTML = player;
		show();
       
    }
}


