//Guilherme Schmidt

window.onload = function(){
	conta_data();
	//monta_pop();
}

function conta_data(){
	var agora = new Date();
	var natal = new Date(2010,06,18);
	var tempo = natal.getTime() - agora.getTime();
	tempo = tempo/(1000*60*60*24);
	tempo = Math.floor(tempo);
	document.getElementById('data').innerHTML = "Faltam <br>" + tempo + " dias"
}

function fecha_pop(){
	document.getElementById("pop").style.display = "none";
}

var t;

function monta_pop(){
	var div = document.getElementById("pop");
	div.style.overflow = "hidden";
	div.style.height = 0+"px";
	div.style.display = "block";
	t = setInterval(cresce, 10);
}

function cresce(){
	var div = document.getElementById("pop");
	var atual = div.style.height;
	atual = Number(atual.replace("px", ""));
	if(atual == 380){
		clearInterval(t);
		t = setInterval(desce, 10);
	}else{
		atual = atual+5;
		div.style.height = atual+"px";
	}
}

function desce(){
	var div = document.getElementById("pop");
	var atual = div.style.top;
	atual = Number(atual.replace("px", ""));
	if(atual == 120){
		clearInterval(t);
	}else{
		atual = atual+5;
		div.style.top = atual+"px";
	}
}