var master_id = "";
function calcHeightVotacao_1(id)
{
master_id = id;
setTimeout("calcHeightVotacao('"+id+"')",100);
}
function calcHeightVotacao(id)
{
//id = master_id;
if (document.getElementById(id) == null && parent.document.getElementById(id) == null)
  id = id.getAttribute("id");
//alert ("idframe"+id+"doc->"+document.getElementById(id)+"parent->"+parent.document.getElementById(id))
if (document.getElementById(id) != null)
{
// FAZ A IFRAME VARIAR FACE À SUA ALTURA
//find the height of the internal page
document.getElementById(id).height = 0;
var the_height= document.getElementById(id).contentWindow.document.body.scrollHeight;
//change the height of the iframe
document.getElementById(id).height=(the_height);
}
else if (parent.document.getElementById(id) != null)
{
// FAZ A IFRAME VARIAR FACE À SUA ALTURA
//find the height of the internal page
var the_height= parent.document.getElementById(id).contentWindow.document.body.scrollHeight;
//change the height of the iframe
parent.document.getElementById(id).height=(the_height);
}
}
function calcHeight(id)
{
if (document.getElementById(id) != null)
{
// FAZ A IFRAME VARIAR FACE À SUA ALTURA
//find the height of the internal page
document.getElementById(id).height = 0;
var the_height= document.getElementById(id).contentWindow.document.body.scrollHeight;
//change the height of the iframe
document.getElementById(id).height=(the_height+50);
}
else if (parent.document.getElementById(id) != null)
{
// FAZ A IFRAME VARIAR FACE À SUA ALTURA
//find the height of the internal page
var the_height= parent.document.getElementById(id).contentWindow.document.body.scrollHeight;
//change the height of the iframe
parent.document.getElementById(id).height=(the_height+50);
}
}

function PubReady(id){document.getElementById(id).innerHTML = document.getElementById(id + "_Replace").innerHTML;document.getElementById(id + "_Replace").innerHTML="";}

function RTPplayerBeta_1(myid,video_param,prog_param)
{

if (prog_param.indexOf("$") != -1)
	prog_param = "";

$f(myid, "/blogs/swf/flowplayercm.swf", {
		key: '#$22842984f0441053f14',		
		play: {replayLabel: "Voltar a ver"},
		onPause: function() {this.getPlugin("content").fadeIn(1000).animate({height:47,bottom:120},1000)} ,					
		onResume: function() {this.getPlugin("content").animate({height:28,bottom:0},1000)},
    		contextMenu: [ {
       			 'RTP.PT': function() { 
           			 location.href = 'http://www.rtp.pt';     
        		}
        		} 
        		
    		],
		playlist : [			
			{
				autoPlay:true,
				provider: 'rtmp',
				url: video_param,
				onCuepoint: [[1000], function(clip, cuepoint) {this.getPlugin("content").animate({height:28,bottom:0},1000)}],
				onFinish:function() {this.getPlugin("content").show().animate({height:47,bottom:120})}
			}
		],
		plugins: 
		{
			content: { 
				display:"none",
				url: '/blogs/swf/separador1.swf?tvprog='+prog_param,
				bottom: 50,
				height:47,
				zIndex: -100

			}, 
			rtmp:
			{
				url: '/blogs/swf/flowplayer.rtmp-3.1.0.swf',
				netConnectionUrl: 'rtmp://video1.rtp.pt/flv/RTPFiles/'
			}
			,
	
			controls: { 
				url: '/blogs/swf/flowplayer.controls-tube-3.1.0.swf',
				bufferColor:'#013682',
				volumeSliderColor:'#013682',
				progressColor: '#013682',
				buttonOverColor: '#013682',
				tooltipTextColor:'#013682'
    			}  
    			  
		}
		
		
	}
);
}

function RTPplayerBeta(myid,video_param,prog_param)
{

$f(myid, "/blogs/swf/flowplayercm.swf", {
		key: '#$22842984f0441053f14',		
		play: {replayLabel: "Voltar a ver"},
    		contextMenu: [ {
       			 'RTP.PT': function() { 
           			 location.href = 'http://www.rtp.pt';     
        		}
        		} 
        		
    		],
		playlist : [			
			{
				autoPlay:true,
				provider: 'rtmp',
				url: video_param
			}
		],
		plugins: 
		{
			rtmp:
			{
				url: '/blogs/swf/flowplayer.rtmp-3.1.0.swf',
				netConnectionUrl: 'rtmp://video1.rtp.pt/flv/RTPFiles/'
			}
			,
	
			controls: { 
				url: '/blogs/swf/flowplayer.controls-tube-3.1.0.swf',
				bufferColor:'#013682',
				volumeSliderColor:'#013682',
				progressColor: '#013682',
				buttonOverColor: '#013682',
				tooltipTextColor:'#013682'
    			}  
    			  
		}
		
		
	}
);
}

/************ abrir em pop up a skin do player de audio ****************/
function popup(int_canal)
{
   window.open('/wportal/popups/player_dalet.php?canal='+int_canal+'', 'Radio', "status=no, width=825, height=425")
}
/************ fim abrir em pop up a skin do player de audio ****************/
