function get_flashCinema(arquivo, largura, altura, bgcolor, id, qualidade, alinhamento,transparente,pgphp) {
	obj = '<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" width="'+largura+'" height="'+altura+'" id="'+id+'" align="'+alinhamento+'">';
	obj+= '<param name="allowScriptAccess" value="sameDomain" />';
	obj+= '<param name="movie" value="'+arquivo+'" />';
	obj+= '<param name="quality" value="'+qualidade+'" />';
	if(transparente == true) {
		obj+= '<param name="wmode" value="transparent" />';
	}
	obj+= '<param name="bgcolor" value="'+bgcolor+'" />';
	obj+= '<param name="FlashVars" value="pg='+pgphp+'" />';
	obj+= '<embed src="'+arquivo+'" '+((transparente==true)?'wmode="transparent"':'')+'" quality="'+qualidade+'" bgcolor="'+bgcolor+'" FlashVars="pg='+pgphp+'" width="'+largura+'" height="'+altura+'" name="'+id+'" align="'+alinhamento+'" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />';
	obj+= '</object>';
	document.write(obj);
}


function get_flash(arquivo, largura, altura, bgcolor, id, qualidade, alinhamento, transparente, pgphp) {
	obj = '<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" width="'+largura+'" height="'+altura+'" id="'+id+'" align="'+alinhamento+'">';
	obj+= '<param name="allowScriptAccess" value="sameDomain" />';
	obj+= '<param name="movie" value="'+arquivo+'" />';
	obj+= '<param name="quality" value="'+qualidade+'" />';
	if(transparente == true) {
		obj+= '<param name="wmode" value="transparent" />';
	}
	obj+= '<param name="bgcolor" value="'+bgcolor+'" />';
	obj+= '<param name="FlashVars" value="pais='+pgphp+'" />';
	obj+= '<embed src="'+arquivo+'" '+((transparente==true)?'wmode="transparent"':'')+'" quality="'+qualidade+'" bgcolor="'+bgcolor+'" FlashVars="pais='+pgphp+'" width="'+largura+'" height="'+altura+'" name="'+id+'" align="'+alinhamento+'" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />';
	obj+= '</object>';
	document.write(obj);
}

// Função Link de matérias (fiveedit linha:132)
function Url(url, cd_matia, cd_site){
	document.location.href = url+"?cd_matia="+cd_matia+"&cd_site="+cd_site;
}

// Função Link da paginação (fiveedit linha:)
function Page(cd_sesit, p){
	document.location.href = "?cd_sesit="+cd_sesit+"&p="+p;
}


// Função ordena por portfólio (fiveedit linha:64)
function ordena(mod){
	document.location.href = "?mod="+mod;
}

function BotaoVideo(ds_midia_link, ds_midia_credi, ds_midia, ds_tpmid_ext){	
	LightBox.getVideo(video = { url:ds_midia_link,fonte:ds_midia_credi,descricao:ds_midia, ext:ds_tpmid_ext});
}

function url(url){
	window.document.location.href=url;
}

function urlNw(url){
	window.open(url);
}

function Popup(Url, Titulo, Width, Height, Scrollbar) 
{
    window.open(Url, Titulo, 'width='+Width+', height='+Height+', scrollbars='+Scrollbar+', status=no, resizable, top='+((screen.availHeight/2)-(Height/2))+', left='+((screen.availWidth/2)-(Width/2)))
}

