// Menu de tabs de Plano y Rutas (seccion: 'como llegar a')
function pyr_1_pie_tab(opcion)
{
	if(opcion=='Origen'){
		document.getElementById("pyr1_tab_link2").style.fontWeight= 'normal'
		document.getElementById("pyr1_tab_link3").style.fontWeight= 'normal'
		document.getElementById("pyr1_tab_link1").style.fontWeight= 'bold'
				
		document.getElementById('pyr1_td_tab_destino').style.borderBottom= '1px solid #CF6663'
		document.getElementById('pyr1_td_tab_opciones').style.borderBottom= '1px solid #CF6663'
		document.getElementById('pyr1_td_tab_origen').style.borderBottom= '0px'
		
		document.getElementById('pyr1_td_tab_destino').style.backgroundColor= '#FFFFFF'
		document.getElementById('pyr1_td_tab_opciones').style.backgroundColor= '#FFFFFF'
		document.getElementById('pyr1_td_tab_origen').style.backgroundColor= '#FFDC50'
		
		document.getElementById('pyr1_pie_menu_destino').style.display= 'none'
		document.getElementById('pyr1_pie_menu_origen').style.display= 'inline'
		
		document.getElementById('pyr_pie_1_destino_options').style.display= 'none'
		document.getElementById('pyr_pie_1_options_avanzadas').style.display= 'none'
		document.getElementById('pyr_pie_1_origen_options').style.display= 'inline'
	}
	else if(opcion=='Destino'){
		document.getElementById("pyr1_tab_link1").style.fontWeight= 'normal'
		document.getElementById("pyr1_tab_link3").style.fontWeight= 'normal'
		document.getElementById("pyr1_tab_link2").style.fontWeight= 'bold'
		
		document.getElementById('pyr1_td_tab_origen').style.borderBottom= '1px solid #CF6663'
		document.getElementById('pyr1_td_tab_opciones').style.borderBottom= '1px solid #CF6663'
		document.getElementById('pyr1_td_tab_destino').style.borderBottom= '0px'
		
		document.getElementById('pyr1_td_tab_destino').style.backgroundColor= '#FFDC50'
		document.getElementById('pyr1_td_tab_opciones').style.backgroundColor= '#FFFFFF'
		document.getElementById('pyr1_td_tab_origen').style.backgroundColor= '#FFFFFF'
		
		document.getElementById('pyr1_pie_menu_origen').style.display= 'none'
		document.getElementById('pyr1_pie_menu_destino').style.display= 'inline'
		
		document.getElementById('pyr_pie_1_origen_options').style.display= 'none'
		document.getElementById('pyr_pie_1_options_avanzadas').style.display= 'none'
		document.getElementById('pyr_pie_1_destino_options').style.display= 'inline'
	}
	else if(opcion="Opciones"){
		document.getElementById("pyr1_tab_link1").style.fontWeight= 'normal'
		document.getElementById("pyr1_tab_link2").style.fontWeight= 'normal'
		document.getElementById("pyr1_tab_link3").style.fontWeight= 'bold'
				
		document.getElementById('pyr1_td_tab_destino').style.borderBottom= '1px solid #CF6663'
		document.getElementById('pyr1_td_tab_origen').style.borderBottom= '1px solid #CF6663'
		document.getElementById('pyr1_td_tab_opciones').style.borderBottom= '0px'
		
		document.getElementById('pyr1_td_tab_destino').style.backgroundColor= '#FFFFFF'
		document.getElementById('pyr1_td_tab_opciones').style.backgroundColor= '#FFDC50'
		document.getElementById('pyr1_td_tab_origen').style.backgroundColor= '#FFFFFF'
				
		document.getElementById('pyr1_pie_menu_destino').style.display= 'none'
		document.getElementById('pyr1_pie_menu_origen').style.display= 'none'
		
		document.getElementById('pyr_pie_1_destino_options').style.display= 'none'
		document.getElementById('pyr_pie_1_origen_options').style.display= 'none'
		document.getElementById('pyr_pie_1_options_avanzadas').style.display= 'inline'
	}
}

