function mnu(){
//inicializa todos os botoes por seção
if(secao==1){
	document.getElementById("mn1").src="img/01_bot_home_on.gif";
}else{
	document.getElementById("mn1").src="img/01_bot_home_off.gif";
}

if(secao==2){
	document.getElementById("mn2").src="img/02_bot_empresa_on.gif";
}else{
	document.getElementById("mn2").src="img/02_bot_empresa_off.gif";
}

if(secao==3){
	document.getElementById("mn3").src="img/03_bot_lojas_on.gif";
}else{
	document.getElementById("mn3").src="img/03_bot_lojas_off.gif";
}

if(secao==4){
	document.getElementById("mn4").src="img/04_bot_garantia_on.gif";
}else{
	document.getElementById("mn4").src="img/04_bot_garantia_off.gif";
}

if(secao==5){
	document.getElementById("mn5").src="img/05_bot_consultas_on.gif";
}else{
	document.getElementById("mn5").src="img/05_bot_consultas_off.gif";
}

if(secao==6){
	document.getElementById("mn6").src="img/06_bot_contatenos_on.gif";
}else{
	document.getElementById("mn6").src="img/06_bot_contatenos_off.gif";
}

//fim inicializa todos os botoes por seção

//acoes botao 1
document.getElementById("mn1").onmouseover = function(){
	if(secao==1){
	document.getElementById("mn1").src="img/01_bot_home_on.gif";
	}else{
	document.getElementById("mn1").src="img/01_bot_home_on.gif";
	}
}

document.getElementById("mn1").onmouseout = function(){

	if(secao==1){
	document.getElementById("mn1").src="img/01_bot_home_on.gif";
	}else{
	document.getElementById("mn1").src="img/01_bot_home_off.gif";
	}
}

document.getElementById("mn1").onclick = function(){
document.location.href="./";
}
//fim acoes botao 1

//acoes botao 2
document.getElementById("mn2").onmouseover = function(){
	if(secao==2){
	document.getElementById("mn2").src="img/02_bot_empresa_on.gif";
	}else{
	document.getElementById("mn2").src="img/02_bot_empresa_on.gif";
	}
}

document.getElementById("mn2").onmouseout = function(){

	if(secao==2){
	document.getElementById("mn2").src="img/02_bot_empresa_on.gif";
	}else{
	document.getElementById("mn2").src="img/02_bot_empresa_off.gif";
	}
}

document.getElementById("mn2").onclick = function(){
document.location.href="empresa.php";
}
//fim acoes botao 2

//acoes botao 3
document.getElementById("mn3").onmouseover = function(){
	if(secao==3){
	document.getElementById("mn3").src="img/03_bot_lojas_on.gif";
	}else{
	document.getElementById("mn3").src="img/03_bot_lojas_on.gif";
	}
}

document.getElementById("mn3").onmouseout = function(){

	if(secao==3){
	document.getElementById("mn3").src="img/03_bot_lojas_on.gif";
	}else{
	document.getElementById("mn3").src="img/03_bot_lojas_off.gif";
	}
}

document.getElementById("mn3").onclick = function(){
document.location.href="lojas.php";
}
//fim acoes botao 3

//acoes botao 4
document.getElementById("mn4").onmouseover = function(){
	if(secao==4){
	document.getElementById("mn4").src="img/04_bot_garantia_on.gif";
	}else{
	document.getElementById("mn4").src="img/04_bot_garantia_on.gif";
	}
}

document.getElementById("mn4").onmouseout = function(){

	if(secao==4){
	document.getElementById("mn4").src="img/04_bot_garantia_on.gif";
	}else{
	document.getElementById("mn4").src="img/04_bot_garantia_off.gif";
	}
}

document.getElementById("mn4").onclick = function(){
document.location.href="garantia.php";
}
//fim acoes botao 4

//acoes botao 5
document.getElementById("mn5").onmouseover = function(){
	if(secao==5){
	document.getElementById("mn5").src="img/05_bot_consultas_on.gif";
	}else{
	document.getElementById("mn5").src="img/05_bot_consultas_on.gif";
	}
}

document.getElementById("mn5").onmouseout = function(){

	if(secao==5){
	document.getElementById("mn5").src="img/05_bot_consultas_on.gif";
	}else{
	document.getElementById("mn5").src="img/05_bot_consultas_off.gif";
	}
}

document.getElementById("mn5").onclick = function(){
document.location.href="consultas.php";
}
//fim acoes botao 5

//acoes botao 6
document.getElementById("mn6").onmouseover = function(){
	if(secao==6){
	document.getElementById("mn6").src="img/06_bot_contatenos_on.gif";
	}else{
	document.getElementById("mn6").src="img/06_bot_contatenos_on.gif";
	}
}

document.getElementById("mn6").onmouseout = function(){

	if(secao==6){
	document.getElementById("mn6").src="img/06_bot_contatenos_on.gif";
	}else{
	document.getElementById("mn6").src="img/06_bot_contatenos_off.gif";
	}
}

document.getElementById("mn6").onclick = function(){
document.location.href="contato.php";
}
//fim acoes botao 6


}


url = document.location.href;
xend = url.lastIndexOf("/") + 1;
var base_url = url.substring(0, xend);


function ajax_do (url) {
       
        if (url.substring(0, 4) != 'http') {
                url = base_url + url;
        }

        var jsel = document.createElement('SCRIPT');
        jsel.type = 'text/javascript';
        jsel.src = url;

        document.body.appendChild (jsel);
		
}

var i=0;

function ajax_get (url, el) {
   
        if (typeof(el) == 'string') {
                el = document.getElementById(el);
        }

    
        if (el == null) { return false; }

	

     
        if (url.substring(0, 4) != 'http') {
				url = 'http://www.helpcel.com.br/'+ url;
				
        }
	
	el.innerHTML="<img src='img/carregando.gif' vspace='10' hsapce='10'>";
   
        getfile_url =  base_url + "getfile.php?url=" + escape(url) + "&el=" + escape(el.id);

        
       

	  ajax_do (getfile_url);
	   
          return true;
}



function mostraEndereco(valorSelect, indexSelect, idObj) {
	if (indexSelect == 0){
		document.getElementById('td1_endereco').style.display='none';
		document.getElementById('td2_endereco').style.display='none';
	}else{
		document.getElementById('td1_endereco').style.display='';
		document.getElementById('td2_endereco').style.display='';
		ajax_get ("mostra_endereco.php?localid="+ valorSelect+"", idObj);
	}
}

/* função utilizada para mudar dois campos select ao mesmo tempo de acordo com a marca*/
function buscaDados(object){
	//apaga o endereço do local
	document.getElementById('td1_endereco').style.display='none';
	document.getElementById('td2_endereco').style.display='none';
	//nao tem mais modelo
	//ajax_get('select_modelo_cel.php?marcaid=' + object +'', 'div_modelo');
	ajax_get('select_local_atend.php?marcaid=' + object +'', 'div_localatend');
}