function validaform() {
    
	msg1 = "";
	
	if (window.document.FrmFale.ds_nome.value == "") {
    	msg1 = msg1 + "O \"NOME\" deve ser preenchido! \n";
		document.getElementById("ds_nome").style.border = "solid #F8A7A9 1px";
		document.getElementById("ds_nome").style.height = "18px";
		document.getElementById("ds_nome").style.width = "420px";
	}else{
		document.getElementById("ds_nome").style.border = "solid #0c4356 1px";
		document.getElementById("ds_nome").style.height = "18px";
		document.getElementById("ds_nome").style.width = "420px";
	}
 
	if (window.document.FrmFale.ds_email.value == "") {
    	msg1 = msg1 + "O \"E-MAIL\" deve ser preenchido! \n";
		document.getElementById("ds_email").style.border = "solid #F8A7A9 1px";	
		document.getElementById("ds_email").style.height = "18px";
		document.getElementById("ds_email").style.width = "420px";
	}else{
		document.getElementById("ds_email").style.border = "solid #0c4356 1px";
		document.getElementById("ds_email").style.height = "18px";
		document.getElementById("ds_email").style.width = "420px";
	}
 
	if (window.document.FrmFale.ds_tel.value == "") {
    	msg1 = msg1 + "O \"NUMERO TELEFONE\" deve ser preenchido! \n";
		document.getElementById("ds_tel").style.border = "solid #F8A7A9 1px";
		document.getElementById("ds_tel").style.height = "18px";
		document.getElementById("ds_tel").style.width = "152px";
	}else{
		document.getElementById("ds_tel").style.border = "solid #0c4356 1px";
		document.getElementById("ds_tel").style.height = "18px";
		document.getElementById("ds_tel").style.width = "152px";
	}
 
	
	if (window.document.FrmFale.ds_assunto.value == "") {
    	msg1 = msg1 + "O \"ASSUNTO\" deve ser preenchido! \n";
		document.getElementById("ds_assunto").style.border = "solid #F8A7A9 1px";
		document.getElementById("ds_assunto").style.height = "18px";
		document.getElementById("ds_assunto").style.width = "420px";
	}else{
		document.getElementById("ds_assunto").style.border = "solid #0c4356 1px";
		document.getElementById("ds_assunto").style.height = "18px";
		document.getElementById("ds_assunto").style.width = "420px";
	}
 
	
	if (window.document.FrmFale.ds_msg.value == "") {
    	msg1 = msg1 + "A \"MENSAGEM\" deve ser preenchida! \n";
		document.getElementById("ds_msg").style.border = "solid #F8A7A9 1px";
		document.getElementById("ds_msg").style.height = "92px";
		document.getElementById("ds_msg").style.width = "420px";
	}else{
		document.getElementById("ds_msg").style.border = "solid #0c4356 1px";
		document.getElementById("ds_msg").style.height = "92px";
		document.getElementById("ds_msg").style.width = "420px";
	}
 
	if (msg1 != "") {
		alert(msg1);
		return false;
	
	}else{
		window.document.FrmFale.submit();
	}

}

function voltacampo(campo) {
	
	if ((window.document.FrmFale.ds_nome.value == "") && (campo == "ds_nome")) {
		document.getElementById("ds_nome").style.border = "1px solid  #d3d3d4";	}
	
	if ((window.document.FrmFale.ds_email.value == "") && (campo == "ds_email")) {
		document.getElementById("ds_email").style.border = "1px solid  #d3d3d4";
	}
	
	if ((window.document.FrmFale.ds_ddd.value == "") && (campo == "ds_ddd")) {
		document.getElementById("ds_ddd").style.border = "1px solid  #d3d3d4";
	}
	
	if ((window.document.FrmFale.ds_tel.value == "") && (campo == "ds_tel")) {
		document.getElementById("ds_tel").style.border = "1px solid  #d3d3d4";
	}
	
	if ((window.document.FrmFale.ds_assunto.value == "") && (campo == "ds_assunto")) {
		document.getElementById("ds_assunto").style.border = "1px solid  #d3d3d4";
	}
	
	if ((window.document.FrmFale.ds_msg.value == "") && (campo == "ds_msg")) {
		document.getElementById("ds_msg").style.border = "1px solid  #d3d3d4";
	}
	}

function formatar(src, mask) {
	var i = src.value.length;
	var saida = mask.substring(0,1);
	var texto = mask.substring(i)

	if (texto.substring(0,1) != saida) {
		src.value += texto.substring(0,1);
	}
}

function validaBusca() {
	if (window.document.Busca.ds_busca.value == "")	{
		alert("Digite uma palavra-chave para realizar a busca.");
		return false;
	} else {
		window.document.Busca.submit();
	}
}