// Menu de tabs de Plano y Rutas (seccion: 'como llegar a')
function pyr_1_pie_menu_origen(opcion)
{
    var padre= document.getElementById('pyr_pie_1_origen_options');
    var elementos= padre.getElementsByTagName('div');
    for(i=0; i<elementos.length; i++){
        elementos[i].style.display= 'none'
        document.getElementById('pyr1_td_origen'+(i+1)).style.backgroundColor= '#FFFFFF'
        document.getElementById('pyr1_flecha_origen'+(i+1)).style.visibility= 'hidden'
    }
    elementos[opcion-1].style.display='inline'
    document.getElementById('pyr1_td_origen'+opcion).style.backgroundColor= '#FFDC50'
    document.getElementById('pyr1_flecha_origen'+opcion).style.visibility= 'visible'
    
    document.getElementById('pyr1_origen_combo1').innerHTML= ''
    document.getElementById('pyr1_origen_combo2').innerHTML= ''
    document.getElementById('pyr1_origen_combo3').innerHTML= ''
}

function ocultar_todo_pyr_pie_menu_origen(opcion){

    if(opcion== 'pyr1_origen'){
        var padre= document.getElementById('pyr_pie_1_origen_options');
        var elementos= padre.getElementsByTagName('div');
        for(i=0; i<elementos.length; i++){
            elementos[i].style.display= 'none'
        }
    }
    else if(opcion== 'pyr1_destino'){
        var padre= document.getElementById('pyr_pie_1_destino_options');
        var elementos= padre.getElementsByTagName('div');
        for(i=0; i<elementos.length; i++){
            elementos[i].style.display= 'none'
        }
    }
    else if(opcion== 'pyr2_origen'){
        var padre= document.getElementById('pyr_pie_2');
        var elementos= padre.getElementsByTagName('div');
        for(i=0; i<elementos.length; i++){
            elementos[i].style.display= 'none'
        }
    }
    else if(opcion== 'pyr3_origen'){
        var padre= document.getElementById('pyr_pie_3');
        var elementos= padre.getElementsByTagName('div');
        for(i=0; i<elementos.length; i++){
            elementos[i].style.display= 'none'
        }
    }
    else if(opcion== 'calculoRutas_origen'){
        var padre= document.getElementById('calculoRutas_origen_options');
        var elementos= padre.getElementsByTagName('div');
        for(i=0; i<elementos.length; i++){
            elementos[i].style.display= 'none'
        }
    }
    else if(opcion== 'calculoRutas_destino'){
        var padre= document.getElementById('calculoRutas_destino_options');
        var elementos= padre.getElementsByTagName('div');
        for(i=0; i<elementos.length; i++){
            elementos[i].style.display= 'none'
        }
    }
    else if(opcion== 'calculoRutas_QueTengoCerca'){
        var padre= document.getElementById('calculoRutas_QueTengoCerca_options');
        var elementos= padre.getElementsByTagName('div');
        for(i=0; i<elementos.length; i++){
            elementos[i].style.display= 'none'
        }
    }
}

// Menu de tabs de Plano y Rutas (seccion: 'como llegar a')
function pyr_1_pie_menu_destino(opcion)
{
    var padre= document.getElementById('pyr_pie_1_destino_options');
    var elementos= padre.getElementsByTagName('div');
    for(i=0; i<elementos.length; i++){
        elementos[i].style.display= 'none'
        document.getElementById('pyr1_td_destino'+(i+1)).style.backgroundColor= '#FFFFFF'
        document.getElementById('pyr1_flecha_destino'+(i+1)).style.visibility= 'hidden'
    }
    elementos[opcion-1].style.display='inline'
    document.getElementById('pyr1_td_destino'+opcion).style.backgroundColor= '#FFDC50'
    document.getElementById('pyr1_flecha_destino'+opcion).style.visibility= 'visible'
    
    document.getElementById('pyr1_destino_combo1').innerHTML= ''
    document.getElementById('pyr1_destino_combo2').innerHTML= ''
    document.getElementById('pyr1_destino_combo3').innerHTML= ''
}

// Menu de tabs de Plano y Rutas (seccion: 'que tengo cerca')
function pyr_2_pie_menus(opcion)
{
    var padre= document.getElementById('pyr_pie_2');
    var elementos= padre.getElementsByTagName('div');
    for(i=0; i<elementos.length; i++){
        elementos[i].style.display= 'none'
        document.getElementById('pyr2_td_'+(i+1)).style.backgroundColor= '#FFFFFF'
        document.getElementById('pyr2_flecha'+(i+1)).style.visibility= 'hidden'
    }
    elementos[opcion-1].style.display='inline'
    document.getElementById('pyr2_td_'+opcion).style.backgroundColor= '#FFDC50'
    document.getElementById('pyr2_flecha'+opcion).style.visibility= 'visible'
    
    document.getElementById('pyr2_origen_combo1').innerHTML= ''
    document.getElementById('pyr2_origen_combo2').innerHTML= ''
    document.getElementById('pyr2_origen_combo3').innerHTML= ''
}

