// ************************************************************
// Comment Settings
// ************************************************************
var currentCommentContent = 0;

// ************************************************************
// Public Comment Methods
// ************************************************************
function Comment_GetCurrent()
{
	if(playerIg)
	{
		return(playerIg.getCurrentMediaId());
	}
}

function showPopup()
{
	window.open("popupSoAssinantes/popupAssinantes.aspx", 'popup', "top=20, width=290, height=340, toolbar=no, resizable=0");
}

function Download()
{
	var isCartoon = document.getElementById( "isCartoon" );
	
	if( isCartoon != null )
	{
		if( isCartoon.value.toLowerCase() == "false" )
		{
			showPopup();
			return;	
		}
	}
	else
	{
		showPopup();
		return;
	}

	var preview = playerIg.getCurrentMedia().preview;
	
	if (preview)
	{
		alert ('Você não pode fazer download de um vídeo de Preview');
		return;
	}
	
	var current = Comment_GetCurrent();

	if(current > 0)
	{
		downloadFrame.location.href = "download.aspx?contentId=" + current;
	}
	else
	{
		alert("Não há nenhum conteúdo selecionado");
	}
}

function Comment_Add()
{
	var current = Comment_GetCurrent();
	if(current > 0)
	{
		window.open("comments.aspx?contentId=" + current + "&refreshVideoDetails=true", 'comments', "top=20, width=350, height=460, toolbar=no, resizable=0");
	}
	else
	{
		alert("Não há nenhum video selecionado");
	}
}
function Comment_Send()
{
	if(document.getElementById("TxtComment").value == ""){
		document.getElementById("Erro").style.visibility ="visible";
	}else{
		document.getElementById("Content").value = "yes";	
		document.frmComments.submit();
	}
}