function abreFigurinha(elemento, album){
	var obj = document.getElementById('figurinha'+String(elemento));
	var objGrande = document.getElementById('img_grande'+String(elemento));
	var objOff = document.getElementById('fotoOff'+String(elemento));
	var objPeq = document.getElementById('fotoPeq'+String(elemento));
	var infos = document.getElementById('infos'+String(elemento));
	
	if(obj.style.width != "500px"){
		//for(i=1;i<=31; i++){
			//fecha tudo
			//$('#figurinha'+i).animate({width: 250}, 300);
			//var objGrande2 = document.getElementById('img_grande'+i);
			//var objOff2 = document.getElementById('fotoOff'+i);
			//var objPeq2 = document.getElementById('fotoPeq'+i);
			//var infos2 = document.getElementById('infos'+i);
			//objGrande2.style.display = 'none';
			//infos2.style.display = 'none';
			//objOff2.style.display = 'block';
			//objPeq2.style.display = 'none';
		//}
		//abre selecionado
		$('#figurinha'+elemento).animate({width: 500}, 100);
		objGrande.style.display = 'block';
		infos.style.display = 'block';
		objOff.style.display = 'none';
		objPeq.style.display = 'none';
	}else{
		//fecha objeto
		$('#figurinha'+elemento).animate({width: 250}, 300);
		objGrande.style.display = 'none';
		infos.style.display = 'none';
		objOff.style.display = 'block';
		objPeq.style.display = 'none';
	}
	return false;
}

function rolloverFigurinha(elemento){
	var objGrande = document.getElementById('img_grande'+String(elemento));
	if(objGrande.style.display == "none"){
		elemento1 = 'fotoOff'+elemento;
		elemento2 = 'fotoPeq'+elemento;
		document.getElementById(elemento1).style.display = 'none';
		document.getElementById(elemento2).style.display = 'block';
	}
}

function rolloutFigurinha(elemento){
	var objGrande = document.getElementById('img_grande'+String(elemento));
	if(objGrande.style.display == "none"){
		elemento1 = 'fotoOff'+elemento;
		elemento2 = 'fotoPeq'+elemento;
		document.getElementById(elemento1).style.display = 'block';
		document.getElementById(elemento2).style.display = 'none';
	}
}

function abreCadastro(){
	document.getElementById('home_btcadastro').style.display = 'none';
	document.getElementById('form_login').style.display = 'none';
	document.getElementById('form_cadastro').style.display = 'block';
	document.getElementById('home_btlogin').style.display = 'block';
}

function abreLogin(){
	document.getElementById('home_btcadastro').style.display = 'block';
	document.getElementById('form_login').style.display = 'block';
	document.getElementById('form_cadastro').style.display = 'none';
	document.getElementById('home_btlogin').style.display = 'none';
}

//Correcoes de css para ie
if (navigator.appName=="Microsoft Internet Explorer"){
	document.write('<link href="css/ie_css.css" rel="stylesheet" type="text/css" />');
	//window.location = "http://www.quackit.com"
}

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 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();

	if(mes <= 5){
		//cabecalho
		document.write("<div id=palestras>");
		document.write("<a href=palestras.aspx target=_top><img src=imagens/palestras_topo.gif /></a>");
		

		//palestra de 26/05
		if(mes == 4 && dia == 26 && hour >= 19 && hour < 21){
		    document.write("<a href=transmissao_aovivo.htm target=_top><img src=imagens/palestra_maio03b.gif /></a>");
			document.write("<a href=palestras.aspx target=_top><img src=imagens/palestras_spacer.gif /></a>");
		}else if(mes == 4 && dia == 26 && hour < 19){
			document.write("<a href='palestras.aspx' target='_top'><img src='imagens/palestra_maio03a.gif' /></a>");
			document.write("<a href=palestras.aspx target=_top><img src=imagens/palestras_spacer.gif /></a>");
		}else if(mes == 4 && dia < 26){
			document.write("<a href='palestras.aspx' target='_top'><img src='imagens/palestra_maio03a.gif' /></a>");
			document.write("<a href=palestras.aspx target=_top><img src=imagens/palestras_spacer.gif /></a>");
		}else if(mes < 4){
			document.write("<a href='palestras.aspx' target='_top'><img src='imagens/palestra_maio03a.gif' /></a>");
			document.write("<a href=palestras.aspx target=_top><img src=imagens/palestras_spacer.gif /></a>");
		}
		//fim da palestra

		document.write("<a href=palestras.aspx target=_top><img src=imagens/palestras_botao.gif /></a>");
		document.write("</div>");	
		}
}
