document.documentelement.classname += ' js_active '; document.documentelement.classname += 'ontouchstart' in document.documentelement ? ' vc_mobile ' : ' vc_desktop '; (function () { var prefix = ['-webkit-', '-o-', '-moz-', '-ms-', ""]; for (var i in prefix) { if (prefix[i] + 'transform' in document.documentelement.style) document.documentelement.classname += " vc_transform "; } })(); /* on document ready jquery will fire set of functions. if you want to override function behavior then copy it to your theme js file with the same name. */ jquery(window).load(function () { }); var vc_js = function () { vc_twitterbehaviour(); 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(); window.settimeout(vc_waypoints, 1500); }; jquery(document).ready(function ($) { window.vc_js(); }); // end jquery(document).ready if (typeof window['vc_plugin_flexslider'] !== 'function') { function vc_plugin_flexslider($parent) { var $slider = $parent ? $parent.find('.wpb_flexslider') : jquery('.wpb_flexslider'); $slider.each(function () { var this_element = jquery(this); var sliderspeed = 800, slidertimeout = parseint(this_element.attr('data-interval')) * 1000, sliderfx = this_element.attr('data-flex_fx'), slideshow = true; if (slidertimeout == 0) slideshow = false; this_element.is(':visible') && this_element.flexslider({ animation:sliderfx, slideshow:slideshow, slideshowspeed:slidertimeout, sliderspeed:sliderspeed, smoothheight:true }); }); } } /* twitter ---------------------------------------------------------- */ if (typeof window['vc_twitterbehaviour'] !== 'function') { function vc_twitterbehaviour() { jquery('.wpb_twitter_widget .tweets').each(function (index) { var this_element = jquery(this), tw_name = this_element.attr('data-tw_name'); tw_count = this_element.attr('data-tw_count'); this_element.tweet({ username:tw_name, join_text:"auto", avatar_size:0, count:tw_count, template:"{avatar}{join}{text}{time}", auto_join_text_default:"", auto_join_text_ed:"", auto_join_text_ing:"", auto_join_text_reply:"", auto_join_text_url:"", loading_text:'loading tweets...' }); }); } } /* google plus ---------------------------------------------------------- */ if (typeof window['vc_googleplus'] !== 'function') { function vc_googleplus() { if (jquery('.wpb_googleplus').length > 0) { (function () { var po = document.createelement('script'); po.type = 'text/javascript'; po.async = true; po.src = 'https://apis.google.com/js/plusone.js'; var s = document.getelementsbytagname('script')[0]; s.parentnode.insertbefore(po, s); })(); } } } /* pinterest ---------------------------------------------------------- */ if (typeof window['vc_pinterest'] !== 'function') { function vc_pinterest() { if (jquery('.wpb_pinterest').length > 0) { (function () { var po = document.createelement('script'); po.type = 'text/javascript'; po.async = true; po.src = 'http://assets.pinterest.com/js/pinit.js'; var s = document.getelementsbytagname('script')[0]; s.parentnode.insertbefore(po, s); // })(); } } } /* progress bar ---------------------------------------------------------- */ if (typeof window['vc_progress_bar'] !== 'function') { function vc_progress_bar() { if (typeof jquery.fn.waypoint !== 'undefined') { jquery('.vc_progress_bar').waypoint(function () { jquery(this).find('.vc_single_bar').each(function (index) { var $this = jquery(this), bar = $this.find('.vc_bar'), val = bar.data('percentage-value'); settimeout(function () { bar.css({"width":val + '%'}); }, index * 200); }); }, { offset:'85%' }); } } } /* waypoints magic ---------------------------------------------------------- */ if (typeof window['vc_waypoints'] !== 'function') { function vc_waypoints() { if (typeof jquery.fn.waypoint !== 'undefined') { jquery('.wpb_animate_when_almost_visible:not(.wpb_start_animation)').waypoint(function () { jquery(this).addclass('wpb_start_animation'); }, { offset:'85%' }); } } } /* toggle ---------------------------------------------------------- */ if (typeof window['vc_togglebehaviour'] !== 'function') { function vc_togglebehaviour() { jquery(".wpb_toggle").unbind('click').click(function (e) { if (jquery(this).next().is(':animated')) { return false; } if (jquery(this).hasclass('wpb_toggle_title_active')) { jquery(this).removeclass('wpb_toggle_title_active').next().slideup(500); } else { jquery(this).addclass('wpb_toggle_title_active').next().slidedown(500); } }); jquery('.wpb_toggle_content').each(function (index) { if (jquery(this).next().is('h4.wpb_toggle') == false) { jquery('
').insertafter(this); } }); } } /* tabs + tours ---------------------------------------------------------- */ if (typeof window['vc_tabsbehaviour'] !== 'function') { function vc_tabsbehaviour($tab) { jquery(function ($) { $(document.body).off('click.preview', 'a') }); var $call = $tab || jquery('.wpb_tabs, .wpb_tour'), ver = jquery.ui && jquery.ui.version ? jquery.ui.version.split('.') : '1.10', old_version = parseint(ver[0]) == 1 && parseint(ver[1]) < 9; // if($call.hasclass('ui-widget')) $call.tabs('destroy'); $call.each(function (index) { var $tabs, interval = jquery(this).attr("data-interval"), tabs_array = []; // $tabs = jquery(this).find('.wpb_tour_tabs_wrapper').tabs({ show:function (event, ui) { wpb_prepare_tab_content(event, ui); }, beforeactivate: function(event, ui) { ui.newpanel.index() !== 1 && ui.newpanel.find('.vc_pie_chart:not(.vc_ready)'); }, activate:function (event, ui) { wpb_prepare_tab_content(event, ui); } }).tabs('rotate', interval * 1000); jquery(this).find('.wpb_tab').each(function () { tabs_array.push(this.id); }); jquery(this).find('.wpb_tabs_nav a').click(function (e) { e.preventdefault(); if (jquery.inarray(jquery(this).attr('href'), tabs_array)) { if (old_version) { $tabs.tabs("select", jquery(this).attr('href')); } else { $tabs.tabs("option", "active", jquery(jquery(this).attr('href')).index() - 1); } return false; } }); jquery(this).find('.wpb_prev_slide a, .wpb_next_slide a').click(function (e) { e.preventdefault(); if (old_version) { var index = $tabs.tabs('option', 'selected'); if (jquery(this).parent().hasclass('wpb_next_slide')) { index++; } else { index--; } if (index < 0) { index = $tabs.tabs("length") - 1; } else if (index >= $tabs.tabs("length")) { index = 0; } $tabs.tabs("select", index); } else { var index = $tabs.tabs("option", "active"), length = $tabs.find('.wpb_tab').length; if (jquery(this).parent().hasclass('wpb_next_slide')) { index = (index + 1) >= length ? 0 : index + 1; } else { index = index - 1 < 0 ? length - 1 : index - 1; } $tabs.tabs("option", "active", index); } }); }); } } /* tabs + tours ---------------------------------------------------------- */ if (typeof window['vc_accordionbehaviour'] !== 'function') { function vc_accordionbehaviour() { jquery('.wpb_accordion').each(function (index) { var $tabs, interval = jquery(this).attr("data-interval"), active_tab = !isnan(jquery(this).data('active-tab')) && parseint(jquery(this).data('active-tab')) > 0 ? parseint(jquery(this).data('active-tab')) - 1 : false, collapsible = active_tab === false || jquery(this).data('collapsible') === 'yes'; // $tabs = jquery(this).find('.wpb_accordion_wrapper').accordion({ header:"> div > h3", autoheight:false, heightstyle:"content", active:active_tab, collapsible:collapsible, navigation:true, activate: vc_accordionactivate, change:function (event, ui) { if (jquery.fn.isotope != undefined) { ui.newcontent.find('.isotope').isotope("layout"); } vc_carouselbehaviour(ui.newpanel); } }); //.tabs().tabs('rotate', interval*1000, true); }); } } /* teaser grid: isotope ---------------------------------------------------------- */ if (typeof window['vc_teasergrid'] !== 'function') { function vc_teasergrid() { var layout_modes = { fitrows:'fitrows', masonry:'masonry' } jquery('.wpb_grid .teaser_grid_container:not(.wpb_carousel), .wpb_filtered_grid .teaser_grid_container:not(.wpb_carousel)').each(function () { var $container = jquery(this); var $thumbs = $container.find('.wpb_thumbnails'); var layout_mode = $thumbs.attr('data-layout-mode'); $thumbs.isotope({ // options itemselector:'.isotope-item', layoutmode:(layout_modes[layout_mode] == undefined ? 'fitrows' : layout_modes[layout_mode]) }); $container.find('.categories_filter a').data('isotope', $thumbs).click(function (e) { e.preventdefault(); var $thumbs = jquery(this).data('isotope'); jquery(this).parent().parent().find('.active').removeclass('active'); jquery(this).parent().addclass('active'); $thumbs.isotope({filter:jquery(this).attr('data-filter')}); }); jquery(window).bind('load resize', function () { $thumbs.isotope("layout"); }); }); /* var isotope = jquery('.wpb_grid ul.thumbnails'); if ( isotope.length > 0 ) { isotope.isotope({ // options itemselector : '.isotope-item', layoutmode : 'fitrows' }); jquery(window).load(function() { isotope.isotope("layout"); }); } */ } } if (typeof window['vc_carouselbehaviour'] !== 'function') { function vc_carouselbehaviour($parent) { var $carousel = $parent ? $parent.find(".wpb_carousel") : jquery(".wpb_carousel"); $carousel.each(function () { var $this = jquery(this); if ($this.data('carousel_enabled') !== true && $this.is(':visible')) { $this.data('carousel_enabled', true); var carousel_width = jquery(this).width(), visible_count = getcolumnscount(jquery(this)), carousel_speed = 500; if (jquery(this).hasclass('columns_count_1')) { carousel_speed = 900; } /* get margin-left value from the css grid and apply it to the carousele li items (margin-right), before carousele initialization */ var carousele_li = jquery(this).find('.wpb_thumbnails-fluid li'); carousele_li.css({"margin-right":carousele_li.css("margin-left"), "margin-left":0 }); jquery(this).find('.wpb_wrapper:eq(0)').jcarousellite({ btnnext:jquery(this).find('.next'), btnprev:jquery(this).find('.prev'), visible:visible_count, speed:carousel_speed }) .width('100%');//carousel_width var fluid_ul = jquery(this).find('ul.wpb_thumbnails-fluid'); fluid_ul.width(fluid_ul.width() + 300); jquery(window).resize(function () { var before_resize = screen_size; screen_size = getsizename(); if (before_resize != screen_size) { window.settimeout('location.reload()', 20); } }); } }); /* if(jquery.fn.bxslider !== undefined ) { jquery('.bxslider').each(function(){ var $slider = jquery(this); $slider.bxslider($slider.data('settings')); }); } */ if (window.swiper !== undefined) { jquery('.swiper-container').each(function () { var $this = jquery(this), my_swiper, max_slide_size = 0, options = jquery(this).data('settings'); if (options.mode === 'vertical') { $this.find('.swiper-slide').each(function () { var height = jquery(this).outerheight(true); if (height > max_slide_size) max_slide_size = height; }); $this.height(max_slide_size); $this.css('overflow', 'hidden'); } jquery(window).resize(function () { $this.find('.swiper-slide').each(function () { var height = jquery(this).outerheight(true); if (height > max_slide_size) max_slide_size = height; }); $this.height(max_slide_size); }); my_swiper = jquery(this).swiper(jquery.extend(options, { onfirstinit:function (swiper) { if (swiper.slides.length < 2) { $this.find('.vc_arrow-left,.vc_arrow-right').hide(); } else if (swiper.activeindex === 0 && swiper.params.loop !== true) { $this.find('.vc_arrow-left').hide(); } else { $this.find('.vc_arrow-left').show(); } }, onslidechangestart:function (swiper) { if (swiper.slides.length > 1 && swiper.params.loop !== true) { if (swiper.activeindex === 0) { $this.find('.vc_arrow-left').hide(); } else { $this.find('.vc_arrow-left').show(); } if (swiper.slides.length - 1 === swiper.activeindex) { $this.find('.vc_arrow-right').hide(); } else { $this.find('.vc_arrow-right').show(); } } } })); $this.find('.vc_arrow-left').click(function (e) { e.preventdefault(); my_swiper.swipeprev(); }); $this.find('.vc_arrow-right').click(function (e) { e.preventdefault(); my_swiper.swipenext(); }); my_swiper.reinit(); }); } } } if (typeof window['vc_slidersbehaviour'] !== 'function') { function vc_slidersbehaviour() { //var sliders_count = 0; jquery('.wpb_gallery_slides').each(function (index) { var this_element = jquery(this); var ss_count = 0; /*if ( this_element.hasclass('wpb_slider_fading') ) { var sliderspeed = 500, slidertimeout = this_element.attr('data-interval')*1000, slider_fx = 'fade'; var current_ss; function slideshowonbefore(currslideelement, nextslideelement, options) { jquery(nextslideelement).css({"position" : "absolute" }); jquery(nextslideelement).find("div.description").animate({"opacity": 0}, 0); } function slideshowonafter(currslideelement, nextslideelement, options) { jquery(nextslideelement).find("div.description").animate({"opacity": 1}, 2000); jquery(nextslideelement).css({"position" : "static" }); var new_h = jquery(nextslideelement).find('img').height(); if ( jquery.isnumeric(new_h) ) { //this_element.animate({ "height" : new_h }, sliderspeed ); } } this_element.find('ul') .before('
') .cycle({ fx: slider_fx, // choose your transition type, ex: fade, scrollup, shuffle, etc... pause: 1, speed: sliderspeed, timeout: slidertimeout, delay: -ss_count * 1000, before: slideshowonbefore, after:slideshowonafter, pager: '.ss_nav_'+ss_count }); //.find('.description').width(jquery(this).width() - 20); ss_count++; } else*/ if (this_element.hasclass('wpb_slider_nivo')) { var sliderspeed = 800, slidertimeout = this_element.attr('data-interval') * 1000; if (slidertimeout == 0) slidertimeout = 9999999999; this_element.find('.nivoslider').nivoslider({ effect:'boxraingrow,boxrain,boxrainreverse,boxraingrowreverse', // specify sets like: 'fold,fade,slicedown' slices:15, // for slice animations boxcols:8, // for box animations boxrows:4, // for box animations animspeed:sliderspeed, // slide transition speed pausetime:slidertimeout, // how long each slide will show startslide:0, // set starting slide (0 index) directionnav:true, // next & prev navigation directionnavhide:true, // only show on hover controlnav:true, // 1,2,3... navigation keyboardnav:false, // use left & right arrows pauseonhover:true, // stop animation while hovering manualadvance:false, // force manual transitions prevtext:'prev', // prev directionnav text nexttext:'next' // next directionnav text }); } else if (this_element.hasclass('wpb_flexslider') && 1 == 2) { /* todo: remove this */ /* var sliderspeed = 800, slidertimeout = this_element.attr('data-interval')*1000, sliderfx = this_element.attr('data-flex_fx'), slideshow = true; if ( slidertimeout == 0 ) slideshow = false; this_element.flexslider({ animation: sliderfx, slideshow: slideshow, slideshowspeed: slidertimeout, sliderspeed: sliderspeed, smoothheight: true }); */ /* var $first_object = this_element.find('li:first').show().find('*:not(a)'); $first_object.bind('load', function() { if(!this_element.find('.flex-control-nav').is('ol')) { this_element.flexslider({ animation: sliderfx, slideshow: slideshow, slideshowspeed: slidertimeout, sliderspeed: sliderspeed, smoothheight: true }); } }); window.settimeout(function(){ if(!this_element.find('.flex-control-nav').is('ol')) { this_element.flexslider({ animation: sliderfx, slideshow: slideshow, slideshowspeed: slidertimeout, sliderspeed: sliderspeed, smoothheight: true }); } }, 5000); */ } else if (this_element.hasclass('wpb_image_grid')) { var isotope = this_element.find('.wpb_image_grid_ul'); isotope.isotope({ // options itemselector:'.isotope-item', layoutmode:'fitrows' }); jquery(window).load(function () { isotope.isotope("layout"); }); } }); } } if (typeof window['vc_prettyphoto'] !== 'function') { function vc_prettyphoto() { try { // just in case. maybe prettyphoto isnt loaded on this site jquery('a.prettyphoto, .gallery-icon a[href*=".jpg"]').prettyphoto({ animationspeed:'normal', /* fast/slow/normal */ padding:15, /* padding for each side of the picture */ opacity:0.7, /* value betwee 0 and 1 */ showtitle:true, /* true/false */ allowresize:true, /* true/false */ counter_separator_label:'/', /* the separator for the gallery counter 1 "of" 2 */ //theme: 'light_square', /* light_rounded / dark_rounded / light_square / dark_square */ hideflash:false, /* hides all the flash object on a page, set to true if flash appears over prettyphoto */ deeplinking:false, /* allow prettyphoto to update the url to enable deeplinking. */ modal:false, /* if set to true, only the close button will close the window */ callback:function () { var url = location.href; var hashtag = (url.indexof('#!prettyphoto')) ? true : false; if (hashtag) location.hash = "!"; } /* called when prettyphoto is closed */, social_tools:'' }); } catch (err) { } } } if ( typeof window['vc_google_fonts'] !== 'function' ) { function vc_google_fonts() { return; } } /* helper ---------------------------------------------------------- */ function getcolumnscount(el) { var find = false, i = 1; while (find == false) { if (el.hasclass('columns_count_' + i)) { find = true; return i; } i++; } } var screen_size = getsizename(); function getsizename() { var screen_size = '', screen_w = jquery(window).width(); if (screen_w > 1170) { screen_size = "desktop_wide"; } else if (screen_w > 960 && screen_w < 1169) { screen_size = "desktop"; } else if (screen_w > 768 && screen_w < 959) { screen_size = "tablet"; } else if (screen_w > 300 && screen_w < 767) { screen_size = "mobile"; } else if (screen_w < 300) { screen_size = "mobile_portrait"; } return screen_size; } function loadscript(url, $obj, callback) { var script = document.createelement("script") script.type = "text/javascript"; if (script.readystate) { //ie script.onreadystatechange = function () { if (script.readystate == "loaded" || script.readystate == "complete") { script.onreadystatechange = null; callback(); } }; } else { //others /* script.onload = function(){ callback(); }; */ } script.src = url; $obj.get(0).appendchild(script); } /** * prepare html to correctly display inside tab container * * @param event - ui tab event 'show' * @param ui - jquery ui tabs object */ function wpb_prepare_tab_content(event, ui) { var panel = ui.panel || ui.newpanel, $pie_charts = panel.find('.vc_pie_chart:not(.vc_ready)'), $carousel = panel.find('[data-ride="vc_carousel"]'), $ui_panel, $google_maps; vc_carouselbehaviour(); vc_plugin_flexslider(panel); $pie_charts.length && jquery.fn.vcchat && $pie_charts.vcchat(); $carousel.length && jquery.fn.carousel && $carousel.carousel('resizeaction'); $ui_panel = panel.find('.isotope'); $google_maps = panel.find('.wpb_gmaps_widget'); if ($ui_panel.length > 0) { $ui_panel.isotope("layout"); } if ($google_maps.length && !$google_maps.is('.map_ready')) { var $frame = $google_maps.find('iframe'); $frame.attr('src', $frame.attr('src')); $google_maps.addclass('map_ready'); } if(panel.parents('.isotope').length) { panel.parents('.isotope').each(function(){ jquery(this).isotope("layout"); }); } } var vc_accordionactivate = function(event, ui) { var $pie_charts = ui.newpanel.find('.vc_pie_chart:not(.vc_ready)'), $carousel = ui.newpanel.find('[data-ride="vc_carousel"]'); if (jquery.fn.isotope != undefined) { ui.newpanel.find('.isotope').isotope("layout"); } vc_carouselbehaviour(ui.newpanel); vc_plugin_flexslider(ui.newpanel); $pie_charts.length && jquery.fn.vcchat && $pie_charts.vcchat(); $carousel.length && jquery.fn.carousel && $carousel.carousel('resizeaction'); if(ui.newpanel.parents('.isotope').length) { ui.newpanel.parents('.isotope').each(function(){ jquery(this).isotope("layout"); }); } }