// ################################################################################################## // Скролл вверх и копирайт // ################################################################################################## var mobile = false; var onefull = true; function checkSize() { if($(window).width() < 1000) mobil(); else full(); } function mbloc_hight() { $("#mbox3 .text").css({"min-height":"0"}); $("#mbox2 .text").css({"min-height":"0"}); var hg2 = parseInt($("#mbox2 .text").height()); var hg3 = parseInt($("#mbox3 .text").height()); if(hg2 > hg3) $("#mbox3 .text").css({"min-height":hg2+"px"}); else $("#mbox2 .text").css({"min-height":hg3+"px"}); } function mobil() { mobile = true; $("ul#nav-top").attr({"id":"nav-top-mob"}); $("#mbox1").css({"width":"98%"}); $("#mbox2").css({"width":"48%"}); $("#mbox3").css({"width":"48%"}); mbloc_hight(); } function full() { mobile = false; $("ul#nav-top-mob").attr({"id":"nav-top"}); $("#mbox1").css({"width":"48%"}); $("#mbox2").css({"width":"23%"}); $("#mbox3").css({"width":"23%"}); mbloc_hight(); if(onefull) { onefull = false; h_menu = $("#nav-top").outerHeight(); $("#nav-top ul.level-1").each(function() { w = parseInt($(this).outerWidth()); if($(this).children("li.block-2").length > 0) ww = (w + 24) * 2; else ww = w + 24; $(this).children("li.block-1").wrapAll("
"); $(this).children("li.block-2").wrapAll(""); $(this).css({"width": ww + "px"}); h = parseInt($(this).outerHeight()); $(this).css({"top":"-" + (h + 10) + "px", "display":"block"}).prev().css({"padding-right":"27px"}).append(""); $(this).wrap(""); }); } } $(document).ready(function(){ checkSize(); $('#scroller').click(function () {$('body,html').animate({scrollTop: 0}, 400); return false;}); slider = $('#slider').bxSlider({"pager":false, "auto":true, "autoHover":true, "adaptiveHeight":true}); $("#accordion").accordion(); $("#tabs").tabs(); $(window).resize(function(){ checkSize(); }); var h_menu = $("#nav-top").outerHeight(); $("#nav-top > li").hover( function() { if(mobile) return false; var div = $(this).children("div"); var ul = div.children("ul"); div.show(); ul.stop(false, true).animate({"top":0}, 400); }, function() { if(mobile) return false; var div = $(this).children("div"); var ul = div.children("ul"); var h = parseInt(div.outerHeight()); ul.stop(false, true).animate({"top":"-"+ (h + 10) +"px"}, 200, function(){div.hide()}); }); }); // ################################################################################################## // Настройки colorbox // ################################################################################################## jQuery.extend(jQuery.colorbox.settings, { current: "изображение {current} из {total}", previous: "назад", next: "вперёд", close: "закрыть", xhrError: "Не удалось загрузить содержимое.", imgError: "Не удалось загрузить изображение.", slideshowStart: "начать слайд-шоу", slideshowStop: "остановить слайд-шоу" }); // ################################################################################################## // Функция создания COOKIE // ################################################################################################## jQuery.cookie = function (key, value, options) { if (arguments.length > 1 && (value === null || typeof value !== "object")) { options = jQuery.extend({}, options); if (value === null) { options.expires = -1; } if (typeof options.expires === 'number') { var days = options.expires, t = options.expires = new Date(); t.setDate(t.getDate() + days); } return (document.cookie = [ encodeURIComponent(key), '=', options.raw ? String(value) : encodeURIComponent(String(value)), options.expires ? '; expires=' + options.expires.toUTCString() : '', // use expires attribute, max-age is not supported by IE options.path ? '; path=' + options.path : '', options.domain ? '; domain=' + options.domain : '', options.secure ? '; secure' : '' ].join('')); } options = value || {}; var result, decode = options.raw ? function (s) { return s; } : decodeURIComponent; return (result = new RegExp('(?:^|; )' + encodeURIComponent(key) + '=([^;]*)').exec(document.cookie)) ? decode(result[1]) : null;}; // ################################################################################################## // Функция ограничения кол-ва вводимых символов // ################################################################################################## jQuery.fn.maxlength = function(options) { var settings = jQuery.extend({ maxChars: 10, infotext: 'осталось символов'}, options); return this.each(function() { var me = $(this); var l = settings.maxChars; me.bind('keydown keypress keyup',function(e) { if(me.val().length>settings.maxChars) me.val(me.val().substr(0,settings.maxChars)); l = settings.maxChars - me.val().length; me.next('div').html('...' + settings.infotext + ': ' + l); }); me.after('
Спасибо! Ваше сообщение успешно отправлено!
Наш менеджер свяжется с вами в ближайшее время.
Спасибо! Ваше сообщение успешно отправлено!
Наш менеджер свяжется с вами в ближайшее время.