// Menu de tabs de Plano y Rutas (seccion: 'donde esta')
function pyr_3_pie_menus(opcion)
{
    var padre= document.getElementById('pyr_pie_3');
    var elementos= padre.getElementsByTagName('div');
    for(i=0; i<elementos.length; i++){
        elementos[i].style.display= 'none'

        document.getElementById('pyr3_td_'+(i+1)).style.backgroundColor= '#FFFFFF'
        document.getElementById('pyr3_flecha'+(i+1)).style.visibility= 'hidden'
    }
    elementos[opcion-1].style.display='inline'
    document.getElementById('pyr3_td_'+opcion).style.backgroundColor= '#FFDC50'
    document.getElementById('pyr3_flecha'+opcion).style.visibility= 'visible'
    
    document.getElementById('pyr3_origen_combo1').innerHTML= ''
    document.getElementById('pyr3_origen_combo2').innerHTML= ''
    document.getElementById('pyr3_origen_combo3').innerHTML= ''
}

function spanBusquedaParadas(opcion, campo){

    document.getElementById(campo+'_tdMenuBusquedaParadas1').style.fontWeight= 'normal'
    document.getElementById(campo+'_tdMenuBusquedaParadas2').style.fontWeight= 'normal'
	document.getElementById(campo+'_tdMenuBusquedaParadas3').style.fontWeight= 'normal'
    
    document.getElementById(campo+'_tdMenuBusquedaParadas'+opcion).style.fontWeight= 'bold'
    document.getElementById(campo+'_tdMenuBusquedaParadas'+opcion).style.backgroundColor= '#FFDC50'
    
    document.getElementById(campo+'_spanBusquedaParadas').innerHTML= ''
    document.getElementById(campo+'_spanBusquedaParadas2').innerHTML= ''
	document.getElementById(campo+'_spanBusquedaParadas3').innerHTML= ''
    
    document.getElementById(campo+"_combo3").innerHTML=''
    
    if(opcion==1){
    	document.getElementById(campo+'_tdMenuBusquedaParadas2').style.backgroundColor= '#FFFFFF'
		document.getElementById(campo+'_tdMenuBusquedaParadas3').style.backgroundColor= '#FFFFFF'
    	
        document.getElementById(campo+'_spanBusquedaParadas').innerHTML= '<input type="text" size="28" value="'+txtBuscarCalle[idioma]+'" id="'+campo+'_BusquedaParada" onfocus=this.value="" title="'+titleIntroduzcaCalle[idioma]+'" />&nbsp;&nbsp;&nbsp;<input id="origenfindparadabutton" type="button" value="'+butBuscar[idioma]+'" onclick="findParadaPorCalle(\''+campo+'\')" class="boton" title="'+titleRealizarConsulta[idioma]+'" />';
        document.getElementById(campo+'_flecha_tdBusquedaParada1').style.visibility= 'visible';
        document.getElementById(campo+'_flecha_tdBusquedaParada2').style.visibility= 'hidden';
		document.getElementById(campo+'_flecha_tdBusquedaParada3').style.visibility= 'hidden';
    }
    else if(opcion==2){
    	document.getElementById(campo+'_tdMenuBusquedaParadas1').style.backgroundColor= '#FFFFFF'
		document.getElementById(campo+'_tdMenuBusquedaParadas3').style.backgroundColor= '#FFFFFF'
    
        document.getElementById(campo+'_flecha_tdBusquedaParada1').style.visibility= 'hidden';
        document.getElementById(campo+'_flecha_tdBusquedaParada2').style.visibility= 'visible';
		document.getElementById(campo+'_flecha_tdBusquedaParada3').style.visibility= 'hidden';
    }else if(opcion==3){
    	document.getElementById(campo+'_tdMenuBusquedaParadas1').style.backgroundColor= '#FFFFFF'
		document.getElementById(campo+'_tdMenuBusquedaParadas2').style.backgroundColor= '#FFFFFF'
    
		document.getElementById(campo+'_spanBusquedaParadas').innerHTML= '<input type="text" size="28" value="'+txtBuscarParada[idioma]+'" id="'+campo+'_BusquedaParada" onfocus=this.value="" title="'+titleIntroduzcaParada[idioma]+'" />&nbsp;&nbsp;&nbsp;<input id="origenfindparadabutton" type="button" value="'+butBuscar[idioma]+'" onclick="findParadaPorNombre(\''+campo+'\')" class="boton" title="'+titleRealizarConsulta[idioma]+'" />';
        document.getElementById(campo+'_flecha_tdBusquedaParada1').style.visibility= 'hidden';
        document.getElementById(campo+'_flecha_tdBusquedaParada2').style.visibility= 'hidden';
		document.getElementById(campo+'_flecha_tdBusquedaParada3').style.visibility= 'visible';
    }
	
}

