/************************************************************************** GLOBAL VARIABLES **************************************************************************/ var cache = []; var dim = { wh : $(window).height(), ww : $(window).width() }; /************************************************************************** GLOBAL EVENT LISTENERS FUNCTIONS **************************************************************************/ function ready() { navManager.init(); widgetBiblioteca(); // Pulisci codice cataloghi priscilla if (!$('div.priscillaskin').length) { $('section.news article img').attr('style', ''); $('div.priscillacatalog').each(function(){ var cid = $(this).attr('id'); if (cid == "catalog_4" || cid == "catalog_47") return; $('img', this).attr('style', ''); $(this).next('div[style^="clear"]').remove(); $('>div:not(.catalogo)>a', this).remove(); $('div[style^="clear"]', this).remove(); $('>div.catalogo',this).css('clear', 'both'); // paginazione catalogo $('>div:not(.catalogo)',this).unwrap().children().unwrap(); }); } $("article.comunicazione img").attr("style", ""); $("article.evento img").attr("style", ""); $("ul.features li:empty").remove(); $("h2 + h2").each(function(index){ $(this).prev("h2").hide(); }); $("section.content .inHead").appendTo("header.bottom .grid").fadeIn(); } function load() { } function resize() { dim.wh = $(window).height(); dim.ww = $(window).width(); } /************************************************************************** FUNCTIONS **************************************************************************/ function widgetBiblioteca(){ $('aside .biblioteca .labels a').click(function(e){ e.preventDefault(); var el = $(this), p = el.parents('.biblioteca'); el.addClass('active').siblings().removeClass('active'); p.children('.tabs').css('margin-left',-el.index()*p.outerWidth()+'px'); }) } var navManager = {}; navManager.init = function(){ biblioteche = { 'ariostea':'Biblioteca Ariostea', 'niccolini':'Biblioteca Casa Niccolini', 'bassani':'Biblioteca Bassani', 'luppi':'Biblioteca Luppi', 'tebaldi':'Biblioteca Tebaldi', 'rodari':'Biblioteca Rodari', 'archivio':'Archivio storico', 'cds':'CDS' } _html = $('html'); _navTop = $('header.top nav'); _navBottom = $('header.bottom nav'); _navAside = $('aside nav'); _navBtn = $('').appendTo('header.top .grid'); _navTabs = $('
').appendTo('header.top .grid'); if(_navAside.length > 0){ _navTabs.prepend('