var ventanas = new Array();
ventanas.push("player");

function iecompattest(){
	return (!window.opera && document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body
}

function centerPlayer(tipo) {

	var ie5=document.all&&document.getElementById
	var ns6=document.getElementById&&!document.all
	
	var winWidth = ns6? window.innerWidth-40 : iecompattest().clientWidth - 40;
	var winHeight = ns6? window.innerHeight-40 : iecompattest().clientHeight - 40;	
	
	if (arguments.length > 1) {
		if (arguments[1] != undefined) {
			var scrollY = arguments[1];
		} else {
			var scrollY = 0;
		}
		if (arguments[2] != undefined) {
			var scrollX = arguments[2];
		} else {
			var scrollX = 0;
		}
	} else {
		var scrollY = 0;
		var scrollX = 0;
	}
	
	for (var i = 0; i < ventanas.length; i++) {
		
		var nome = ventanas[i]; 
		
		var popupWidth	= document.getElementById(nome).style.width;	
		var popupWidth	= popupWidth.substr(0,popupWidth.length-2);
		
		var popupHeight 	= document.getElementById(nome).style.height;	
		var popupHeight	= popupHeight.substr(0,popupHeight.length-2);
		
		var winX = Math.ceil((winWidth - popupWidth) / 2);
		var winY = Math.ceil((winHeight - popupHeight) / 2);
		
	
		// POPUP
		winX = (winX - scrollX - ((tipo == "home") ? 293 : 10));
		winY = ((tipo == "home") ? 0 - scrollY : winY - scrollY + 10 );

		document.getElementById(nome).style.left =  winX + 'px';
		document.getElementById(nome).style.top = winY + 'px';
		document.getElementById(nome).style.visibility = "visible";
		
	}

}
function resizeBrowser(x,y)
{
	var locationFrame =  window.ConteudoSite.location;
	centerPlayer("home",y,x);

}
