$(document).ready(function(){ var _startInterval = function () { var _timer = null; _timer = setInterval(function () { if (document.location.hash.replace('#', '') == 'excurs') { floor = 1; openExcurs(); _timer = clearInterval(_timer); } }, 500); } _startInterval(); { // tooltip для ссылок $('.content a').tooltip({ track: true, delay: 0, showURL: false, showBody: false, fade: 250 }); $('a.tooltip').click(function () { return false; }) } $("table.tbl tr:nth-child(even)").addClass("chet"); $('.clock .table').clock({offset: '3', type: 'digital'}); $('.topBanners .scroll ul').jcarousel({scroll:1}); function mycarousel_initCallback(carousel) { carousel.buttonNext.bind('click', function() { carousel.startAuto(0); }); carousel.buttonPrev.bind('click', function() { carousel.startAuto(0); }); $('.bigboard .scroll').hover(function() { carousel.stopAuto(); }, function() { carousel.startAuto(); }); $('.bigboard .paging div').bind('click', function() { carousel.scroll($.jcarousel.intval( $(this).attr("rel") )); //$('.bigboard .paging div').removeClass('current'); //$(this).addClass('current'); return false; }); }; $('.bigboard .scroll ul').jcarousel({ initCallback: mycarousel_initCallback, setupCallback: bigboardInbsertMask, scroll:1, auto:3, wrap:'last', itemVisibleInCallback: { onAfterAnimation: function( carusel, current_el, index ){ $('.bigboard .paging div').removeClass('current'); $('.bigboard .paging div:nth-child('+index+')').addClass('current'); $("#abigboard").attr('href', $('.bigboard li.jcarousel-item-'+index+' a').attr('href') ); } } }); /* $("a.ban2").fancybox({ 'width' : '100%', 'height' : '500px', 'padding' : 0, 'autoScale' : false, 'transitionIn' : 'none', 'transitionOut' : 'none', 'swf': {allowScriptAccess:'always', wmode: 'transparent'} }); */ $("a.ban2").click(function(){ floor = 1; openExcurs(); //return false; }); $('a.plus').hide(); //alert( $('#next_schedule').height() - $('.topBanners .ban3').height() ); scheduleHeight = $('#next_schedule').height() - $('.topBanners .ban3').height() + 20; $('#next_schedule').css("top", "-" + scheduleHeight + "px" ); $('.ban3 a.more').toggle( function(){ $('.ban3 .nextImage').hide(); $('#next_schedule').animate({ "top": "+"+( $('.topBanners .ban3').height() - 10 )+"px" }, "slow" ); return false; }, function () { $('#next_schedule').animate({ "top": "-"+scheduleHeight+"px" }, "slow", function(){ $('.ban3 .nextImage').show(); } ); return false; } ); reInitLinks( $('#steps') ); $('.steps_inner .jcarousel-prev').hide(); $('.steps_inner .jcarousel-next').hide(); $('.steps_inner .jcarousel-prev').click( function(){ var left = $('#steps').position().left; var num_elements = $('#steps .steps_wrap').length; if ( left < 0 ) { $('.steps_inner .jcarousel-prev').show(); $('#steps').animate({"left": ( left + 225 )+'px'}); if ( ( left + 225 ) == 0 ) { $('.steps_inner .jcarousel-prev').hide(); } if ( ( left + 225 ) <= 0 && num_elements > 3 ) { $('.steps_inner .jcarousel-next').show(); } } }); $('.steps_inner .jcarousel-next').click( function(){ var left = $('#steps').position().left; var num_elements = $('#steps .steps_wrap').length; $('#steps').animate({"left": ( left - 225 ) +'px'}); if ( ( left - 225 ) < 0 ) { $('.steps_inner .jcarousel-prev').show(); } if ( ( left - 225 ) <= - ( 225 * ( num_elements - 3 ) ) ) { $('.steps_inner .jcarousel-next').hide(); } }); }); function itemLoadCallbackFunction(carousel, state) { for (var i = carousel.first; i <= carousel.last; i++) { // Check if the item already exists if (!carousel.has(i)) { // Add the item carousel.add(i, "I'm item #" + i); } } }; function reInitLinks( parent ) { $('a', parent).click( function(){ var _this = $(this) _parent = $(_this).parents('.steps_wrap'); $(_parent).nextAll().remove(); $( '.step', parent).removeClass('here'); $( _this ).parent( ).parent( ).addClass('here'); $.get( _this.attr('href')+'&is_ajax=1', function(data){ if ( _this.attr('name') != '' ) { $('#abon').show(); $('#abon').html( data ); } else { $('#steps').append( data ); $('#abon').hide(); reInitLinks( $('#steps .steps_wrap:last') ); var num_elements = $('#steps .steps_wrap').length; $('#steps').width( 225 * num_elements ); if ( num_elements > 3 ) { $('#steps').animate({ "left": - ( 225 * ( num_elements - 3 ) ) +'px' }); $('.steps_inner .jcarousel-prev').show(); //$('.jcarousel-next').show(); if ( ( $('#steps').position().left - 225 ) <= - ( 225 * ( num_elements - 3 ) ) ) { $('.steps_inner .jcarousel-next').hide(); } } else { $('#steps').animate({ "left": 0 }); $('.steps_inner .jcarousel-prev').hide(); $('.steps_inner .jcarousel-next').hide(); } } }); return false; }); } function bigboardInbsertMask(){ $('.bigboard .jcarousel-container').append('
'); $("#abigboard").attr('href', $('.bigboard li.jcarousel-item-1 a').attr('href') ); $("#abigboard").attr('target', $('.bigboard li.jcarousel-item-1 a').attr('target') ); } function openExcurs(){ var fv = 'startfloor='+floor; if($.flash.version.major > 9){ $.fancybox({ 'href' : _root+'public/flash/excurs/excurs3.swf', 'width' : '100%', 'height' : '500px', 'padding' : 0, 'autoScale' : false, 'transitionIn' : 'none', 'transitionOut' : 'none', 'swf': {allowScriptAccess:'always', wmode: 'transparent', flashvars: fv } }); } else { $.fancybox({ 'padding' : '50px', 'content' : '
Для просмотра виртуальной экскурсии необходим установленный Adobe Flash Player версии 9 или выше
Установить новейшую версию Flash Player сейчас
' }); } return false; } var floor = 1; function floorchanged(num){ floor = num; } function opengallery(name){ $.get(_root + 'include/list_photos.php', {name: name}, function (data) { $.fancybox(data, { 'padding' : 0, 'transitionIn' : 'none', 'transitionOut' : 'none', 'cyclic' : true, 'onClosed' : fancyboxClosed }); }, 'json'); } function openpanoram(name){ if($.flash.version.major > 9){ $.fancybox({ 'href' : _root+'public/flash/excurs/'+name+'.swf', 'width' : '100%', 'height' : '500px', 'padding' : 0, 'autoScale' : false, 'transitionIn' : 'none', 'transitionOut' : 'none', 'swf' : {allowScriptAccess:'always', wmode: 'transparent', allowFullScreen: 'true'}, 'onClosed' : fancyboxClosed }); } else { $.fancybox({ 'padding' : '50px', 'content' : '
Для просмотра виртуальной экскурсии необходим установленный Adobe Flash Player версии 9 или выше
Установить новейшую версию Flash Player сейчас
' }); } } function fancyboxClosed(){ // alert(' - fancyboxClosed'); //$.delay(1500).openExcurs(); var t = setTimeout ( openExcurs, 500 ); } function disqus_config() { this.callbacks.afterRender = [function() { $('#disqus_thread .dsq-reply h3').html('Отзывы:'); }]; }