var wimg = '';
function PopupPic(sPicURL) { wimg=window.open( "/popup.htm?"+sPicURL, "Imagen", "resizable=1,HEIGHT=200,WIDTH=200"); if (window.focus) wimg.focus();}
var winpreview = '';
function ShowPreviewMM(id){
	var title = 'Multimedia_Viewer';
	var url = '/mm.php?id='+id;
	if (!winpreview.closed && winpreview.location) {
		winpreview.location.href = url;
	} else {
		var w = '400';
		var h = '300';
		LeftPosition = (screen.width) ? (screen.width-w)/2 : 0;
		TopPosition = (screen.height) ? (screen.height-h)/2 : 0;
		settings ='height='+h+',width='+w+',top='+TopPosition+',left='+LeftPosition+',toolbar=0,location=0,status=0,menubar=0,scrollbars=1,toolbar=0,resizable=1';
		winpreview = window.open(url,title,settings);
	}
	if (window.focus) winpreview.focus();
}

var winpreviewVideoArt = '';
function ShowPreviewVideoArt(id){
	var title = 'Multimedia_Viewer';
	var url = '/mm_art.php?id='+id+'&tip=v';
	if (!winpreviewVideoArt.closed && winpreviewVideoArt.location) {
		winpreviewVideoArt.location.href = url;
	} else {
		var w = '400';
		var h = '300';
		LeftPosition = (screen.width) ? (screen.width-w)/2 : 0;
		TopPosition = (screen.height) ? (screen.height-h)/2 : 0;
		settings ='height='+h+',width='+w+',top='+TopPosition+',left='+LeftPosition+',toolbar=0,location=0,status=0,menubar=0,scrollbars=1,toolbar=0,resizable=1';
		winpreviewVideoArt = window.open(url,title,settings);
	}
	if (window.focus) winpreviewVideoArt.focus();
}

var winpreviewAudioArt = '';
function ShowPreviewAudioArt(id){
	var title = 'Multimedia_Viewer';
	var url = '/mm_art.php?id='+id+'&tip=a';
	if (!winpreviewAudioArt.closed && winpreviewAudioArt.location) {
		winpreviewAudioArt.location.href = url;
	} else {
		var w = '400';
		var h = '300';
		LeftPosition = (screen.width) ? (screen.width-w)/2 : 0;
		TopPosition = (screen.height) ? (screen.height-h)/2 : 0;
		settings ='height='+h+',width='+w+',top='+TopPosition+',left='+LeftPosition+',toolbar=0,location=0,status=0,menubar=0,scrollbars=1,toolbar=0,resizable=1';
		winpreviewAudioArt = window.open(url,title,settings);
	}
	if (window.focus) winpreviewAudioArt.focus();
}


var winpreviewAudioEnq = '';
function ShowPreviewAudioEnq(id){
	var title = 'Multimedia_Viewer';
	var url = '/mm_enq.php?id='+id+'&tip=a';
	if (!winpreviewAudioEnq.closed && winpreviewAudioEnq.location) {
		winpreviewAudioEnq.location.href = url;
	} else {
		var w = '400';
		var h = '300';
		LeftPosition = (screen.width) ? (screen.width-w)/2 : 0;
		TopPosition = (screen.height) ? (screen.height-h)/2 : 0;
		settings ='height='+h+',width='+w+',top='+TopPosition+',left='+LeftPosition+',toolbar=0,location=0,status=0,menubar=0,scrollbars=1,toolbar=0,resizable=1';
		winpreviewAudioEnq = window.open(url,title,settings);
	}
	if (window.focus) winpreviewAudioEnq.focus();
}

var winpreviewVideoEnq = '';
function ShowPreviewVideoEnq(id){
	var title = 'Multimedia_Viewer';
	var url = '/mm_enq.php?id='+id+'&tip=v';
	if (!winpreviewVideoEnq.closed && winpreviewVideoEnq.location) {
		winpreviewVideoEnq.location.href = url;
	} else {
		var w = '400';
		var h = '300';
		LeftPosition = (screen.width) ? (screen.width-w)/2 : 0;
		TopPosition = (screen.height) ? (screen.height-h)/2 : 0;
		settings ='height='+h+',width='+w+',top='+TopPosition+',left='+LeftPosition+',toolbar=0,location=0,status=0,menubar=0,scrollbars=1,toolbar=0,resizable=1';
		winpreviewVideoEnq = window.open(url,title,settings);
	}
	if (window.focus) winpreviewVideoEnq.focus();
}

var winpopup = '';
function ShowPopup(url,w,h){
	var title = 'RTVCM';
	if (!winpopup.closed && winpopup.location) {
		winpopup.location.href = url;
	} else {
		LeftPosition = (screen.width) ? (screen.width-w)/2 : 0;
		TopPosition = (screen.height) ? (screen.height-h)/2 : 0;
		settings ='height='+h+',width='+w+',top='+TopPosition+',left='+LeftPosition+',toolbar=0,location=0,status=0,menubar=0,scrollbars=1,toolbar=0,resizable=1';
		winpopup = window.open(url,title,settings);
	}
	if (window.focus) winpopup.focus();
}

function ShowMapaEmision() {
	ShowPopup('/popups/mapa_emision.html',550,580);
}

function Abrir_Ventana(url,titulo) {
	var especificaciones="top=0, left=0, toolbar=no,location=no, status=no,menubar=no,scrollbars=no, resizable=no, width=800,height=600";
	window.open(url,titulo,especificaciones);
}
