$(document).ready(function() { $('a[rel=fancybox]').fancybox({ 'opacity' : true, 'overlayShow' : true, 'transitionIn' : 'elastic', 'transitionOut' : 'none' }); $('a[rel=fancybox2]').fancybox({ 'opacity' : true, 'overlayShow' : true, 'transitionIn' : 'elastic', 'transitionOut' : 'none', 'showNavArrows' : false }); $('#product-show').click(function() { $('div.product-hidebox').slideToggle(500, function() { $('#product-show span').text(($('div.product-hidebox:visible').length==0) ? 'Подробнее':'Скрыть'); }); return false; }); // ВЫБОР РЕГИОНА // Открываем поле выбора регионального представительства $(".header_city_button").click(function() { $('.header_list_select').fadeIn(400, function() { $('.header_list') .css('display', 'block') .animate({opacity:1, top:'5%'}, 200); }); }); // Закрываем поле выбора регионального представительства $('.header_list_cancel').click(function() { $('.header_list') .animate({opacity:0, top:'-110%'}, 200, function() { $(this).css('display', 'none'); $('.header_list_select').fadeOut(400); } ); }); $(document).click(function(event) { if ($(event.target).closest('div.header_list').length == 0 && $(event.target).hasClass('header_list_select') == true) { $('.header_list') .animate({opacity:0, top:'-110%'}, 200, function() { $(this).css('display', 'none'); $('.header_list_select').fadeOut(400); } ); } }); // Выбор региона 1: Екатеринбург $(".header_link_1").click(function() { // Скрываем поле выбора регионального представительства $('.header_list').animate ( {opacity:0, top:'-110%'}, 200, function() { $(this).css('display', 'none'); $('.header_list_select').fadeOut(400); } ); // Скрываем все блоки о региональной информации $(".header_city_button").hide(); $(".header_vcard_box").hide(); $(".footer_list_box").hide(); // Показываем информацию $(".header_button_1").show(); $(".header_box_1").show(); $(".footer_box_1").show(); // Создаем объект Date cookieExp = new Date(); // Устанавливаем текущий месяц и добавляем еще шесть месяцев к нему cookieExp.setMonth(cookieExp.getMonth()+6); // Обновляем куки GEO и присваиваем новое значение document.cookie = "GEO=1; expires="+cookieExp.toGMTString()+"; path=/"; }); // Выбор региона 2: Волгоград $(".header_link_2").click(function() { // Скрываем поле выбора регионального представительства $('.header_list').animate ( {opacity:0, top:'-110%'}, 200, function() { $(this).css('display', 'none'); $('.header_list_select').fadeOut(400); } ); // Скрываем все блоки о региональной информации $(".header_city_button").hide(); $(".header_vcard_box").hide(); $(".footer_list_box").hide(); // Показываем информацию $(".header_button_2").show(); $(".header_box_2").show(); $(".footer_box_2").show(); // Создаем объект Date cookieExp = new Date(); // Устанавливаем текущий месяц и добавляем еще шесть месяцев к нему cookieExp.setMonth(cookieExp.getMonth()+6); // Обновляем куки GEO и присваиваем новое значение document.cookie = "GEO=2; expires="+cookieExp.toGMTString()+"; path=/"; }); // Выбор региона 3: Красноярск $(".header_link_3").click(function() { // Скрываем поле выбора регионального представительства $('.header_list').animate ( {opacity:0, top:'-110%'}, 200, function() { $(this).css('display', 'none'); $('.header_list_select').fadeOut(400); } ); // Скрываем все блоки о региональной информации $(".header_city_button").hide(); $(".header_vcard_box").hide(); $(".footer_list_box").hide(); // Показываем информацию $(".header_button_3").show(); $(".header_box_3").show(); $(".footer_box_3").show(); // Создаем объект Date cookieExp = new Date(); // Устанавливаем текущий месяц и добавляем еще шесть месяцев к нему cookieExp.setMonth(cookieExp.getMonth()+6); // Обновляем куки GEO и присваиваем новое значение document.cookie = "GEO=3; expires="+cookieExp.toGMTString()+"; path=/"; }); // Выбор региона 4: Новосибирск $(".header_link_4").click(function() { // Скрываем поле выбора регионального представительства $('.header_list').animate ( {opacity:0, top:'-110%'}, 200, function() { $(this).css('display', 'none'); $('.header_list_select').fadeOut(400); } ); // Скрываем все блоки о региональной информации $(".header_city_button").hide(); $(".header_vcard_box").hide(); $(".footer_list_box").hide(); // Показываем информацию $(".header_button_4").show(); $(".header_box_4").show(); $(".footer_box_4").show(); // Создаем объект Date cookieExp = new Date(); // Устанавливаем текущий месяц и добавляем еще шесть месяцев к нему cookieExp.setMonth(cookieExp.getMonth()+6); // Обновляем куки GEO и присваиваем новое значение document.cookie = "GEO=4; expires="+cookieExp.toGMTString()+"; path=/"; }); // Выбор региона 5: Пермь $(".header_link_5").click(function() { // Скрываем поле выбора регионального представительства $('.header_list').animate ( {opacity:0, top:'-110%'}, 200, function() { $(this).css('display', 'none'); $('.header_list_select').fadeOut(400); } ); // Скрываем все блоки о региональной информации $(".header_city_button").hide(); $(".header_vcard_box").hide(); $(".footer_list_box").hide(); // Показываем информацию $(".header_button_5").show(); $(".header_box_5").show(); $(".footer_box_5").show(); // Создаем объект Date cookieExp = new Date(); // Устанавливаем текущий месяц и добавляем еще шесть месяцев к нему cookieExp.setMonth(cookieExp.getMonth()+6); // Обновляем куки GEO и присваиваем новое значение document.cookie = "GEO=5; expires="+cookieExp.toGMTString()+"; path=/"; }); // Выбор региона 6: Тюмень $(".header_link_6").click(function() { // Скрываем поле выбора регионального представительства $('.header_list').animate ( {opacity:0, top:'-110%'}, 200, function() { $(this).css('display', 'none'); $('.header_list_select').fadeOut(400); } ); // Скрываем все блоки о региональной информации $(".header_city_button").hide(); $(".header_vcard_box").hide(); $(".footer_list_box").hide(); // Показываем информацию $(".header_button_6").show(); $(".header_box_6").show(); $(".footer_box_6").show(); // Создаем объект Date cookieExp = new Date(); // Устанавливаем текущий месяц и добавляем еще шесть месяцев к нему cookieExp.setMonth(cookieExp.getMonth()+6); // Обновляем куки GEO и присваиваем новое значение document.cookie = "GEO=6; expires="+cookieExp.toGMTString()+"; path=/"; }); // Выбор региона 7: Хабаровск $(".header_link_7").click(function() { // Скрываем поле выбора регионального представительства $('.header_list').animate ( {opacity:0, top:'-110%'}, 200, function() { $(this).css('display', 'none'); $('.header_list_select').fadeOut(400); } ); // Скрываем все блоки о региональной информации $(".header_city_button").hide(); $(".header_vcard_box").hide(); $(".footer_list_box").hide(); // Показываем информацию $(".header_button_7").show(); $(".header_box_7").show(); $(".footer_box_7").show(); // Создаем объект Date cookieExp = new Date(); // Устанавливаем текущий месяц и добавляем еще шесть месяцев к нему cookieExp.setMonth(cookieExp.getMonth()+6); // Обновляем куки GEO и присваиваем новое значение document.cookie = "GEO=7; expires="+cookieExp.toGMTString()+"; path=/"; }); // ================================================== // --- feedback $('p.req_button_1').click(function() { $('.feedback span').text('Оформить заказ'); $('.feedback-title').val('Заявка на приобретение товара'); $('.feedback-toogle').show(); $('.req-box').fadeIn(300); }); $('p.req_button_2').click(function() { $('.feedback span').text('Заказать звонок'); $('.feedback-title').val('Заявка на обратный звонок'); $('.feedback-toogle').hide(); $('.req-box').fadeIn(300); }); $(document).click(function(event) { if ($(event.target).closest('.req-box-body').length == 0 && $(event.target).hasClass('req-box') == true) { $('.req-box').fadeOut(300); } }); $('.req-box-cancel').click(function() { $('.req-box').fadeOut(300); }); // --- end // ТОВАРНЫЕ ИНФОРМЕРЫ $('p.tctrs').click(function() { $(this).next().fadeIn(300); }); $(document).click(function(event) { if ($(event.target).closest('div.tctrs_box_body').length == 0 && $(event.target).hasClass('tctrs_box') == true) { $('div.tctrs_box').fadeOut(300); } }); $('span.tctrs_box_cancel').click(function() { $('div.tctrs_box').fadeOut(300); }); // ================================================== // ПАНЕЛЬ ВКЛАДОК (function($) { $(function() { $('ul.tcb_tabs').delegate('li:not(.tcb_current)','click',function() { $(this).addClass('tcb_current').siblings().removeClass('tcb_current') .parents('div.tovar-card-bot').find('div.tcb_static').hide().eq($(this).index()).fadeIn(150); }) }) }) (jQuery) // ========== }); function changeimg(foto) { $("#rg-biglink").attr("href", foto); $("#rg-bigimg").attr("src", foto); }