jQuery.noConflict();
jQuery(document).ready(
	function(){
	jQuery('#conteudo_destaque').innerfade({ speed: 'slow', timeout: 5000, type: 'sequence'}); 
});

// quadro de fotos
var move = 0;
var total = 0;
var total_limit = 0;
var espera_click = 0;
var opVideoSelecionado = -1;
var videoTela = 0;

function aparecerSetas()
{
	document.getElementById("seta_esq").style.display = "block";
	document.getElementById("seta_dir").style.display = "block";
}

function desaparecerSetas()
{
	document.getElementById("seta_esq").style.display = "none";
	document.getElementById("seta_dir").style.display = "none";
}

function MoveEsq()
{
	queue = Effect.Queues.get('menuscope');
	
	if((move > 0)&&(espera_click == 0)&&(queue.size() == 0))
	{
		espera_click = 1;
		new Effect.Move(document.getElementById('tab_painel'), { x: 480, y: 0, mode: 'relative', transition: Effect.Transitions.sinoidal, queue: { position: 'end', scope: 'menuscope',
limit: 1 }, afterFinish: SetMove(0) });
	}
}

function MoveDir()
{
	queue = Effect.Queues.get('menuscope');
	
	if((move < (total_limit - 1))&&(espera_click == 0)&&(queue.size() == 0))
	{
		espera_click = 1;
		new Effect.Move(document.getElementById('tab_painel'), { x: -480, y: 0, mode: 'relative', transition: Effect.Transitions.sinoidal, queue: { position: 'end', scope: 'menuscope',
limit: 1 }, afterFinish: SetMove(1) });
	}
}

function SetMove(dir)
{
	if(dir == 0)
		move--;
	else
		move++;
		
	espera_click = 0;
}
// quadro de fotos

function validarMensagemMural()
{
	form = document.form_mural;
	
	if(form.cx_add_msg_mural.value == "")
	{
		alert("A mensgem está vazia");
		form.cx_add_msg_mural.focus();
		return;
	}
	
	xajax_adicionarMensagemMuralBD(form.cx_add_nome_mural.value, form.cx_add_msg_mural.value);
}

function verificarNovaMsgMural()
{
	var timestamp = document.getElementById("timestamp_envio_msg");
	if(timestamp.value != "")
	{
		xajax_verificarNovaMsgMural2(timestamp.value);
	}	

	setTimeout("verificarNovaMsgMural()", 5000);
}

function mudarVideo()
{
	selectVideo = document.form_video.select_video;
	
	numVideo = selectVideo.options[selectVideo.selectedIndex].value;
	
	if((selectVideo.selectedIndex != 0)&&(numVideo != videoTela))
	{
		divObjTv = document.getElementById("div_obj_tv");
		listaItems = divObjTv.getElementsByTagName("object");
		total = listaItems.length;

		if(total > 0)
		{
			while(divObjTv.hasChildNodes())
				divObjTv.removeChild(divObjTv.firstChild);
		}
		
		//numVideo = selectVideo.options[selectVideo.selectedIndex].value;
		
		if(numVideo != opVideoSelecionado)
		{
			videoObj = "<object width='280' height='230'><param name='movie' value='http://www.youtube.com/v/" + videos[numVideo] + "&hl=pt-br&fs=1'></param><param name='allowFullScreen' value='true'></param><param name='allowscriptaccess' value='always'></param><embed src='http://www.youtube.com/v/" + videos[numVideo] + "&hl=pt-br&fs=1' type='application/x-shockwave-flash' allowscriptaccess='always' allowfullscreen='true' width='280' height='230'></embed></object>";

			document.getElementById("div_obj_tv").innerHTML = videoObj;
			opVideoSelecionado = numVideo;
			videoTela = numVideo;
		}
	}
	else
		opVideoSelecionado = -1;
}

function abrirJanelaImagemMidia(imagem, titulo, largura, altura)
{
	endereco = "imagem_midia.php?titulo=" + titulo + "&imagem=" + imagem;
	opcoes = "directories=no,location=no,menubar=no,toolbar=no,top=50,height=" + largura + ",width=" + altura;
	
	window.open(endereco, 'imagemMidia', opcoes);
}