function fixMenu(){ var topMenu = jQuery(''); topMenu.append(jQuery('.l-header .menu .Custom-arshive').show()).find('.JS-Menu-Button').bind('click',function(){ animateCustomMenuItems(jQuery(this)); return false; }); topMenu.append(jQuery('.l-header .menu .Custom-mediaroom').show()).find('.JS-Menu-Button').bind('click',function(){ animateCustomMenuItems(jQuery(this)); return false; }); topMenu.appendTo(jQuery('.l-userbar')); topMenu.find('.JS-Menu-Button').trigger('click'); var bottomMenu = jQuery('.double-menu').find('.Custom-arshive').remove().end(), permItem = bottomMenu.find('.Custom-perm').remove(), permLink = permItem.find('a'); permItem.find('dt').appendTo(bottomMenu.find('.Custom-o_forume')).show(); } function animateCustomMenuItems(obj) { var duration = 200, item = obj.parents('.JS-Menu-Item').eq(0), subitems = item.find('.JS-Menu-Subitems'); if( !item.hasClass('JS-Menu-Item-animating') ){ item.addClass('.JS-Menu-Item-animating'); if( item.hasClass('JS-Menu-Item-active') ){ subitems.css({'opacity' : '0'}).show().animate({'opacity' : '1'}, duration, function(){ item.removeClass('JS-Menu-Item-animating').removeClass('JS-Menu-Item-active'); }); }else{ subitems.css({'opacity' : '1'}).animate({'opacity' : '0'}, duration, function(){ subitems.hide(); item.removeClass('JS-Menu-Item-animating').addClass('JS-Menu-Item-active'); }); } } return false; } function createPopupContent(selectedArray, selectedIndex, selectedOpts){ var currentItem = jQuery(selectedArray[selectedIndex]).parents('.partners__item').html(), popupContentBlock = jQuery('#partner-popup').find('.partner-popup__content'); popupContentBlock.html(currentItem).find('.partners__logo__img').unwrap('a'); } jQuery(document).ready(function(){ fixMenu(); jQuery('.JS-Menu:not(.js-ready)').each(function(){new Menu(jQuery(this).addClass('js-ready'),{ classActiveItem : 'menu__item_active', minHeight : 8 })}); jQuery('.JS-Slider-banner:not(.JS-ready)').each(function(){new Slider(jQuery(this).addClass('JS-ready'),{ autoPlay : true, interval : 5000, duration : 500, classActiveDirect : 'slider__direct_active' })}); jQuery('.JS-Slider:not(.JS-ready)').each(function(){new Slider(jQuery(this).addClass('JS-ready'),{ duration : 'auto', classActiveDirect : 'slider__direct_active' })}); jQuery('.partner-popup-link').fancybox({ onStart: createPopupContent, showCloseButton : false, titleShow : false, padding : 0, centerOnScroll : true }); jQuery('.partner-popup__close').bind('click', function(){ jQuery.fancybox.close(); return false; }); jQuery('.programm').each(function(){new Programm(this)}); jQuery('.programm a.programm__event__title, .person a.person__event-link').fancybox({ width : 810, height: 600, padding : 0, speedIn : 0, speedOut : 0, centerOnScroll : true }); jQuery('.js-gallery-popup').fancybox({ autoScale : false, hideOnContentClick : true, centerOnScroll : false, zoomSpeedIn : 1000, zoomSpeedOut : 1000, padding : 0, cyclic : true }); });