var MediaCenterWin = null;

function RealVideo(l)
{
		var fascia = "/grafica/fasce_popup/" + PopupImgFascia;
		var titolo = PopupTitolo;
		var video = l;
		window.open('/live/realvideo_popup.php?fascia=' + escape(fascia) + '&titolo=' + escape(titolo) + '&video=' + escape(video),'RAI_realvideo_popup','width=300, height=390');
}

function RealVideo2(fascia, titolo, filmato)
{
		var fascia = "/grafica/fasce_popup/" + fascia;
		var video = filmato;
		window.open('/live/realvideo_popup.php?fascia=' + escape(fascia) + '&titolo=' + escape(titolo) + '&video=' + escape(video),'RAI_realvideo_popup','width=300, height=390');
}

function RealVideoSpeciale(titolo, filmato)
{
		var video = filmato;
		var width = RealVideoSpeciale.arguments[2]?RealVideoSpeciale.arguments[2]:400;
		var height = RealVideoSpeciale.arguments[3]?RealVideoSpeciale.arguments[3]:365;
		window.open('/live/realvideo_popup_speciali.php?titolo=' + escape(titolo) + '&video=' + escape(video) + '&height=' + height + '&width=' + width,'RAI_realvideo_speciale','width=665, height='+(height+215));
}

/*
function RealVideoParts()
{
		var fascia = "/grafica/fasce_popup/" + PopupImgFascia;
		var titolo = PopupTitolo;
		video="";
		for (var i=0; i<arguments.length; i++)
			video = video + "&video[]=" + escape(arguments[i]);
		window.open('/live/realvideo_popup.php?fascia=' + escape(fascia) + '&titolo=' + escape(titolo) + video,'RAI_realvideo_popup','width=300, height=390');
}
*/

function RealAudio2(fascia, titolo, filmato)
{
		var fascia = "/grafica/fasce_popup/" + fascia;
		var video = filmato;
		window.open('/live/realaudio_popup.php?fascia=' + escape(fascia) + '&titolo=' + escape(titolo) + '&video=' + escape(video),'RAI_realvideo_popup','width=300, height=290');
}

function RealAudio(l)
{
		var fascia = "/grafica/fasce_popup/" + PopupImgFascia;
		var titolo = PopupTitolo;
		var video = l;
		window.open('/live/realaudio_popup.php?fascia=' + escape(fascia) + '&titolo=' + escape(titolo) + '&video=' + escape(video),'RAI_realvideo_popup','width=300, height=290');
}

function MediaCenter(id_video, id_prog) {
	if (!parseInt(id_video) && !parseInt(id_prog)) {
		var lnk = '/mediacenter/frontend/index.php';
		if (!MediaCenterWin || MediaCenterWin.closed) {
			MediaCenterWin = window.open(lnk, 'RAI_Mediacenter', 'width=780, height=600, resizable=1, scrollbars=1');
		}
	} else if (!parseInt(id_video)) {
		var lnk = '/mediacenter/frontend/programma.php?cat=' + escape(id_prog);
		MediaCenterWin = window.open(lnk, 'RAI_Mediacenter', 'width=780, height=600, resizable=1, scrollbars=1');
	} else {
		var lnk = '/mediacenter/frontend/programma.php?id_video=' + escape(id_video);
		MediaCenterWin = window.open(lnk, 'RAI_Mediacenter', 'width=780, height=600, resizable=1, scrollbars=1');
	}
	MediaCenterWin.focus();
}