function spanBusquedaHorarios(opcion, campo){

    document.getElementById(campo+'_tdMenuBusquedaParadas1').style.fontWeight= 'normal'
    document.getElementById(campo+'_tdMenuBusquedaParadas2').style.fontWeight= 'normal'
	document.getElementById(campo+'_tdMenuBusquedaParadas3').style.fontWeight= 'normal'
    
    document.getElementById(campo+'_tdMenuBusquedaParadas'+opcion).style.fontWeight= 'bold'
    document.getElementById(campo+'_tdMenuBusquedaParadas'+opcion).style.backgroundColor= '#FFDC50'
    
    document.getElementById(campo+'_spanBusquedaParadas').innerHTML= ''
    document.getElementById(campo+'_spanBusquedaParadas2').innerHTML= ''
    document.getElementById(campo+'_spanBusquedaParadas3').innerHTML= ''
    
	document.getElementById(campo+"_combo1").innerHTML=''
	document.getElementById(campo+"_combo2").innerHTML=''
    document.getElementById(campo+"_combo3").innerHTML=''
    
    if(opcion==1){
		//----- ESTADISTICAS ---------------------------------------------------------------
		oEstadisticas.opcion = 'EBUSPC';
		//TODO: AŅADIR PARAMETROS DE ESTADISTICAS EN ESTA FUNCION
		//--------------------------------------------------------------------
    	document.getElementById(campo+'_tdMenuBusquedaParadas2').style.backgroundColor= '#FFFFFF'
		document.getElementById(campo+'_tdMenuBusquedaParadas3').style.backgroundColor= '#FFFFFF'
    	
        document.getElementById(campo+'_spanBusquedaParadas').innerHTML= '<input type="text" size="28" value="'+txtBuscarCalle[idioma]+'" id="'+campo+'_BusquedaParada" onfocus=this.value="" title="'+titleIntroduzcaCalle[idioma]+'" />&nbsp;&nbsp;&nbsp;<input type="button" value="'+butBuscar[idioma]+'" onclick="findParadaPorCalle(\''+campo+'\')" class="boton" title="'+titleRealizarConsulta[idioma]+'" />';
        document.getElementById(campo+'_flecha_tdBusquedaParada1').style.visibility= 'visible';
        document.getElementById(campo+'_flecha_tdBusquedaParada2').style.visibility= 'hidden';
		document.getElementById(campo+'_flecha_tdBusquedaParada3').style.visibility= 'hidden';
    }
    else if(opcion==2){
		//----- ESTADISTICAS ---------------------------------------------------------------
		oEstadisticas.opcion = 'EBUSL';
		//TODO: AŅADIR PARAMETROS DE ESTADISTICAS EN ESTA FUNCION
		//--------------------------------------------------------------------
    	document.getElementById(campo+'_tdMenuBusquedaParadas1').style.backgroundColor= '#FFFFFF'
		document.getElementById(campo+'_tdMenuBusquedaParadas3').style.backgroundColor= '#FFFFFF'
    	
        document.getElementById(campo+'_flecha_tdBusquedaParada1').style.visibility= 'hidden';
        document.getElementById(campo+'_flecha_tdBusquedaParada2').style.visibility= 'visible';
		document.getElementById(campo+'_flecha_tdBusquedaParada3').style.visibility= 'hidden';
    }
	else if(opcion==3){
		//----- ESTADISTICAS ---------------------------------------------------------------
		oEstadisticas.opcion = 'EBUSN';
		//TODO: AŅADIR PARAMETROS DE ESTADISTICAS EN ESTA FUNCION
		//--------------------------------------------------------------------
    	document.getElementById(campo+'_tdMenuBusquedaParadas1').style.backgroundColor= '#FFFFFF'
		document.getElementById(campo+'_tdMenuBusquedaParadas2').style.backgroundColor= '#FFFFFF'
    	
		document.getElementById(campo+'_spanBusquedaParadas').innerHTML= '<input type="text" size="28" value="'+txtBuscarParada[idioma]+'" id="'+campo+'_BusquedaParada" onfocus=this.value="" title="'+titleIntroduzcaParada[idioma]+'" />&nbsp;&nbsp;&nbsp;<input type="button" value="'+butBuscar[idioma]+'" onclick="findParadasWithSAE(\''+campo+'\')" class="boton" title="'+titleRealizarConsulta[idioma]+'" />';
        document.getElementById(campo+'_flecha_tdBusquedaParada1').style.visibility= 'hidden';
        document.getElementById(campo+'_flecha_tdBusquedaParada2').style.visibility= 'hidden';
		document.getElementById(campo+'_flecha_tdBusquedaParada3').style.visibility= 'visible';
    }
}

