function extra(caixa){
	if (document.getElementById(caixa).style.display == 'none') 
		document.getElementById(caixa).style.display = '';
	else
		document.getElementById(caixa).style.display = 'none';
}


function verifica(){
	if(document.form1.nome.value == ""){
		alert("O Campo Nome deve ser preenchido!");
		return false;
	}
	if(document.form1.email.value == ""){
		alert("O Campo E-mail deve ser preenchido!");
		return false;
	}
	if(document.form1.mensagem.value == ""){
		alert("O Campo Mensagem deve ser preenchido!");
		return false;
	}
}

/****************
Accordion
*****************/
acc_atual = 1;

//Função para redirecionar para a página indicada
function abrePag(pagina){
	window.self.location = pagina + ".html";
}

//Função para carregar o efeito Accordion
function carrega(opcao){
	catSelec = readCookie(opcao);
	if(catSelec == null || catSelec == "")
		catSelec = "test1-header";
	if((catSelec == "test12-header") || (catSelec == "test13-header"))
		catSelec = "test1-header";
			
	if(document.getElementById(catSelec) != null)
		document.getElementById(catSelec).className += " header_highlight";
	new Accordian('basic-accordian',5,'header_highlight');
}
function carrega2(opcao){
	catSelec = readCookie(opcao);
	if(catSelec == null || catSelec == "")
		catSelec = "test12-header";
	if((catSelec != "test12-header") && (catSelec != "test13-header"))
		catSelec = "test12-header";
	
	if(document.getElementById(catSelec) != null)
		document.getElementById(catSelec).className += " header_highlight";
	new Accordian('basic-accordian',5,'header_highlight');
}


//Função que redireciona para a categoria, selecionando o Accordion
function redirCat(idCat){ //Redireciona para Produtos
	createCookie("categoria",idCat,1);
	window.self.location = "produtos.php";
}
function redirCatSer(idCat){ //Redireciona para Laboratorios
	createCookie("categoria",idCat,1);
	window.self.location = "servicos.html";
}


//Função que redireciona para o produto, selecionando o Accordion
function redirProd(idCat,idProd){
	createCookie("categoria",idCat,1); //grava cookie para a função "Voltar"
	createCookie("produto",idProd,1);
	window.self.location = "produtos_desc.html";
}

/* Funções de Cookies */
function createCookie(name,value,days) {
	if (days) {
		var date = new Date();
		date.setTime(date.getTime()+(days*24*60*60*1000));
		var expires = "; expires="+date.toGMTString();
	}
	else var expires = "";
	document.cookie = name+"="+value+expires+"; path=/";
}

function readCookie(name) {
	var nameEQ = name + "=";
	var ca = document.cookie.split(';');
	for(var i=0;i < ca.length;i++) {
		var c = ca[i];
		while (c.charAt(0)==' ') c = c.substring(1,c.length);
		if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
	}
	return null;
}

function eraseCookie(name) {
	createCookie(name,"",-1);
}


/* Funcoes para imitar o efeito de link (Hover), pois o Accordion nao funciona bem com links*/
function mimeLinkOver(item){
	item.style.color = "#FFF";
}
function mimeLinkOverLI(opcao){
	document.getElementById("li_1").className = "";
	document.getElementById("li_2").className = "";
	document.getElementById("li_3").className = "";
	document.getElementById("li_4").className = "";
	document.getElementById("li_5").className = "";
	document.getElementById("li_6").className = "";
	document.getElementById("li_"+opcao).className = "acc-sel";
	document.getElementById("li_"+acc_atual).className = "acc-sel";
}
function mimeLinkOutLI(opcao){
	document.getElementById("li_1").className = "";
	document.getElementById("li_2").className = "";
	document.getElementById("li_3").className = "";
	document.getElementById("li_4").className = "";
	document.getElementById("li_5").className = "";
	document.getElementById("li_6").className = "";
	document.getElementById("li_"+acc_atual).className = "acc-sel";
	document.getElementById("test"+acc_atual+"-header").className = "accordion_headings acc-sel-branco";
}
function mimeLinkOut(item){
	item.style.color = "#527bd2";
	item.style.textDecoration = "none";
	document.getElementById("li_"+acc_atual).className = "acc-sel";
	document.getElementById("test"+acc_atual+"-header").className = "accordion_headings acc-sel-branco";
	document.getElementById("test"+acc_atual+"-header").style.color = "#FFF";
}
function mimeLinkCli(item){
	alert(item.style.paddingLeft);
	item.style.color = "#f39a00";
	item.style.paddingLeft = "10px";
}
function mimeRestore(){
	document.getElementById("test"+1+"-header").style.color = "#527bd2";
	document.getElementById("test"+2+"-header").style.color = "#527bd2";
	document.getElementById("test"+3+"-header").style.color = "#527bd2";
	document.getElementById("test"+4+"-header").style.color = "#527bd2";
	document.getElementById("test"+5+"-header").style.color = "#527bd2";
	document.getElementById("test"+6+"-header").style.color = "#527bd2";
}

/************/
function locMostra(opcao){
	document.getElementById("sentido1").style.display = "none";
	document.getElementById("sentido2").style.display = "none";
	document.getElementById("sentido3").style.display = "none";
	document.getElementById("sentido4").style.display = "none";
	document.getElementById(opcao).style.display = "";
}
