function MoveVideoController(){

	var divvideo = document.getElementById("videocontainer");
	var x = (parseInt(screen.availWidth)-parseInt(divvideo.offsetWidth)) / 2;
	var y = (parseInt(screen.availHeight)-parseInt(divvideo.offsetHeight)) / 2;
	divvideo.style.top = parseInt(y-40);
	divvideo.style.left = parseInt(x);
	//divvideo.style.visibility = "visible";
	/*
	alert(divvideo.offsetWidth);
	alert(document.body.offsetWidth);
	alert(document.body.offsetHeight);
	*/
	//divvideo.top = 

}

function PlayVideo(file) {
	/*
	var divvideo = document.getElementById("videocontainer");
	var videobg = document.getElementById("videobg");
	videobg.style.display = "";
	alert(divvideo.style.offsetX);
	divvideo.style.visibility = "visible";
	var videoobject = document.getElementById("WMPlay");
	//videoobject.setAttribute("URL", "../documents/mediatar/"+file);
	  videoobject.setAttribute("URL", "http://www.tiszatv.hu/modules/onkormi.media.php"+file);
	*/
	window.open("http://www.tiszatv.hu/modules/onkormi.media.php?file="+file, "",  "width=500, height=500");
}

function CloseVideo() {

	var divvideo = document.getElementById("videocontainer");
	var videobg = document.getElementById("videobg");
	videobg.style.display = "none";
	divvideo.style.visibility = "hidden";
	var videoobject = document.getElementById("WMPlay");
	videoobject.setAttribute("URL", "");
}

function playVideoPublic(panelID, url, width, height, loop)
{
	/*
	var divvideo = document.getElementById("videocontainer");
	var panel = document.getElementById(panelID);
	divvideo.style.visibility = "visible";
  if (panel)
  {
    panel.innerHTML =
            "<object classid='CLSID:22d6f312-b0f6-11d0-94ab-0080c74c7e95' codebase='http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701'" +
            "height='" + height + "' standby='Loading Microsoft Windows Media Player components...'" +
            "type='application/x-oleobject' width='" + width + "'>" +
            "<param name='fileName' value='" + url + "' />" +
            "<param name='animationatStart' value='0' />" +
            "<param name='transparentatStart' value='1' />" +
            "<param name='autoStart' value='1' />" +
            "<param name='ShowControls' value='1' />" +
            "<param name='ShowDisplay' value='0' />" +
            "<param name='ShowStatusBar' value='1' />" +
            "<param name='loop' value='" + loop + "' />" +
                '<object type="video/x-ms-wmv" data="' + url + '"width="' + width + '" height="' + height + '">' +
                '<param name="src" value="' + url + '" />' +
                '<param name="autostart" value="true" />' +
                '<param name="controller" value="true" />' +
                '<param name="loop" value="' + loop + '" />' +
                '</object>'
            "</object>";
  }
  */
	urlarray = url.split("/");
	//alert(urlarray[urlarray.length - 1]);
	if(urlarray[urlarray.length - 1] != "") {
//  		window.open("media.php?file="+url, "",  "width=500, height=500");
  		window.open("http://www.tiszatv.hu/modules/onkormi.media.php?file="+url, "",  "width=500, height=500");
	}
}

function closeVideoPublic(panelID)
{
	var divvideo = document.getElementById("videocontainer");
	var panel = document.getElementById(panelID);
	divvideo.style.visibility = "hidden";
	  if (panel)
	  {
		panel.innerHTML = "";
	  }
} 
