function abrePopup(url, w, h, nombre) {
	
	if (screen.availWidth && screen.availHeight) {

		if (w > screen.availWidth) {
			w = screen.availWidth;
		}

		if (h > screen.availHeight) {
			h = screen.availHeight;
		}
		
		var x = Math.round(screen.availWidth/2 - w/2);
		var y = Math.round(screen.availHeight/2 - h/2);
		
	} else if (screen.width && screen.height) {

		if (w > screen.width) {
			w = screen.width;
		}

		if (h > screen.height) {
			h = screen.height;
		}		
		
		var x = Math.round(screen.width/2 - w/2);
		var y = Math.round(screen.height/2 - h/2);
		
	} else {
		var x = y = 0;
	}
	
	if (!nombre) {
		nombre =  'popup' + Math.round(Math.random() * 100000)
	}
	
	return (window.open(url, nombre, 'width=' + w + ',height=' + h + ', left=' + x + ',top=' + y + ',scrollbars=1'));
}

function abreReproductor() {
	var rep = abrePopup('reproductor.html', 320, 70, 'reproductor');
	window.focus();
	rep.opener.focus();
}

function abreAviso() {
	abrePopup('aviso.php', 400, 600);
}
