function initFechasEventos(){
	$(".menuEventual li").hover(function () {
        // switch all tabs off
        $(".menuEventual li.actual").removeClass("actual");

        // switch this tab on
        $(this).addClass("actual");

        // slide all elements with the class 'content' up
        $(".infoEvento").slideUp();

        // Now figure out what the 'title' attribute value is and find the element with that id.  Then slide that down.
        var content_show = $(this).attr("title");
        $("#"+content_show).slideDown('normal');
    },
	function(){});
}

function initTabsTools(){
    $(".tabsTools li").click(function () {
        // switch all tabs off
        $(".tabsTools li.actual").removeClass("actual");

        // switch this tab on
        $(this).addClass("actual");

        // slide all elements with the class 'content' up
        $(".contentFichaTools").slideUp();

        // Now figure out what the 'title' attribute value is and find the element with that id.  Then slide that down.
        var content_show = $(this).attr("title");
        $("#"+content_show).slideDown('normal');
    });
}

function initTabs(){
    $(".tabs li").click(function () {
        // switch all tabs off
        $("#main li.actual").removeClass("actual");

        // switch this tab on
        $(this).addClass("actual");

        // slide all elements with the class 'content' up
        $(".contentFicha").slideUp();

        // Now figure out what the 'title' attribute value is and find the element with that id.  Then slide that down.
        var content_show = $(this).attr("title");
        $("#"+content_show).slideDown('normal');
    });
	$(".desactivada").unbind();
}

function initCallejero(){
    $("#buscarCallejero").submit(function(){
        $("#mapHerramientas").removeClass("oculta");
        var direccion = $("#dirCallejero").val();
        carga(direccion+", spain", "spain", '', 16, "mapHerramientas", "mapHerramientasError", false);
        return false;
    });
}

$(document).ready(function(){
	initFechasEventos();
    initTabsTools();
	initTabs();
    initCallejero();
});