function ChecaForm() {
	
	msg = "";
	
	if (window.document.frmEnviar.nomeremetente.value == "")	{
    	msg = msg + "O \"SEU NOME\" deve ser preenchido! \n";
		document.getElementById("nomeremetente").style.border = "solid #F8A7A9 1px";

	}else{
		document.getElementById("nomeremetente").style.border = "solid #d3d3d4 1px";
	}

	if (window.document.frmEnviar.emailremetente.value == "")	{
    	msg = msg + "O \"SEU E-MAIL\" deve ser preenchido! \n";
		document.getElementById("emailremetente").style.border = "solid #F8A7A9 1px";

	}else{
		document.getElementById("emailremetente").style.border = "solid #d3d3d4 1px";
	}
	
	if (window.document.frmEnviar.nomedestinatario.value == "")	{
    	msg = msg + "O \"NOME DO AMIGO\" deve ser preenchido! \n";
		document.getElementById("nomedestinatario").style.border = "solid #F8A7A9 1px";

	}else{
		document.getElementById("nomedestinatario").style.border = "solid #d3d3d4 1px";
	}
	
	if (window.document.frmEnviar.emaildestinatario.value == "")	{
    	msg = msg + "O \"E-MAIL DO DESTINATÁRIO\" deve ser preenchido! \n";
		document.getElementById("emaildestinatario").style.border = "solid #F8A7A9 1px";

	}else{
		document.getElementById("emaildestinatario").style.border = "solid #d3d3d4 1px";
	}
	if (window.document.frmEnviar.comentario.value == "")	{
    	msg = msg + "O \"COMENTÁRIO\" deve ser preenchido! \n";
		document.getElementById("comentario").style.border = "solid #F8A7A9 1px";

	}else{
		document.getElementById("comentario").style.border = "solid #d3d3d4 1px";
	}
		
	if (msg != "") {
		alert(msg);
		return false;
	
	}else{
		window.document.frmEnviar.submit();
	}
}


var req; 
function loadXMLDoc(url){ 
	req = null; 
	// Procura por um objeto nativo (Mozilla/Safari) 
	if (window.XMLHttpRequest){ 
		req = new XMLHttpRequest(); 
		req.onreadystatechange = processReqChange; 
		req.open("GET", url, true); 
		req.send(null); 
	// Procura por uma versão ActiveX (IE) 
	}else if (window.ActiveXObject){ 
		req = new ActiveXObject("Microsoft.XMLHTTP"); 
		if (req){ 
			req.onreadystatechange = processReqChange; 
			req.open("GET", url, true); 
			req.send(); 
		} 
	} 
} 

//função de aumentar e diminuir a fonte do texto 
function FonteTamanho(id, tipo){
	size = new String(window.document.getElementById(id).style.fontSize);
	var fonte = size.replace('px','');
	
	if(fonte == "") { fonte = "11"; }
	 
	fonte = parseInt(fonte);
	
	if((tipo == "+") && (fonte < 16)) {
		fonte += 1;
		window.document.getElementById(id).style.fontSize = fonte+"px";
		window.document.getElementById(id).style.lineHeight = "1.4em";
	}
	if((tipo == "-") && (fonte > 11)){
		fonte -= 1;
		window.document.getElementById(id).style.fontSize = fonte+"px";
		window.document.getElementById(id).style.lineHeight = "1.4em";
	}			
}

function imgRollover(id, imagem){
		window.document.getElementById(id).src=imagem;
}

function underline(obj){
	if(obj.style.textDecoration == "underline")
		obj.style.textDecoration = "none";	
	else
		obj.style.textDecoration = "underline";
}

$(document).ready(function(){
	var col01H = $("#internasCol1").height();
	var col02H = $("#internasCol2").height();
	if(col01H > col02H){
		$("#internasCol2").height(col01H);
	}
	if(col01H < col02H){
		$("#internasCol1").height(col02H);
	}
});

function calendario(mes,ano){
	$('#calendar').html('<div style="width:253px; background-color:#fff; background-image:url(imagens/loading_image_grande.gif); background-repeat:no-repeat; background-position: center center; margin-bottom:18px; padding-top:130px; height:100px; text-align:center; border:1px #f1f1f1 solid">Carregando...</div>');
	$.post('index.php?id=/includes/paginas/calendarioeventos.php', 
		{ mes : mes, ano : ano }, 
		function(resposta){
			$('#calendar').html(resposta);
		}
	);
}

function boxNoticias(id){
	$('#noticiaCol1DestaqueMateria').html('Carregando...');
	$.post('index.php?id=/includes/paginas/box_noticias_'+id+'.php', 
		{ id : id }, 
		function(resposta){
			$('#noticiaCol1DestaqueMateria').html(resposta);
		}
	);
}

function TrocaImagem(op){
	if(op == '-'){
		num = num - 1;
		if(num < 1)
			num = total;
	}
	if(op == '+'){
		num = num + 1;
		if(num > total)
			num = 1;
	}


	window.document.getElementById('galeriaPicture').src = Picture[num];
	window.document.getElementById('galeriaAssunto').innerHTML = Assunto[num];
	window.document.getElementById('galeriaTitulo').innerHTML = Titulo[num];
	window.document.getElementById('galeriaChamada').innerHTML = Chamada[num];
	//window.document.getElementById('galeriaTituloLink').href = Link[num];
	//window.document.getElementById('galeriaComentarios').innerHTML = Comentarios[num];

}

