!function(a,b){"object"==typeof exports?module.exports=b(require("jquery")):"function"==typeof define&&define.amd?define("EasyPieChart",["jquery"],b):b(a.jQuery)}(this,function(a){var b=function(a,b){var c,d=document.createElement("canvas");"undefined"!=typeof G_vmlCanvasManager&&G_vmlCanvasManager.initElement(d);var e=d.getContext("2d");d.width=d.height=b.size,a.appendChild(d);var f=1;window.devicePixelRatio>1&&(f=window.devicePixelRatio,d.style.width=d.style.height=[b.size,"px"].join(""),d.width=d.height=b.size*f,e.scale(f,f)),e.translate(b.size/2,b.size/2),e.rotate((-0.5+b.rotate/180)*Math.PI);var g=(b.size-b.lineWidth)/2;b.scaleColor&&b.scaleLength&&(g-=b.scaleLength+2),Date.now=Date.now||function(){return+new Date};var h=function(a,b,c){c=Math.min(Math.max(-1,c||0),1);var d=0>=c?!0:!1;e.beginPath(),e.arc(0,0,g,0,2*Math.PI*c,d),e.strokeStyle=a,e.lineWidth=b,e.stroke()},i=function(){var a,c,d=24;e.lineWidth=1,e.fillStyle=b.scaleColor,e.save();for(var d=24;d>0;--d)0===d%6?(c=b.scaleLength,a=0):(c=.6*b.scaleLength,a=b.scaleLength-c),e.fillRect(-b.size/2+a,0,c,1),e.rotate(Math.PI/12);e.restore()},j=function(){return window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||function(a){window.setTimeout(a,1e3/60)}}(),k=function(){b.scaleColor&&i(),b.trackColor&&h(b.trackColor,b.lineWidth,1)};this.clear=function(){e.clearRect(b.size/-2,b.size/-2,b.size,b.size)},this.draw=function(a){b.scaleColor||b.trackColor?e.getImageData&&e.putImageData?c?e.putImageData(c,0,0):(k(),c=e.getImageData(0,0,b.size*f,b.size*f)):(this.clear(),k()):this.clear(),e.lineCap=b.lineCap;var d;d="function"==typeof b.barColor?b.barColor(a):b.barColor,h(d,b.lineWidth,a/100)}.bind(this),this.animate=function(a,c){var d=Date.now();b.onStart(a,c);var e=function(){var f=Math.min(Date.now()-d,b.animate),g=b.easing(this,f,a,c-a,b.animate);this.draw(g),b.onStep(a,c,g),f>=b.animate?b.onStop(a,c):j(e)}.bind(this);j(e)}.bind(this)},c=function(a,c){var d={barColor:"#ef1e25",trackColor:"#f9f9f9",scaleColor:"#dfe0e0",scaleLength:5,lineCap:"round",lineWidth:3,size:110,rotate:0,animate:1e3,easing:function(a,b,c,d,e){return b/=e/2,1>b?d/2*b*b+c:-d/2*(--b*(b-2)-1)+c},onStart:function(){},onStep:function(){},onStop:function(){}};if("undefined"!=typeof b)d.renderer=b;else{if("undefined"==typeof SVGRenderer)throw new Error("Please load either the SVG- or the CanvasRenderer");d.renderer=SVGRenderer}var e={},f=0,g=function(){this.el=a,this.options=e;for(var b in d)d.hasOwnProperty(b)&&(e[b]=c&&"undefined"!=typeof c[b]?c[b]:d[b],"function"==typeof e[b]&&(e[b]=e[b].bind(this)));e.easing="string"==typeof e.easing&&"undefined"!=typeof jQuery&&jQuery.isFunction(jQuery.easing[e.easing])?jQuery.easing[e.easing]:d.easing,this.renderer=new e.renderer(a,e),this.renderer.draw(f),a.dataset&&a.dataset.percent?this.update(parseFloat(a.dataset.percent)):a.getAttribute&&a.getAttribute("data-percent")&&this.update(parseFloat(a.getAttribute("data-percent")))}.bind(this);this.update=function(a){return a=parseFloat(a),e.animate?this.renderer.animate(f,a):this.renderer.draw(a),f=a,this}.bind(this),g()};a.fn.easyPieChart=function(b){return this.each(function(){var d;a.data(this,"easyPieChart")||(d=a.extend({},b,a(this).data()),a.data(this,"easyPieChart",new c(this,d)))})}}); (function($){ $.fn.appear=function(fn, options){ var settings=$.extend({ data: undefined, one: true, accX: 0, accY: 0 }, options); return this.each(function(){ var t=$(this); t.appeared=false; if(!fn){ t.trigger('appear', settings.data); return; } var w=$(window); var check=function(){ if(!t.is(':visible')){ t.appeared=false; return; } var a=w.scrollLeft(); var b=w.scrollTop(); var o=t.offset(); var x=o.left; var y=o.top; var ax=settings.accX; var ay=settings.accY; var th=t.height(); var wh=w.height(); var tw=t.width(); var ww=w.width(); if(y + th + ay >=b && y <=b + wh + ay && x + tw + ax >=a && x <=a + ww + ax){ if(!t.appeared) t.trigger('appear', settings.data); }else{ t.appeared=false; }}; var modifiedFn=function(){ t.appeared=true; if(settings.one){ w.unbind('scroll', check); var i=$.inArray(check, $.fn.appear.checks); if(i >=0) $.fn.appear.checks.splice(i, 1); } fn.apply(this, arguments); }; if(settings.one) t.one('appear', settings.data, modifiedFn); else t.bind('appear', settings.data, modifiedFn); w.scroll(check); $.fn.appear.checks.push(check); (check)(); }); }; $.extend($.fn.appear, { checks: [], timeout: null, checkAll: function(){ var length=$.fn.appear.checks.length; if(length > 0) while (length--) ($.fn.appear.checks[length])(); }, run: function(){ if($.fn.appear.timeout) clearTimeout($.fn.appear.timeout); $.fn.appear.timeout=setTimeout($.fn.appear.checkAll, 20); }}); $.each(['append', 'prepend', 'after', 'before', 'attr', 'removeAttr', 'addClass', 'removeClass', 'toggleClass', 'remove', 'css', 'show', 'hide'], function(i, n){ var old=$.fn[n]; if(old){ $.fn[n]=function(){ var r=old.apply(this, arguments); $.fn.appear.run(); return r; }} }); })(jQuery); jQuery(document).ready(function($){ var smoothScroll = !!('WebkitOverflowScrolling' in document.documentElement.style); var touchDevice=(Modernizr.touch) ? true:false; var css3=(Modernizr.csstransforms3d) ? true:false; var pre; function prefix(){ var styles=window.getComputedStyle(document.documentElement, ''); pre=(Array.prototype.slice.call(styles).join('') .match(/-(moz|webkit|ms)-/)||(styles.OLink===''&&['', 'o']))[1]; } if(css3===true){ prefix(); } var ie=(function(){ var v=3, div=document.createElement('div'), all=div.getElementsByTagName('i'); do { div.innerHTML=''; } while (all[0]); return v > 4 ? v:document.documentMode; }()); var scroll=window.requestAnimationFrame || window.webkitRequestAnimationFrame || window.mozRequestAnimationFrame || window.msRequestAnimationFrame || window.oRequestAnimationFrame || function(callback){ window.setTimeout(callback, 1000/600); }; $('.paratrue iframe').each(function(){ if(ie==11&&parseInt($(this).parent().height()) > 1000){ $(this).closest('.parallax-container').removeClass('paratrue'); }}); var divPosition=-1; function parallaxImgDiv(){ if(divPosition==$(document).scrollTop()){ scroll(parallaxImgDiv); return false; }else{ if(touchDevice===false&&css3===true){ var wH=$(window).height(); $('.paratrue').each(function(){ var $this=$(this); var sPos=$(document).scrollTop(); var pPos=$this.offset().top; var pH=$this.outerHeight(true); var pTop=pPos - wH; var pBot=pPos + wH; if(sPos >=pTop&&sPos <=pBot){ var pF=50/(wH+pH); var pX=Math.abs(sPos-pTop)*pF*-1; $this.find('.parallax-container-inner').css('-'+pre+'-transform', 'translate3d(0px, '+pX+'%, 0px)'); }}); }} scroll(parallaxImgDiv); } if(touchDevice===false){ parallaxImgDiv(); } $.fn.countTo=function(options){ options=$.extend({}, $.fn.countTo.defaults, options||{}); var loops=Math.ceil(options.speed / options.refreshInterval), increment=(options.to - options.from) / loops; return $(this).each(function(){ var _this=this, loopCount=0, value=options.from, interval=setInterval(updateTimer, options.refreshInterval); function updateTimer(){ value +=increment; loopCount++; $(_this).html(value.toFixed(options.decimals)+options.sign); if(typeof(options.onUpdate)=='function'){ options.onUpdate.call(_this, value); } if(loopCount >=loops){ clearInterval(interval); value=options.to; if(typeof(options.onComplete)=='function'){ options.onComplete.call(_this, value); }} }}); }; $.fn.countTo.defaults={ from: 0, to: 100, speed: 1000, refreshInterval: 100, decimals: 0, sign: '', onUpdate: null, onComplete: null }; function colCalc(){ $('.col.col-3').each(function(){ var $currentDiv=$(this); var $nextDiv=$(this).next('div, li'); if($nextDiv.hasClass('col-3')&&!$currentDiv.hasClass('col1-4')){ $currentDiv.addClass('col1-4 clear-both'); $nextDiv.addClass('col1-4 right-edge'); }}); $('.col.col-2').each(function(){ var $currentDiv=$(this); var $nextDiv=$currentDiv.nextAll('div, li').slice(0,6); if($nextDiv.hasClass('col-2')&&!$currentDiv.hasClass('col1-4')){ $currentDiv.addClass('col1-4 clear-both'); $currentDiv.nextAll('div, li').slice(0,1).addClass('col1-4 right-edge'); $currentDiv.nextAll('div, li').slice(1,2).addClass('col1-4 clear-both mid-edge'); $currentDiv.nextAll('div, li').slice(2,3).addClass('col1-4 col1-6 right-edge'); $currentDiv.nextAll('div, li').slice(3,4).addClass('col1-4 clear-both'); $currentDiv.nextAll('div, li').slice(4,5).addClass('col1-4 right-edge'); }}); } function viewport(){ var e=window, a='inner'; if(!('innerWidth' in window)){ a='client'; e=document.documentElement||document.body; } return { width:e[ a+'Width' ]};} function colCalc2(){ windowSize=viewport().width; var colHP=[]; var colNb=1; $('.to-anim-box').each(function(){ var height=[]; var $currentDiv=$(this); $currentDiv.add($currentDiv.find('.to-anim-box-icon-inner,.to-anim-box-desc,.to-anim-box-icon')).addClass('notransition').height('auto'); height.push($currentDiv.find('.to-anim-box-desc').outerHeight()); height.push($currentDiv.find('.to-anim-box-icon').outerHeight()); height=Math.max.apply(Math,height); $currentDiv.add($currentDiv.find('.to-anim-box-icon-inner,.to-anim-box-desc,.to-anim-box-icon')).css('height',height+'px'); $currentDiv.add($currentDiv.find('.to-anim-box-icon-inner,.to-anim-box-desc,.to-anim-box-icon')).removeClass('notransition'); }); $('.col.col-padding').each(function(){ var $currentDiv=$(this); $currentDiv.height('auto'); if($currentDiv.find('.to-anim-box').length){ $currentDiv.addClass('to-anim-box-border'); } if($currentDiv.find('.to-member-box').length){ var img=$currentDiv.find('.team-member-box-image').css('background-image').replace(/^url\(["']?/, '').replace(/["']?\)$/, ''); var tmpImg=new Image(); tmpImg.src=img; $(tmpImg).on('load',function(){ var ratio=tmpImg.height/tmpImg.width; var height=$currentDiv.outerWidth()*ratio; $currentDiv.css('height',height); }); } if(windowSize > 999&&!$currentDiv.children('.to-step').length){ var $nextDiv=$currentDiv.next('div'); $currentDiv.addClass('col-H'+colNb); colHP.push($currentDiv.outerHeight()); if($currentDiv.hasClass('col-last')){ var height=Math.max.apply(Math,colHP); $('.col-H'+colNb).css('height',height+'px'); colHP=[]; colNb++; }} }); $('.equal-height').each(function(){ var $currentDiv=$(this).find('> [class*=vc_col-], > .section-container > [class*=vc_col-]'); $currentDiv.last().addClass('col-last'); $currentDiv.height('auto'); $currentDiv.each(function(){ $currentDiv=$(this); if($currentDiv.find('.to-anim-box').length){ $currentDiv.addClass('to-anim-box-border'); } if($currentDiv.find('.to-member-box').length){ $currentDiv.addClass('col-H'+colNb); var img=$currentDiv.find('.team-member-box-image').css('background-image').replace(/^url\(["']?/, '').replace(/["']?\)$/, ''); var tmpImg=new Image(); tmpImg.src=img; $(tmpImg).on('load',function(){ var ratio=tmpImg.height/tmpImg.width; var height=$currentDiv.outerWidth()*ratio; colHP.push(height); if($currentDiv.hasClass('col-last')){ var height=Math.max.apply(Math,colHP); $('.col-H'+colNb).css('height',height+'px'); colHP=[]; colNb++; }}); }else if(!$currentDiv.children('.to-step').length){ var $nextDiv=$currentDiv.next('div'); $currentDiv.addClass('col-H'+colNb); colHP.push($currentDiv.outerHeight()); if($currentDiv.hasClass('col-last')){ var height=Math.max.apply(Math,colHP); $('.col-H'+colNb).css('height',height+'px'); colHP=[]; colNb++; }} }); }); } $(window).resize(function(){ setTimeout(function(){ colCalc2(); },800); }); function colAnim(){ $('.no-touch.no-csstransitions .has-anim').appear(function(){ var $this=$(this); anim=$this.attr('data-anim').replace('from-', ''); delay=$this.attr('data-delay'); ease='easeOutSine'; options={}; options[anim]=0; options['opacity']=1; if(anim!==''&&anim!=='grow-in'&&anim!=='flip-in'){ $this.delay(delay).animate(options, 800, ease); } setTimeout(function(){ $this.removeClass('has-anim'); },parseInt(delay)+1200); },{accX: 0, accY: -90}); $('.no-touch.csstransitions .has-anim').appear(function(){ var $this=$(this); delay=$this.attr('data-delay'); setTimeout(function(){ $this.css({ 'transform': 'perspective(1000px) rotateY(0deg) translate3d(0,0,0)', '-webkit-transform': 'perspective(1000px) rotateY(0deg) translate3d(0,0,0)', '-o-transform': 'perspective(1000px) rotateY(0deg) translate3d(0,0,0)', '-moz-transform': 'perspective(1000px) rotateY(0deg) translate3d(0,0,0)', 'opacity': 1 }); },delay); setTimeout(function(){ $this.removeClass('has-anim'); },parseInt(delay)+1200); },{accX: 0, accY: -90}); } $(window).resize(function(){ $('.no-touch .has-anim .owl-carousel').each(function(){ $this=$(this); $this.closest('.has-anim').addClass('notransition'); }); setTimeout(function(){ $('.no-touch .has-anim .owl-carousel').closest('.has-anim').removeClass('notransition'); }, 300); }); function progressBar(){ $('.to-progress-bar').appear(function(){ var $this=$(this); var percent=$this.attr('data-width'); $this.animate({'width':percent + '%'},1500, 'easeOutCirc'); $this.find('strong').animate({'opacity':1},1000, 'easeOutCirc'); $this.find('strong').countTo({ from: 0, to: percent, speed: 1000, refreshInterval: 30, sign: '%' }); },{accX: 0, accY: -90}); $('#sliding-sidebar .to-progress-bar').each(function(index, element){ var $this=$(this); var percent=$this.attr('data-width'); $this.width(percent + '%'); $this.find('strong').css('opacity',1); $this.find('strong span').html(percent + '%'); }); } function pieChartAnim(){ $('.to-pie-chart-anim').appear(function(){ var percent=$(this).attr('data-anim'); $(this).data('easyPieChart').update(percent); },{accX: 0, accY: -90}); } function counter(){ $('.to-counter-holder').appear(function(){ var $this=$(this); var number=$this.attr('data-counter'); var speed=$this.attr('data-counter-speed'); if($this.closest('.no-touch .col.has-anim').length){ setTimeout(function(){ $this.find('.to-counter-number .to-count-number').countTo({ from: 0, to: number, speed: speed, refreshInterval: 30 }); }, 800); }else{ $this.find('.to-counter-number .to-count-number').countTo({ from: 0, to: number, speed: speed, refreshInterval: 30 }); }},{accX: 0, accY: -90}); } function lightOrDark(color){ var r,b,g,hsp, a=color; if(a===false){ a='#000000'; } if(a.match(/^rgb/)){ a=a.match(/^rgba?\((\d+),\s*(\d+),\s*(\d+)(?:,\s*(\d+(?:\.\d+)?))?\)$/); r=a[1]; b=a[2]; g=a[3]; }else{ a=+("0x" + a.slice(1).replace(a.length < 5&&/./g, '$&$&')); r=a >> 16; b=a >> 8 & 255; g=a & 255; } hsp=Math.sqrt(0.299*(r*r)+0.587*(g*g)+0.114*(b*b)); if(hsp>200){ color='light'; }else{ color='dark'; } return color; } function buttonColor(){ $('.to-button.to-button-border.to-button-anim').each(function(index, element){ if(!$(this).attr('data-txtcolor')){ if($(this).parents('.parallax-container').length){ var txtColor=$(this).parents('.parallax-container').find('.parallax-container-overlay-color').css('background-color'); if(!txtColor){ var txtColor=$(this).parents('.parallax-container').find('.parallax-container-overlay').css('background-color'); }}else{ var txtColor=svgBg($(this)); } $(this).attr('data-txtcolor',txtColor); }else{ var txtColor=$(this).attr('data-txtcolor'); } var color1=lightOrDark($(this).attr('data-bgcolor')); var color2=lightOrDark(txtColor); if(color1==color2){ if(color2=='light'){ txtColor='#000000'; }else{ txtColor='#ffffff'; }} $(this).attr('data-txtcolor',txtColor); }); } $(document).on('mouseenter', '.to-button.to-button-border.to-button-anim', function(){ var txtColor=$(this).attr('data-txtcolor'); if(txtColor){ var bgColor=$(this).data('color'); $(this).attr('style', 'color:'+txtColor+';background:'+bgColor+' !important;border-color:'+bgColor+''); $(this).find('span').attr('style', 'color:'+txtColor); }}).on('mouseleave', '.to-button.to-button-border', function(){ var txtColor=$(this).data('color'); if(txtColor){ $(this).attr('style', 'color:'+txtColor+';background: none !important;border-color:'+txtColor+''); $(this).find('span').attr('style', 'color:'+txtColor); }}); $(document).on('mouseenter', '.to-button.to-button-bg.to-button-anim', function(){ var txtColor=$(this).data('color'); if(txtColor){ $(this).css('color', txtColor); $(this).find('span').attr('style', 'color:'+txtColor); }}).on('mouseleave', '.to-button.to-button-bg', function(){ var txtColor=$(this).data('bgcolor'); if(txtColor){ $(this).css('color', txtColor); $(this).find('span').attr('style', 'color:'+txtColor); }}); function iconHover(){ $('.to-icon').bind('webkitAnimationEnd mozAnimationEnd oAnimationEnd animationend', function(){ var anim=$(this).attr('data-anim-icon'); $(this).removeClass(anim); }); } $(document).on('hover', '.col, .to-list, .to-button', function(){ if($(this).find('ul').length===0&&$(this).find('.to-button').length===0){ var anim=$(this).find('.to-icon').attr('data-anim-icon'); $(this).find('.to-icon').addClass(anim); }}); $(document).on('hover', '.vc_column_container .to-icon', function(){ var anim=$(this).attr('data-anim-icon'); $(this).addClass(anim); }); $(document).on('mouseenter', '.col', function(){ var $this=$(this); if($this.find('.to-icon.full-bg.color.bg-anim').length > 0){ var color=$this.find('.to-icon.full-bg.color').attr('data-bg'); $this.find('.to-icon.full-bg.color.bg-anim').attr('style', 'color:'+ color +'! important'); $this.find('.to-icon.full-bg.color.bg-anim').css('background', 'none'); }}).on('mouseleave', '.col, .vc_column_container', function(){ var $this=$(this); if($this.find('.to-icon.full-bg.color.bg-anim').length > 0){ var color=$this.find('.to-icon.full-bg.color.bg-anim').attr('data-bg'); $this.find('.to-icon.full-bg.color.bg-anim').attr('style', 'color:'+ $this.find('.to-icon.full-bg.color').attr('data-color')); $this.find('.to-icon.full-bg.color.bg-anim').css('background', color); }}); $(document).on('mouseenter', '.vc_column_container .to-icon.full-bg.color.bg-anim', function(){ var $this=$(this); if($this.length > 0){ var color=$this.attr('data-bg'); $this.attr('style', 'color:'+ color +'! important'); $this.css('background', 'none'); }}).on('mouseleave', '.vc_column_container .to-icon.full-bg.color.bg-anim', function(){ var $this=$(this); if($this.length > 0){ var color=$this.attr('data-bg'); $this.attr('style', 'color:'+ $this.attr('data-color')); $this.css('background', color); }}); var tabholder='.to-tabs-holder', tab='.to-tabs li', tabLine='.to-tabs-line', activetab='active-tab'; $(document).on('click',tab, function(){ var $this=$(this); if(!$this.hasClass('active-tab')&&$this.index()>1){ var i=$this.index()-2; $this.closest(tabholder).find('.to-tab').hide().removeClass('active-tab'); $this.closest(tabholder).find('.to-tab').eq(i).fadeIn(500).addClass('active-tab'); $this.closest(tabholder).find('li').removeClass(activetab); $this.addClass(activetab); }}); $(document).on('mouseover',tab, function(){ if(!$(this).is('.to-tabs-overlay, .to-tabs-line')){ tabMove($(this)); }}).on('mouseleave',tab, function(){ if(!$(this).is('.to-tabs-overlay, .to-tabs-line')){ tabMove($(this).closest(tabholder).find('li.'+activetab)); }}); function activedtab(){ smartTabs(); $(tabholder).each(function(){ var $curtab=$(this).find('li.'+activetab); if(!$curtab.length){ $curtab=$(this).find('ul li').first(); $curtab.addClass(activetab); } tabMove($curtab); }); } function tabMove(el){ var index=el.position().left; var width=el.outerWidth(); movingLine(el.closest('ul').find(tabLine),width,index); } function movingLine(el,w,off){ if(Modernizr.csstransitions){ el.css({ 'width': w+'px', '-webkit-transform':' translate3d('+off+'px,0,0)', '-moz-transform':' translate3d('+off+'px,0,0)', '-ms-transform':' translate3d('+off+'px,0,0)', '-o-transform':' translate3d('+off+'px,0,0)', 'transform': 'translate3d('+off+'px,0,0)' }); }else{ el.stop(true).animate({left:off+'px',width:w+'px'}, 300); }} function smartTabs(){ $(tabholder).each(function(){ var width=0; $(this).find('.to-tabs li span').each(function(){ width=width + $(this).outerWidth(); }); if(width>$(this).width()){ $(this).addClass('block-tabs'); }else if($(this).hasClass('block-tabs')){ $(this).removeClass('block-tabs'); }}); } $(window).resize(function(){ smartTabs(); activedtab(); }); $(document).on('click', '.to-toggle-title', function(){ if($(this).find('.to-toggle-open .icon-to-plus').length){ $(this).find('.to-toggle-open').html(''); }else{ $(this).find('.to-toggle-open').html(''); } $(this).next('.to-toggle-content').slideToggle(200); }); var accContent='.to-accordion-content', accHolder='to-accordion-holder', accOpen='.to-accordion-open', accPlus='.to-accordion-open .icon-to-plus'; $(document).on('click', '.to-accordion-title', function(){ $this=$(this); $prev=$this.parent().prev(); while ($prev.hasClass(accHolder)){ if($prev.find(accContent).is(':visible')){ $prev.find(accContent).slideToggle(300); $prev.find(accOpen).html(''); } $prev=$prev.prev(); } $next=$this.parent().next(); while ($next.hasClass(accHolder)){ if($next.find(accContent).is(':visible')){ $next.find(accContent).slideToggle(300); $next.find(accOpen).html(''); } $next=$next.next(); } if($this.find(accPlus).length){ $this.next(accContent).slideToggle(300); $this.find(accOpen).html(''); }}); var pieChart, iconClass, speed; function initPieChart(){ $('.to-pie-chart').each(function(){ $pieChart=$(this); if($pieChart.hasClass('to-pie-chart-anim')){ speed=1000; }else{ speed=1; } var legendStyle=$pieChart.attr('data-legend-style'); var lineWidth=$pieChart.attr('data-line-width'); var barColor=$pieChart.attr('data-bar-color'); var backgroundColor=$pieChart.attr('data-background-color'); var chartSize=$pieChart.width(); $pieChart.easyPieChart({ animate: speed, barColor: barColor, trackColor: backgroundColor, lineWidth: lineWidth, size: chartSize, scaleColor: false, onStep: function(from, to, percent){ if(legendStyle=='percent'){ this.el.children[0].innerHTML=Math.round(percent)+'%'; }} }); pieChartSize(); }); } function pieChartSize(){ var maxSize=$pieChart.parent().parent().width()*0.9; var maxWidth=parseInt($pieChart.parent().css('max-width')); var pieWidth=parseInt($pieChart.data('width')); if(pieWidth > maxSize||maxWidth < maxSize){ if(pieWidth <=maxSize){ maxSize=pieWidth; } $pieChart.parent().css({'max-width': maxSize+'px','max-height': maxSize+'px','line-height': maxSize+'px'}); $pieChart.find('canvas').width(maxSize).height(maxSize); pieWidth=maxSize; } $pieChart.find('span').css('font-size', (pieWidth/5)+'px'); $pieChart.find('i').css('font-size', (pieWidth/3)+'px'); } $(window).resize(function(){ $('.to-pie-chart').each(function(){ $pieChart=$(this); pieChartSize(); }); }); function teamCarousel(){ $('.to-team-carousel').owlCarousel({ theme: '', pagination: false, navigation: true, slideSpeed: 500, navigationText: ['',''] }); } function testiCarousel(){ $('.to-testimonial').owlCarousel({ theme: '', singleItem: true, autoHeight: true, stopOnHover: true, slideSpeed: 500, navigationText: ['',''] }); } function clientCarousel(){ $('.to-clients-carousel').owlCarousel({ theme: '', stopOnHover: true, slideSpeed: 500, navigationText: ['',''], }); } function toscSlider(){ $('.to-sc-slider').owlCarousel({ theme: '', singleItem: true, autoHeight: true, stopOnHover: true, slideSpeed: 500, navigationText: ['
',''] }); } function toscTwitter(){ $('.to-sc-twitter').owlCarousel({ theme: '', singleItem: true, autoHeight: true, stopOnHover: true, slideSpeed: 500, navigationText: ['',''] }); } function svgBg(svgEl){ var color=svgEl.css('background-color'); if((color!=='rgba(0, 0, 0, 0)')&&(color!=='transparent')){ return color; } if(svgEl.is('body')){ return false; }else{ return svgBg(svgEl.parent()); }} function svgFill(){ $('.to-separator-top svg path, .to-separator-bottom svg path, .to-separator-top svg circle, .to-separator-bottom svg circle').each(function(){ var fill=$(this).attr('fill'); if(typeof val==='undefined'){ var fillColor=svgBg($(this)); $(this).css('fill', fillColor); }}); } var videosSection=[]; var videoSDiv='.parallax-container video'; var videoVimeoS='iframe.vimeo-player-section'; function videoSection(){ videosSection=[]; $(videoSDiv).mediaelementplayer({ features: ['volume'], pauseOtherPlayers: false, loop: true, startVolume: 0.0, success: function(mediaElement, domObject){ mediaElement.addEventListener('play', function(e){ $(mediaElement).closest('.parallax-container').find('.parallax-container-poster').remove(); }); videosSection.push(mediaElement); mediaElement.pause(); mediaElement.load(); mediaElement.addEventListener('loadeddata', function(e){ videoSectionSize(mediaElement); mediaElement.play(); }); }, error: function(domObject){ $(domObject).closest('.mejs-container').remove(); }}); } function videoSectionSize(mediaElement){ var $this=$(mediaElement); $this.attr('style',''); var wW=$this.width(); var wH=$this.height(); var pW=$this.closest('.parallax-container-inner').width(); var pH=$this.closest('.parallax-container-inner').height(); var wR=wW/pW; var hR=wH/pH; var scale=Math.min(wR,hR); var rW=(wW/scale); var rH=(wH/scale); var leftI=-Math.abs((rW-pW)/2); var topI=(rH-rW)/2; $this.attr('style', 'height: auto !important; width: '+rW+'px !important; left: '+leftI+'px !important; top: 0px !important;'); } function videoSectionVimeo(){ $('iframe.vimeo-player-section').each(function(){ var $el=$(this); var pYTW=$el.parent().width(); var pYTH=$el.parent().height(); var ratio; if(!$el.data('vimeo-ratio')){ ratio=$el.data('height') / $el.data('width'); $el.attr('data-vimeo-ratio', ratio); }else{ ratio=$el.attr('data-vimeo-ratio'); } $el.removeAttr('height width'); if(pYTW*ratio >=pYTH){ $el.height(pYTW*ratio).width('100%').css('margin-top', -(pYTW*ratio-pYTH)/2).css('margin-left', 0); }else{ var left=-(pYTH/ratio-pYTW)/2; $el.height(pYTH).width(pYTH/ratio).css('margin-left', left).css('margin-top', 0); }}); $.getScript('//a.vimeocdn.com/js/froogaloop2.min.js', function(){ $('iframe.vimeo-player-section').each(function(){ var $this=$(this); $this.attr('src', $this.attr('src')); var player=$f(this); player.addEvent('ready', function(){ player.api('setVolume', 0); player.api('play'); }); }); }); $(window).on('statechangecomplete', function(){ $('iframe.vimeo-player-section').each(function(){ var player=$f(this); player.addEvent('ready', function(){ player.api('setVolume', 0); player.api('play'); }); }); }); } $(window).resize(function(){ $(videoSDiv).each(function(){ videoSectionSize($(this)); }); videoSectionVimeo(); }); var toSCvideo='.to-sc-video-holder video'; function to_sc_video(){ $(toSCvideo).mediaelementplayer({ features: ['fullscreen','playpause', 'current', 'progress', 'duration', 'volume'], videoVolume: 'vertical', pauseOtherPlayers: false, startVolume: 0.8, success: function(mediaElement, domObject){ mediaElement.addEventListener("ended", function(e){ $(e.target).closest('.to-sc-video-holder').find(' .mejs-poster').show(); }); }, error: function(domObject){ $(domObject).closest('.mejs-container').remove(); }}); } var fontArr=[]; function google_font_loader(){ $('span[data-font]').each(function(){ var font=$(this).data('font'); var family=font.replace(':',''); if($.inArray(family, fontArr)==-1){ fontArr.push(family); $.ajax({ beforeSend: function(xhr){ xhr.overrideMimeType("application/octet-stream"); }, success: function(){ $("", { 'id': family, 'rel': 'stylesheet', 'href': 'http://fonts.googleapis.com/css?family='+font }).appendTo('head'); }}); }}); } function processStep(){ var owlClick=false; var owlDrag=false; $('.to-process').owlCarousel({ theme: '', pagination: false, navigation: false, slideSpeed: 500, afterInit: function(elem){ var page=''; var nb=$(elem).find('.owl-item').length; var first=' active'; if(nb > 1){ for (var i=1; i<=nb; i++){ page=page+''+((i<10) ? 0+String(i):String(i))+''; first=''; } $(elem).append(''+page+''); } $(elem).find('.owl-item').first().addClass('active'); }, startDragging:function (elem){ owlDrag=true; }, afterMove:function (elem){ if(owlClick!==true){ var $current=$(elem).closest('.to-process'); var x=this.owl.currentItem; $current.find('.to-step-nb').add($current.find('.owl-item')).removeClass('active'); $current.find('.to-step-nb').eq(x).add($current.find('.owl-item').eq(x)).addClass('active'); } owlClick=false; owlDrag=false; }}); $(document).on('click', '.to-process .to-step-nb', function(e){ owlClick=true; var $current=$(this).closest('.to-process'); var owl=$current.data('owlCarousel'); var x=parseInt($(this).text())-1; $current.find('.to-step-nb').add($current.find('.owl-item')).removeClass('active'); $(this).add($current.find('.owl-item').eq(x)).addClass('active'); owl.goTo(x); }); $(document).on('click', '.to-process .owl-item', function(e){ owlClick=true; var $current=$(this).closest('.to-process'); var owl=$current.data('owlCarousel'); var x=parseInt($(this).index()); $current.find('.to-step-nb').add($current.find('.owl-item')).removeClass('active'); $(this).add($current.find('.to-step-nb').eq(x)).addClass('active'); owl.goTo(x); }); } var chrW=0; $.browser.chrome=/chrom(e|ium)/.test(navigator.userAgent.toLowerCase()); if($.browser.chrome){ chrW=2; } $(document).ready(function(){ if($('#wpadminbar').length){ adminBarH=parseInt($('html').css('top')); }else{ adminBarH=0; }}); $(window).resize(function(){ if($('#wpadminbar').length){ adminBarH=parseInt($('html').css('top')); }else{ adminBarH=0; }}); var targets='[rel~=tooltip]', target=false, tooltip=false, title=false, pos_left, pos_top; function to_tooltip_size(){ var docW=$(window).width(); if(docW < 340 * 1.5){ tooltip.css('width',docW/2); }else{ tooltip.css('width',340); } pos_left=target.offset().left - (tooltip.outerWidth()/2) + 15 - chrW; pos_top=target.offset().top - tooltip.outerHeight(); if(pos_left < 0){ pos_left=target.offset().left + target.outerWidth() / 2; tooltip.addClass('left'); }else{ tooltip.removeClass('left'); } if(pos_left + tooltip.outerWidth() > docW){ pos_left=target.offset().left - tooltip.outerWidth() + target.outerWidth() / 2; tooltip.addClass('right'); }else{ tooltip.removeClass('right'); } if(pos_top - $(window).scrollTop() - $('header').height() - 45 < 0){ pos_top=target.offset().top + target.outerHeight(); tooltip.addClass('top'); pos_top=pos_top + 25 - adminBarH; }else{ tooltip.removeClass('top'); pos_top=pos_top - 25 - adminBarH; } chrW=10; } $(document).on('mouseenter', targets, function(){ tip=$(this).data('content'); target=$(this).closest('.to-pulse-holder'); tooltip=$('#to-tooltip'); if(!tip||tip==''){ return false; } if(tooltip.length==0){ $('body').append(''); tooltip=$('#to-tooltip'); } tooltip.css('z-index', 10); tooltip.html(tip); to_tooltip_size(); tooltip.css({left: pos_left,top: pos_top}).addClass('show'); }).on('mouseleave', targets, function(){ remove_tooltip(); }); function remove_tooltip(){ tooltip.removeClass('show'); setTimeout(function(){ if(tooltip.css('opacity')==0){ tooltip.css('z-index', -1); }},500); } $(window).resize(function(){ if(tooltip.length==0){ to_tooltip_size(); tooltip.css('z-index', -1); }}); function typeString($target, str, cursor, delay, cb){ $target.html(function (_, html){ return html + str[cursor]; }); if(cursor < str.length - 1){ delay=Math.round(Math.random() * (300 - 30)) + 30; setTimeout(function (){ typeString($target, str, cursor + 1, delay, cb); }, delay); }else{ cb(); }} function deleteString($target, delay, cb){ var length; $target.html(function (_, html){ length=$target.text().length; return html.substr(0, length - 1); }); delay=100; if(length > 1){ setTimeout(function (){ deleteString($target, delay, cb); }, delay); }else{ cb(); }} $.fn.extend({ teletype: function (opts){ var settings=$.extend({}, $.teletype.defaults, opts); return $(this).each(function (){ (function loop($tar, idx){ typeString($tar, settings.text[idx], 0, settings.delay, function (){ setTimeout(function (){ deleteString($tar, settings.delay, function (){ loop($tar, (idx + 1) % settings.text.length); }); }, settings.pause); }); }($(this), 0)); }); }}); $.extend({ teletype: { defaults: { delay: 100, pause: 2500, text: [] }} }); function typeWriter (){ $('.to-type-writer').each(function(){ var $this=$(this); if(!$this.hasClass('typing')){ $this.teletype({ text:$this.data('text').split(";"), pause: $this.data('pause') }); $this.addClass('typing'); }}); $('.to-type-writer-cursor').teletype({ text: ['|', ' '], delay: 0, pause: 500 }); } function initShortcode(){ processStep(); google_font_loader(); buttonColor(); colCalc(); activedtab(); smartTabs(); iconHover(); initPieChart(); pieChartAnim(); progressBar(); counter(); teamCarousel(); testiCarousel(); clientCarousel(); toscSlider(); toscTwitter(); svgFill(); to_sc_video(); videoSection(); videoSectionVimeo(); colCalc2(); typeWriter(); } colAnim(); $(document).ready(function(){ initShortcode(); }); $(window).on('statechangecomplete', function(){ colAnim(); initShortcode(); ajaxVCscripts(); }); function ajaxVCscripts(){ if($('html').hasClass('vc_desktop')){ vc_toggleBehaviour(); vc_tabsBehaviour(); vc_accordionBehaviour(); vc_teaserGrid(); vc_carouselBehaviour(); vc_slidersBehaviour(); vc_prettyPhoto(); vc_googleplus(); vc_pinterest(); vc_progress_bar(); vc_plugin_flexslider(); vc_google_fonts(); vc_gridBehaviour(); vc_rowBehaviour(); jQuery(document).trigger('vc_js'); window.setTimeout(vc_waypoints, 500); }} var isInIframe=(window.location!=window.parent.location) ? true:false; if(isInIframe===true){ $(window).resize(function(e){ google_font_loader(); buttonColor(); colCalc(); activedtab(); smartTabs(); iconHover(); initPieChart(); pieChartAnim(); progressBar(); counter(); svgFill(); to_sc_video(); videoSection(); videoSectionVimeo(); colCalc2(); typeWriter(); }); }}); jQuery(document).ready(function ($){ $(document).on('click', '.post-like', function(e){ e.preventDefault(); $heart=$(this); post_id=$heart.data('post_id'); $heart.find('.fa-heart-o, .fa-heart').addClass('heart-pulse'); $.ajax({ type: "post", url: ajax_var.url, data: 'action=post-like&nonce='+ajax_var.nonce+'&post_like=&post_id='+post_id, success: function(count){ if(count.indexOf('already')!==-1){ var lecount=count.replace('already',''); var heartClass='no-liked'; $heart.prop('title', 'Like'); $heart.removeClass('liked'); if(lecount==0){ var lecount='0'; $heart.html(' '+lecount+''); }else{ $heart.html(' '+lecount+''); }}else{ var heartClass='liked'; $heart.prop('title', 'Unlike'); $heart.addClass('liked'); $heart.html(' '+count+''); } $heart.removeClass('liked no-liked').addClass(heartClass) $heart.children('.like i').removeClass('heart-pulse'); }}); return false; }) }); (function($){ 'use strict'; if(typeof wpcf7==='undefined'||wpcf7===null){ return; } wpcf7=$.extend({ cached: 0, inputs: [] }, wpcf7); $(function(){ wpcf7.supportHtml5=(function(){ var features={}; var input=document.createElement('input'); features.placeholder='placeholder' in input; var inputTypes=[ 'email', 'url', 'tel', 'number', 'range', 'date' ]; $.each(inputTypes, function(index, value){ input.setAttribute('type', value); features[ value ]=input.type!=='text'; }); return features; })(); $('div.wpcf7 > form').each(function(){ var $form=$(this); wpcf7.initForm($form); if(wpcf7.cached){ wpcf7.refill($form); }}); }); wpcf7.getId=function(form){ return parseInt($('input[name="_wpcf7"]', form).val(), 10); }; wpcf7.initForm=function(form){ var $form=$(form); $form.submit(function(event){ if(typeof window.FormData!=='function'){ return; } wpcf7.submit($form); event.preventDefault(); }); $('.wpcf7-submit', $form).after(''); wpcf7.toggleSubmit($form); $form.on('click', '.wpcf7-acceptance', function(){ wpcf7.toggleSubmit($form); }); $('.wpcf7-exclusive-checkbox', $form).on('click', 'input:checkbox', function(){ var name=$(this).attr('name'); $form.find('input:checkbox[name="' + name + '"]').not(this).prop('checked', false); }); $('.wpcf7-list-item.has-free-text', $form).each(function(){ var $freetext=$(':input.wpcf7-free-text', this); var $wrap=$(this).closest('.wpcf7-form-control'); if($(':checkbox, :radio', this).is(':checked')){ $freetext.prop('disabled', false); }else{ $freetext.prop('disabled', true); } $wrap.on('change', ':checkbox, :radio', function(){ var $cb=$('.has-free-text', $wrap).find(':checkbox, :radio'); if($cb.is(':checked')){ $freetext.prop('disabled', false).focus(); }else{ $freetext.prop('disabled', true); }}); }); if(! wpcf7.supportHtml5.placeholder){ $('[placeholder]', $form).each(function(){ $(this).val($(this).attr('placeholder')); $(this).addClass('placeheld'); $(this).focus(function(){ if($(this).hasClass('placeheld')){ $(this).val('').removeClass('placeheld'); }}); $(this).blur(function(){ if(''===$(this).val()){ $(this).val($(this).attr('placeholder')); $(this).addClass('placeheld'); }}); }); } if(wpcf7.jqueryUi&&! wpcf7.supportHtml5.date){ $form.find('input.wpcf7-date[type="date"]').each(function(){ $(this).datepicker({ dateFormat: 'yy-mm-dd', minDate: new Date($(this).attr('min')), maxDate: new Date($(this).attr('max')) }); }); } if(wpcf7.jqueryUi&&! wpcf7.supportHtml5.number){ $form.find('input.wpcf7-number[type="number"]').each(function(){ $(this).spinner({ min: $(this).attr('min'), max: $(this).attr('max'), step: $(this).attr('step') }); }); } $('.wpcf7-character-count', $form).each(function(){ var $count=$(this); var name=$count.attr('data-target-name'); var down=$count.hasClass('down'); var starting=parseInt($count.attr('data-starting-value'), 10); var maximum=parseInt($count.attr('data-maximum-value'), 10); var minimum=parseInt($count.attr('data-minimum-value'), 10); var updateCount=function(target){ var $target=$(target); var length=$target.val().length; var count=down ? starting - length:length; $count.attr('data-current-value', count); $count.text(count); if(maximum&&maximum < length){ $count.addClass('too-long'); }else{ $count.removeClass('too-long'); } if(minimum&&length < minimum){ $count.addClass('too-short'); }else{ $count.removeClass('too-short'); }}; $(':input[name="' + name + '"]', $form).each(function(){ updateCount(this); $(this).keyup(function(){ updateCount(this); }); }); }); $form.on('change', '.wpcf7-validates-as-url', function(){ var val=$.trim($(this).val()); if(val && ! val.match(/^[a-z][a-z0-9.+-]*:/i) && -1!==val.indexOf('.')){ val=val.replace(/^\/+/, ''); val='http://' + val; } $(this).val(val); }); }; wpcf7.submit=function(form){ if(typeof window.FormData!=='function'){ return; } var $form=$(form); $('.ajax-loader', $form).addClass('is-active'); $('[placeholder].placeheld', $form).each(function(i, n){ $(n).val(''); }); wpcf7.clearResponse($form); var formData=new FormData($form.get(0)); var detail={ id: $form.closest('div.wpcf7').attr('id'), status: 'init', inputs: [], formData: formData }; $.each($form.serializeArray(), function(i, field){ if('_wpcf7'==field.name){ detail.contactFormId=field.value; }else if('_wpcf7_version'==field.name){ detail.pluginVersion=field.value; }else if('_wpcf7_locale'==field.name){ detail.contactFormLocale=field.value; }else if('_wpcf7_unit_tag'==field.name){ detail.unitTag=field.value; }else if('_wpcf7_container_post'==field.name){ detail.containerPostId=field.value; }else if(field.name.match(/^_wpcf7_\w+_free_text_/)){ var owner=field.name.replace(/^_wpcf7_\w+_free_text_/, ''); detail.inputs.push({ name: owner + '-free-text', value: field.value }); }else if(field.name.match(/^_/)){ }else{ detail.inputs.push(field); }}); wpcf7.triggerEvent($form.closest('div.wpcf7'), 'beforesubmit', detail); var ajaxSuccess=function(data, status, xhr, $form){ detail.id=$(data.into).attr('id'); detail.status=data.status; detail.apiResponse=data; var $message=$('.wpcf7-response-output', $form); switch(data.status){ case 'validation_failed': $.each(data.invalidFields, function(i, n){ $(n.into, $form).each(function(){ wpcf7.notValidTip(this, n.message); $('.wpcf7-form-control', this).addClass('wpcf7-not-valid'); $('[aria-invalid]', this).attr('aria-invalid', 'true'); }); }); $message.addClass('wpcf7-validation-errors'); $form.addClass('invalid'); wpcf7.triggerEvent(data.into, 'invalid', detail); break; case 'acceptance_missing': $message.addClass('wpcf7-acceptance-missing'); $form.addClass('unaccepted'); wpcf7.triggerEvent(data.into, 'unaccepted', detail); break; case 'spam': $message.addClass('wpcf7-spam-blocked'); $form.addClass('spam'); $('[name="g-recaptcha-response"]', $form).each(function(){ if(''===$(this).val()){ var $recaptcha=$(this).closest('.wpcf7-form-control-wrap'); wpcf7.notValidTip($recaptcha, wpcf7.recaptcha.messages.empty); }}); wpcf7.triggerEvent(data.into, 'spam', detail); break; case 'aborted': $message.addClass('wpcf7-aborted'); $form.addClass('aborted'); wpcf7.triggerEvent(data.into, 'aborted', detail); break; case 'mail_sent': $message.addClass('wpcf7-mail-sent-ok'); $form.addClass('sent'); wpcf7.triggerEvent(data.into, 'mailsent', detail); break; case 'mail_failed': $message.addClass('wpcf7-mail-sent-ng'); $form.addClass('failed'); wpcf7.triggerEvent(data.into, 'mailfailed', detail); break; default: var customStatusClass='custom-' + data.status.replace(/[^0-9a-z]+/i, '-'); $message.addClass('wpcf7-' + customStatusClass); $form.addClass(customStatusClass); } wpcf7.refill($form, data); wpcf7.triggerEvent(data.into, 'submit', detail); if('mail_sent'==data.status){ $form.each(function(){ this.reset(); }); } $form.find('[placeholder].placeheld').each(function(i, n){ $(n).val($(n).attr('placeholder')); }); $message.html('').append(data.message).slideDown('fast'); $message.attr('role', 'alert'); $('.screen-reader-response', $form.closest('.wpcf7')).each(function(){ var $response=$(this); $response.html('').attr('role', '').append(data.message); if(data.invalidFields){ var $invalids=$('' + wc_add_to_cart_variation_params.i18n_unavailable_text + '
'); } if(variation.min_qty) $single_variation_wrap.find('input[name=quantity]').attr('min', variation.min_qty).val(variation.min_qty); else $single_variation_wrap.find('input[name=quantity]').removeAttr('min'); if(variation.max_qty) $single_variation_wrap.find('input[name=quantity]').attr('max', variation.max_qty); else $single_variation_wrap.find('input[name=quantity]').removeAttr('max'); if(variation.is_sold_individually==='yes'){ $single_variation_wrap.find('input[name=quantity]').val('1'); $single_variation_wrap.find('.quantity').hide(); } $single_variation_wrap.slideDown(200).trigger('show_variation', [ variation ]); }); $form.trigger('wc_variation_form'); return $form; }; $(function(){ $('.variations_form').wc_variation_form(); $('.variations_form .variations select').change(); }); }); })(jQuery, window); var addComment={moveForm:function(e,t,n,o){var r,i,d,m=this,l=m.I(e),a=m.I(n),c=m.I("cancel-comment-reply-link"),s=m.I("comment_parent"),e=m.I("comment_post_ID"),p=a.getElementsByTagName("form")[0];if(l&&a&&c&&s&&p){m.respondId=n,o=o||!1,m.I("wp-temp-form-div")||((m=document.createElement("div")).id="wp-temp-form-div",m.style.display="none",a.parentNode.insertBefore(m,a)),l.parentNode.insertBefore(a,l.nextSibling),e&&o&&(e.value=o),s.value=t,c.style.display="",c.onclick=function(){var e=addComment,t=e.I("wp-temp-form-div"),n=e.I(e.respondId);if(t&&n)return e.I("comment_parent").value="0",t.parentNode.insertBefore(n,t),t.parentNode.removeChild(t),this.style.display="none",this.onclick=null,!1};try{for(var f=0;f'+to_comment_msg.processing+'
'); }, type:'post', url:$this.attr('action'), data:$this.serialize(), dataType:'html', error: function(xhr,status){ $(com_stat).html(''+to_comment_msg.error_string+':'+to_comment_msg.error[xhr.status]+'
'); }, success:function(data){ var error=data.replace(/(<\/?)html(.+?)?>/gi,'$1NOTHTML$2>',data), error=error.replace(/(<\/?)body(.+?)?>/gi,'$1NOTBODY$2>',error), error=$(error).find(errormsg), $newComList=$(data).find(com_list); if(error.length){ $(com_stat).html(error.html()); }else if($newComList.length){ if($(is_woo).length){ com_wrap=woo_rev; success_msg=to_comment_msg.success.review; }else{ com_wrap='#respond'; success_msg=to_comment_msg.success.comment; if($(com_wrap).parents('li.comment').length > 0){ $(com_wrap).insertAfter(com_list); $('#cancel-comment-reply-link').click(); }} if($(com_list).length > 0){ $(com_list).replaceWith($newComList); }else{ $(com_wrap).before($newComList); $(woo_rev).remove(); } $(com_stat).html(success_msg); setTimeout(function(){ $(com_stat).remove(); $(textarea).val(''); }, 3000); }else{ $(com_stat).html(''+to_comment_msg.error_string+':'+to_comment_msg.error['408']+'
'); } return false; }}); return false; }); }); }; !function(a){"function"==typeof define&&define.amd?define(["jquery","./core"],a):a(jQuery)}(function(a){function b(a){for(var b,c;a.length&&a[0]!==document;){if(b=a.css("position"),("absolute"===b||"relative"===b||"fixed"===b)&&(c=parseInt(a.css("zIndex"),10),!isNaN(c)&&0!==c))return c;a=a.parent()}return 0}function c(){this._curInst=null,this._keyEvent=!1,this._disabledInputs=[],this._datepickerShowing=!1,this._inDialog=!1,this._mainDivId="ui-datepicker-div",this._inlineClass="ui-datepicker-inline",this._appendClass="ui-datepicker-append",this._triggerClass="ui-datepicker-trigger",this._dialogClass="ui-datepicker-dialog",this._disableClass="ui-datepicker-disabled",this._unselectableClass="ui-datepicker-unselectable",this._currentClass="ui-datepicker-current-day",this._dayOverClass="ui-datepicker-days-cell-over",this.regional=[],this.regional[""]={closeText:"Done",prevText:"Prev",nextText:"Next",currentText:"Today",monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],monthNamesShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["Su","Mo","Tu","We","Th","Fr","Sa"],weekHeader:"Wk",dateFormat:"mm/dd/yy",firstDay:0,isRTL:!1,showMonthAfterYear:!1,yearSuffix:""},this._defaults={showOn:"focus",showAnim:"fadeIn",showOptions:{},defaultDate:null,appendText:"",buttonText:"...",buttonImage:"",buttonImageOnly:!1,hideIfNoPrevNext:!1,navigationAsDateFormat:!1,gotoCurrent:!1,changeMonth:!1,changeYear:!1,yearRange:"c-10:c+10",showOtherMonths:!1,selectOtherMonths:!1,showWeek:!1,calculateWeek:this.iso8601Week,shortYearCutoff:"+10",minDate:null,maxDate:null,duration:"fast",beforeShowDay:null,beforeShow:null,onSelect:null,onChangeMonthYear:null,onClose:null,numberOfMonths:1,showCurrentAtPos:0,stepMonths:1,stepBigMonths:12,altField:"",altFormat:"",constrainInput:!0,showButtonPanel:!1,autoSize:!1,disabled:!1},a.extend(this._defaults,this.regional[""]),this.regional.en=a.extend(!0,{},this.regional[""]),this.regional["en-US"]=a.extend(!0,{},this.regional.en),this.dpDiv=d(a(""))}function d(b){var c="button, .ui-datepicker-prev, .ui-datepicker-next, .ui-datepicker-calendar td a";return b.delegate(c,"mouseout",function(){a(this).removeClass("ui-state-hover"),this.className.indexOf("ui-datepicker-prev")!==-1&&a(this).removeClass("ui-datepicker-prev-hover"),this.className.indexOf("ui-datepicker-next")!==-1&&a(this).removeClass("ui-datepicker-next-hover")}).delegate(c,"mouseover",e)}function e(){a.datepicker._isDisabledDatepicker(g.inline?g.dpDiv.parent()[0]:g.input[0])||(a(this).parents(".ui-datepicker-calendar").find("a").removeClass("ui-state-hover"),a(this).addClass("ui-state-hover"),this.className.indexOf("ui-datepicker-prev")!==-1&&a(this).addClass("ui-datepicker-prev-hover"),this.className.indexOf("ui-datepicker-next")!==-1&&a(this).addClass("ui-datepicker-next-hover"))}function f(b,c){a.extend(b,c);for(var d in c)null==c[d]&&(b[d]=c[d]);return b}a.extend(a.ui,{datepicker:{version:"1.11.4"}});var g;return a.extend(c.prototype,{markerClassName:"hasDatepicker",maxRows:4,_widgetDatepicker:function(){return this.dpDiv},setDefaults:function(a){return f(this._defaults,a||{}),this},_attachDatepicker:function(b,c){var d,e,f;d=b.nodeName.toLowerCase(),e="div"===d||"span"===d,b.id||(this.uuid+=1,b.id="dp"+this.uuid),f=this._newInst(a(b),e),f.settings=a.extend({},c||{}),"input"===d?this._connectDatepicker(b,f):e&&this._inlineDatepicker(b,f)},_newInst:function(b,c){var e=b[0].id.replace(/([^A-Za-z0-9_\-])/g,"\\\\$1");return{id:e,input:b,selectedDay:0,selectedMonth:0,selectedYear:0,drawMonth:0,drawYear:0,inline:c,dpDiv:c?d(a("")):this.dpDiv}},_connectDatepicker:function(b,c){var d=a(b);c.append=a([]),c.trigger=a([]),d.hasClass(this.markerClassName)||(this._attachments(d,c),d.addClass(this.markerClassName).keydown(this._doKeyDown).keypress(this._doKeyPress).keyup(this._doKeyUp),this._autoSize(c),a.data(b,"datepicker",c),c.settings.disabled&&this._disableDatepicker(b))},_attachments:function(b,c){var d,e,f,g=this._get(c,"appendText"),h=this._get(c,"isRTL");c.append&&c.append.remove(),g&&(c.append=a(""+g+""),b[h?"before":"after"](c.append)),b.unbind("focus",this._showDatepicker),c.trigger&&c.trigger.remove(),d=this._get(c,"showOn"),"focus"!==d&&"both"!==d||b.focus(this._showDatepicker),"button"!==d&&"both"!==d||(e=this._get(c,"buttonText"),f=this._get(c,"buttonImage"),c.trigger=a(this._get(c,"buttonImageOnly")?a("").addClass(this._triggerClass).attr({src:f,alt:e,title:e}):a("").addClass(this._triggerClass).html(f?a("").attr({src:f,alt:e,title:e}):e)),b[h?"before":"after"](c.trigger),c.trigger.click(function(){return a.datepicker._datepickerShowing&&a.datepicker._lastInput===b[0]?a.datepicker._hideDatepicker():a.datepicker._datepickerShowing&&a.datepicker._lastInput!==b[0]?(a.datepicker._hideDatepicker(),a.datepicker._showDatepicker(b[0])):a.datepicker._showDatepicker(b[0]),!1}))},_autoSize:function(a){if(this._get(a,"autoSize")&&!a.inline){var b,c,d,e,f=new Date(2009,11,20),g=this._get(a,"dateFormat");g.match(/[DM]/)&&(b=function(a){for(c=0,d=0,e=0;e"+this._get(a,"weekHeader")+" | ":"",v=0;v<7;v++)D=(v+k)%7,C+="=5?" class='ui-datepicker-week-end'":"")+">"+n[D]+" | ";for(B+=C+""+this._get(a,"calculateWeek")(I)+" | ":"",v=0;v<7;v++)L=q?q.apply(a.input?a.input[0]:null,[I]):[!0,""],M=I.getMonth()!==_,N=M&&!s||!L[0]||Z&&I"+(M&&!r?" ":N?""+I.getDate()+"":""+I.getDate()+"")+" | ",I.setDate(I.getDate()+1),I=this._daylightSavingAdjust(I);B+=K+""}_++,_>11&&(_=0,aa++),B+="
---|