// JavaScript Document

/*LISTA DE PRECO*/
function l_categoria(){
nwin=window.open("lista_preco.php?categoria="+document.form_categoria.categoria.value,"lista","toolbar=no,height=600,width=900,scrollbars=yes");
nwin.focus();
return;
}
function l_marca(){
nwin=window.open("lista_preco.php?marca="+document.form_marca.marca.value,"lista","toolbar=no,height=600,width=900,scrollbars=yes");
nwin.focus();
return;
}
function l_todos(){
nwin=window.open("lista_preco.php?todos=1","lista","toolbar=no,height=600,width=900,scrollbars=yes");
nwin.focus();
return;
}



// Função que fecha o pop-up ao clicar no botao fechar
function fechar_desc_drivers(){
document.getElementById('descricao_drivers').style.display = 'none';
}
// Aqui definimos o tempo para fechar o pop-up automaticamente
function abrir_desc_drivers($id){
document.getElementById('descricao_drivers').style.display = 'block';
/*setTimeout ("fechar()", 3000); deterina qual o tempo automatico para fechamento do pop-up*/
}

//PAINEL DEPARTAMENTOS
function mostrar (div,valor){    
	if (valor == "1"){
		document.getElementById(div).style.display = "block";
	}else{
		document.getElementById(div).style.display = "none";
	}
}

//PARA ABAS DO MENU DETALHES DO PRODUTO
function blendoff(idname){
	document.getElementById(idname).style.display = 'none';
}
function blendon(idname){
document.getElementById(idname).style.display = 'block';
}

//DEFINE AS ABAS DO MENU DETALHES PRODUTO	
function swichtabs(wert) {
	if (wert=='1'){
		document.getElementById('tablink1').className='tab1 tabactive';
		document.getElementById('tablink2').className='tab2';
	    document.getElementById('tablink3').className='tab3';
		document.getElementById('tablink4').className='tab4';
	} else if (wert=='2'){
		document.getElementById('tablink1').className='tab1';
		document.getElementById('tablink2').className='tab2 tabactive';
	    document.getElementById('tablink3').className='tab3';
		document.getElementById('tablink4').className='tab4';
	} else if (wert=='3'){
		document.getElementById('tablink1').className='tab1';
		document.getElementById('tablink2').className='tab2';
	    document.getElementById('tablink3').className='tab3 tabactive';
		document.getElementById('tablink4').className='tab4';
	} else if (wert=='4'){
		document.getElementById('tablink1').className='tab1';
		document.getElementById('tablink2').className='tab2';
		document.getElementById('tablink3').className='tab3';
	    document.getElementById('tablink4').className='tab4 tabactive';
	}
}
//PULA CAMPO
function pula(maxlength,id,proximo){ 
   if(document.getElementById(id).value.length>=maxlength){ 
     document.getElementById(proximo).focus(); 
  } 
} 