StartInfos();

function StartInfos()
{
	setTimeout("GetVideoInfos()", 15000);
}

function GetVideoInfos()
{
	var objTitle = document.getElementById("VideoTitle");
	
	xhr = createXhrObject();
	if(xhr == null)
		return;

	xhr.onreadystatechange = function()
	{ 
		if(xhr.readyState == 4)
		{
			if(xhr.status == 200)
			{ 
				objTitle.innerHTML = xhr.responseText; 
				document.title = xhr.responseText; 
			}
		}
	} 
	
	xhr.open("GET", "info.php", true);                
	xhr.send(null);
	
	StartInfos();
}

function createXhrObject()
{
    if (window.XMLHttpRequest)
        return new XMLHttpRequest();
 
    if (window.ActiveXObject)
    {
        var names = [
            "Msxml2.XMLHTTP.6.0",
            "Msxml2.XMLHTTP.3.0",
            "Msxml2.XMLHTTP",
            "Microsoft.XMLHTTP"
        ];
        for(var i in names)
        {
            try{ return new ActiveXObject(names[i]); }
            catch(e){}
        }
    }

	return null;
}

