").append(m.parseHTML(a)).find(d):a)}).complete(c&&function(a,b){g.each(c,e||[a.responseText,b,a])}),this},m.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(a,b){m.fn[b]=function(a){return this.on(b,a)}}),m.expr.filters.animated=function(a){return m.grep(m.timers,function(b){return a===b.elem}).length};var cc=a.document.documentElement;function dc(a){return m.isWindow(a)?a:9===a.nodeType?a.defaultView||a.parentWindow:!1}m.offset={setOffset:function(a,b,c){var d,e,f,g,h,i,j,k=m.css(a,"position"),l=m(a),n={};"static"===k&&(a.style.position="relative"),h=l.offset(),f=m.css(a,"top"),i=m.css(a,"left"),j=("absolute"===k||"fixed"===k)&&m.inArray("auto",[f,i])>-1,j?(d=l.position(),g=d.top,e=d.left):(g=parseFloat(f)||0,e=parseFloat(i)||0),m.isFunction(b)&&(b=b.call(a,c,h)),null!=b.top&&(n.top=b.top-h.top+g),null!=b.left&&(n.left=b.left-h.left+e),"using"in b?b.using.call(a,n):l.css(n)}},m.fn.extend({offset:function(a){if(arguments.length)return void 0===a?this:this.each(function(b){m.offset.setOffset(this,a,b)});var b,c,d={top:0,left:0},e=this[0],f=e&&e.ownerDocument;if(f)return b=f.documentElement,m.contains(b,e)?(typeof e.getBoundingClientRect!==K&&(d=e.getBoundingClientRect()),c=dc(f),{top:d.top+(c.pageYOffset||b.scrollTop)-(b.clientTop||0),left:d.left+(c.pageXOffset||b.scrollLeft)-(b.clientLeft||0)}):d},position:function(){if(this[0]){var a,b,c={top:0,left:0},d=this[0];return"fixed"===m.css(d,"position")?b=d.getBoundingClientRect():(a=this.offsetParent(),b=this.offset(),m.nodeName(a[0],"html")||(c=a.offset()),c.top+=m.css(a[0],"borderTopWidth",!0),c.left+=m.css(a[0],"borderLeftWidth",!0)),{top:b.top-c.top-m.css(d,"marginTop",!0),left:b.left-c.left-m.css(d,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){var a=this.offsetParent||cc;while(a&&!m.nodeName(a,"html")&&"static"===m.css(a,"position"))a=a.offsetParent;return a||cc})}}),m.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(a,b){var c=/Y/.test(b);m.fn[a]=function(d){return V(this,function(a,d,e){var f=dc(a);return void 0===e?f?b in f?f[b]:f.document.documentElement[d]:a[d]:void(f?f.scrollTo(c?m(f).scrollLeft():e,c?e:m(f).scrollTop()):a[d]=e)},a,d,arguments.length,null)}}),m.each(["top","left"],function(a,b){m.cssHooks[b]=La(k.pixelPosition,function(a,c){return c?(c=Ja(a,b),Ha.test(c)?m(a).position()[b]+"px":c):void 0})}),m.each({Height:"height",Width:"width"},function(a,b){m.each({padding:"inner"+a,content:b,"":"outer"+a},function(c,d){m.fn[d]=function(d,e){var f=arguments.length&&(c||"boolean"!=typeof d),g=c||(d===!0||e===!0?"margin":"border");return V(this,function(b,c,d){var e;return m.isWindow(b)?b.document.documentElement["client"+a]:9===b.nodeType?(e=b.documentElement,Math.max(b.body["scroll"+a],e["scroll"+a],b.body["offset"+a],e["offset"+a],e["client"+a])):void 0===d?m.css(b,c,g):m.style(b,c,d,g)},b,f?d:void 0,f,null)}})}),m.fn.size=function(){return this.length},m.fn.andSelf=m.fn.addBack,"function"==typeof define&&define.amd&&define("jquery",[],function(){return m});var ec=a.jQuery,fc=a.$;return m.noConflict=function(b){return a.$===m&&(a.$=fc),b&&a.jQuery===m&&(a.jQuery=ec),m},typeof b===K&&(a.jQuery=a.$=m),m});
/**
* BxSlider v4.1.2 - Fully loaded, responsive content slider
* http://bxslider.com
*
* Copyright 2014, Steven Wanderski - http://stevenwanderski.com - http://bxcreative.com
* Written while drinking Belgian ales and listening to jazz
*
* Released under the MIT license - http://opensource.org/licenses/MIT
*/
!function(t){var e={},s={mode:"horizontal",slideSelector:"",infiniteLoop:!0,hideControlOnEnd:!1,speed:500,easing:null,slideMargin:0,startSlide:0,randomStart:!1,captions:!1,ticker:!1,tickerHover:!1,adaptiveHeight:!1,adaptiveHeightSpeed:500,video:!1,useCSS:!0,preloadImages:"visible",responsive:!0,slideZIndex:50,touchEnabled:!0,swipeThreshold:50,oneToOneTouch:!0,preventDefaultSwipeX:!0,preventDefaultSwipeY:!1,pager:!0,pagerType:"full",pagerShortSeparator:" / ",pagerSelector:null,buildPager:null,pagerCustom:null,controls:!0,nextText:"Next",prevText:"Prev",nextSelector:null,prevSelector:null,autoControls:!1,startText:"Start",stopText:"Stop",autoControlsCombine:!1,autoControlsSelector:null,auto:!1,pause:4e3,autoStart:!0,autoDirection:"next",autoHover:!1,autoDelay:0,minSlides:1,maxSlides:1,moveSlides:0,slideWidth:0,onSliderLoad:function(){},onSlideBefore:function(){},onSlideAfter:function(){},onSlideNext:function(){},onSlidePrev:function(){},onSliderResize:function(){}};t.fn.bxSlider=function(n){if(0==this.length)return this;if(this.length>1)return this.each(function(){t(this).bxSlider(n)}),this;var o={},r=this;e.el=this;var a=t(window).width(),l=t(window).height(),d=function(){o.settings=t.extend({},s,n),o.settings.slideWidth=parseInt(o.settings.slideWidth),o.children=r.children(o.settings.slideSelector),o.children.length
1||o.settings.maxSlides>1,o.carousel&&(o.settings.preloadImages="all"),o.minThreshold=o.settings.minSlides*o.settings.slideWidth+(o.settings.minSlides-1)*o.settings.slideMargin,o.maxThreshold=o.settings.maxSlides*o.settings.slideWidth+(o.settings.maxSlides-1)*o.settings.slideMargin,o.working=!1,o.controls={},o.interval=null,o.animProp="vertical"==o.settings.mode?"top":"left",o.usingCSS=o.settings.useCSS&&"fade"!=o.settings.mode&&function(){var t=document.createElement("div"),e=["WebkitPerspective","MozPerspective","OPerspective","msPerspective"];for(var i in e)if(void 0!==t.style[e[i]])return o.cssPrefix=e[i].replace("Perspective","").toLowerCase(),o.animProp="-"+o.cssPrefix+"-transform",!0;return!1}(),"vertical"==o.settings.mode&&(o.settings.maxSlides=o.settings.minSlides),r.data("origStyle",r.attr("style")),r.children(o.settings.slideSelector).each(function(){t(this).data("origStyle",t(this).attr("style"))}),c()},c=function(){r.wrap(''),o.viewport=r.parent(),o.loader=t(''),o.viewport.prepend(o.loader),r.css({width:"horizontal"==o.settings.mode?100*o.children.length+215+"%":"auto",position:"relative"}),o.usingCSS&&o.settings.easing?r.css("-"+o.cssPrefix+"-transition-timing-function",o.settings.easing):o.settings.easing||(o.settings.easing="swing"),f(),o.viewport.css({width:"100%",overflow:"hidden",position:"relative"}),o.viewport.parent().css({maxWidth:p()}),o.settings.pager||o.viewport.parent().css({margin:"0 auto 0px"}),o.children.css({"float":"horizontal"==o.settings.mode?"left":"none",listStyle:"none",position:"relative"}),o.children.css("width",u()),"horizontal"==o.settings.mode&&o.settings.slideMargin>0&&o.children.css("marginRight",o.settings.slideMargin),"vertical"==o.settings.mode&&o.settings.slideMargin>0&&o.children.css("marginBottom",o.settings.slideMargin),"fade"==o.settings.mode&&(o.children.css({position:"absolute",zIndex:0,display:"none"}),o.children.eq(o.settings.startSlide).css({zIndex:o.settings.slideZIndex,display:"block"})),o.controls.el=t(''),o.settings.captions&&P(),o.active.last=o.settings.startSlide==x()-1,o.settings.video&&r.fitVids();var e=o.children.eq(o.settings.startSlide);"all"==o.settings.preloadImages&&(e=o.children),o.settings.ticker?o.settings.pager=!1:(o.settings.pager&&T(),o.settings.controls&&C(),o.settings.auto&&o.settings.autoControls&&E(),(o.settings.controls||o.settings.autoControls||o.settings.pager)&&o.viewport.after(o.controls.el)),g(e,h)},g=function(e,i){var s=e.find("img, iframe").length;if(0==s)return i(),void 0;var n=0;e.find("img, iframe").each(function(){t(this).one("load",function(){++n==s&&i()}).each(function(){this.complete&&t(this).load()})})},h=function(){if(o.settings.infiniteLoop&&"fade"!=o.settings.mode&&!o.settings.ticker){var e="vertical"==o.settings.mode?o.settings.minSlides:o.settings.maxSlides,i=o.children.slice(0,e).clone().addClass("bx-clone"),s=o.children.slice(-e).clone().addClass("bx-clone");r.append(i).prepend(s)}o.loader.remove(),S(),"vertical"==o.settings.mode&&(o.settings.adaptiveHeight=!0),o.viewport.height(v()),r.redrawSlider(),o.settings.onSliderLoad(o.active.index),o.initialized=!0,o.settings.responsive&&t(window).bind("resize",Z),o.settings.auto&&o.settings.autoStart&&H(),o.settings.ticker&&L(),o.settings.pager&&q(o.settings.startSlide),o.settings.controls&&W(),o.settings.touchEnabled&&!o.settings.ticker&&O()},v=function(){var e=0,s=t();if("vertical"==o.settings.mode||o.settings.adaptiveHeight)if(o.carousel){var n=1==o.settings.moveSlides?o.active.index:o.active.index*m();for(s=o.children.eq(n),i=1;i<=o.settings.maxSlides-1;i++)s=n+i>=o.children.length?s.add(o.children.eq(i-1)):s.add(o.children.eq(n+i))}else s=o.children.eq(o.active.index);else s=o.children;return"vertical"==o.settings.mode?(s.each(function(){e+=t(this).outerHeight()}),o.settings.slideMargin>0&&(e+=o.settings.slideMargin*(o.settings.minSlides-1))):e=Math.max.apply(Math,s.map(function(){return t(this).outerHeight(!1)}).get()),e},p=function(){var t="100%";return o.settings.slideWidth>0&&(t="horizontal"==o.settings.mode?o.settings.maxSlides*o.settings.slideWidth+(o.settings.maxSlides-1)*o.settings.slideMargin:o.settings.slideWidth),t},u=function(){var t=o.settings.slideWidth,e=o.viewport.width();return 0==o.settings.slideWidth||o.settings.slideWidth>e&&!o.carousel||"vertical"==o.settings.mode?t=e:o.settings.maxSlides>1&&"horizontal"==o.settings.mode&&(e>o.maxThreshold||e0)if(o.viewport.width()o.maxThreshold)t=o.settings.maxSlides;else{var e=o.children.first().width();t=Math.floor(o.viewport.width()/e)}else"vertical"==o.settings.mode&&(t=o.settings.minSlides);return t},x=function(){var t=0;if(o.settings.moveSlides>0)if(o.settings.infiniteLoop)t=o.children.length/m();else for(var e=0,i=0;e0&&o.settings.moveSlides<=f()?o.settings.moveSlides:f()},S=function(){if(o.children.length>o.settings.maxSlides&&o.active.last&&!o.settings.infiniteLoop){if("horizontal"==o.settings.mode){var t=o.children.last(),e=t.position();b(-(e.left-(o.viewport.width()-t.width())),"reset",0)}else if("vertical"==o.settings.mode){var i=o.children.length-o.settings.minSlides,e=o.children.eq(i).position();b(-e.top,"reset",0)}}else{var e=o.children.eq(o.active.index*m()).position();o.active.index==x()-1&&(o.active.last=!0),void 0!=e&&("horizontal"==o.settings.mode?b(-e.left,"reset",0):"vertical"==o.settings.mode&&b(-e.top,"reset",0))}},b=function(t,e,i,s){if(o.usingCSS){var n="vertical"==o.settings.mode?"translate3d(0, "+t+"px, 0)":"translate3d("+t+"px, 0, 0)";r.css("-"+o.cssPrefix+"-transition-duration",i/1e3+"s"),"slide"==e?(r.css(o.animProp,n),r.bind("transitionend webkitTransitionEnd oTransitionEnd MSTransitionEnd",function(){r.unbind("transitionend webkitTransitionEnd oTransitionEnd MSTransitionEnd"),D()})):"reset"==e?r.css(o.animProp,n):"ticker"==e&&(r.css("-"+o.cssPrefix+"-transition-timing-function","linear"),r.css(o.animProp,n),r.bind("transitionend webkitTransitionEnd oTransitionEnd MSTransitionEnd",function(){r.unbind("transitionend webkitTransitionEnd oTransitionEnd MSTransitionEnd"),b(s.resetValue,"reset",0),N()}))}else{var a={};a[o.animProp]=t,"slide"==e?r.animate(a,i,o.settings.easing,function(){D()}):"reset"==e?r.css(o.animProp,t):"ticker"==e&&r.animate(a,speed,"linear",function(){b(s.resetValue,"reset",0),N()})}},w=function(){for(var e="",i=x(),s=0;i>s;s++){var n="";o.settings.buildPager&&t.isFunction(o.settings.buildPager)?(n=o.settings.buildPager(s),o.pagerEl.addClass("bx-custom-pager")):(n=s+1,o.pagerEl.addClass("bx-default-pager")),e+='"}o.pagerEl.html(e)},T=function(){o.settings.pagerCustom?o.pagerEl=t(o.settings.pagerCustom):(o.pagerEl=t(''),o.settings.pagerSelector?t(o.settings.pagerSelector).html(o.pagerEl):o.controls.el.addClass("bx-has-pager").append(o.pagerEl),w()),o.pagerEl.on("click","a",I)},C=function(){o.controls.next=t(''+o.settings.nextText+""),o.controls.prev=t(''+o.settings.prevText+""),o.controls.next.bind("click",y),o.controls.prev.bind("click",z),o.settings.nextSelector&&t(o.settings.nextSelector).append(o.controls.next),o.settings.prevSelector&&t(o.settings.prevSelector).append(o.controls.prev),o.settings.nextSelector||o.settings.prevSelector||(o.controls.directionEl=t(''),o.controls.directionEl.append(o.controls.prev).append(o.controls.next),o.controls.el.addClass("bx-has-controls-direction").append(o.controls.directionEl))},E=function(){o.controls.start=t('"),o.controls.stop=t('"),o.controls.autoEl=t(''),o.controls.autoEl.on("click",".bx-start",k),o.controls.autoEl.on("click",".bx-stop",M),o.settings.autoControlsCombine?o.controls.autoEl.append(o.controls.start):o.controls.autoEl.append(o.controls.start).append(o.controls.stop),o.settings.autoControlsSelector?t(o.settings.autoControlsSelector).html(o.controls.autoEl):o.controls.el.addClass("bx-has-controls-auto").append(o.controls.autoEl),A(o.settings.autoStart?"stop":"start")},P=function(){o.children.each(function(){var e=t(this).find("img:first").attr("title");void 0!=e&&(""+e).length&&t(this).append(''+e+"
")})},y=function(t){o.settings.auto&&r.stopAuto(),r.goToNextSlide(),t.preventDefault()},z=function(t){o.settings.auto&&r.stopAuto(),r.goToPrevSlide(),t.preventDefault()},k=function(t){r.startAuto(),t.preventDefault()},M=function(t){r.stopAuto(),t.preventDefault()},I=function(e){o.settings.auto&&r.stopAuto();var i=t(e.currentTarget),s=parseInt(i.attr("data-slide-index"));s!=o.active.index&&r.goToSlide(s),e.preventDefault()},q=function(e){var i=o.children.length;return"short"==o.settings.pagerType?(o.settings.maxSlides>1&&(i=Math.ceil(o.children.length/o.settings.maxSlides)),o.pagerEl.html(e+1+o.settings.pagerShortSeparator+i),void 0):(o.pagerEl.find("a").removeClass("active"),o.pagerEl.each(function(i,s){t(s).find("a").eq(e).addClass("active")}),void 0)},D=function(){if(o.settings.infiniteLoop){var t="";0==o.active.index?t=o.children.eq(0).position():o.active.index==x()-1&&o.carousel?t=o.children.eq((x()-1)*m()).position():o.active.index==o.children.length-1&&(t=o.children.eq(o.children.length-1).position()),t&&("horizontal"==o.settings.mode?b(-t.left,"reset",0):"vertical"==o.settings.mode&&b(-t.top,"reset",0))}o.working=!1,o.settings.onSlideAfter(o.children.eq(o.active.index),o.oldIndex,o.active.index)},A=function(t){o.settings.autoControlsCombine?o.controls.autoEl.html(o.controls[t]):(o.controls.autoEl.find("a").removeClass("active"),o.controls.autoEl.find("a:not(.bx-"+t+")").addClass("active"))},W=function(){1==x()?(o.controls.prev.addClass("disabled"),o.controls.next.addClass("disabled")):!o.settings.infiniteLoop&&o.settings.hideControlOnEnd&&(0==o.active.index?(o.controls.prev.addClass("disabled"),o.controls.next.removeClass("disabled")):o.active.index==x()-1?(o.controls.next.addClass("disabled"),o.controls.prev.removeClass("disabled")):(o.controls.prev.removeClass("disabled"),o.controls.next.removeClass("disabled")))},H=function(){o.settings.autoDelay>0?setTimeout(r.startAuto,o.settings.autoDelay):r.startAuto(),o.settings.autoHover&&r.hover(function(){o.interval&&(r.stopAuto(!0),o.autoPaused=!0)},function(){o.autoPaused&&(r.startAuto(!0),o.autoPaused=null)})},L=function(){var e=0;if("next"==o.settings.autoDirection)r.append(o.children.clone().addClass("bx-clone"));else{r.prepend(o.children.clone().addClass("bx-clone"));var i=o.children.first().position();e="horizontal"==o.settings.mode?-i.left:-i.top}b(e,"reset",0),o.settings.pager=!1,o.settings.controls=!1,o.settings.autoControls=!1,o.settings.tickerHover&&!o.usingCSS&&o.viewport.hover(function(){r.stop()},function(){var e=0;o.children.each(function(){e+="horizontal"==o.settings.mode?t(this).outerWidth(!0):t(this).outerHeight(!0)});var i=o.settings.speed/e,s="horizontal"==o.settings.mode?"left":"top",n=i*(e-Math.abs(parseInt(r.css(s))));N(n)}),N()},N=function(t){speed=t?t:o.settings.speed;var e={left:0,top:0},i={left:0,top:0};"next"==o.settings.autoDirection?e=r.find(".bx-clone").first().position():i=o.children.first().position();var s="horizontal"==o.settings.mode?-e.left:-e.top,n="horizontal"==o.settings.mode?-i.left:-i.top,a={resetValue:n};b(s,"ticker",speed,a)},O=function(){o.touch={start:{x:0,y:0},end:{x:0,y:0}},o.viewport.bind("touchstart",X)},X=function(t){if(o.working)t.preventDefault();else{o.touch.originalPos=r.position();var e=t.originalEvent;o.touch.start.x=e.changedTouches[0].pageX,o.touch.start.y=e.changedTouches[0].pageY,o.viewport.bind("touchmove",Y),o.viewport.bind("touchend",V)}},Y=function(t){var e=t.originalEvent,i=Math.abs(e.changedTouches[0].pageX-o.touch.start.x),s=Math.abs(e.changedTouches[0].pageY-o.touch.start.y);if(3*i>s&&o.settings.preventDefaultSwipeX?t.preventDefault():3*s>i&&o.settings.preventDefaultSwipeY&&t.preventDefault(),"fade"!=o.settings.mode&&o.settings.oneToOneTouch){var n=0;if("horizontal"==o.settings.mode){var r=e.changedTouches[0].pageX-o.touch.start.x;n=o.touch.originalPos.left+r}else{var r=e.changedTouches[0].pageY-o.touch.start.y;n=o.touch.originalPos.top+r}b(n,"reset",0)}},V=function(t){o.viewport.unbind("touchmove",Y);var e=t.originalEvent,i=0;if(o.touch.end.x=e.changedTouches[0].pageX,o.touch.end.y=e.changedTouches[0].pageY,"fade"==o.settings.mode){var s=Math.abs(o.touch.start.x-o.touch.end.x);s>=o.settings.swipeThreshold&&(o.touch.start.x>o.touch.end.x?r.goToNextSlide():r.goToPrevSlide(),r.stopAuto())}else{var s=0;"horizontal"==o.settings.mode?(s=o.touch.end.x-o.touch.start.x,i=o.touch.originalPos.left):(s=o.touch.end.y-o.touch.start.y,i=o.touch.originalPos.top),!o.settings.infiniteLoop&&(0==o.active.index&&s>0||o.active.last&&0>s)?b(i,"reset",200):Math.abs(s)>=o.settings.swipeThreshold?(0>s?r.goToNextSlide():r.goToPrevSlide(),r.stopAuto()):b(i,"reset",200)}o.viewport.unbind("touchend",V)},Z=function(){var e=t(window).width(),i=t(window).height();(a!=e||l!=i)&&(a=e,l=i,r.redrawSlider(),o.settings.onSliderResize.call(r,o.active.index))};return r.goToSlide=function(e,i){if(!o.working&&o.active.index!=e)if(o.working=!0,o.oldIndex=o.active.index,o.active.index=0>e?x()-1:e>=x()?0:e,o.settings.onSlideBefore(o.children.eq(o.active.index),o.oldIndex,o.active.index),"next"==i?o.settings.onSlideNext(o.children.eq(o.active.index),o.oldIndex,o.active.index):"prev"==i&&o.settings.onSlidePrev(o.children.eq(o.active.index),o.oldIndex,o.active.index),o.active.last=o.active.index>=x()-1,o.settings.pager&&q(o.active.index),o.settings.controls&&W(),"fade"==o.settings.mode)o.settings.adaptiveHeight&&o.viewport.height()!=v()&&o.viewport.animate({height:v()},o.settings.adaptiveHeightSpeed),o.children.filter(":visible").fadeOut(o.settings.speed).css({zIndex:0}),o.children.eq(o.active.index).css("zIndex",o.settings.slideZIndex+1).fadeIn(o.settings.speed,function(){t(this).css("zIndex",o.settings.slideZIndex),D()});else{o.settings.adaptiveHeight&&o.viewport.height()!=v()&&o.viewport.animate({height:v()},o.settings.adaptiveHeightSpeed);var s=0,n={left:0,top:0};if(!o.settings.infiniteLoop&&o.carousel&&o.active.last)if("horizontal"==o.settings.mode){var a=o.children.eq(o.children.length-1);n=a.position(),s=o.viewport.width()-a.outerWidth()}else{var l=o.children.length-o.settings.minSlides;n=o.children.eq(l).position()}else if(o.carousel&&o.active.last&&"prev"==i){var d=1==o.settings.moveSlides?o.settings.maxSlides-m():(x()-1)*m()-(o.children.length-o.settings.maxSlides),a=r.children(".bx-clone").eq(d);n=a.position()}else if("next"==i&&0==o.active.index)n=r.find("> .bx-clone").eq(o.settings.maxSlides).position(),o.active.last=!1;else if(e>=0){var c=e*m();n=o.children.eq(c).position()}if("undefined"!=typeof n){var g="horizontal"==o.settings.mode?-(n.left-s):-n.top;b(g,"slide",o.settings.speed)}}},r.goToNextSlide=function(){if(o.settings.infiniteLoop||!o.active.last){var t=parseInt(o.active.index)+1;r.goToSlide(t,"next")}},r.goToPrevSlide=function(){if(o.settings.infiniteLoop||0!=o.active.index){var t=parseInt(o.active.index)-1;r.goToSlide(t,"prev")}},r.startAuto=function(t){o.interval||(o.interval=setInterval(function(){"next"==o.settings.autoDirection?r.goToNextSlide():r.goToPrevSlide()},o.settings.pause),o.settings.autoControls&&1!=t&&A("stop"))},r.stopAuto=function(t){o.interval&&(clearInterval(o.interval),o.interval=null,o.settings.autoControls&&1!=t&&A("start"))},r.getCurrentSlide=function(){return o.active.index},r.getCurrentSlideElement=function(){return o.children.eq(o.active.index)},r.getSlideCount=function(){return o.children.length},r.redrawSlider=function(){o.children.add(r.find(".bx-clone")).outerWidth(u()),o.viewport.css("height",v()),o.settings.ticker||S(),o.active.last&&(o.active.index=x()-1),o.active.index>=x()&&(o.active.last=!0),o.settings.pager&&!o.settings.pagerCustom&&(w(),q(o.active.index))},r.destroySlider=function(){o.initialized&&(o.initialized=!1,t(".bx-clone",this).remove(),o.children.each(function(){void 0!=t(this).data("origStyle")?t(this).attr("style",t(this).data("origStyle")):t(this).removeAttr("style")}),void 0!=t(this).data("origStyle")?this.attr("style",t(this).data("origStyle")):t(this).removeAttr("style"),t(this).unwrap().unwrap(),o.controls.el&&o.controls.el.remove(),o.controls.next&&o.controls.next.remove(),o.controls.prev&&o.controls.prev.remove(),o.pagerEl&&o.settings.controls&&o.pagerEl.remove(),t(".bx-caption",this).remove(),o.controls.autoEl&&o.controls.autoEl.remove(),clearInterval(o.interval),o.settings.responsive&&t(window).unbind("resize",Z))},r.reloadSlider=function(t){void 0!=t&&(n=t),r.destroySlider(),d()},d(),this}}(jQuery);/*
Masked Input plugin for jQuery
Copyright (c) 2007-2013 Josh Bush (digitalbush.com)
Licensed under the MIT license (http://digitalbush.com/projects/masked-input-plugin/#license)
Version: 1.3.1
*/
(function(e){function t(){var e=document.createElement("input"),t="onpaste";return e.setAttribute(t,""),"function"==typeof e[t]?"paste":"input"}var n,a=t()+".mask",r=navigator.userAgent,i=/iphone/i.test(r),o=/android/i.test(r);e.mask={definitions:{9:"[0-9]",a:"[A-Za-z]","*":"[A-Za-z0-9]"},dataName:"rawMaskFn",placeholder:"_"},e.fn.extend({caret:function(e,t){var n;if(0!==this.length&&!this.is(":hidden"))return"number"==typeof e?(t="number"==typeof t?t:e,this.each(function(){this.setSelectionRange?this.setSelectionRange(e,t):this.createTextRange&&(n=this.createTextRange(),n.collapse(!0),n.moveEnd("character",t),n.moveStart("character",e),n.select())})):(this[0].setSelectionRange?(e=this[0].selectionStart,t=this[0].selectionEnd):document.selection&&document.selection.createRange&&(n=document.selection.createRange(),e=0-n.duplicate().moveStart("character",-1e5),t=e+n.text.length),{begin:e,end:t})},unmask:function(){return this.trigger("unmask")},mask:function(t,r){var c,l,s,u,f,h;return!t&&this.length>0?(c=e(this[0]),c.data(e.mask.dataName)()):(r=e.extend({placeholder:e.mask.placeholder,completed:null},r),l=e.mask.definitions,s=[],u=h=t.length,f=null,e.each(t.split(""),function(e,t){"?"==t?(h--,u=e):l[t]?(s.push(RegExp(l[t])),null===f&&(f=s.length-1)):s.push(null)}),this.trigger("unmask").each(function(){function c(e){for(;h>++e&&!s[e];);return e}function d(e){for(;--e>=0&&!s[e];);return e}function m(e,t){var n,a;if(!(0>e)){for(n=e,a=c(t);h>n;n++)if(s[n]){if(!(h>a&&s[n].test(R[a])))break;R[n]=R[a],R[a]=r.placeholder,a=c(a)}b(),x.caret(Math.max(f,e))}}function p(e){var t,n,a,i;for(t=e,n=r.placeholder;h>t;t++)if(s[t]){if(a=c(t),i=R[t],R[t]=n,!(h>a&&s[a].test(i)))break;n=i}}function g(e){var t,n,a,r=e.which;8===r||46===r||i&&127===r?(t=x.caret(),n=t.begin,a=t.end,0===a-n&&(n=46!==r?d(n):a=c(n-1),a=46===r?c(a):a),k(n,a),m(n,a-1),e.preventDefault()):27==r&&(x.val(S),x.caret(0,y()),e.preventDefault())}function v(t){var n,a,i,l=t.which,u=x.caret();t.ctrlKey||t.altKey||t.metaKey||32>l||l&&(0!==u.end-u.begin&&(k(u.begin,u.end),m(u.begin,u.end-1)),n=c(u.begin-1),h>n&&(a=String.fromCharCode(l),s[n].test(a)&&(p(n),R[n]=a,b(),i=c(n),o?setTimeout(e.proxy(e.fn.caret,x,i),0):x.caret(i),r.completed&&i>=h&&r.completed.call(x))),t.preventDefault())}function k(e,t){var n;for(n=e;t>n&&h>n;n++)s[n]&&(R[n]=r.placeholder)}function b(){x.val(R.join(""))}function y(e){var t,n,a=x.val(),i=-1;for(t=0,pos=0;h>t;t++)if(s[t]){for(R[t]=r.placeholder;pos++a.length)break}else R[t]===a.charAt(pos)&&t!==u&&(pos++,i=t);return e?b():u>i+1?(x.val(""),k(0,h)):(b(),x.val(x.val().substring(0,i+1))),u?t:f}var x=e(this),R=e.map(t.split(""),function(e){return"?"!=e?l[e]?r.placeholder:e:void 0}),S=x.val();x.data(e.mask.dataName,function(){return e.map(R,function(e,t){return s[t]&&e!=r.placeholder?e:null}).join("")}),x.attr("readonly")||x.one("unmask",function(){x.unbind(".mask").removeData(e.mask.dataName)}).bind("focus.mask",function(){clearTimeout(n);var e;S=x.val(),e=y(),n=setTimeout(function(){b(),e==t.length?x.caret(0,e):x.caret(e)},10)}).bind("blur.mask",function(){y(),x.val()!=S&&x.change()}).bind("keydown.mask",g).bind("keypress.mask",v).bind(a,function(){setTimeout(function(){var e=y(!0);x.caret(e),r.completed&&e==x.val().length&&r.completed.call(x)},0)}),y()}))}})})(jQuery);/* Cristall Box v1.1 - ΠΏΡΠΎΠ΄ΡΠΊΡ Π»ΠΈΠ½Π΅ΠΉΠΊΠΈ Cristall Group
ΡΠΏΡΠ°Π²Π»ΡΠ΅Ρ ΠΌΠΎΠ΄Π°Π»ΡΠ½ΡΠΌΠΈ ΠΎΠΊΠ½Π°ΠΌΠΈ, ΠΏΠΎΠΊΠ°Π·ΡΠ²Π°Π΅Ρ ΠΏΡΠΎΠΈΠ·Π²ΠΎΠ»ΡΠ½ΠΎΠ΅ ΡΠΎΠ΄Π΅ΡΠΆΠΈΠΌΠΎΠ΅ Π² ΠΌΠΎΠ΄Π°Π»ΡΠ½ΠΎΠΌ ΠΎΠΊΠ½Π΅
ΠΏΠΎ ajax, ΡΠ»Π΅ΠΌΠ΅Π½Ρ ΡΡΡΠ°Π½ΠΈΡΡ, ΠΎΠ΄ΠΈΠ½ΠΎΡΠ½ΡΠ΅ ΠΈΠ·ΠΎΠ±ΡΠ°ΠΆΠ΅Π½ΠΈΡ ΠΈΠ»ΠΈ Π³ΡΡΠΏΠΏΡ ΠΈΠ·ΠΎΠ±ΡΠ°ΠΆΠ΅Π½ΠΈΠΉ
ΡΠ°Π·ΡΠ°Π±ΠΎΡΡΠΈΠΊ: ΠΠΎΠ»ΡΡΠ°ΠΊΠΎΠ² Π.Π.
mail: cristall-group@yandex.ru
17.07.2015
*/
var startEl = false;
var startEl_top = 0;
(function($){
// ΡΡΡΠ°Π½ΠΎΠ²ΠΊΠ° Π½Π° ΡΡΡΠ°Π½ΠΈΡΡ
$.fn.cristallBox = function( options ){
// Π½Π°ΡΡΡΠΎΠΉΠΊΠΈ ΠΏΠΎ ΡΠΌΠΎΠ»ΡΠ°Π½ΠΈΡ
var settings = {
speed: 500, // ΡΠΊΠΎΡΠΎΡΡΡ Π°Π½ΠΈΠΌΠ°ΡΠΈΠΈ
ajaxPath: '/ajax/', // ΠΏΡΡΡ ΠΊ ΠΏΠ°ΠΏΠΊΠ΅ ajax-ΡΠ°ΠΉΠ»ΠΎΠ²
offset: -10, // ΡΠΌΠ΅ΡΠ΅Π½ΠΈΠ΅ ΠΌΠΎΠ΄Π°Π»ΡΠ½ΠΎΠ³ΠΎ ΠΎΠΊΠ½Π° ΠΎΡΠ½ΠΎΡΠΈΡΠ΅Π»ΡΠ½ΠΎ Π²Π΅ΡΡ
Π° ΡΡΡΠ°Π½ΠΈΡΡ
widthOffset: 20, // ΠΏΠΎΠΏΡΠ°Π²ΠΊΠ° ΠΏΠΎ ΡΠΈΡΠΈΠ½Π΅ ΠΏΡΠΈ ΠΌΠ°ΡΡΡΠ°Π±ΠΈΡΠΎΠ²Π°Π½ΠΈΠΈ ΠΎΠΊΠ½Π°
heightOffset: 100, // ΠΏΠΎΠΏΡΠ°Π²ΠΊΠ° ΠΏΠΎ Π²ΡΡΠΎΡΠ΅ ΠΏΡΠΈ ΠΌΠ°ΡΡΡΠ°Π±ΠΈΡΠΎΠ²Π°Π½ΠΈΠΈ ΠΎΠΊΠ½Π°
widthOffsetH: 60, // ΠΏΠΎΠΏΡΠ°Π²ΠΊΠ° ΠΏΠΎ ΡΠΈΡΠΈΠ½Π΅ ΠΏΡΠΈ ΠΌΠ°ΡΡΡΠ°Π±ΠΈΡΠΎΠ²Π°Π½ΠΈΠΈ ΠΎΠΊΠ½Π° Π΄Π»Ρ Π²ΡΡΠΎΠΊΠΈΡ
ΠΈ ΡΠ·ΠΊΠΈΡ
ΠΈΠ·ΠΎΠ±ΡΠ°ΠΆΠ΅Π½ΠΈΠΉ
heightOffsetH: 110, // ΠΏΠΎΠΏΡΠ°Π²ΠΊΠ° ΠΏΠΎ Π²ΡΡΠΎΡΠ΅ ΠΏΡΠΈ ΠΌΠ°ΡΡΡΠ°Π±ΠΈΡΠΎΠ²Π°Π½ΠΈΠΈ ΠΎΠΊΠ½Π° Π΄Π»Ρ Π²ΡΡΠΎΠΊΠΈΡ
ΠΈ ΡΠ·ΠΊΠΈΡ
ΠΈΠ·ΠΎΠ±ΡΠ°ΠΆΠ΅Π½ΠΈΠΉ
};
// Π½Π°ΡΡΡΠΎΠΉΠΊΠΈ ΠΏΡΠΎΠ³ΡΠ°ΠΌΠΌΡ
var sett = $.extend( settings, options||{});
var el$ = this, imgAll, top, paramsEl, buttons = '';
var ekran = $('#ekranBlock'), modalBlock = $( '#modalBlock' );
// Π΄ΠΎΠ±Π°Π²Π»ΡΠ΅ΠΌ Π½Π° ΡΡΡΠ°Π½ΠΈΡΡ Π½Π΅ΠΎΠ±Ρ
ΠΎΠ΄ΠΈΠΌΡΠ΅ HTML-ΡΠ»Π΅ΠΌΠ΅Π½ΡΡ ( Π΅ΡΠ»ΠΈ ΠΈΡ
Π½Π΅Ρ Π² DOM )
makeElements();
// Π΄ΠΎΠ±Π°Π²Π»ΡΠ΅ΠΌ ΡΠΊΠΎΡΠΎΡΡΡ Π°Π½ΠΈΠΌΠ°ΡΠΈΠΈ Π² ΡΡΠΈΠ»ΠΈ
$('#ekranBlock').css( 'transition', sett.speed / 1000 + 's' );
// ΡΠΎΠ±ΡΡΠΈΡ ΠΌΠΎΠ΄ΡΠ»Ρ ΡΠ°Π±ΠΎΡΡ ΠΌΠΎΠ΄Π°Π»ΡΠ½ΡΡ
ΠΎΠΊΠΎΠ½
$.modalActions = function( e ){
e = e ? e : $( '[data-modal]' );
// Π½Π°Π²Π΅ΡΠΈΠ²Π°Π΅ΠΌ ΡΠΎΠ±ΡΡΠΈΡ Π½Π° ΡΠ»Π΅ΠΌΠ΅Π½ΡΡ ΠΎΠ±Π΅ΡΠ½ΡΡΠΎΠ³ΠΎ Π½Π°Π±ΠΎΡΠ°
e.unbind( 'click' );
e.click( function(){
// ΡΠ»Π΅ΠΌΠ΅Π½Ρ-ΠΈΡΡΠΎΡΠ½ΠΈΠΊ Π²ΡΠ·ΠΎΠ²Π° ΠΎΠΊΠ½Π°
startEl = $(this);
// Π·Π°ΠΏΠΎΠΌΠΈΠ½Π°Π΅ΠΌ ΠΏΠΎΠ·ΠΈΡΠΈΡ ΡΠ»Π΅ΠΌΠ΅Π½ΡΠ° ΠΈΠ· ΠΊΠΎΡΠΎΡΠΎΠ³ΠΎ Π±ΡΠ»ΠΎ Π²ΡΠ·Π²Π°Π½ΠΎ ΠΌΠ°Π΄Π°Π»ΡΠ½ΠΎΠ΅ ΠΎΠΊΠ½ΠΎ
startEl_top = startEl.offset().top;
// ΠΈΠΌΡ ΠΎΡΠΊΡΡΠ²Π°Π΅ΠΌΠΎΠ³ΠΎ ΠΎΠΊΠ½Π°
var blockOpen = startEl.data( 'modal' );
// Π΄Π΅ΠΉΡΡΠ²ΠΈΡ Π½Π° ΠΎΡΠΊΡΡΡΠΈΠ΅ ΠΎΠΊΠ½Π°
$.modalOpenActions( { block:blockOpen, htmlEl:true } );
// ΠΎΡΠΌΠ΅Π½ΡΠ΅ΠΌ ΠΏΠ΅ΡΠ΅Ρ
ΠΎΠ΄ ΠΏΠΎ ΡΡΡΠ»ΠΊΠ΅
return false;
});
}
$.modalActions( el$ );
// ΠΎΡΠΊΡΡΡΠΈΠ΅ ΠΌΠΎΠ΄Π°Π»ΡΠ½ΡΡ
ΠΎΠΊΠΎΠ½
$.modalOpenActions = function ( paramsEl ){
// ΠΏΠΎΠ»ΡΡΠ°Π΅ΠΌ Π΄Π°Π½Π½ΡΠ΅ Π΄Π»Ρ ΠΏΠΎΠΊΠ°Π·Π° ΠΎΠΊΠ½Π°
paramsEl = getData( paramsEl );
if( ekran.length < 1 ){
ekran = $('#ekranBlock');
}
if( modalBlock.length < 1 ){
modalBlock = $( '#modalBlock' );
}
// ΠΏΠΎΠΊΠ°Π·ΡΠ²Π°Π΅ΠΌ ΡΠΊΡΠ°Π½, Π΅ΡΠ»ΠΈ ΠΎΠ½ Π½Π΅ ΠΎΡΠΊΡΡΡ
if( ekran.is(':hidden') ){
// ΡΠ½Π°ΡΠ°Π»Π° ΠΏΠΎΠΊΠ°Π·ΡΠ²Π°Π΅ΠΌ Π±Π»ΠΎΠΊ
ekran.addClass( 'act' );
/*
2024-07-16
ΠΏΠ΅ΡΠ΅Π΄Π΅Π»ΠΊΠ° ΡΠ²ΡΠ·Π°Π½Π° Ρ ΡΠ΅ΠΌ ΡΡΠΎ ΠΌΠΎΠ΄Π°Π»ΡΠ½ΠΎΠ΅ ΠΎΠΊΠ½ΠΎ,
Π²ΡΠ·Π²Π°Π½Π½ΠΎΠ΅ ΡΠ½ΠΈΠ·Ρ ΡΡΡΠ°Π½ΠΈΡΡ ΠΌΠΎΠΆΠ΅Ρ ΡΠΉΡΠΈ ΠΈΠ· Π·ΠΎΠ½Ρ Π²ΠΈΠ΄ΠΈΠΌΠΎΡΡΠΈ
ΠΈΠ·-Π·Π° Π°Π±ΡΠΎΠ»ΡΡΠ½ΠΎΠΉ ΠΏΠΎΠ·ΠΈΡΠΈΠΈ ΠΌΠΎΠ΄Π°Π»ΡΠ½ΠΎΠ³ΠΎ ΠΎΠΊΠ½Π°
ΠΎΡΡΠ΅Π³ΠΎ ΠΌΠΎΠΆΠ΅Ρ ΡΡΠ΅Π·Π°ΡΡΡΡ ΡΠΎΠ΄Π΅ΡΠΆΠΈΠΌΠΎΠ΅
*/
$( 'body' ).addClass( 'modai_open' );
// ΡΠ΅ΠΏΠ΅ΡΡ ΠΏΡΠΎΡΠ²Π»ΡΠ΅ΠΌ
setTimeout(function(){ ekran.addClass( 'active' ) }, 1 );
}
// ΡΡΠ½ΠΊΡΠΈΡ ΠΈΡΠΏΠΎΠ»Π½ΡΠ΅ΠΌΠ°Ρ Π΄ΠΎ ΠΎΡΠΊΡΡΡΠΈΡ ΠΎΠΊΠ½Π°
if( paramsEl['script'] ){
eval( paramsEl['script'] );
}
// ΠΏΠΎΠΊΠ°Π·ΡΠ²Π°Π΅ΠΌ ΠΌΠΎΠ΄Π°Π»ΡΠ½ΠΎΠ΅ ΠΎΠΊΠ½ΠΎ
modalOpen( paramsEl );
};
$(window).resize(function(){
var o = $('.modalItem.imgBox .imgItem.active img');
if( o.length > 0 ){
$( '.imgBlock' ).css( getImgSize( o ) );
}
});
// ΡΡΡΠ°Π½ΠΎΠ²ΠΊΠΈ Π΄Π»Ρ Π΄ΠΎΠ±Π°Π²Π»Π΅Π½ΠΈΡ ΡΠΎΠ΄Π΅ΡΠΆΠΈΠΌΠΎΠ³ΠΎ ΠΌΠΎΠ΄Π°Π»ΡΠ½ΠΎΠ³ΠΎ ΠΎΠΊΠ½Π°
function setContent( paramsEl, str ){
// ΠΊΠΎΠ½ΡΠ΅Π½Ρ-Π·ΠΎΠ½Π°
if( paramsEl['content'] ){
// ΠΊΠΎΠ½ΡΠ΅Π½Ρ-Π·ΠΎΠ½Π° Π±Π»ΠΎΠΊΠ°
var cont = $( str + ' .content' );
// ΡΠΈΠΏ ΡΠΎΠ΄Π΅ΡΠΆΠΈΠΌΠΎΠ³ΠΎ
switch( paramsEl['content'] ){
// ΡΠΎΠ΄Π΅ΡΠΆΠΈΠΌΠΎΠ΅ ΠΏΠΎ ajax
case 'ajax':
ajaxActions( paramsEl, str );
break;
// ΠΈΠ·ΠΎΠ±ΡΠ°ΠΆΠ΅Π½ΠΈΡ
case 'img':
if( paramsEl['group'] ){
var index = paramsEl['index'] ? paramsEl['index'] : 0;
// Π³ΡΡΠΏΠΏΠ° ΠΈΠ·ΠΎΠ±ΡΠ°ΠΆΠ΅Π½ΠΈΠΉ
var g = $('img[data-group=' + paramsEl['group'] + ']');
if( g.length > 0 ){
imgAll = [];
// ΠΎΠ±Ρ
ΠΎΠ΄ΠΈΠΌ Π²ΡΠ΅ ΡΠ»Π΅ΠΌΠ΅Π½ΡΡ Π²Ρ
ΠΎΠ΄ΡΡΠΈΠ΅ Π² ΡΡΡ Π³ΡΡΠΏΠΏΡ
g.each(function( i ){
var classN = '', e = $(this), title = e.attr('title');
// Π΄Π»Ρ ΠΏΠ΅ΡΠ²ΠΎΠ³ΠΎ ΡΠ»Π΅ΠΌΠ΅Π½ΡΠ° ΡΠΏΠΈΡΠΊΠ°
if( i == index ){ classN = 'active'; }
title = title ? "" + title + '' : '' ;
imgAll.push(
""+
"
" + title +
"
" );
});
imgAll = galleryHtml( imgAll );
}
}else{ // ΠΎΠ΄ΠΈΠ½ΠΎΡΠ½ΠΎΠ΅ ΠΈΠ·ΠΎΠ±ΡΠ°ΠΆΠ΅Π½ΠΈΠ΅ Π²Π½ΡΡΡΠΈ ΡΡΡΠ»ΠΊΠΈ ΠΎΡΠΊΡΡΡΠΈΡ ΠΌΠΎΠ΄Π°Π»ΡΠ½ΠΎΠ³ΠΎ ΠΎΠΊΠ½Π°
if( !startEl ){ return false; }
var imgBlock = startEl.find('img');
if( imgBlock.length > 0 ){
var src = imgBlock.attr('src');
if( src ){
var titleImg = imgBlock.attr('title') ? imgBlock.attr('title') : '';
}else{
src = 'no_img.jpg';
var titleImg = 'ΠΠ·ΠΎΠ±ΡΠ°ΠΆΠ΅Π½ΠΈΡ Π½Π΅Ρ';
}
imgAll =
"" +
"
" +
"
" +
"
" + titleImg + '' +
'
' +
'
';
}else{
// Π»ΡΠ±ΠΎΠ΅ ΠΊΠΎΠ»ΠΈΡΠ΅ΡΡΠ²ΠΎ ΠΈΠ·ΠΎΠ±ΡΠ°ΠΆΠ΅Π½ΠΈΠΉ ΠΏΠΎ ΡΡΡΠ»ΠΊΠ΅
if( paramsEl['src'] ){
src = paramsEl['src'].split(',');
var count = src.length;
if( count > 0 ){
imgAll = [];
for( var i = 0; i < count; i++ ){
var classN = i ? '' : 'active';
imgAll.push(
"" +
"
" +
"
" );
}
imgAll = galleryHtml( imgAll );
}
}
}
}
var str = '#modalBlock';
// Π΄Π»Ρ Π³Π°Π»Π΅ΡΠ΅ΠΈ Π΄ΠΎΠ±Π°Π²Π»ΡΠ΅ΠΌ ΠΎΡΠ΄Π΅Π»ΡΠ½ΡΠΉ ΠΊΠ»Π°ΡΡ, Π΄Π»Ρ ΠΎΡΠΎΡΠΌΠ»Π΅Π½ΠΈΡ
$( str + ' .modalItem.' + paramsEl['block'] ).addClass( 'imgBox' );
if( !paramsEl['title'] ){
paramsEl['title'] = 'Π€ΠΎΡΠΎΠ³Π°Π»Π΅ΡΠ΅Ρ';
}
// Π²ΡΡΠ°Π²Π»ΡΠ΅ΠΌ Π³Π°Π»Π΅ΡΠ΅Ρ Π² ΠΎΠΊΠ½ΠΎ
cont.html( imgAll );
// ΡΠΎΠ±ΡΡΠΈΡ Π½Π° ΠΊΠ½ΠΎΠΏΠΊΠΈ ΡΠΏΡΠ°Π²Π»Π΅Π½ΠΈΡ Π³Π°Π»Π΅ΡΠ΅Π΅ΠΉ
if( buttons ){
var leftButton = $( str + ' .left' );
leftButton.unbind('click');
leftButton.click(function(){
buttonsActions( true );
});
var rightButton = $( str + ' .right' );
rightButton.unbind('click');
rightButton.click(function(){
buttonsActions(false);
});
}
break;
// ΡΠ΅ΠΊΡΡ Π΄Π»Ρ ΠΊΠΎΠ½ΡΠ΅Π½Ρ-Π·ΠΎΠ½Ρ
case 'text':
cont.html( paramsEl['text'] );
break;
// ΡΠΎΠ΄Π΅ΡΠΆΠΈΠΌΠΎΠ΅ Π±Π»ΠΎΠΊΠ° ΠΈΠ· ΡΠ»Π΅ΠΌΠ΅Π½ΡΠ° ΡΡΡΠ°Π½ΠΈΡΡ
default:
cont.html( $( paramsEl['content'] ).html() );
break;
}
}
// Π·Π°Π³ΠΎΠ»ΠΎΠ²ΠΎΠΊ ΠΎΠΊΠ½Π°
if( paramsEl['title'] ){
$( str ).find( 'h2' ).html( paramsEl['title'] );
}
};
// ΠΎΠ±Π½ΠΎΠ²Π»Π΅Π½ΠΈΠ΅ ΠΊΠΎΠ½ΡΠ΅Π½Ρ-Π·ΠΎΠ½Ρ Π΄Π»Ρ ajax
function ajaxActions( paramsEl, str ){
var cont = $( str + ' .content' ); // ΠΊΠΎΠ½ΡΠ΅Π½Ρ-Π·ΠΎΠ½Π° Π±Π»ΠΎΠΊΠ°
if( !paramsEl['path'] ){
paramsEl['path'] = sett.ajaxPath + paramsEl['block'] + '.php';
}
if( paramsEl['params'] ){
cont.load( paramsEl['path'], { 'params':paramsEl['params'] }, function(){
if( paramsEl['reload'] ){
$.modalActions(); // ΠΏΠ΅ΡΠ΅Π·Π°Π³ΡΡΠΆΠ°Π΅ΠΌ ΡΠΎΠ±ΡΡΠΈΡ Π½Π° ΠΌΠΎΠ΄Π°Π»ΡΠ½ΡΠ΅ ΠΎΠΊΠ½Π°
}
});
}else{
cont.load( paramsEl['path'], function(){
if( paramsEl['reload'] ){
$.modalActions();
}
});
}
};
// Π΄Π΅ΠΉΡΡΠ²ΠΈΡ ΠΏΠΎΡΠ²Π»Π΅Π½ΠΈΡ \ ΡΠΊΡΡΡΠΈΡ ΠΌΠΎΠ΄Π°Π»ΡΠ½ΠΎΠ³ΠΎ ΠΎΠΊΠ½Π°
function modalOpen( paramsEl ){
var str = '#modalBlock .modalItem';
var str2 = str + '.' + paramsEl['block'];
// Π΅ΡΠ»ΠΈ ΠΎΠΊΠ½ΠΎ ΠΎΡΠΊΡΡΡΠΎ
if( $( str2 + '.active' ).length > 0 ){
// ΠΎΠ±Π½ΠΎΠ²Π»ΡΠ΅ΠΌ Π·ΠΎΠ½Ρ ΠΊΠΎΠ½ΡΠ΅Π½ΡΠ°
if( paramsEl['content'] == 'ajax' || paramsEl['path'] ){
ajaxActions( paramsEl, str2 );
}
// ΠΊΠΎΠ³Π΄Π° Π΅ΡΡΡ Π·Π°Π³ΠΎΠ»ΠΎΠ²ΠΎΠΊ, ΠΎΠ±Π½ΠΎΠ²Π»ΡΠ΅ΠΌ Π΅Π³ΠΎ
if( paramsEl.title ){
$( str2 + '.active h2' ).text( paramsEl.title );
}
// Π΄Π°Π»Π΅Π΅ Π½ΠΈΡΠ΅Π³ΠΎ Π½Π΅ Π΄Π΅Π»Π°Π΅ΠΌ
return false;
}
// ΡΠ°Π½Π΅Π΅ ΠΎΡΠΊΡΡΡΡΠ΅ ΠΎΠΊΠ½Π° ΡΠΊΡΡΠ²Π°Π΅ΠΌ
var open = $( str + ':visible' );
if( open.length > 0 ){
open.removeClass('active');
setTimeout(function(){ open.removeClass('act') }, sett.speed );
}
// ΠΈΠΌΠ΅Π΅ΠΌ ΠΈΠΌΡ Π±Π»ΠΎΠΊΠ°, Π½ΠΎ Π΅Π³ΠΎ Π½Π΅Ρ Π² DOM
if( $( str2 ).length < 1 ){
// ΡΠΎΠ·Π΄Π°Π΅ΠΌ ΠΌΠΎΠ΄Π°Π»ΡΠ½ΠΎΠ΅ ΠΎΠΊΠ½ΠΎ ΠΏΠΎ ΠΈΠΌΠ΅Π½ΠΈ Π±Π»ΠΎΠΊΠ°
modalBlock.append( $.modalBlockTemplate( paramsEl['block'] ) );
}
// ΠΏΠΎΠ»ΡΡΠ°Π΅ΠΌ ΡΠΎΠ΄Π΅ΡΠΆΠΈΠΌΠΎΠ΅ Π² Π·Π°Π²ΠΈΡΠΈΠΌΠΎΡΡΠΈ ΠΎΡ ΡΠΈΠΏΠ° Π΅Π³ΠΎ ΠΏΠΎΠ»ΡΡΠ΅Π½ΠΈΡ
setContent( paramsEl, str2 );
// ΡΡΡΠ°Π½Π°Π²Π»ΠΈΠ²Π°Π΅ΠΌ ΠΏΠΎΠ·ΠΈΡΠΈΡ ΠΌΠΎΠ΄Π°Π»ΡΠ½ΡΡ
ΠΎΠΊΠΎΠ½
setModalPosition();
if( paramsEl['content'] == 'img' ){
img = $( '.imgBlock .imgItem.active img' );
// ΠΈΠ·ΠΌΠ΅Π½ΡΠ΅ΠΌ ΡΠ°Π·ΠΌΠ΅ΡΡ ΠΎΠΊΠ½Π° Ρ ΠΈΠ·ΠΎΠ±ΡΠ°ΠΆΠ΅Π½ΠΈΡΠΌΠΈ
$( '.imgBlock' ).css( getImgSize( img ) );
}
// ΠΏΠΎΠΊΠ°Π·ΡΠ²Π°Π΅ΠΌ Π·Π°ΠΏΡΠ°ΡΠΈΠ²Π°Π΅ΠΌΠΎΠ΅ ΠΎΠΊΠ½ΠΎ
// ΡΡΡΠ°Π½ΠΎΠ²Π»Π΅Π½Π° ΠΏΠ°ΡΠ·Π° Π΄ΠΎ ΠΎΡΠΊΡΡΡΠΈΡ ΠΎΠΊΠ½Π°
if( paramsEl['pause'] && paramsEl['pause'] > sett.speed ){
setTimeout( function(){ openActions( str2 ); }, paramsEl['pause'] );
}else{
// Π΄Π°Π΅ΠΌ Π²ΡΠ΅ΠΌΡ Π΄Π»Ρ Π·Π°ΠΏΠΎΠ»Π½Π΅Π½ΠΈΡ ΠΊΠΎΠ½ΡΠ΅Π½Ρ-Π·ΠΎΠ½Ρ, ΡΠ°ΠΊΠΆΠ΅ Π΅ΡΠ»ΠΈ ΠΎΠ΄Π½ΠΎ ΠΎΠΊΠ½ΠΎ ΠΎΡΠΊΡΡΡΠΎ, Π·Π°ΠΌΠ΅Π½ΡΠ΅ΠΌ Π΄ΡΡΠ³ΠΈΠΌ ΡΠ΅ΡΠ΅Π· ΠΏΠ°ΡΠ·Ρ
setTimeout( function(){ openActions( str2 ); }, sett.speed );
}
};
// Π΄Π΅ΠΉΡΡΠ²ΠΈΡ ΠΏΠΎ ΠΎΡΠΊΡΡΡΠΈΡ ΠΎΠΊΠ½Π°
function openActions( str ){
modalBlock.addClass( 'active' );
var o = $( str );
o.addClass( 'act' );
setTimeout(function(){ o.addClass( 'active' ) }, 1 );
setTimeout(function(){
// Π²ΠΎΡΡΡΠ°Π½Π°Π²Π»ΠΈΠ²Π°Π΅ΠΌ ΡΠΎΠ±ΡΡΠΈΡ Π½Π° Π·Π°ΠΊΡΡΡΠΈΠ΅ ΠΌΠΎΠ΄Π°Π»ΡΠ½ΡΡ
ΠΎΠΊΠΎΠ½
modalCloseEvent( true );
// ΠΏΡΡΡΠ΅ΠΌ ΠΈΠ½Π΄ΠΈΠΊΠ°ΡΠΎΡ Π·Π°Π³ΡΡΠ·ΠΊΠΈ
ekran.find( 'i,span' ).addClass( 'hide' );
}, sett.speed * 2 );
};
// ΡΠΎΠ±ΡΡΠΈΠ΅ Π½Π° ΡΡΡΠ»ΠΊΠΈ Π·Π°ΠΊΡΡΡΠΈΡ ΠΌΠΎΠ΄Π°Π»ΡΠ½ΡΡ
ΠΎΠΊΠΎΠ½ ΠΈ ΡΠΊΡΠ°Π½
function modalCloseEvent( mark ){
var e = $( '.modalClose, #ekranBlock');
e.unbind('click');
e.click(function(){
$.modalCloseActions( mark );
});
};
// Π΄Π΅ΠΉΡΡΠ²ΠΈΡ ΠΏΠΎ Π·Π°ΠΊΡΡΡΠΈΡ ΠΎΠΊΠ½Π°
$.modalCloseActions = function( mark ){
test( startEl );
modalBlock.removeClass( 'active' );
// ΡΠ½Π°ΡΠ°Π»Π° Π·Π°ΠΊΡΡΠ²Π°Π΅ΠΌ ΠΎΠΊΠ½ΠΎ
var o = $( '#modalBlock .modalItem' )
o.removeClass('active');
setTimeout(function(){
o.removeClass( 'act' );
// ΡΠ»Π΅Π΄ΠΎΠΌ ΡΠΊΡΠ°Π½
ekran.removeClass( 'active' );
setTimeout(function(){
ekran.removeClass( 'act' );
setTimeout(function(){
// Π²ΠΎΡΡΡΠ°Π½Π°Π²Π»ΠΈΠ²Π°Π΅ΠΌ ΡΠΎΠ±ΡΡΠΈΡ Π½Π° ΠΎΡΠΊΡΡΡΠΈΠ΅ ΠΌΠΎΠ΄Π°Π»ΡΠ½ΡΡ
ΠΎΠΊΠΎΠ½
$.modalActions( el$ );
// Π²ΠΎΡΡΡΠ°Π½Π°Π²Π»ΠΈΠ²Π°Π΅ΠΌ Π²ΠΈΠ΄ΠΈΠΌΠΎΡΡΡ ΠΈΠ½Π΄ΠΈΠΊΠ°ΡΠΎΡΠ° Π·Π°Π³ΡΡΠ·ΠΊΠΈ
ekran.find( 'i,span' ).removeClass( 'hide' );
/*
ΡΡΠΎ Π²Π½Π΅Π΄ΡΠΈΠ» 2024-07-16
ΠΏΠΎΡΠ»Π΅ Π·Π°ΠΊΡΡΡΠΈΡ ΠΎΠΊΠ½Π° ΠΏΠ΅ΡΠ΅ΠΌΠ΅ΡΠ°Π΅ΠΌΡΡ ΠΊ Π±Π»ΠΎΠΊΡ ΠΎΡΠΊΡΠ΄Π° Π±ΡΠ»ΠΎ Π²ΡΠ·Π²Π°Π½ΠΎ ΠΌΠΎΠ΄Π°Π»ΡΠ½ΠΎΠ΅ ΠΎΠΊΠ½ΠΎ
*/
$( 'body' ).removeClass( 'modai_open' );
$('html, body').scrollTop( startEl_top );
}, sett.speed );
}, sett.speed );
}, sett.speed );
$( '#modalBlock .errorInfo' ).remove();
};
// ΡΠ°Π±Π»ΠΎΠ½ ΠΌΠΎΠ΄Π°Π»ΡΠ½ΠΎΠ³ΠΎ ΠΎΠΊΠ½Π°
$.modalBlockTemplate = function( block ){
var text =
"" +
"
ΠΠ½ΡΠΎΡΠΌΠ°ΡΠΈΠΎΠ½Π½ΠΎΠ΅ ΡΠΎΠΎΠ±ΡΠ΅Π½ΠΈΠ΅
" +
"
ΠΠΎΠ½ΡΠ΅Π½Ρ-Π·ΠΎΠ½Π° ΠΏΡΡΡΠ°.
ΠΡΠΎΠ²Π΅ΡΡΡΠ΅ Π°ΡΡΠΈΠ±ΡΡ 'data-content' Π΄Π»Ρ ΠΏΠΎΠ»ΡΡΠ΅Π½ΠΈΡ ΡΠΎΠ΄Π΅ΡΠΆΠΈΠΌΠΎΠ³ΠΎ
" +
"
×" +
"
";
return text;
};
// ΡΡΡΠ°Π½Π°Π²Π»ΠΈΠ²Π°Π΅ΠΌ ΠΏΠΎΠ·ΠΈΡΠΈΡ ΠΎΠΊΠ½Π°
function setModalPosition(){
// var h_modal = $modalItem product_item
// ΠΎΠΏΡΠ΅Π΄Π΅Π»ΡΠ΅ΠΌ ΠΏΠΎΠ·ΠΈΡΠΈΡ ΠΎΠΊΠ½Π° Π±ΡΠ°ΡΠ·Π΅ΡΠ°
top = window.pageYOffset - sett['offset'];
// ΡΡΡΠ°Π½Π°Π²Π»ΠΈΠ²Π°Π΅ΠΌ ΠΏΠΎΠ»ΠΎΠΆΠ΅Π½ΠΈΠ΅ ΠΌΠΎΠ΄Π°Π»ΡΠ½ΠΎΠ³ΠΎ ΠΎΠΊΠ½Π°
modalBlock.css( 'top', top + 'px' );
// test( modalBlock );
// test( modalBlock.height() );
};
// ΠΊΠ½ΠΎΠΏΠΊΠΈ ΡΠΏΡΠ°Π²Π»Π΅Π½ΠΈΡ ΡΠ»Π°ΠΉΠ΄Π΅ΡΠΎΠΌ
function buttonsActions( left ){
var str = '#modalBlock .imgItem';
var imgItems = $( str );
var index = $( str + '.active' ).data('index');
// ΠΈΠ΄Π΅ΠΌ Π½Π°Π»Π΅Π²ΠΎ
if( left ){
if( index ){
index--;
}else{
index = imgItems.length - 1;
}
}else{ // Π½Π°ΠΏΡΠ°Π²ΠΎ
if( index == imgItems.length - 1 ){
index = 0;
}else{
index++;
}
}
// ΠΏΠΎΠ»ΡΡΠ°Π΅ΠΌΡΠΉ Π±Π»ΠΎΠΊ ΠΈΠ·ΠΎΠ±ΡΠ°ΠΆΠ΅Π½ΠΈΡ
var ob = $( str + '[data-index='+ index +']' );
// ΠΏΠΎΠ»ΡΡΠ°Π΅ΠΌ ΡΠ°Π·ΠΌΠ΅ΡΡ ΠΎΠΊΠ½Π° Π΄Π»Ρ ΠΏΠΎΠΊΠ°Π·Π° Π½ΠΎΠ²ΠΎΠ³ΠΎ ΠΈΠ·ΠΎΠ±ΡΠ°ΠΆΠ΅Π½ΠΈΡ
img = ob.find( 'img' );
// ΠΈΠ·ΠΌΠ΅Π½ΡΠ΅ΠΌ ΡΠ°Π·ΠΌΠ΅ΡΡ ΠΎΠΊΠ½Π° Ρ ΠΈΠ·ΠΎΠ±ΡΠ°ΠΆΠ΅Π½ΠΈΡΠΌΠΈ
ob.closest( '.imgBlock' ).css( getImgSize( img ) );
// ΡΠ°ΡΡΠ²ΠΎΡΡΠ΅ΠΌ ΠΏΡΠ΅Π΄ΡΠ΄ΡΡΠ΅Π΅ ΠΈΠ·ΠΎΠ±ΡΠ°ΠΆΠ΅Π½ΠΈΠ΅
$( '#modalBlock .imgItem img.active, #modalBlock .imgItem .imgTitle.active').removeClass('active');
setTimeout(function(){
// ΡΠΊΡΡΠ²Π°Π΅ΠΌ Π±Π»ΠΎΠΊ ΠΈΠ·ΠΎΠ±ΡΠ°ΠΆΠ΅Π½ΠΈΡ
$( str + '.active' ).removeClass('active');
// ΠΎΡΠΊΡΡΠ²Π°Π΅ΠΌ ΡΠ»Π΅Π΄ΡΡΡΠΈΠΉ Π±Π»ΠΎΠΊ
ob.addClass('active');
setTimeout(function(){
// ΠΏΡΠΎΡΠ²Π»ΡΠ΅ΠΌ ΠΈΠ·ΠΎΠ±ΡΠ°ΠΆΠ΅Π½ΠΈΠ΅
ob.find( 'img' ).addClass( 'active' );
setTimeout(function(){
// ΠΏΠΎΠΊΠ°Π·ΡΠ²Π°Π΅ΠΌ Π·Π°Π³ΠΎΠ»ΠΎΠ²ΠΎΠΊ
ob.find( '.imgTitle' ).addClass( 'active' );
}, sett.speed / 2 );
}, sett.speed / 2 );
}, sett.speed );
};
// ΡΡΡΠ°Π½Π°Π²Π»ΠΈΠ²Π°Π΅ΠΌ ΡΠ°Π·ΠΌΠ΅ΡΡ Π±Π»ΠΎΠΊΠ° Π΄Π»Ρ ΠΈΠ·ΠΎΠ±ΡΠ°ΠΆΠ΅Π½ΠΈΠΉ Π΄Π»Ρ ΡΠ΅Π°Π»ΠΈΠ·Π°ΡΠΈΠΈ Π°Π½ΠΈΠΌΠ°ΡΠΈΠΎΠ½Π½ΠΎΠ³ΠΎ ΠΈΠ·ΠΌΠ΅Π½Π΅Π½ΠΈΡ ΡΠ°Π·ΠΌΠ΅ΡΠΎΠ² ΠΎΠΊΠ½Π°
function getImgSize( img ){
var width, height;
// ΡΠ°Π·ΠΌΠ΅ΡΡ ΠΈΠ·ΠΎΠ±ΡΠ°ΠΆΠ΅Π½ΠΈΡ
var iw = img[0]['naturalWidth']; // ΠΈΡΡ
ΠΎΠ΄Π½Π°Ρ ΡΠΈΡΠΈΠ½Π° ΠΈΠ·ΠΎΠ±ΡΠ°ΠΆΠ΅Π½ΠΈΡ
var ih = Number( img[0]['naturalHeight'] ) + 45; // ΠΈΡΡ
ΠΎΠ΄Π½Π°Ρ Π²ΡΡΠΎΡΠ° ΠΈΠ·ΠΎΠ±ΡΠ°ΠΆΠ΅Π½ΠΈΡ + ΠΌΠ΅ΡΡΠΎ Π΄Π»Ρ ΠΏΠΎΠ΄ΠΏΠΈΡΠΈ ΠΊ ΠΈΠ·ΠΎΠ±ΡΠ°ΠΆΠ΅Π½ΠΈΡ
//console.log( 'widthImg_' + iw + ' heightImg_' +ih );
var iratio = iw / ih; // ΠΏΡΠΎΠΏΠΎΡΡΠΈΠΈ ΠΈΠ·ΠΎΠ±ΡΠ°ΠΆΠ΅Π½ΠΈΡ
// ΡΠ°Π·ΠΌΠ΅ΡΡ ΠΎΠΊΠ½Π°
var wh = $( window ).height() - sett.heightOffset; // Π²ΡΡΠΎΡΠ° ΠΎΠΊΠ½Π°
// ΡΠΈΡΠΎΠΊΠΈΠ΅ ΠΈΠ·ΠΎΠ±ΡΠ°ΠΆΠ΅Π½ΠΈΡ
if( iratio > 1 ){
var ww = $( window ).width() * 0.9 - sett.widthOffset; // ΡΠΈΡΠΈΠ½Π° ΠΎΠΊΠ½Π°
width = ww;
height = ww / iratio;
// ΠΏΠΎΡΠ»Π΅ ΡΡΠΎΠ³ΠΎ Π²ΡΡΠΎΡΠ° ΠΎΠΊΠ°Π·Π°Π»Π°ΡΡ Π±ΠΎΠ»ΡΡΠ΅ Π½Π΅ΠΎΠ±Ρ
ΠΎΠ΄ΠΈΠΌΠΎΠΉ
if( height > wh ){
width = wh * iratio;
height = wh;
}
if( height > ih ){
height = ih;
}
if( width > iw + 80 ){
width = iw + 80;
}
// console.log( 'width_' + width + ' height_' + height );
}else{ // ΠΏΠΎΠ΄Π³ΠΎΠ½ΡΠ΅ΠΌ Π²ΡΡΠΎΠΊΠΈΠ΅ ΠΈΠ·ΠΎΠ±ΡΠ°ΠΆΠ΅Π½ΠΈΡ
var ww = $( window ).width() * 0.9 - sett.widthOffsetH; // ΡΠΈΡΠΈΠ½Π° ΠΎΠΊΠ½Π°
if( ih > wh ){
// ΡΡΠΈΡΠ°Π΅ΠΌ ΠΎΡ Π²ΡΡΠΎΡΡ
width = wh * iratio;
height = wh;
//console.log(1);
}else{
//console.log( 2 );
width = iw;
height = ih;
}
//console.log( 'width_' + width + ' height_' + height );
if( width > ww ){
width = ww;
height = width / iratio;
}
}
// console.log( 'width_' + width + ' height_' + height );
return { 'width' : width, 'height' : height };
}
// ΡΠΎΡΠΌΠΈΡΡΠ΅ΠΌ ΡΠΎΠ΄Π΅ΡΠΆΠΈΠΌΠΎΠ΅ ΡΠΎΡΠΎ Π³Π°Π»Π΅ΡΠ΅ΠΈ
function galleryHtml( imgArr ){
// ΠΈΠ·ΠΎΠ±ΡΠ°ΠΆΠ΅Π½ΠΈΠΉ Π±ΠΎΠ»ΡΡΠ΅ 1 -> Π΄ΠΎΠ±Π°Π²Π»ΡΠ΅ΠΌ ΠΊΠ½ΠΎΠΏΠΊΠΈ ΡΠ»Π°ΠΉΠ΄Π΅ΡΠ°
if( imgArr.length > 1 ){
buttons =
""+
"";
}
// html ΡΠΎΠ΄Π΅ΡΠΆΠΈΠΌΠΎΠ³ΠΎ ΡΠΎΡΠΎ Π³Π°Π»Π΅ΡΠ΅ΠΈ
return "" + imgArr.join( '' ) + '
' + buttons;
};
// ΠΏΠΎΠ»ΡΡΠ°Π΅ΠΌ Π΄Π°Π½Π½ΡΠ΅ Π΄Π»Ρ ΠΏΠΎΠΊΠ°Π·Π° ΠΎΠΊΠ½Π°
function getData( paramsEl ){
// ΠΏΠΎΠ»ΡΡΠ΅Π½ΠΎ ΠΈΠΌΡ ΠΎΡΠΊΡΡΠ²Π°Π΅ΠΌΠΎΠ³ΠΎ Π±Π»ΠΎΠΊΠ° Π² Π²ΠΈΠ΄Π΅ ΡΡΡΠΎΠΊΠΈ
if( typeof( paramsEl ) == 'string' ){
startEl = false;
return {block:paramsEl};
}
// Π΄Π°Π½Π½ΡΠ΅ ΠΊΠ°ΠΊ Π°ΡΡΠΈΠ±ΡΡΡ html-ΡΠ»Π΅ΠΌΠ΅Π½ΡΠ°
if( paramsEl['htmlEl'] ){
if( !paramsEl['block'] ){
alert( 'ΠΠ΅ ΡΡΡΠ°Π½ΠΎΠ²Π»Π΅Π½ Π°ΡΡΠΈΠ±ΡΡ data-modal' );
return false;
}
// ΡΠΏΠΈΡΠΎΠΊ Π²ΡΠ΅Ρ
Π²ΠΎΠ·ΠΌΠΎΠΆΠ½ΡΡ
Π°ΡΡΠΈΠ±ΡΡΠΎΠ²
var attr = ['title', 'content', 'script', 'path', 'params', 'group', 'src', 'text', 'pause', 'index', 'reload'];
$.each( attr, function( k, v ){
var tmp = startEl.data( v );
if( tmp != undefined ){
paramsEl[ v ] = tmp;
}
});
}
if( paramsEl['text'] ){
paramsEl['content'] = 'text';
}
if( paramsEl['path'] ){
paramsEl['content'] = 'ajax';
}
return paramsEl;
};
// Π΄ΠΎΠ±Π°Π²Π»ΡΠ΅ΠΌ Π½Π° ΡΡΡΠ°Π½ΠΈΡΡ Π½Π΅ΠΎΠ±Ρ
ΠΎΠ΄ΠΈΠΌΡΠ΅ HTML-ΡΠ»Π΅ΠΌΠ΅Π½ΡΡ ( Π΅ΡΠ»ΠΈ ΠΈΡ
Π½Π΅Ρ Π² DOM )
function makeElements(){
// ΠΏΡΠΎΠ²Π΅ΡΡΠ΅ΠΌ Π½Π°Π»ΠΈΡΠΈΠ΅ ΡΠΊΡΠ°Π½Π°
if( $( '#ekranBlock' ).length < 1 ){
modalBlock.before( "... ΠΈΠ΄Π΅Ρ Π·Π°Π³ΡΡΠ·ΠΊΠ° ...
" );
}
if( $( '#boxBlocks' ).length < 1 ){
// ΡΠΆΠ΅ Π΅ΡΡΡ Π±Π»ΠΎΠΊ Ρ HTML Π³ΠΎΡΠΎΠ²ΡΡ
ΠΌΠΎΠ΄Π°Π»ΡΠ½ΡΡ
ΠΎΠΊΠΎΠ½
if( modalBlock.length > 0 ){
// Π΄ΠΎΠ±Π°Π²Π»ΡΠ΅ΠΌ Π±Π»ΠΎΠΊ - ΠΎΠ±Π΅ΡΡΠΊΡ Π±Π»ΠΎΠΊΠ° ΠΌΠΎΠ΄Π°Π»ΡΠ½ΡΡ
ΠΎΠΊΠΎΠ½
modalBlock.wrap( "" );
// Π½ΡΠΆΠ½ΡΡ
ΡΠ»Π΅ΠΌΠ΅Π½ΡΠΎΠ² Π½Π΅Ρ -> Π΄ΠΎΠ±Π°Π²Π»ΡΠ΅ΠΌ ΠΈΡ
}else{
$('body').append(
""+
"
"+
"
"+
""+
""+
"... ΠΈΠ΄Π΅Ρ Π·Π°Π³ΡΡΠ·ΠΊΠ° ..."+
"
"+
"
"+
"
"+
"
"+
"
" );
}
}
// ΠΏΡΠΎΠ²Π΅ΡΡΠ΅ΠΌ Π½Π°Π»ΠΈΡΠΈΠ΅ ΡΠ΅ΡΠ²ΠΈΡΠ½ΠΎΠ³ΠΎ Π±Π»ΠΎΠΊΠ°
if( $( '#serviceBlock' ).length < 1 ){
modalBlock.after( "" );
}
};
return el$;
}
})(jQuery);/* cristallForm.v1.0.js - ΠΏΡΠΎΠ΄ΡΠΊΡ Π»ΠΈΠ½Π΅ΠΉΠΊΠΈ Cristall Group
ΡΠΊΡΠΈΠΏΡΡ ΠΎΠ±Π΅ΡΠΏΠ΅ΡΠ΅Π½ΠΈΡ ΡΠ°Π±ΠΎΡΡ ΡΠΎΡΠΌ, Π²Π°Π»ΠΈΠ΄Π°ΡΠΈΡ ΠΏΠΎΠ»Π΅ΠΉ
ΡΠ°Π·ΡΠ°Π±ΠΎΡΡΠΈΠΊ: ΠΠΎΠ»ΡΡΠ°ΠΊΠΎΠ² Π.Π.
mail: cristall-group@yandex.ru
17.07.2015
ΠΈΡΠΏΠΎΠ»ΡΠ·ΠΎΠ²Π°Π½ΠΈΠ΅ $('form').cristallForm();
Π°ΡΡΠΈΠ±ΡΡ form data-act='no' - ΡΠ½ΠΈΠΌΠ°Π΅Ρ Π½Π°Π±Π»ΡΠ΄Π΅Π½ΠΈΠ΅ Π·Π° ΡΡΠΎΠΉ ΡΠΎΡΠΌΠΎΠΉ;
Π°ΡΡΠΈΠ±ΡΡ form data-act='reload' - ΠΏΠΎΡΠ»Π΅ ΠΏΡΠΎΠ²Π΅ΡΠΊΠΈ ΠΏΠΎΠ»Π΅ΠΉ, ΠΎΠ±ΡΠ°Π±Π°ΡΡΠ²Π°Π΅ΠΌ ΡΠΎΡΠΌΡ ΡΠ΅ΡΠ΅Π· ΠΏΠ΅ΡΠ΅Π·Π°Π³ΡΡΠ·ΠΊΡ ΡΡΡΠ°Π½ΠΈΡΡ;
ΠΏΡΠΎΠ²Π΅ΡΡΠ΅ΠΌΡΠ΅ ΠΏΠΎΠ»Ρ ΠΏΠΎΠΌΠ΅ΡΠ°Π΅ΠΌ class='check';
Π°ΡΡΠΈΠ±ΡΡ ΠΏΠΎΠ»Ρ data-required='1' - ΠΎΠ±ΡΠ·Π°ΡΠ΅Π»ΡΠ½ΠΎΠ΅ ΠΏΠΎΠ»Π΅
Π°ΡΡΠΈΠ±ΡΡ ΠΏΠΎΠ»Ρ data-min='10' - ΠΌΠΈΠ½ΠΈΠΌΠ°Π»ΡΠ½ΠΎΠ΅ ΠΊΠΎΠ»ΠΈΡΠ΅ΡΡΠ²ΠΎ ΡΠ»ΠΎΠ² 10 ΡΡ
Π°ΡΡΠΈΠ±ΡΡ ΠΏΠΎΠ»Ρ data-type='...' - ΡΠΈΠΏ ΡΠΎΠ΄Π΅ΡΠΆΠΈΠΌΠΎΠ³ΠΎ ΠΏΠΎΠ»Ρ Π΄Π»Ρ ΠΏΡΠΎΠ²Π΅ΡΠΊΠΈ ( email, text, num-ΡΠΈΡΠ»ΠΎ, phone, common, link, checkbox, select )