function spanLugarInteres(opcion, campo){

    document.getElementById(campo+'_tdMenuLugarInteres1').style.fontWeight= 'normal'
    document.getElementById(campo+'_tdMenuLugarInteres2').style.fontWeight= 'normal'
    
    document.getElementById(campo+'_tdMenuLugarInteres'+opcion).style.fontWeight= 'bold'
    document.getElementById(campo+'_tdMenuLugarInteres'+opcion).style.backgroundColor= '#FFDC50'
    
    document.getElementById(campo+'_spanLugarInteres').innerHTML= ''
    document.getElementById(campo+'_spanLugarInteres2').innerHTML= ''
    
    document.getElementById(campo+"_combo1").innerHTML=''
    document.getElementById(campo+"_combo2").innerHTML=''
    document.getElementById(campo+"_combo3").innerHTML=''
    
    if(opcion==1){
    	document.getElementById(campo+'_tdMenuLugarInteres2').style.backgroundColor= '#FFFFFF'
    	
        document.getElementById(campo+'_spanLugarInteres').innerHTML= '<input type="text" size="35" value="'+txtLugarInteres[idioma]+'" title="'+titleIntroduzcaLugarInteres[idioma]+'" id="'+campo+'_lugarInteres" onfocus=this.value="" />&nbsp;&nbsp;&nbsp;<input id="origenfindlugarinteresbutton" type="button" value="'+butBuscar[idioma]+'" onclick="findPoint(\''+campo+'\')" class="boton" title="'+titleRealizarConsulta[idioma]+'" /><br />';
        document.getElementById(campo+'_flecha_tdLugarInteres1').style.visibility= 'visible';
        document.getElementById(campo+'_flecha_tdLugarInteres2').style.visibility= 'hidden';
    }
    else{
    	document.getElementById(campo+'_tdMenuLugarInteres1').style.backgroundColor= '#FFFFFF'
    	
        document.getElementById(campo+'_flecha_tdLugarInteres1').style.visibility= 'hidden';
        document.getElementById(campo+'_flecha_tdLugarInteres2').style.visibility= 'visible';
    }
}

function eyr_tab(opcion)
{
	if(opcion=='Encuadres'){
		document.getElementById("eyr_tab_link2").style.fontWeight= 'normal'
		document.getElementById("eyr_tab_link1").style.fontWeight= 'bold'
				
		document.getElementById('eyr_td_tab_rutas').style.borderBottom= '1px solid #CF6663'
		document.getElementById('eyr_td_tab_encuadres').style.borderBottom= '0px'
		
		
		document.getElementById('eyr_div_rutas').style.display= 'none'
		document.getElementById('eyr_div_encuadres').style.display= 'block'
	}
	else if(opcion=='Rutas'){
		document.getElementById("eyr_tab_link1").style.fontWeight= 'normal'
		document.getElementById("eyr_tab_link2").style.fontWeight= 'bold'
		
		document.getElementById('eyr_td_tab_encuadres').style.borderBottom= '1px solid #CF6663'
		document.getElementById('eyr_td_tab_rutas').style.borderBottom= '0px'
		
		document.getElementById('eyr_div_encuadres').style.display= 'none'
		document.getElementById('eyr_div_rutas').style.display= 'block'
	}
}
