/*
if (AC_FL_RunContent == 0 || DetectFlashVer == 0) {
	alert("This page requires AC_RunActiveContent.js.");
} else {
	var hasRightVersion = DetectFlashVer(requiredMajorVersion, requiredMinorVersion, requiredRevision);
	if(hasRightVersion) {  // if we've detected an acceptable version
    	document.getElementById('boxflash').style.display='none';
	} else {  // flash is too old or we can't detect the plugin
    	document.getElementById('boxflash').style.display='block';
	}
}
*/


function randomEd(){
	var max = 17; // numero de imagens
	var imagens = new Array();
	imagens[0] = "/images/boxchat_fotoed01.jpg";
	imagens[1] = "/images/boxchat_fotoed02.jpg";
	imagens[2] = "/images/boxchat_fotoed03.jpg";
	imagens[3] = "/images/boxchat_fotoed04.jpg";
	imagens[4] = "/images/boxchat_fotoed05.jpg";
	imagens[5] = "/images/boxchat_fotoed06.jpg";
	//imagens[6] = "images/boxchat_fotoed07.jpg";
	imagens[6] = "/images/boxchat_fotoed08.jpg";
	imagens[7] = "/images/boxchat_fotoed09.jpg";
	imagens[8] = "/images/boxchat_fotoed10.jpg";
	imagens[9] = "/images/boxchat_fotoed11.jpg";
	imagens[10] = "/images/boxchat_fotoed12.jpg";
	imagens[11] = "/images/boxchat_fotoed13.jpg";
	//imagens[13] = "images/boxchat_fotoed14.jpg";
	imagens[12] = "/images/boxchat_fotoed15.jpg";
	imagens[13] = "/images/boxchat_fotoed16.jpg";
	imagens[14] = "/images/boxchat_fotoed17.jpg";
	imagens[15] = "/images/boxchat_fotoed18.jpg";
	imagens[16] = "/images/boxchat_fotoed19.jpg";
	imagens[17] = "/images/boxchat_fotoed20.jpg";
	var img = Math.floor(Math.random() * max);
	var idEd = document.getElementById('ed_foto');
	if(idEd != null){
		idEd.src = (imagens[img]);
	}
}



// JavaScript Document

function boxFotos(){
	document.getElementById('mostrafotos').style.display='block';
}

function qualFoto(nome){
	document.getElementById('foto').src=nome;
}

function abreIndique(){
	document.getElementById('boxindique').style.display='block';
}

function abreNovidades(){
	document.getElementById('boxnovidades').style.display='block';
}






function mudatema(){
	
	var elBody = document.getElementsByTagName('body')[0];

//	var elEdDia = document.getElementById('eddia');
//	var elEdTarde = document.getElementById('edtarde');
//	var elEdNoite = document.getElementById('ednoite');

	var elTopo = document.getElementById('topodosite');
	var elNuvens = document.getElementById('nuvens');
	var elConteudo = document.getElementById('conteudo'); 
	var elFooter = document.getElementById('footer'); 
	
	var elCp = document.getElementById('logoconpetfooter');
	var elPb = document.getElementById('logopetrofooter');

 	var now = new Date();

  if (typeof ed_animacao == 'undefined' || !ed_animacao) {
    ed_animacao = 'home'; // default
  }

	if (
       (now.getHours() >= 0  && now.getHours() <= 4)
    || (now.getHours() == 18 && now.getMinutes() >= 30)
	|| (now.getHours() >= 19)
     )
	    {

		ed_animacao_tema = 'ed_noite'; // ed_noite.swf
		ed_animacao_bg   = '#00397C';  //cor de fundo do flash
	
		elFooter.className = "footer_noite";
		elBody.className = "noite";
//		elEdNoite.className = "mostra";
		elTopo.className = "toponoite";
		elNuvens.className = "nuvnoite";
		elConteudo.className = "conteudo_noite"; 
		elCp.src = "/images/logo_conpet_cf_n.gif";
		elPb.src = "/images/logo_petro_cf_n.gif";
  } else if ( // TARDE
            (now.getHours() >= 5  && now.getHours() <= 6)
         || (now.getHours() >= 17 && now.getHours() < 18)
         || (now.getHours() == 18 && now.getMinutes() <= 30)
           ) {

		ed_animacao_tema = 'ed_tarde'; // ed_tarde.swf
		ed_animacao_bg   = '#778394';  // cor de fundo do flash
		
		elFooter.className = "footer_tarde";
		elBody.className = "tarde";
//		elEdTarde.className = "mostra";
		elTopo.className = "topotarde";
		elNuvens.className = "nuvtarde";
		elConteudo.className = "conteudo_tarde"; 
		elCp.src = "/images/logo_conpet_cf_t.gif";
		elPb.src = "/images/logo_petro_cf_t.gif";

  } else { // DIA

//	else if (now.getHours() >= 7 && now.getHours() <= 16)

  ed_animacao_tema = 'ed_dia';  // ed_dia.swf
  ed_animacao_bg   = '#50a5de'; // cor de fundo do flash
		
  elFooter.className = "footer_dia";
  elBody.className = "dia";
//	elEdDia.className = "mostra";
  elTopo.className = "topodia";
  elNuvens.className = "nuvdia";
  elConteudo.className = "conteudo_dia"; 
  elCp.src = "/images/logo_conpet_cf_d.gif";
  elPb.src = "/images/logo_petro_cf_d.gif";
}

  var swf_animacao = '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" height="350" width="200"><param name="movie" value="../flash/' + ed_animacao_tema + '.swf?' + ed_animacao + '" /><param name="quality" value="high"><param name="bgcolor" value="' + ed_animacao_bg + '" /><param name="scale" value="noscale" /><!--[if !IE]><--><object data="../flash/' + ed_animacao_tema + '.swf?' + ed_animacao + '" type="application/x-shockwave-flash" height="350" width="200"><param name="quality" value="high"><param name="bgcolor" value="' + ed_animacao_bg + '"><param name="pluginurl" value="http://www.macromedia.com/go/getflashplayer"></object><!--><![endif]--></object>';

  $('#ed_animacao').html(swf_animacao);

}


//mostra/esconde divs de descricoes do menu "quem sou eu"
if (document.getElementById){ //DynamicDrive.com change
document.write('<style type="text/css">\n')
document.write('.contsobre{display: none;}\n')
document.write('</style>\n')
}

function SwitchDesc(obj){
	if(document.getElementById){
	var el = document.getElementById(obj);
	var ar = document.getElementById("descricoes").getElementsByTagName("div"); //DynamicDrive.com change
		if(el.style.display != "block"){ //DynamicDrive.com change
			for (var i=0; i<ar.length; i++){
				if (ar[i].className=="contsobre") //DynamicDrive.com change
				ar[i].style.display = "none";
			}
			el.style.display = "block";
		}else{
			el.style.display = "none";
		}
	}
}


