// JavaScript Document

//Correcoes de css para ie
if (navigator.appName=="Microsoft Internet Explorer"){
	document.write('<link href="css/ie_css.css" rel="stylesheet" type="text/css" />');
}

//JS do lightbox
function abreLightbox(){
	tamanho();
	Effect.Appear('fade', { to: 0.8 });
	Effect.Appear('light', { duration: 2.0 });
}

function tamanho(){
	var largura = getWidth();
	var altura = getHeight();
	//alert(document.getElementById('light').style.width);
	document.getElementById('light').style.left = (largura/2)-(504/2)+"px";
	document.getElementById('light').style.top = (altura/2)-(400/2)+"px";
	document.getElementById('fade').style.width = largura+"px";
	document.getElementById('fade').style.height = altura+"px";
}

function getWidth(){
	return window.innerWidth ? window.innerWidth : /* For non-IE */  
	document.documentElement ? document.documentElement.clientWidth : /* IE 6+ (Standards Compilant Mode) */  
	document.body ? document.body.clientWidth : /* IE 4 Compatible */  
	window.screen.width; /* Others (It is not browser window size, but screen size) */  
}  

function getHeight(){
	return window.innerHeight ? window.innerHeight : /* For non-IE */  
	document.documentElement ? document.documentElement.clientHeight : /* IE 6+ (Standards Compilant Mode) */  
	document.body ? document.body.clientHeight : /* IE 4 Compatible */  
	window.screen.height; /* Others (It is not browser window size, but screen size) */  
}  		

function abreSubMenu(numero){
	if(numero == 1){
		document.getElementById('submenu2').style.display='none';
		document.getElementById('submenu3').style.display='none';
		document.getElementById('submenu1').style.display='block';
		//Effect.SlideDown('submenu1', {duration:0.5});
	}else if(numero == 2){
		document.getElementById('submenu1').style.display='none';
		document.getElementById('submenu3').style.display='none';
		document.getElementById('submenu2').style.display='block';
		//Effect.SlideDown('submenu2', {duration:0.5});
	}else if(numero == 3){
		document.getElementById('submenu1').style.display='none';
		document.getElementById('submenu2').style.display='none';
		document.getElementById('submenu3').style.display='block';
		//Effect.SlideDown('submenu3', {duration:0.5});
		
				
		
	}else{
		document.getElementById('submenu1').style.display='none';
		document.getElementById('submenu2').style.display='none';
		document.getElementById('submenu3').style.display='none';
	}
}

function eLementos(recebeId){
	return document.getElementById(recebeId);
}

function dElementos(Alvo){
	if(eLementos(Alvo).style.display=='none'){
		eLementos(Alvo).style.display='block';
	}else{
		eLementos(Alvo).style.display='none';
	}
}

function dElementosOver(Alvo){
		eLementos(Alvo).style.overflow='visible';
		//eLementos(Alvo).style.height='300px';
}

function dElementosOut(Alvo){
	eLementos(Alvo).style.overflow='hidden';
	//eLementos(Alvo).style.height='20px';
}

function bannerPalestras(){
	d = new Date();
	hour = d.getHours();
	dia = d.getDate();
	mes = d.getMonth() + 1;

	if(mes <= 11){
		//cabecalho
		document.write("<div id=palestras>");
		document.write("<a href=palestras.aspx target=_top><img src=imagens/palestras_topo.gif /></a>");
		
		//palestra de 18/01
		if(mes == 1 && dia == 18 && hour >= 18 && hour < 21){
		    document.write("<a href=transmissao_aovivo.htm target=_top><img src=imagens/palestra_jan1101b.gif /></a>");
			document.write("<a href=palestras.aspx target=_top><img src=imagens/palestras_spacer.gif /></a>");
			
		}else if(mes == 1 && dia == 18 && hour < 18){
			document.write("<a href='palestras.aspx' target='_top'><img src='imagens/palestra_jan1101a.gif' /></a>");
			document.write("<a href=palestras.aspx target=_top><img src=imagens/palestras_spacer.gif /></a>");
			
		}else if(mes == 1 && dia < 18){
			document.write("<a href='palestras.aspx' target='_top'><img src='imagens/palestra_jan1101a.gif' /></a>");
			document.write("<a href=palestras.aspx target=_top><img src=imagens/palestras_spacer.gif /></a>");
			
		}else if(mes < 1){
			document.write("<a href='palestras.aspx' target='_top'><img src='imagens/palestra_jan1101a.gif' /></a>");
			document.write("<a href=palestras.aspx target=_top><img src=imagens/palestras_spacer.gif /></a>");
			
		}


		document.write("<a href=palestras.aspx target=_top><img src=imagens/palestras_botao.gif /></a>");
		document.write("</div>");	
		}
}
