function abrir(id){
	var control = document.getElementById("slidecontrol");
	var arr = ["slides","palestrantes","download","pergunta","indique","ajuda","opniao","indice"];
	for(var i=0;i<arr.length;i++){
		if(arr[i] != id){
			var v = document.getElementById(arr[i]);
			if(v)v.className = "hidden";	
		}
		else{
			if(arr[i] == "slides" || arr[i] == "indique"){
				control.style.overflow = "hidden";		
			}
			else{
				control.style.overflow = "auto";
			}
			
			var v = document.getElementById(arr[i]);
			if(v)v.className = "painel";	
		}
	}
}
function showPalestrante(id) {
	var e = document.getElementById("palestrante_"+id);
	e.className = (e.className == "oculta fonte_menor")?"fonte_menor":"oculta fonte_menor";
}

function alerta(msg){
	
	alertbox.innerHTML = msg;
	if(!alertboxativo){
		alertboxativo = true;
		alertbox.style.display = "none";
		var bh = typeof(window.pageYOffset) == "number" ? window.pageYOffset : (document.body.scrollTop ? document.body.scrollTop : (document.documentElement ? document.documentElement.scrollTop : 0)) ;
		alertbox.style.display = "block";
		alertbox.style.bottom = -(alertbox.offsetHeight+bh) + "px";
		
		var p = -(alertbox.offsetHeight+bh);
		var h = alertbox.offsetHeight;
		for(var i=0;i<10;i++){ 
			setTimeout(function(){
				p+=parseInt(h/10);
				alertbox.style.top = "auto";
				alertbox.style.bottom = p + "px";
			},100 + i*20)
		}
		setTimeout(function(){
			alertbox.style.bottom = -bh + "px";			
			setTimeout(function(){
				for(var i=0;i<10;i++){ 
					setTimeout(function(){
						p-=(h/10);
						alertbox.style.top = "auto";
						alertbox.style.bottom = p + "px";
					},100 + i*20)
				}
				setTimeout(function(){
					alertbox.style.display = "none";	
					alertboxativo = false;
				},100 + i*20);
			},5000);
		},100 + i*20); 
	}
}


function loadAlertBox(){
	alertbox.style.position = "absolute";
	alertbox.id = "msgbox";
	alertbox.className = "msgbox";
	document.body.appendChild(alertbox);
	if(typeof(onLoadAlertBox)!="undefined"){
		onLoadAlertBox();
	}
}
var alertbox = document.createElement("div");
var alertboxativo = false;
if(window.attachEvent){
	window.attachEvent("onload",loadAlertBox);	
}
else{
	window.addEventListener("load",loadAlertBox,true);
}
