function box(){
	var box = document.getElementById("news2");
	if(box.style.display == "block")
		box.style.display = "none";
	else
		box.style.display = "block";
}
		
function curriculo(){
	var box = document.getElementById("trabalhe");
	if(box.style.display == "block")
		box.style.display = "none";
	else
		box.style.display = "block";
}
		

function cadastroNews(){
	var nome	= document.news.nome.value;
	var email 	= document.news.email.value;
	if(nome != "" && nome != "Nome" && email != "" && email != "E-mail")
		document.news.submit();
	else
		alert("Preencha corretamente o campo Nome e o campo E-mail");
}

function cadastroNewsHome(){
	var nome	= document.newshome.nome.value;
	var email 	= document.newshome.email.value;
	if(nome != "" && nome != "Nome" && email != "" && email != "E-mail")
		document.newshome.submit();
	else
		alert("Preencha corretamente o campo Nome e o campo E-mail");
}

function abrefoto(){
	var box = document.getElementById("funcionarios");
	if(box.style.display == "block")
		box.style.display = "none";
	else
		box.style.display = "block";
}


function format(obj,mask){
	var str 	  = obj.value;
	var ret 	  = "";
	var strCheck  = '0123456789';
	var str_limpa = "";
	var posicao   = 0;
	
	// Pega somente os caracteres numericos da string
	for(i=0;i<str.length;i++){
		if(strCheck.indexOf(str.charAt(i)) >= 0)
			str_limpa += str.charAt(i);
	}

	for(i=0;i<mask.length;i++){
		if(posicao >= str_limpa.length)
			break;
		
		if(mask.charAt(i) == "*"){
			ret += str_limpa.charAt(posicao);
			posicao++;
		}
		else{
			ret += mask.charAt(i);
		}
	}
	
	obj.value = ret;
}


