1/* jQuery CounTo */ 2(function(a){a.fn.countTo=function(g){g=g||{};return a(this).each(function(){function e(a){a=b.formatter.call(h,a,b);f.html(a)}var b=a.extend({},a.fn.countTo.defaults,{from:a(this).data("from"),to:a(this).data("to"),speed:a(this).data("speed"),refreshInterval:a(this).data("refresh-interval"),decimals:a(this).data("decimals")},g),j=Math.ceil(b.speed/b.refreshInterval),l=(b.to-b.from)/j,h=this,f=a(this),k=0,c=b.from,d=f.data("countTo")||{};f.data("countTo",d);d.interval&&clearInterval(d.interval);d.interval= 3setInterval(function(){c+=l;k++;e(Math.abs(c));"function"==typeof b.onUpdate&&b.onUpdate.call(h,c);k>=j&&(f.removeData("countTo"),clearInterval(d.interval),c=b.to,"function"==typeof b.onComplete&&b.onComplete.call(h,c))},b.refreshInterval);e(c)})};a.fn.countTo.defaults={from:0,to:0,speed:1E3,refreshInterval:100,decimals:0,formatter:function(a,e){return a.toFixed(e.decimals)},onUpdate:null,onComplete:null}})(jQuery); 4 5/* 6* hoverFlow - A Solution to Animation Queue Buildup in jQuery 7* Version 1.00 8* 9* Copyright (c) 2009 Ralf Stoltze, http://www.2meter3.de/code/hoverFlow/ 10* Dual-licensed under the MIT and GPL licenses. 11* http://www.opensource.org/licenses/mit-license.php 12* http://www.gnu.org/licenses/gpl.html 13*/ 14(function($){$.fn.hoverFlow=function(c,d,e,f,g){if($.inArray(c,['mouseover','mouseenter','mouseout','mouseleave'])==-1){return this}var h=typeof e==='object'?e:{complete:g||!g&&f||$.isFunction(e)&&e,duration:e,easing:g&&f||f&&!$.isFunction(f)&&f};h.queue=false;var i=h.complete;h.complete=function(){$(this).dequeue();if($.isFunction(i)){i.call(this)}};return this.each(function(){var b=$(this);if(c=='mouseover'||c=='mouseenter'){b.data('jQuery.hoverFlow',true)}else{b.removeData('jQuery.hoverFlow')}b.queue(function(){var a=(c=='mouseover'||c=='mouseenter')?b.data('jQuery.hoverFlow')!==undefined:b.data('jQuery.hoverFlow')===undefined;if(a){b.animate(d,h)}else{b.queue([])}})})}})(jQuery); 15 16/** 17 * User agent 18 * http://cssuseragent.org/ 19 */ 20var cssua=function(n,l,p){var q=/\s*([\-\w ]+)[\s\/\:]([\d_]+\b(?:[\-\._\/]\w+)*)/,r=/([\w\-\.]+[\s\/][v]?[\d_]+\b(?:[\-\._\/]\w+)*)/g,s=/\b(?:(blackberry\w*|bb10)|(rim tablet os))(?:\/(\d+\.\d+(?:\.\w+)*))?/,t=/\bsilk-accelerated=true\b/,u=/\bfluidapp\b/,v=/(\bwindows\b|\bmacintosh\b|\blinux\b|\bunix\b)/,w=/(\bandroid\b|\bipad\b|\bipod\b|\bwindows phone\b|\bwpdesktop\b|\bxblwp7\b|\bzunewp7\b|\bwindows ce\b|\bblackberry\w*|\bbb10\b|\brim tablet os\b|\bmeego|\bwebos\b|\bpalm|\bsymbian|\bj2me\b|\bdocomo\b|\bpda\b|\bchtml\b|\bmidp\b|\bcldc\b|\w*?mobile\w*?|\w*?phone\w*?)/, 21x=/(\bxbox\b|\bplaystation\b|\bnintendo\s+\w+)/,k={parse:function(b,d){var a={};d&&(a.standalone=d);b=(""+b).toLowerCase();if(!b)return a;for(var c,e,g=b.split(/[()]/),f=0,k=g.length;f<k;f++)if(f%2){var m=g[f].split(";");c=0;for(e=m.length;c<e;c++)if(q.exec(m[c])){var h=RegExp.$1.split(" ").join("_"),l=RegExp.$2;if(!a[h]||parseFloat(a[h])<parseFloat(l))a[h]=l}}else if(m=g[f].match(r))for(c=0,e=m.length;c<e;c++)h=m[c].split(/[\/\s]+/),h.length&&"mozilla"!==h[0]&&(a[h[0].split(" ").join("_")]=h.slice(1).join("-")); 22w.exec(b)?(a.mobile=RegExp.$1,s.exec(b)&&(delete a[a.mobile],a.blackberry=a.version||RegExp.$3||RegExp.$2||RegExp.$1,RegExp.$1?a.mobile="blackberry":"0.0.1"===a.version&&(a.blackberry="7.1.0.0"))):v.exec(b)?a.desktop=RegExp.$1:x.exec(b)&&(a.game=RegExp.$1,c=a.game.split(" ").join("_"),a.version&&!a[c]&&(a[c]=a.version));a.intel_mac_os_x?(a.mac_os_x=a.intel_mac_os_x.split("_").join("."),delete a.intel_mac_os_x):a.cpu_iphone_os?(a.ios=a.cpu_iphone_os.split("_").join("."),delete a.cpu_iphone_os):a.cpu_os? 23(a.ios=a.cpu_os.split("_").join("."),delete a.cpu_os):"iphone"!==a.mobile||a.ios||(a.ios="1");a.opera&&a.version?(a.opera=a.version,delete a.blackberry):t.exec(b)?a.silk_accelerated=!0:u.exec(b)&&(a.fluidapp=a.version);if(a.applewebkit)a.webkit=a.applewebkit,delete a.applewebkit,a.opr&&(a.opera=a.opr,delete a.opr,delete a.chrome),a.safari&&(a.chrome||a.crios||a.opera||a.silk||a.fluidapp||a.phantomjs||a.mobile&&!a.ios?delete a.safari:a.safari=a.version&&!a.rim_tablet_os?a.version:{419:"2.0.4",417:"2.0.3", 24416:"2.0.2",412:"2.0",312:"1.3",125:"1.2",85:"1.0"}[parseInt(a.safari,10)]||a.safari);else if(a.msie||a.trident)if(a.opera||(a.ie=a.msie||a.rv),delete a.msie,a.windows_phone_os)a.windows_phone=a.windows_phone_os,delete a.windows_phone_os;else{if("wpdesktop"===a.mobile||"xblwp7"===a.mobile||"zunewp7"===a.mobile)a.mobile="windows desktop",a.windows_phone=9>+a.ie?"7.0":10>+a.ie?"7.5":"8.0",delete a.windows_nt}else if(a.gecko||a.firefox)a.gecko=a.rv;a.rv&&delete a.rv;a.version&&delete a.version;return a}, 25format:function(b){var d="",a;for(a in b)if(a&&b.hasOwnProperty(a)){var c=a,e=b[a],c=c.split(".").join("-"),g=" ua-"+c;if("string"===typeof e){for(var e=e.split(" ").join("_").split(".").join("-"),f=e.indexOf("-");0<f;)g+=" ua-"+c+"-"+e.substring(0,f),f=e.indexOf("-",f+1);g+=" ua-"+c+"-"+e}d+=g}return d},encode:function(b){var d="",a;for(a in b)a&&b.hasOwnProperty(a)&&(d&&(d+="\x26"),d+=encodeURIComponent(a)+"\x3d"+encodeURIComponent(b[a]));return d}};k.userAgent=k.ua=k.parse(l,p);l=k.format(k.ua)+ 26" js";n.className=n.className?n.className.replace(/\bno-js\b/g,"")+l:l.substr(1);return k}(document.documentElement,navigator.userAgent,navigator.standalone); 27 28 29var generateCarousel = function() { 30 if(jQuery().carouFredSel) { 31 jQuery('.es-carousel-wrapper').not('.fusion-woo-featured-products-slider').each(function() { 32 jQuery(this).find('ul').carouFredSel({
33 auto: false, 34 prev: jQuery(this).find('.es-nav-prev'), 35 next: jQuery(this).find('.es-nav-next'), 36 width: '100%', 37 height: 'variable', 38 align: 'center', 39 onCreate: function(data) { 40 jQuery( this ).find( '.image' ).css('visibility', 'visible'); 41 } 42 }); 43 }); 44 45 jQuery('.fusion-woo-featured-products-slider').each(function() { 46 var carousel = jQuery(this).find('ul'); 47 carousel.carouFredSel({ 48 auto: false, 49 prev: jQuery(this).find('.es-nav-prev'), 50 next: jQuery(this).find('.es-nav-next'), 51 align: 'left', 52 left: 0, 53 width: '100%', 54 height: 'variable', 55 responsive: true, 56 scroll: { 57 items: 1 58 }, 59 items: { 60 width: 500, 61 height: 'variable', 62 visible: { 63 min: 1, 64 max: 30 65 } 66 }, 67 onCreate: function(data) { 68 jQuery( this ).find( '.image' ).css('visibility', 'visible'); 69 jQuery( this ).parent().css('overflow', ''); 70 } 71 }); 72 }); 73 74 jQuery('.simple-products-slider-variable').each(function() { 75 var carousel = jQuery(this).find('ul'); 76 carousel.carouFredSel({ 77 auto: false, 78 prev: jQuery(this).find('.es-nav-prev'), 79 next: jQuery(this).find('.es-nav-next'), 80 width: '100%', 81 height: 'variable', 82 align: 'center' 83 }); 84 }); 85 } 86}; 87 88var calcTabsLayout = function(tab_selector) { 89 jQuery(tab_selector).each(function() { 90 var menuWidth = jQuery(this).parent().width(); 91 var menuItems = jQuery(this).find('li').length; 92 var mod = menuWidth % menuItems; 93 var itemWidth = (menuWidth - mod)/menuItems; 94 var lastItemWidth = menuWidth - itemWidth*(menuItems - 1); 95 96 jQuery(this).css({'width': menuWidth +'px'}); 97 jQuery(this).find('li').css({'width': itemWidth +'px'}); 98 jQuery(this).find('li:last').css({'width': lastItemWidth +'px'}).addClass('no-border-right'); 99 }); 100}; 101 102var fusion_reanimate_slider = function( content_container ) { 103 var slide_content = content_container.find( '.slide-content' ); 104 105 jQuery( slide_content ).each( function() { 106 107 jQuery(this).stop( true, true ); 108 109 jQuery(this).css('opacity', '0'); 110 jQuery(this).css('margin-top', '50px'); 111 112 jQuery(this).animate({ 113 'opacity': '1', 114 'margin-top': '0' 115 }, 1000 ); 116 117 }); 118}; 119 120function onPlayerStateChange(frame, slider) { 121 return function(event) { 122 if(event.data == YT.PlayerState.PLAYING) { 123 jQuery(slider).flexslider("pause"); 124 } 125 if(event.data == YT.PlayerState.PAUSED) { 126 jQuery(slider).flexslider("play"); 127 } 128 if(event.data == YT.PlayerState.BUFFERING) { 129 jQuery(slider).flexslider("pause"); 130 } 131 } 132} 133function onPlayerReady(slide) { 134 return function(event) { 135 if( jQuery(slide).attr('data-mute') == 'yes' ) { 136 event.target.mute(); 137 } 138 } 139} 140 141(function( jQuery ) { 142 143 "use strict"; 144 145 jQuery('.tfs-slider').each(function() { 146 var this_tfslider = this; 147 148 if(jQuery(this_tfslider).parents('.post-content').length >= 1) { 149 jQuery(this_tfslider).data('parallax', 0); 150 jQuery(this_tfslider).data('full_screen', 0); 151 } 152 153 if(cssua.ua.tablet_pc) { 154 jQuery(this_tfslider).data('parallax', 0); 155 } 156 157 if(cssua.ua.mobile) { 158 jQuery(this_tfslider).data('parallax', 0); 159 } 160 }); 161 162 // init sticky header 163 jQuery.fn.init_sticky_header = function() { 164 165 var sticky_mobile_menu_padding; 166 167 var sticky_header_height = 65; 168 var sticky_top = jQuery('.sticky-header').css('top'); 169 var sticky_start = sticky_top.replace('px','') - 55; 170 var logo = '.sticky-header .logo img.normal_logo'; 171 var not_logo = '.sticky-header .logo img.retina_logo'; 172 var orig_logo_height, orig_logo_width, logo_max_width, width_ratio, calc_width, calc_height, 173 logo_height, logo_line_height, logo_width, logo_margin_top = 0; 174 175 var anchor_scrolling = 0; 176 jQuery('.sticky-header').css('top', sticky_start+'px'); 177 jQuery('.init-sticky-header').waypoint(function(direction) { 178 if(direction === "down") { 179 // one page anchor page load scrolling 180 var adminbar_height = jQuery('#wpadminbar').outerHeight(); 181 var anchor = window.location.hash.toString(); 182 183 if( anchor.length > 1 && jQuery(anchor).length && ! anchor_scrolling ) { 184 jQuery('html, body').animate({ 185 scrollTop: jQuery(anchor).offset().top - adminbar_height - 65 + 1 186 }, 350, 'easeInOutExpo'); 187 anchor_scrolling = 1; 188 } 189 190 if( jQuery('#wpadminbar').length ) { 191 sticky_top = jQuery('#wpadminbar').outerHeight()+"px"; 192 } 193 jQuery('.sticky-header').show(); 194 jQuery('.sticky-header').animate({ 195 height: sticky_header_height + 3 + 'px', 196 top: sticky_top 197 }, 500 ); 198 jQuery('.sticky-shadow').animate({ 199 height: sticky_header_height + 'px', 200 top: sticky_top 201 }, 500 ); 202 203 204 if( jQuery('#header .retina_logo').is(':visible')) { 205 logo = '.sticky-header .logo img.retina_logo'; 206 not_logo ='.sticky-header .logo img.normal_logo'; 207 } else { 208 logo = '.sticky-header .logo img.normal_logo'; 209 not_logo = '.sticky-header .logo img.retina_logo'; 210 } 211 212 orig_logo_height = jQuery(logo).height(); 213 orig_logo_width = jQuery(logo).width(); 214 logo_max_width = jQuery(logo).data("max-width"); 215 216 //IE8 quirks 217 if (jQuery('.no-svg').length >= 1) { 218 orig_logo_height = orig_logo_height + 4; 219 orig_logo_width = orig_logo_width + 4;
220 } 221 222 calc_width = orig_logo_width; 223 calc_height = orig_logo_height; 224 225 if (logo_max_width > 0) { 226 width_ratio = logo_max_width / orig_logo_width; 227 calc_width = logo_max_width; 228 calc_height = orig_logo_height * width_ratio; 229 } 230 231 if (calc_height > 55) { 232 logo_height = "55px"; 233 logo_line_height = "55px"; 234 logo_width = 55 / orig_logo_height * orig_logo_width; 235 logo_margin_top = "5px"; 236 } else { 237 logo_height = calc_height+"px"; 238 logo_line_height = calc_height+"px"; 239 logo_width = calc_width; 240 logo_margin_top = (65 - calc_height) / 2; 241 } 242 243 sticky_mobile_menu_padding = logo_width+25; 244 245 jQuery('body #header-sticky.sticky-header .sticky-shadow .mobile-nav-holder').css('padding-left', sticky_mobile_menu_padding+"px"); 246 logo_width = logo_width+"px"; 247 248 //IE8 quirks 249 if ( jQuery( '.no-svg' ).length ) { 250 jQuery(logo).animate({ 251 height: logo_height, 252 'line-height': logo_line_height, 253 'max-width': logo_width, 254 'margin-top': logo_margin_top 255 }, 500 ); 256 jQuery(not_logo).css('height', logo_height).css('line-height', logo_line_height).css('max-width', logo_width).css('margin-top', logo_margin_top); 257 jQuery(logo).css('display', ''); 258 } else { 259 jQuery(logo).animate({ 260 height: logo_height, 261 'line-height': logo_line_height, 262 width: logo_width, 263 'margin-top': logo_margin_top 264 }, 500 ); 265 jQuery(not_logo).css('height', logo_height).css('line-height', logo_line_height).css('width', logo_width).css('margin-top', logo_margin_top); 266 jQuery(logo).css('display', ''); 267 } 268 269 jQuery('.sticky-header #sticky-nav ul.menu > li > a').animate({ 270 height: sticky_header_height + 'px', 271 'line-height': sticky_header_height + 'px' 272 }, 500 ); 273 274 275 jQuery('.sticky-header').addClass('sticky'); 276 jQuery('#small-nav').css('visibility', 'hidden'); 277 } else if(direction === "up") { 278 jQuery('.sticky-header').css( 'height', '' ); 279 jQuery('.sticky-shadow').css( 'height', '' ); 280 281 jQuery('#header-sticky .retina_logo').css( 'height', orig_logo_height ); 282 jQuery('#header .retina_logo, #header-sticky .retina_logo').css( 'width', orig_logo_width ); 283 jQuery('#header-sticky .retina_logo').css( 'margin-top', '' ); 284 jQuery('#header .normal_logo, #header-sticky .normal_logo').css( 'height', '' ); 285 jQuery('#header .normal_logo, #header-sticky .normal_logo').css( 'width', '' ); 286 jQuery('#header-sticky .retina_logo').css( 'margin-top', '' ); 287 288 jQuery(logo+','+not_logo).css( 'line-height', '' ); 289 jQuery(logo+','+not_logo).css( 'padding-top', '' ); 290 jQuery(logo+','+not_logo).css( 'max-width', '' ); 291 jQuery(logo+','+not_logo).css( 'margin-top', '' ); 292 293 jQuery('.sticky-header #sticky-nav ul.menu > li > a').css( 'height', '' ); 294 jQuery('.sticky-header #sticky-nav ul.menu > li > a').css( 'line-height', '' ); 295 296 jQuery('.sticky-header').removeClass( 'sticky' ); 297 jQuery('.sticky-header').hide(); 298 jQuery('#small-nav').css('visibility', 'visible'); 299 300 jQuery('.sticky-header .mobile-nav-holder #mobile-nav').css( 'display', 'none' ); 301 } 302 }); 303 }; 304 305 306 // position dropdown menu correctly 307 jQuery.fn.fusion_position_menu_dropdown = function( variables ) { 308 309 if( ( js_local_vars.header_position == 'Top' && ! jQuery( 'body.rtl' ).length ) || js_local_vars.header_position == 'Left' ) { 310 return jQuery( this ).children( '.sub-menu' ).each( function() { 311 312 // reset attributes 313 jQuery( this ).removeAttr( 'style' ); 314 jQuery( this ).show(); 315 jQuery( this ).removeData( 'shifted' ); 316 317 var submenu = jQuery( this ); 318 319 if( submenu.length ) { 320 var submenu_position = submenu.offset(), 321 submenu_left = submenu_position.left, 322 submenu_top = submenu_position.top, 323 submenu_height = submenu.height(), 324 submenu_width = submenu.outerWidth(), 325 submenu_bottom_edge = submenu_top + submenu_height, 326 submenu_right_edge = submenu_left + submenu_width, 327 browser_bottom_edge = jQuery( window ).height(), 328 browser_right_edge = jQuery( window ).width(); 329 330 if( jQuery( '#wpadminbar' ).length ) { 331 var admin_bar_height = jQuery( '#wpadminbar' ).height(); 332 } else { 333 var admin_bar_height = 0; 334 } 335 336 if( jQuery( '#side-header' ).length ) { 337 var side_header_top = jQuery( '#side-header' ).offset().top - admin_bar_height; 338 } 339 340 // current submenu goes beyond browser's right edge 341 if( submenu_right_edge > browser_right_edge ) { 342 343 //if there are 2 or more submenu parents position this submenu below last one 344 if( submenu.parent().parent( '.sub-menu' ).parent().parent( '.sub-menu' ).length ) { 345 submenu.css({ 346 'left': '0', 347 'top': submenu.parent().parent( '.sub-menu' ).height() 348 }); 349 350 // first or second level submenu 351 } else { 352 // first level submenu 353 if( ! submenu.parent().parent( '.sub-menu' ).length ) { 354 submenu.css( 'left', ( -1 ) * submenu_width + submenu.parent().width() ); 355 356 // second level submenu 357 } else { 358 submenu.css({ 359 'left': ( -1 ) * submenu_width 360 }); 361 } 362 } 363 364 submenu.data( 'shifted', 1 ); 365 // parent submenu had to be shifted 366 } else if( submenu.parent().parent( '.sub-menu' ).length ) { 367 if( submenu.parent().parent( '.sub-menu' ).data( 'shifted' ) ) { 368 submenu.css( 'left', ( -1 ) * submenu_width ); 369 submenu.data( 'shifted', 1 ); 370 } 371 } 372 373 // Calculate dropdown vertical position on side header 374 if( js_local_vars.header_position != 'Top' && submenu_bottom_edge > side_header_top + browser_bottom_edge && jQuery( window ).height() >= jQuery( '.side-header-wrapper' ).height() ) { 375 if( submenu_height < browser_bottom_edge ) { 376 var submenu_new_top_pos = ( -1 ) * ( submenu_bottom_edge - side_header_top - browser_bottom_edge + 20 ); 377 } else { 378 var submenu_new_top_pos = ( -1 ) * ( submenu_top - admin_bar_height ); 379 }
380 submenu.css( 'top', submenu_new_top_pos ); 381 } 382 } 383 }); 384 } else { 385 return jQuery( this ).children( '.sub-menu' ).each( function() { 386 387 // reset attributes 388 jQuery( this ).removeAttr( 'style' ); 389 jQuery( this ).removeData( 'shifted' ); 390 391 var submenu = jQuery( this ); 392 393 if( submenu.length ) { 394 var submenu_position = submenu.offset(), 395 submenu_left_edge = submenu_position.left, 396 submenu_top = submenu_position.top, 397 submenu_height = submenu.height(), 398 submenu_width = submenu.outerWidth(), 399 submenu_bottom_edge = submenu_top + submenu_height, 400 browser_bottom_edge = jQuery( window ).height(); 401 402 if( jQuery( '#wpadminbar' ).length ) { 403 var admin_bar_height = jQuery( '#wpadminbar' ).height(); 404 } else { 405 var admin_bar_height = 0; 406 } 407 408 if( jQuery( '#side-header' ).length ) { 409 var side_header_top = jQuery( '#side-header' ).offset().top - admin_bar_height; 410 } 411 412 // current submenu goes beyond browser's left edge 413 if( submenu_left_edge < 0 ) { 414 //if there are 2 or more submenu parents position this submenu below last one 415 if( submenu.parent().parent( '.sub-menu' ).parent().parent( '.sub-menu' ).length ) { 416 if( js_local_vars.header_position == 'Right' ) { 417 submenu.css({ 418 'left': '0', 419 'top': submenu.parent().parent( '.sub-menu' ).height() 420 }); 421 } else { 422 submenu.css({ 423 'right': '0', 424 'top': submenu.parent().parent( '.sub-menu' ).height() 425 }); 426 } 427 // first or second level submenu 428 } else { 429 // first level submenu 430 if( ! submenu.parent().parent( '.sub-menu' ).length ) { 431 submenu.css( 'right', ( -1 ) * submenu_width + submenu.parent().width() ); 432 433 // second level submenu 434 } else { 435 submenu.css({ 436 'right': ( -1 ) * submenu_width 437 }); 438 } 439 } 440 441 submenu.data( 'shifted', 1 ); 442 // parent submenu had to be shifted 443 } else if( submenu.parent().parent( '.sub-menu' ).length ) { 444 if( submenu.parent().parent( '.sub-menu' ).data( 'shifted' ) ) { 445 submenu.css( 'right', ( -1 ) * submenu_width ); 446 } 447 } 448 449 // Calculate dropdown vertical position on side header 450 if( js_local_vars.header_position != 'Top' && submenu_bottom_edge > side_header_top + browser_bottom_edge && jQuery( window ).height() >= jQuery( '.side-header-wrapper' ).height() ) { 451 if( submenu_height < browser_bottom_edge ) { 452 var submenu_new_top_pos = ( -1 ) * ( submenu_bottom_edge - side_header_top - browser_bottom_edge + 20 ); 453 } else { 454 var submenu_new_top_pos = ( -1 ) * ( submenu_top - admin_bar_height ); 455 } 456 submenu.css( 'top', submenu_new_top_pos ); 457 } 458 } 459 }); 460 } 461 }; 462 463 // Recursive function for positioning menu items correctly on load 464 jQuery.fn.walk_through_menu_items = function() { 465 jQuery( this ).fusion_position_menu_dropdown(); 466 467 if( jQuery( this ).find( '.sub-menu' ).length ) { 468 jQuery( this ).find( '.sub-menu li' ).walk_through_menu_items(); 469 } else { 470 return; 471 } 472 }; 473 474 // Position the cart dropdown vertically on side-header layouts 475 jQuery.fn.position_cart_dropdown = function() { 476 if( js_local_vars.header_position != 'Top' ) { 477 jQuery( this ).each( function() { 478 jQuery( this ).css( 'top', '' ); 479 480 var cart_dropdown = jQuery( this ), 481 cart_dropdown_top = cart_dropdown.offset().top, 482 cart_dropdown_height = cart_dropdown.height(), 483 cart_dropdown_bottom_edge = cart_dropdown_top + cart_dropdown_height, 484 admin_bar_height = ( jQuery( '#wpadminbar' ).length ) ? jQuery( '#wpadminbar' ).height() : 0, 485 side_header_top = jQuery( '#side-header' ).offset().top - admin_bar_height, 486 browser_bottom_edge = jQuery( window ).height(); 487 488 if( cart_dropdown_bottom_edge > side_header_top + browser_bottom_edge && jQuery( window ).height() >= jQuery( '.side-header-wrapper' ).height() ) { 489 if( cart_dropdown_height < browser_bottom_edge ) { 490 var cart_dropdown_new_top_pos = ( -1 ) * ( cart_dropdown_bottom_edge - side_header_top - browser_bottom_edge + 20 ); 491 } else { 492 var cart_dropdown_new_top_pos = ( -1 ) * ( cart_dropdown_top - admin_bar_height ); 493 } 494
495 cart_dropdown.css( 'top', cart_dropdown_new_top_pos ); 496 } 497 }); 498 } 499 }; 500 501 // Position the search form vertically on side-header layouts 502 jQuery.fn.position_menu_search_form = function() { 503 if( js_local_vars.header_position != 'Top' ) { 504 jQuery( this ).each( function() { 505 jQuery( this ).css( 'top', '' ); 506 507 var search_form = jQuery( this ), 508 search_form_top = search_form.offset().top, 509 search_form_height = search_form.outerHeight(), 510 search_form_bottom_edge = search_form_top + search_form_height, 511 admin_bar_height = ( jQuery( '#wpadminbar' ).length ) ? jQuery( '#wpadminbar' ).height() : 0, 512 side_header_top = jQuery( '#side-header' ).offset().top - admin_bar_height, 513 browser_bottom_edge = jQuery( window ).height(); 514 515 if( search_form_bottom_edge > side_header_top + browser_bottom_edge && jQuery( window ).height() >= jQuery( '.side-header-wrapper' ).height() ) { 516 var search_form_new_top_pos = ( -1 ) * ( search_form_bottom_edge - side_header_top - browser_bottom_edge + 20 ); 517 518 search_form.css( 'top', search_form_new_top_pos ); 519 } 520 }); 521 } 522 }; 523 524 // position mega menu correctly 525 jQuery.fn.fusion_position_megamenu = function( variables ) { 526 // side header left handling 527 if( jQuery( '.side-header-left' ).length ) { 528 return this.each( function() { 529 jQuery( this ).children( 'li' ).each( function() { 530 var li_item = jQuery( this ), 531 megamenu_wrapper = li_item.find( '.fusion-megamenu-wrapper' ); 532 533 if( megamenu_wrapper.length ) { 534 megamenu_wrapper.removeAttr( 'style' ); 535 536 var megamenu_wrapper_left = jQuery( '#side-header' ).outerWidth() - 1, 537 megamenu_wrapper_top = megamenu_wrapper.offset().top, 538 megamenu_wrapper_height = megamenu_wrapper.height(), 539 megamenu_bottom_edge = megamenu_wrapper_top + megamenu_wrapper_height, 540 admin_bar_height = ( jQuery( '#wpadminbar' ).length ) ? jQuery( '#wpadminbar' ).height() : 0, 541 side_header_top = jQuery( '#side-header' ).offset().top - admin_bar_height, 542 browser_bottom_edge = jQuery( window ).height(); 543 544 if( ! jQuery( 'body.rtl' ).length ) { 545 megamenu_wrapper.css( 'left', megamenu_wrapper_left ); 546 } else { 547 megamenu_wrapper.css({ 'left': megamenu_wrapper_left, 'right': 'auto' }); 548 } 549 550 if( megamenu_bottom_edge > side_header_top + browser_bottom_edge && jQuery( window ).height() >= jQuery( '.side-header-wrapper' ).height() ) { 551 if( megamenu_wrapper_height < browser_bottom_edge ) { 552 var megamenu_wrapper_new_top_pos = ( -1 ) * ( megamenu_bottom_edge - side_header_top - browser_bottom_edge + 20 ); 553 } else { 554 var megamenu_wrapper_new_top_pos = ( -1 ) * ( megamenu_wrapper_top - admin_bar_height ); 555 } 556 557 megamenu_wrapper.css( 'top', megamenu_wrapper_new_top_pos ); 558 } 559 } 560 }); 561 }); 562 } 563 564 // side header right handling 565 if( jQuery( '.side-header-right' ).length ) { 566 return this.each( function() { 567 jQuery( this ).children( 'li' ).each( function() { 568 var li_item = jQuery( this ), 569 megamenu_wrapper = li_item.find( '.fusion-megamenu-wrapper' ); 570 571 if( megamenu_wrapper.length ) { 572 megamenu_wrapper.removeAttr( 'style' ); 573 574 var megamenu_wrapper_left = ( -1 ) * megamenu_wrapper.outerWidth(), 575 megamenu_wrapper_top = megamenu_wrapper.offset().top, 576 megamenu_wrapper_height = megamenu_wrapper.height(), 577 megamenu_bottom_edge = megamenu_wrapper_top + megamenu_wrapper_height, 578 admin_bar_height = ( jQuery( '#wpadminbar' ).length ) ? jQuery( '#wpadminbar' ).height() : 0, 579 side_header_top = jQuery( '#side-header' ).offset().top - admin_bar_height, 580 browser_bottom_edge = jQuery( window ).height(); 581 582 if( ! jQuery( 'body.rtl' ).length ) { 583 megamenu_wrapper.css( 'left', megamenu_wrapper_left ); 584 } else { 585 megamenu_wrapper.css({ 'left': megamenu_wrapper_left, 'right': 'auto' }); 586 } 587 588 if( megamenu_bottom_edge > side_header_top + browser_bottom_edge && jQuery( window ).height() >= jQuery( '.side-header-wrapper' ).height()) { 589 if( megamenu_wrapper_height < browser_bottom_edge ) { 590 var megamenu_wrapper_new_top_pos = ( -1 ) * ( megamenu_bottom_edge - side_header_top - browser_bottom_edge + 20 ); 591 } else { 592 var megamenu_wrapper_new_top_pos = ( -1 ) * ( megamenu_wrapper_top - admin_bar_height ); 593 } 594
595 megamenu_wrapper.css( 'top', megamenu_wrapper_new_top_pos ); 596 } 597 } 598 }); 599 }); 600 } 601 602 // top header headnling 603 var reference_elem = ''; 604 if( jQuery( '.header-v4' ).length ) { 605 reference_elem = jQuery( this ).parent('nav').parent(); 606 } else { 607 reference_elem = jQuery( this ).parent('nav'); 608 } 609 610 if( jQuery( this ).parent( 'nav' ).length ) { 611 612 var main_nav_container = reference_elem, 613 main_nav_container_position = main_nav_container.offset(), 614 main_nav_container_width = main_nav_container.width(), 615 main_nav_container_left_edge = main_nav_container_position.left, 616 main_nav_container_right_edge = main_nav_container_left_edge + main_nav_container_width; 617 618 if( ! jQuery( 'body.rtl' ).length ) { 619 return this.each( function() { 620 621 jQuery( this ).children( 'li' ).each( function() { 622 var li_item = jQuery( this ), 623 li_item_position = li_item.offset(), 624 megamenu_wrapper = li_item.find( '.fusion-megamenu-wrapper' ), 625 megamenu_wrapper_width = megamenu_wrapper.outerWidth(), 626 megamenu_wrapper_position = 0; 627 628 // check if there is a megamenu 629 if( megamenu_wrapper.length ) { 630 megamenu_wrapper.removeAttr( 'style' ); 631 632 // set megamenu max width 633 var reference_avada_row; 634 635 if( jQuery( '#small-nav' ).length ) { 636 reference_avada_row = jQuery( '.header-wrapper #small-nav .avada-row' ); 637 } else { 638 reference_avada_row = jQuery( '.header-wrapper .avada-row' ); 639 } 640 641 if( megamenu_wrapper.hasClass( 'col-span-12' ) && ( reference_avada_row.width() < megamenu_wrapper.data( 'maxwidth' ) ) ) { 642 megamenu_wrapper.css( 'width', reference_avada_row.width() ); 643 } else { 644 megamenu_wrapper.removeAttr( 'style' ); 645 } 646 647 // reset the megmenu width after resizing the menu 648 megamenu_wrapper_width = megamenu_wrapper.outerWidth(); 649 650 if( li_item_position.left + megamenu_wrapper_width > main_nav_container_right_edge ) { 651 megamenu_wrapper_position = -1 * ( li_item_position.left - ( main_nav_container_right_edge - megamenu_wrapper_width ) ); 652 653 if( js_local_vars.logo_alignment.toLowerCase() == 'right' ) { 654 if( li_item_position.left + megamenu_wrapper_position < main_nav_container_left_edge ) { 655 megamenu_wrapper_position = -1 * ( li_item_position.left - main_nav_container_left_edge ); 656 } 657 } 658 659 megamenu_wrapper.css( 'left', megamenu_wrapper_position ); 660 } 661 } 662 }); 663 }); 664 665 } else { 666 return this.each( function() { 667 jQuery( this ).children( 'li' ).each( function() { 668 var li_item = jQuery( this ), 669 li_item_position = li_item.offset(), 670 li_item_right_edge = li_item_position.left + li_item.outerWidth(), 671 megamenu_wrapper = li_item.find( '.fusion-megamenu-wrapper' ), 672 megamenu_wrapper_width = megamenu_wrapper.outerWidth(), 673 megamenu_wrapper_position = 0; 674 675 // check if there is a megamenu 676 if( megamenu_wrapper.length ) { 677 megamenu_wrapper.removeAttr( 'style' ); 678 679 // set megamenu max width 680 var reference_avada_row; 681 682 if( jQuery( '#small-nav' ).length ) { 683 reference_avada_row = jQuery( '.header-wrapper #small-nav .avada-row' ); 684 } else { 685 reference_avada_row = jQuery( '.header-wrapper .avada-row' ); 686 } 687 688 if( megamenu_wrapper.hasClass( 'col-span-12' ) && ( reference_avada_row.width() < megamenu_wrapper.data( 'maxwidth' ) ) ) { 689 megamenu_wrapper.css( 'width', reference_avada_row.width() ); 690 } else { 691 megamenu_wrapper.removeAttr( 'style' ); 692 } 693 694 if( li_item_right_edge - megamenu_wrapper_width < main_nav_container_left_edge ) { 695 696 megamenu_wrapper_position = -1 * ( megamenu_wrapper_width - ( li_item_right_edge - main_nav_container_left_edge ) ); 697 698 if( js_local_vars.logo_alignment.toLowerCase() == 'left' || ( js_local_vars.logo_alignment.toLowerCase() == 'center' && ! jQuery( '.header-v5' ).length ) || jQuery( this ).parents( '.sticky-header' ).length ) { 699 if( li_item_right_edge - megamenu_wrapper_position > main_nav_container_right_edge ) { 700 megamenu_wrapper_position = -1 * ( main_nav_container_right_edge - li_item_right_edge ); 701 } 702 } 703 704 megamenu_wrapper.css( 'right', megamenu_wrapper_position ); 705 } 706 } 707 }); 708 }); 709 } 710 } 711 }; 712
713 jQuery.fn.calc_mengamenu_responsive_column_widths = function( variables ) { 714 jQuery( this ).find( '.fusion-megamenu-menu' ).each( function() { 715 var megamenu_holder = jQuery( this ).find( '.fusion-megamenu-holder' ); 716 var megamenu_holder_full_width = megamenu_holder.data( 'width' ); 717 var main_padding = jQuery( '#main' ).css( 'padding-left' ).replace( 'px', '' ) * 2; 718 var available_space = jQuery( window ).width() - main_padding; 719 720 if( js_local_vars.header_position != 'Top' ) { 721 available_space = available_space - jQuery( '#side-header' ).outerWidth() + 30; 722 } 723 724 if( available_space < megamenu_holder_full_width ) { 725 megamenu_holder.css( 'width', available_space ); 726 727 728 if( ! megamenu_holder.parents( '.fusion-megamenu-wrapper' ).hasClass( 'fusion-megamenu-fullwidth' ) ) { 729 megamenu_holder.find( '.fusion-megamenu-submenu' ).each( function() { 730 var submenu = jQuery( this ); 731 var submenu_width = submenu.data( 'width' ) * available_space / megamenu_holder_full_width; 732 submenu.css( 'width', submenu_width ); 733 }); 734 } 735 } else { 736 megamenu_holder.css( 'width', megamenu_holder_full_width ); 737 738 if( ! megamenu_holder.parents( '.fusion-megamenu-wrapper' ).hasClass( 'fusion-megamenu-fullwidth' ) ) { 739 megamenu_holder.find( '.fusion-megamenu-submenu' ).each( function() { 740 jQuery( this ).css( 'width', jQuery( this ).data( 'width' ) ); 741 }); 742 } 743 } 744 }); 745 }; 746 747 jQuery.fn.position_last_top_menu_item = function( variables ) { 748 if( jQuery( this ).children( 'ul' ).length || jQuery( this).children( 'div' ).length ) { 749 var last_item = jQuery( this ), 750 last_item_left_pos = last_item.position().left, 751 last_item_width = last_item.outerWidth(), 752 last_item_child, 753 parent_container = jQuery( '.header-social .avada-row' ), 754 parent_container_left_pos = parent_container.position().left, 755 parent_container_width = parent_container.outerWidth(); 756 757 if( last_item.children( 'ul' ).length ) { 758 last_item_child = last_item.children( 'ul' ); 759 } else if( last_item.children('div').length ) { 760 last_item_child = last_item.children( 'div' ); 761 } 762 763 if( ! jQuery( 'body.rtl' ).length ) { 764 if( last_item_left_pos + last_item_child.outerWidth() > parent_container_left_pos + parent_container_width ) { 765 last_item_child.css( 'right', '-1px' ).css( 'left', 'auto' ); 766 767 last_item_child.find( '.sub-menu' ).each( function() { 768 jQuery( this ).css( 'right', '100px' ).css( 'left', 'auto' ); 769 }); 770 } 771 } else { 772 if( last_item_child.position().left < last_item_left_pos ) { 773 last_item_child.css( 'left', '-1px' ).css( 'right', 'auto' ); 774 775 last_item_child.find( '.sub-menu' ).each( function() { 776 jQuery( this ).css( 'left', '100px' ).css( 'right', 'auto' ); 777 }); 778 } 779 } 780 } 781 }; 782 783 // Waypoint 784 jQuery.fn.init_waypoint = function() { 785 if( jQuery().waypoint ) { 786 787 // Counters Box 788 jQuery('.fusion-counter-box').not('.fusion-modal .fusion-counter-box').waypoint(function() { 789 jQuery(this).find('.display-counter').each(function() { 790 jQuery(this).fusion_box_counting(); 791 }); 792 }, { 793 triggerOnce: true, 794 offset: 'bottom-in-view' 795 }); 796 797 // Counter Circles 798 jQuery('.counter-circle-wrapper').not('.fusion-modal .counter-circle-wrapper').waypoint(function() { 799 jQuery(this).fusion_draw_circles(); 800 }, { 801 triggerOnce: true, 802 offset: 'bottom-in-view' 803 }); 804 805 // Counter Circles Responsive Resizing 806 jQuery('.counter-circle-wrapper').not('.fusion-modal .counter-circle-wrapper').waypoint(function() { 807 var counter_circles = jQuery( this ); 808 809 jQuery(window).on('resize', function() { 810 counter_circles.fusion_redraw_circles(); 811 }); 812 }, { 813 triggerOnce: true, 814 offset: 'bottom-in-view' 815 }); 816 817 // Progressbar 818 jQuery( '.fusion-progressbar' ).not('.fusion-modal .fusion-progressbar').waypoint( function() { 819 jQuery(this).fusion_draw_progress(); 820 }, { 821 triggerOnce: true, 822 offset: 'bottom-in-view' 823 }); 824 825 // CSS Animations 826 jQuery('.fusion-animated').waypoint(function() { 827 jQuery(this).css('visibility', 'visible'); 828 829 // this code is executed for each appeared element 830 var animation_type = jQuery(this).data('animationtype'); 831 var animation_duration = jQuery(this).data('animationduration'); 832 833 jQuery(this).addClass('animated- '+animation_type); 834 835 if(animation_duration) { 836 jQuery(this).css('-moz-animation-duration', animation_duration+'s'); 837 jQuery(this).css('-webkit-animation-duration', animation_duration+'s'); 838 jQuery(this).css('-ms-animation-duration', animation_duration+'s'); 839 jQuery(this).css('-o-animation-duration', animation_duration+'s'); 840 jQuery(this).css('animation-duration', animation_duration+'s'); 841 } 842 },{ triggerOnce: true, offset: 'bottom-in-view' }); 843 } 844 }; 845 846 // animate counter boxes 847 jQuery.fn.fusion_box_counting = function() { 848 var count_value = jQuery( this ).data( 'value' ); 849 var count_direction = jQuery( this ).data( 'direction' ); 850 851 if( count_direction == 'down' ) { 852 jQuery(this).countTo( { from: count_value, to: 0, refreshInterval: 10, speed: 1000 } ); 853 } else { 854 jQuery(this).countTo( { from: 0, to: count_value, refreshInterval: 10, speed: 1000 } ); 855 } 856 }; 857 858 // Animate counter circles 859 jQuery.fn.fusion_draw_circles = function() { 860 var circle = jQuery( this ); 861 var countdown = circle.children( '.counter-circle' ).attr( 'data-countdown' ); 862 var filledcolor = circle.children( '.counter-circle' ).attr( 'data-filledcolor' ); 863 var unfilledcolor = circle.children( '.counter-circle' ).attr( 'data-unfilledcolor' ); 864 var scale = circle.children( '.counter-circle' ).attr( 'data-scale' ); 865 var size = circle.children( '.counter-circle' ).attr( 'data-size' );
866 var speed = circle.children( '.counter-circle' ).attr( 'data-speed' ); 867 var strokesize = circle.children( '.counter-circle' ).attr( 'data-strokesize' ); 868 var percentage = circle.children( '.counter-circle' ).attr( 'data-percent' ); 869 870 // Check if set values fit the container 871 if( circle.parent().width() < circle.width() ) { 872 size = circle.parent().width(); 873 strokesize = size / 220 * 11; 874 875 circle.css({ 'width': size, 'height': size, 'line-height': size + 'px' }); 876 circle.find( '.fusion-counter-circle' ).each( function() { 877 jQuery( this ).css({ 'width': size, 'height': size, 'line-height': size + 'px' }); 878 jQuery( this ).data( 'size', size ); 879 jQuery( this ).data( 'strokesize', strokesize ); 880 }); 881 } 882 883 if( scale ) { 884 scale = jQuery( 'body' ).css( 'color' ); 885 } 886 887 if( countdown ) { 888 circle.children( '.counter-circle' ).attr( 'data-percent', 100 ); 889 890 circle.children( '.counter-circle' ).easyPieChart({ 891 barColor: filledcolor, 892 trackColor: unfilledcolor, 893 scaleColor: scale, 894 scaleLength: 5, 895 lineCap: 'round', 896 lineWidth: strokesize, 897 size: size, 898 rotate: 0, 899 animate: { 900 duration: speed, enabled: true 901 } 902 }); 903 circle.children( '.counter-circle' ).data( 'easyPieChart' ).enableAnimation(); 904 circle.children( '.counter-circle' ).data( 'easyPieChart' ).update( percentage ); 905 } else { 906 circle.children( '.counter-circle' ).easyPieChart({ 907 barColor: filledcolor, 908 trackColor: unfilledcolor, 909 scaleColor: scale, 910 scaleLength: 5, 911 lineCap: 'round', 912 lineWidth: strokesize, 913 size: size, 914 rotate: 0, 915 animate: { 916 duration: speed, enabled: true 917 } 918 }); 919 } 920 }; 921 922 jQuery.fn.fusion_redraw_circles = function() { 923 var counter_circles_wrapper = jQuery( this ); 924 counter_circles_wrapper.attr( 'data-originalsize', counter_circles_wrapper.width() ); 925 var fusion_counters_circle_width = counter_circles_wrapper.parent().width(); 926 927 if( fusion_counters_circle_width < counter_circles_wrapper.data( 'originalsize' ) ) { 928 929 counter_circles_wrapper.css({ 'width': fusion_counters_circle_width, 'height': fusion_counters_circle_width, 'line-height': fusion_counters_circle_width + 'px' }); 930 counter_circles_wrapper.find( '.fusion-counter-circle' ).each( function() { 931 jQuery( this ).css({ 'width': fusion_counters_circle_width, 'height': fusion_counters_circle_width, 'line-height': fusion_counters_circle_width + 'px' }); 932 jQuery( this ).data( 'size', fusion_counters_circle_width ); 933 jQuery( this ).data( 'strokesize', fusion_counters_circle_width / 220 * 11 ); 934 jQuery( this ).data( 'animate', false ); 935 jQuery( this ).attr( 'data-size', fusion_counters_circle_width ); 936 jQuery( this ).attr( 'data-strokesize', fusion_counters_circle_width / 220 * 11 ); 937 jQuery( this ).children( 'canvas' ).remove(); 938 jQuery( this ).removeData( 'easyPieChart' ); 939 }); 940 941 counter_circles_wrapper.fusion_draw_circles(); 942 } else if( fusion_counters_circle_width >= counter_circles_wrapper.data( 'originalsize' ) && counter_circles_wrapper.width() < counter_circles_wrapper.data( 'originalsize' ) ) { 943 var original_size = counter_circles_wrapper.data( 'originalsize' ); 944 945 counter_circles_wrapper.css({ 'width': original_size, 'height': original_size, 'line-height': original_size + 'px' }); 946 counter_circles_wrapper.find( '.fusion-counter-circle' ).each( function() { 947 jQuery( this ).css({ 'width': original_size, 'height': original_size, 'line-height': original_size + 'px' }); 948 jQuery( this ).data( 'size', original_size ); 949 jQuery( this ).data( 'strokesize', original_size / 220 * 11 ); 950 jQuery( this ).data( 'animate', false ); 951 jQuery( this ).attr( 'data-size', original_size ); 952 jQuery( this ).attr( 'data-strokesize', original_size / 220 * 11 ); 953 jQuery( this ).children( 'canvas' ).remove(); 954 jQuery( this ).removeData( 'easyPieChart' ); 955 }); 956 957 counter_circles_wrapper.fusion_draw_circles(); 958 } 959 }; 960 961 // animate progress bar 962 jQuery.fn.fusion_draw_progress = function() { 963 var progressbar = jQuery( this ); 964 if ( jQuery( 'html' ).hasClass( 'lt-ie9' ) ) { 965 progressbar.css( 'visibility', 'visible' ); 966 progressbar.each( function() { 967 var percentage = progressbar.find( '.progress' ).attr("aria-valuenow"); 968 progressbar.find( '.progress' ).css( 'width', '0%' ); 969 progressbar.find( '.progress' ).animate( { 970 width: percentage+'%' 971 }, 'slow' ); 972 } ); 973 } else { 974 progressbar.find( '.progress' ).css( "width", function() { 975 return jQuery( this ).attr( "aria-valuenow" ) + "%"; 976 }); 977 } 978 }; 979 980 // set flip boxes equal front/back height 981 jQuery.fn.fusion_calc_flip_boxes_height = function() { 982 var flip_box = jQuery( this ); 983 var outer_height, height, top_margin = 0; 984 985 flip_box.find( '.flip-box-front' ).css( 'min-height', '' ); 986 flip_box.find( '.flip-box-back' ).css( 'min-height', '' ); 987 flip_box.find( '.flip-box-front-inner' ).css( 'margin-top', '' ); 988 flip_box.find( '.flip-box-back-inner' ).css( 'margin-top', '' ); 989 flip_box.css( 'min-height', '' ); 990 991 setTimeout( function() { 992 if( flip_box.find( '.flip-box-front' ).outerHeight() > flip_box.find( '.flip-box-back' ).outerHeight() ) { 993 height = flip_box.find( '.flip-box-front' ).height(); 994 if( cssua.ua.ie && cssua.ua.ie.substr(0, 1) == '8' ) { 995 outer_height = flip_box.find( '.flip-box-front' ).height(); 996 } else { 997 outer_height = flip_box.find( '.flip-box-front' ).outerHeight(); 998 } 999 top_margin = ( height - flip_box.find( '.flip-box-back-inner' ).outerHeight() ) / 2; 1000 1001 flip_box.find( '.flip-box-back' ).css( 'min-height', outer_height ); 1002 flip_box.css( 'min-height', outer_height ); 1003 flip_box.find( '.flip-box-back-inner' ).css( 'margin-top', top_margin ); 1004 } else { 1005 height = flip_box.find( '.flip-box-back' ).height(); 1006 if( cssua.ua.ie && cssua.ua.ie.substr(0, 1) == '8' ) { 1007 outer_height = flip_box.find( '.flip-box-back' ).height(); 1008 } else { 1009 outer_height = flip_box.find( '.flip-box-back' ).outerHeight(); 1010 } 1011 top_margin = ( height - flip_box.find( '.flip-box-front-inner' ).outerHeight() ) / 2; 1012 1013 flip_box.find( '.flip-box-front' ).css( 'min-height', outer_height ); 1014 flip_box.css( 'min-height', outer_height ); 1015 flip_box.find( '.flip-box-front-inner' ).css( 'margin-top', top_margin ); 1016 } 1017 1018 if( cssua.ua.ie && cssua.ua.ie.substr(0, 1) == '8' ) { 1019 flip_box.find( '.flip-box-back' ).css( 'height', '100%' ); 1020 } 1021 1022 }, 100 ); 1023 }; 1024 1025 // fusion scroller plugin to change css while scrolling 1026 jQuery.fn.fusion_scroller = function( options ) { 1027 var settings = jQuery.extend({ 1028 type: 'opacity', 1029 offset: 0, 1030 end_offset: '' 1031 }, options ); 1032 1033 var divs = jQuery(this); 1034 1035 divs.each(function() { 1036 var offset, height, end_offset; 1037 var current_element = this; 1038 1039 jQuery(window).on('scroll', function() { 1040 offset = jQuery(current_element).offset().top; 1041 if(jQuery('body').hasClass('admin-bar')) { 1042 offset = jQuery(current_element).offset().top - jQuery('#wpadminbar').outerHeight(); 1043 } 1044 if(settings.offset > 0) { 1045 offset = jQuery(current_element).offset().top - settings.offset; 1046 } 1047 height = jQuery(current_element).outerHeight(); 1048 1049 end_offset = offset + height; 1050 if(settings.end_offset) { 1051 end_offset = jQuery(settings.end_offset).offset().top; 1052 } 1053 1054 var st = jQuery(this).scrollTop(); 1055 1056 if(st >= offset && st <= end_offset) { 1057 var diff = end_offset - st; 1058 var diff_percentage = (diff / height) * 100; 1059 1060 if(settings.type == 'opacity') { 1061 var opacity = (diff_percentage / 100) * 1; 1062 jQuery(current_element).css({ 1063 'opacity': opacity 1064 }); 1065 } else if(settings.type == 'blur') { 1066 var diff_percentage = 100 - diff_percentage; 1067 var blur = 'blur(' + ((diff_percentage / 100) * 50) + 'px)'; 1068 jQuery(current_element).css({ 1069 '-webkit-filter': blur, 1070 '-ms-filter': blur, 1071 '-o-filter': blur, 1072 '-moz-filter': blur, 1073 'filter': blur 1074 }); 1075 } else if(settings.type == 'fading_blur') { 1076 var opacity = (diff_percentage / 100) * 1; 1077 var diff_percentage = 100 - diff_percentage; 1078 var blur = 'blur(' + ((diff_percentage / 100) * 50) + 'px)'; 1079 jQuery(current_element).css({ 1080 '-webkit-filter': blur, 1081 '-ms-filter': blur, 1082 '-o-filter': blur, 1083 '-moz-filter': blur, 1084 'filter': blur, 1085 'opacity': opacity 1086 }); 1087 } 1088 } 1089 1090 if( st < offset ) { 1091 if(settings.type == 'opacity') { 1092 jQuery(current_element).css({ 1093 'opacity': 1 1094 }); 1095 } else if(settings.type == 'blur') { 1096 blur = 'blur(0px)'; 1097 jQuery(current_element).css({ 1098 '-webkit-filter': blur, 1099 '-ms-filter': blur, 1100 '-o-filter': blur, 1101 '-moz-filter': blur, 1102 'filter': blur 1103 }); 1104 } else if(settings.type == 'fading_blur') { 1105 blur = 'blur(0px)'; 1106 jQuery(current_element).css({ 1107 'opacity': 1, 1108 '-webkit-filter': blur, 1109 '-ms-filter': blur, 1110 '-o-filter': blur, 1111 '-moz-filter': blur, 1112 'filter': blur 1113 }); 1114 } 1115 } 1116 }); 1117 }); 1118 }; 1119 1120 // set flip boxes equal front/back height 1121 jQuery.fn.fusion_switch_tab_on_link_click = function() { 1122 if( document.location.hash && jQuery( this ).find( '.nav-tabs li a[href="' + document.location.hash + '"]' ).length ) { 1123 jQuery( this ).find( '.nav-tabs li' ).removeClass( 'active' ); 1124 jQuery( this ).find( '.nav-tabs li a[href="' + document.location.hash + '"]' ).parent().addClass( 'active' ); 1125 1126 jQuery( this ).find( '.tab-content .tab-pane' ).removeClass( 'in' ).removeClass( 'active' ); 1127 jQuery( this ).find( '.tab-content .tab-pane[id="' + document.location.hash.split('#')[1] + '"]' ).addClass( 'in' ).addClass( 'active' ); 1128 } 1129 1130 if( document.location.hash && jQuery( this ).find( '.nav-tabs li a[id="' + window.location.href.split('#')[1] + '"]' ).length ) { 1131 jQuery( this ).find( '.nav-tabs li' ).removeClass( 'active' ); 1132 jQuery( this ).find( '.nav-tabs li a[id="' + window.location.href.split('#')[1] + '"]' ).parent().addClass( 'active' ); 1133 1134 jQuery( this ).find( '.tab-content .tab-pane' ).removeClass( 'in' ).removeClass( 'active' ); 1135 jQuery( this ).find( '.tab-content .tab-pane[id="' + jQuery( this ).find( '.nav-tabs li a[id="' + window.location.href.split('#')[1] + '"]' ).attr( 'href' ).split('#')[1] + '"]' ).addClass( 'in' ).addClass( 'active' ); 1136 } 1137 }; 1138 1139 // max height for columns and content boxes 1140 jQuery.fn.equalHeights = function( min_height, max_height ) { 1141 if( Modernizr.mq( 'only screen and (min-width: 800px)' ) || Modernizr.mq( 'only screen and (min-device-width: 768px) and (max-device-width: 1366px) and (orientation: portrait)' ) ) { 1142 var tallest = ( min_height ) ? min_height : 0; 1143 1144 this.each(function() { 1145 jQuery( this ).css( 'min-height', '0' ); 1146 jQuery( this ).css('height', 'auto' ); 1147 1148 if(jQuery( this ).outerHeight() > tallest) { 1149 tallest = jQuery( this ).outerHeight(); 1150 } 1151 }); 1152 1153 if( ( max_height ) && tallest > max_height) { 1154 tallest = max_height; 1155 } 1156 return this.each(function() { 1157 jQuery( this ).css( 'min-height', tallest ).css( 'overflow', 'auto' ); 1158 }); 1159 } else { 1160 return this.each(function() { 1161 jQuery( this ).css( 'min-height', '' ).css( 'overflow', 'auto' ); 1162 }); 1163 } 1164 }; 1165 1166 // Reinitialize google map; needed when maps are loaded inside of hidden containers 1167 jQuery.fn.reinitialize_google_map = function() { 1168 var fusion_map_object = jQuery( this ).data( 'plugin_fusion_maps' ), 1169 map = fusion_map_object.map, 1170 center = map.getCenter(); 1171 1172 google.maps.event.trigger( map, 'resize' ); 1173 map.setCenter( center ); 1174 }; 1175 1176})( jQuery ); 1177 1178jQuery(window).load(function() { // start window_load_1 1179 // Static layout 1180 if( js_local_vars.is_responsive == '0' ) { 1181 var column_classes = ['col-sm-0', 'col-sm-1', 'col-sm-2', 'col-sm-3', 'col-sm-4', 'col-sm-5', 'col-sm-6', 'col-sm-7', 'col-sm-8', 'col-sm-9', 'col-sm-10', 'col-sm-11', 'col-sm-12']; 1182 jQuery( '.col-sm-1, .col-sm-2, .col-sm-3, .col-sm-4, .col-sm-5, .col-sm-6, .col-sm-7, .col-sm-8, .col-sm-9, .col-sm-10, .col-sm-11, .col-sm-12' ).each( function() { 1183 for( var i = 0; i < column_classes.length; i++ ) { 1184 if( jQuery( this ).attr('class').indexOf( column_classes[i] ) !== -1 ) { 1185 jQuery( this ).addClass( 'col-xs-' + i ); 1186 } 1187 } 1188 }); 1189 } 1190 1191 // Initialize Waypoint
1192 jQuery.waypoints( 'viewportHeight' ); 1193 setTimeout( function() { 1194 jQuery(window).init_waypoint(); 1195 }, 300 ); 1196 1197 // Counters Box - Modals 1198 jQuery('.fusion-modal .fusion-counter-box').each(function() { 1199 jQuery(this).appear(function() { 1200 jQuery(this).find('.display-counter').each(function() { 1201 jQuery(this).fusion_box_counting(); 1202 }); 1203 }); 1204 }); 1205 1206 // Counter Circles - Modals 1207 jQuery('.fusion-modal .counter-circle-wrapper').each(function() { 1208 jQuery(this).appear(function() { 1209 jQuery(this).fusion_draw_circles(); 1210 }); 1211 }); 1212 1213 // Progressbar - Modals 1214 jQuery('.fusion-modal .fusion-progressbar').each(function() { 1215 jQuery(this).appear(function() { 1216 jQuery(this).fusion_draw_progress(); 1217 }); 1218 }); 1219 1220 // Flip Boxes 1221 jQuery( '.flip-box-inner-wrapper' ).each( function() { 1222 jQuery( this ).fusion_calc_flip_boxes_height(); 1223 }); 1224 1225 // Testimonials 1226 function onBefore( curr, next, opts, fwd ) { 1227 var $ht = jQuery( this ).height(); 1228 1229 //set the active testimonial class for resize event 1230 jQuery( this ).parent().children().removeClass( 'active-testimonial' ); 1231 jQuery( this ).addClass( 'active-testimonial' ); 1232 1233 //set the container's height to that of the current slide 1234 jQuery( this ).parent().animate( {height: $ht}, 500 ); 1235 } 1236 1237 if( jQuery().cycle ) { 1238 var reviews_cycle_args = { 1239 fx: 'fade', 1240 before: onBefore, 1241 containerResize: 0, 1242 containerResizeHeight: 1, 1243 height: 'auto', 1244 width: '100%', 1245 fit: 1, 1246 speed: 500, 1247 delay: 0 1248 }; 1249 1250 if ( js_local_vars.testimonials_speed ) { 1251 reviews_cycle_args.timeout = parseInt(js_local_vars.testimonials_speed); 1252 } 1253 1254 reviews_cycle_args.pager = '.testimonial-pagination'; 1255 1256 jQuery( '.fusion-testimonials .reviews' ).each( function() { 1257 if( jQuery( this ).children().length == 1 ) { 1258 jQuery( this ).children().fadeIn(); 1259 } 1260 1261 reviews_cycle_args.pager = '#' + jQuery( this ).parent().find( '.testimonial-pagination' ).attr( 'id'); 1262 jQuery( this ).cycle( reviews_cycle_args ); 1263 }); 1264 1265 jQuery(window).resize(function() { 1266 jQuery( '.fusion-testimonials .reviews' ).each( function() { 1267 jQuery( this ).css( 'height', jQuery( this ).children( '.active-testimonial' ).height() ); 1268 }); 1269 }); 1270 } 1271 1272 // Toggles 1273 jQuery( '.fusion-accordian .panel-title a' ).on( 'click', function () { 1274 var clicked_toggle = jQuery( this ); 1275 var toggle_content_to_activate = jQuery( jQuery( this ).data( 'target' ) ).find( '.panel-body' ); 1276 1277 // To make premium sliders work in tabs 1278 jQuery(window).trigger('resize'); 1279 1280 if( clicked_toggle.hasClass( 'active' ) ) { 1281 clicked_toggle.parents( '.fusion-accordian ').find( '.panel-title a' ).removeClass( 'active' ); 1282 } else { 1283 clicked_toggle.parents( '.fusion-accordian ').find( '.panel-title a' ).removeClass( 'active' ); 1284 clicked_toggle.addClass( 'active' ); 1285 1286 setTimeout( function(){ 1287 toggle_content_to_activate.find( '.shortcode-map' ).each(function() { 1288 jQuery( this ).reinitialize_google_map(); 1289 }); 1290 1291 if( toggle_content_to_activate.find( '.es-carousel-wrapper' ).length ) { 1292 generateCarousel(); 1293 } 1294 1295 toggle_content_to_activate.find( '.portfolio' ).each( function() { 1296 jQuery( this).find( '.portfolio-wrapper' ).isotope( 'layout' ); 1297 }); 1298 1299 if( toggle_content_to_activate.find( '.flexslider' ).length ) { 1300 jQuery( window ).trigger( 'resize' ); 1301 } 1302 1303 toggle_content_to_activate.find( '.fusion-blog-shortcode' ).each( function() { 1304 var columns = 2; 1305 for( i = 1; i < 7; i++ ) { 1306 if( jQuery( this ).find( '.grid-layout' ).hasClass( 'grid-layout-' + i ) ) { 1307 columns = i; 1308 } 1309 } 1310 1311 var grid_width = Math.floor( 100 / columns * 100 ) / 100 + '%'; 1312 jQuery( this ).find( '.grid-layout' ).find( '.post' ).css( 'width', grid_width ); 1313 1314 jQuery( this).find( '.grid-layout' ).isotope(); 1315 1316 calc_select_arrow_dimensions(); 1317 }); 1318 }, 350); 1319 } 1320 }); 1321 1322 // Initialize Bootstrap Modals 1323 jQuery( '.fusion-modal' ).each( function() { 1324 jQuery( '#wrapper' ).append( jQuery( this ) ); 1325 }); 1326 1327 jQuery( '.fusion-modal' ).bind('hidden.bs.modal', function () { 1328 jQuery( 'html' ).css( 'overflow', '' ); 1329 }); 1330 1331 jQuery( '.fusion-modal' ).bind('show.bs.modal', function () { 1332 jQuery( 'html' ).css( 'overflow', 'visible' ); 1333 1334 var modal_window = jQuery ( this ); 1335 1336 // To make premium sliders work in tabs 1337 jQuery(window).trigger('resize'); 1338 1339 setTimeout( function(){ 1340 modal_window.find( '.shortcode-map' ).each(function() { 1341 jQuery( this ).reinitialize_google_map(); 1342 }); 1343 1344 if( modal_window.find( '.es-carousel-wrapper' ).length ) { 1345 generateCarousel(); 1346 } 1347 1348 modal_window.find( '.portfolio' ).each( function() { 1349 jQuery( this ).find( '.portfolio-wrapper' ).isotope( 'layout' ); 1350 }); 1351 1352 if( modal_window.find( '.flexslider' ).length ) { 1353 jQuery( window ).trigger( 'resize' ); 1354 } 1355 1356 modal_window.find( '.fusion-blog-shortcode' ).each( function() { 1357 var columns = 2; 1358 for( i = 1; i < 7; i++ ) { 1359 if( jQuery( this ).find( '.grid-layout' ).hasClass( 'grid-layout-' + i ) ) { 1360 columns = i; 1361 } 1362 } 1363 1364 var grid_width = Math.floor( 100 / columns * 100 ) / 100 + '%'; 1365 jQuery( this ).find( '.grid-layout' ).find( '.post' ).css( 'width', grid_width ); 1366 1367 jQuery( this).find( '.grid-layout' ).isotope(); 1368
1369 calc_select_arrow_dimensions(); 1370 }); 1371 }, 350); 1372 }); 1373 1374 if( jQuery( '#sliders-container .tfs-slider' ).data( 'parallax' ) == 1 ) { 1375 jQuery( '.fusion-modal' ).css( 'top', jQuery( '.header-wrapper' ).height() ); 1376 } 1377 1378 // stop videos in modals when closed 1379 jQuery( '.fusion-modal' ).each(function() { 1380 jQuery( this ).on( 'hide.bs.modal', function() { 1381 1382 // Youtube 1383 jQuery( this ).find('iframe').each(function(i) { 1384 var func = 'stopVideo'; 1385 this.contentWindow.postMessage('{"event":"command","func":"' + func + '","args":""}', '*'); 1386 }); 1387 1388 // Vimeo 1389 jQuery( this ).find('.fusion-vimeo iframe').each(function(i) { 1390 $f(this).api('pause'); 1391 }); 1392 }); 1393 }); 1394 1395 jQuery('[data-toggle=modal]').on('click', function(e) { 1396 e.preventDefault(); 1397 }); 1398 1399 jQuery( '.fusion-modal-text-link' ).click( function( e ) { 1400 e.preventDefault(); 1401 }); 1402 1403 if(cssua.ua.mobile || cssua.ua.tablet_pc) { 1404 jQuery('.fusion-popover, .fusion-tooltip').each(function() { 1405 jQuery(this).attr('data-trigger', 'click'); 1406 jQuery(this).data('trigger', 'click'); 1407 }); 1408 } 1409 1410 // Initialize Bootstrap Popovers 1411 jQuery( '[data-toggle~="popover"]' ).popover({ 1412 container: 'body' 1413 }); 1414 1415 // Initialize Bootstrap Tabs 1416 // Initialize vertical tabs content container height 1417 if( jQuery( '.vertical-tabs' ).length ) { 1418 jQuery( '.vertical-tabs .tab-content .tab-pane' ).each( function() { 1419 if( jQuery ( this ).parents( '.vertical-tabs' ).hasClass( 'clean' ) ) { 1420 jQuery ( this ).css( 'min-height', jQuery( '.vertical-tabs .nav-tabs' ).outerHeight() - 10 ); 1421 } else { 1422 jQuery ( this ).css( 'min-height', jQuery( '.vertical-tabs .nav-tabs' ).outerHeight() ); 1423 } 1424 1425 if( jQuery ( this ).find( '.video-shortcode' ).length ) { 1426 var video_width = parseInt( jQuery ( this ).find( '.fusion-video' ).css( 'max-width' ).replace( 'px', '' ) ); 1427 jQuery ( this ).css({ 1428 'float': 'none', 1429 'max-width': video_width + 60 1430 }); 1431 } 1432 }); 1433 } 1434 1435 jQuery( window ).on( 'resize', function() { 1436 if( jQuery( '.vertical-tabs' ).length ) { 1437 jQuery( '.vertical-tabs .tab-content .tab-pane' ).css( 'min-height', jQuery( '.vertical-tabs .nav-tabs' ).outerHeight() ); 1438 } 1439 }); 1440 1441 // Initialize Bootstrap Tooltip 1442 jQuery( '[data-toggle~="tooltip"]' ).tooltip({ 1443 container: 'body' 1444 }); 1445 1446 generateCarousel(); 1447 1448 if(jQuery().flexslider && jQuery('.woocommerce .images #carousel').length >= 1) { 1449 var WooThumbWidth = 100; 1450 if(jQuery('body.woocommerce .sidebar').is(':visible')) { 1451 wooThumbWidth = 100; 1452 } else { 1453 wooThumbWidth = 118; 1454 } 1455 1456 if(typeof jQuery('.woocommerce .images #carousel').data('flexslider') !== 'undefined') { 1457 jQuery('.woocommerce .images #carousel').flexslider('destroy'); 1458 jQuery('.woocommerce .images #slider').flexslider('destroy'); 1459 } 1460 1461 jQuery('.woocommerce .images #carousel').flexslider({ 1462 animation: 'slide', 1463 controlNav: false, 1464 directionNav: false, 1465 animationLoop: false, 1466 slideshow: false, 1467 itemWidth: wooThumbWidth, 1468 itemMargin: 9, 1469 touch: false, 1470 useCSS: false, 1471 asNavFor: '.woocommerce .images #slider', 1472 smoothHeight: false, 1473 prevText: '', 1474 nextText: '' 1475 }); 1476 1477 jQuery('.woocommerce .images #slider').flexslider({ 1478 animation: 'slide', 1479 controlNav: false, 1480 animationLoop: false, 1481 slideshow: false, 1482 smoothHeight: true, 1483 touch: true, 1484 useCSS: false, 1485 sync: '.woocommerce .images #carousel', 1486 prevText: '', 1487 nextText: '' 1488 }); 1489 } 1490 1491 if(jQuery().flexslider && jQuery('.flexslider-attachments').length >= 1) { 1492 if(typeof jQuery('.flexslider-attachments').data('flexslider') !== 'undefined') { 1493 jQuery('.flexslider-attachments').flexslider('destroy'); 1494 } 1495 1496 jQuery('.flexslider-attachments').flexslider({ 1497 slideshow: Boolean(Number(js_local_vars.slideshow_autoplay)), 1498 slideshowSpeed: js_local_vars.slideshow_speed, 1499 video: false, 1500 smoothHeight: false, 1501 pauseOnHover: false, 1502 useCSS: false, 1503 prevText: '', 1504 nextText: '', 1505 controlNav: 'thumbnails' 1506 }); 1507 } 1508 1509 jQuery('.content-boxes-icon-boxed').each(function() { 1510 jQuery(this).find('.content-box-column .content-wrapper-boxed').equalHeights(); 1511 jQuery(this).find('.content-box-column .content-wrapper-boxed').css( 'overflow', 'visible' ); 1512 }); 1513 1514 jQuery(window).on( 'resize', function() { 1515 jQuery('.content-boxes-icon-boxed').each(function() { 1516 jQuery(this).find('.content-box-column .content-wrapper-boxed').equalHeights(); 1517 jQuery(this).find('.content-box-column .content-wrapper-boxed').css( 'overflow', 'visible' ); 1518 }); 1519 }); 1520 1521 jQuery('.double-sidebars.woocommerce .social-share > li').equalHeights(); 1522 1523 jQuery( '.fusion-fullwidth.equal-height-columns' ).each( function() { 1524 jQuery( this ).find( '.fusion-column .fusion-column-wrapper' ).equalHeights(); 1525 }); 1526 1527 jQuery(window).on( 'resize', function() { 1528 jQuery( '.fusion-fullwidth.equal-height-columns' ).each( function() { 1529 jQuery( this ).find( '.fusion-layout-column .fusion-column-wrapper' ).equalHeights(); 1530 }); 1531 }); 1532 1533 /** 1534 * Icon Hack for iOS7 on Buttons 1535 */ 1536 if(cssua.ua.ios) { 1537 var ios_version = parseInt(cssua.ua.ios);
1538 if(ios_version == 7) { 1539 jQuery('.button-icon-divider-left, .button-icon-divider-right').each(function() { 1540 var height = jQuery(this).parent().outerHeight(); 1541 jQuery(this).css('height', height); 1542 1543 }); 1544 } 1545 } 1546}); // end window_load_1 1547 1548jQuery(document).ready(function($) { // start document_ready_1 1549 1550 // Check if the side header is larger than browser window in height and make it scrolling if needed 1551 if( js_local_vars.header_position != 'Top' ) { 1552 var resize_width = jQuery(window).width(); 1553 var resize_height = jQuery(window).height(); 1554 1555 jQuery(window).on( 'resize', function() { 1556 if( jQuery(window).width() != resize_width || jQuery(window).height() != resize_height ) { 1557 if( jQuery( window ).height() < jQuery( '.side-header-wrapper' ).height() ) { 1558 jQuery('body').css( 'position', 'relative' ); 1559 1560 if( jQuery( '.layout-boxed-mode' ).length && js_local_vars.header_position == 'Right' ) { 1561 jQuery( '.side-header-wrapper' ).css( 'position', 'absolute' ); 1562 1563 } else if( jQuery( 'body.rtl' ).length && js_local_vars.header_position == 'Left' ) { 1564 jQuery( '#side-header' ).css({ 1565 'position': 'absolute', 1566 'top': '0' 1567 }); 1568 jQuery( '.side-header-wrapper' ).css( 'position', 'absolute' ); 1569 jQuery( '#slidingbar-area' ).css( 'top', '0' ); 1570 } else { 1571 jQuery( '#slidingbar-area' ).css( 'top', '0' ); 1572 1573 jQuery( '#side-header' ).css({ 1574 'position': 'absolute', 1575 'top': '0' 1576 }); 1577 } 1578 } else { 1579 jQuery('body').css( 'position', '' ); 1580 1581 jQuery( '#slidingbar-area' ).css( 'top', '' ); 1582 1583 jQuery( '#side-header' ).css({ 1584 'position': '', 1585 'top': '' 1586 }); 1587 1588 jQuery( '.side-header-wrapper' ).css( 'position', '' ); 1589 } 1590 1591 resize_width = jQuery(window).width(); 1592 resize_height = jQuery(window).height(); 1593 } 1594 }); 1595 1596 if( jQuery( window ).height() < jQuery( '.side-header-wrapper' ).height() ) { 1597 jQuery('body').css( 'position', 'relative' ); 1598 1599 if( jQuery( '.layout-boxed-mode' ).length && js_local_vars.header_position == 'Right' ) { 1600 jQuery( '.side-header-wrapper' ).css( 'position', 'absolute' ); 1601 1602 } else if( jQuery( 'body.rtl' ).length && js_local_vars.header_position == 'Left' ) { 1603 jQuery( '#side-header' ).css({ 1604 'position': 'absolute', 1605 'top': '0' 1606 }); 1607 jQuery( '.side-header-wrapper' ).css( 'position', 'absolute' ); 1608 jQuery( '#slidingbar-area' ).css( 'top', '0' ); 1609 } else { 1610 jQuery( '#slidingbar-area' ).css( 'top', '0' ); 1611 1612 jQuery( '#side-header' ).css({ 1613 'position': 'absolute', 1614 'top': '0' 1615 }); 1616 } 1617 } 1618 } 1619 1620 // IE8 Fix 1621 jQuery('#nav > ul > li:last-child').addClass('last-menu-item'); 1622 jQuery('#sticky-nav > ul > li:last-child').addClass('last-menu-item'); 1623 if(cssua.ua.ie) { 1624 jQuery('.header-shadow').removeClass('header-shadow'); 1625 } 1626 1627 if(js_local_vars.disable_mobile_animate_css == '1' && cssua.ua.mobile) { 1628 jQuery('body').addClass('dont-animate'); 1629 } else { 1630 jQuery('body').addClass('do-animate'); 1631 } 1632 1633 // Sidebar Position 1634 if(jQuery('#sidebar-2').length >= 1) { 1635 var sidebar_1_float = jQuery('#sidebar').css('float'); 1636 jQuery('body').addClass('sidebar-position-' + sidebar_1_float); 1637 } 1638 1639 jQuery('.fusion-flip-box').mouseover(function() { 1640 jQuery(this).addClass('hover'); 1641 }); 1642 1643 jQuery('.fusion-flip-box').mouseout(function() { 1644 jQuery(this).removeClass('hover'); 1645 }); 1646 1647 jQuery('.fusion-accordian .panel-title a').click(function(e) { 1648 e.preventDefault(); 1649 }); 1650 1651 // Top Menu last item positioning 1652 jQuery('.header-wrapper .top-menu > ul > li:last-child').position_last_top_menu_item(); 1653 1654 // Make navbar overflow visible 1655 jQuery( '.fusion-navbar-nav' ).mouseenter( function() { 1656 jQuery( this ).css( 'overflow', '' ); 1657 }); 1658 1659 // Calculate main menu dropdown submenu position 1660 if( jQuery.fn.fusion_position_menu_dropdown ) { 1661 jQuery( '.fusion-navbar-nav .fusion-dropdown-menu, .fusion-navbar-nav .fusion-dropdown-menu li' ).mouseenter( function() { 1662 jQuery( this ).fusion_position_menu_dropdown(); 1663 }); 1664 1665 jQuery( '.fusion-navbar-nav .fusion-dropdown-menu > ul > li' ).each( function() { 1666 jQuery( this ).walk_through_menu_items(); 1667 }); 1668 1669 jQuery(window).on( 'resize', function() { 1670 jQuery( '.fusion-navbar-nav .fusion-dropdown-menu > ul > li' ).each( function() { 1671 jQuery( this ).walk_through_menu_items(); 1672 }); 1673 }); 1674 } 1675 1676 1677 // Set overflow state of main nav items; done to get rid of menu overflow 1678 jQuery( '.fusion-navbar-nav .fusion-dropdown-menu ' ).mouseenter( function() { 1679 jQuery( this ).css( 'overflow', 'visible' ); 1680 }); 1681 jQuery( '.fusion-navbar-nav .fusion-dropdown-menu' ).mouseleave( function() { 1682 jQuery( this ).css( 'overflow', '' ); 1683 }); 1684 1685 // Position main menu cart dropdown correctly 1686 if( js_local_vars.header_position == 'Top' ) { 1687 if( jQuery( '.fusion-navbar-nav .cart' ).length ) { 1688 jQuery( '.fusion-navbar-nav .cart' ).mouseenter(function(e) { 1689 // position main menu search box on click positioning 1690 if( ! jQuery( 'body.rtl' ).length && jQuery(this).find( '.cart-contents' ).length && jQuery(this).find( '.cart-contents' ).offset().left < 0 ) { 1691 jQuery (this ).find( '.cart-contents' ).css({ 1692 'left': '0', 1693 'right': 'auto' 1694 }); 1695 } 1696 1697 if( jQuery( 'body.rtl' ).length && jQuery(this).find( '.cart-contents' ).length && jQuery( this ).find( '.cart-contents' ).offset().left + jQuery( this ).find( '.cart-contents' ).width() > jQuery( window ).width() ) { 1698 jQuery( this ).find( '.cart-contents' ).css({ 1699 'left': 'auto', 1700 'right': '0' 1701 }); 1702 } 1703 }); 1704 } 1705 1706 jQuery(window).on( 'resize', function() { 1707 jQuery( '.fusion-navbar-nav .cart' ).find( '.cart-contents' ).each( function() { 1708 var cart_dropdown = jQuery( this ), 1709 cart_dropdown_width = cart_dropdown.outerWidth(), 1710 cart_dropdown_left_edge = cart_dropdown.offset().left, 1711 cart_dropdown_right_edge = cart_dropdown_left_edge + cart_dropdown_width, 1712 cart_menu_item_left_edge = cart_dropdown.parent().offset().left, 1713 window_right_edge = jQuery( window ).width(); 1714 1715 1716 if( ! jQuery( 'body.rtl' ).length ) { 1717 if( ( cart_dropdown_left_edge < cart_menu_item_left_edge && cart_dropdown_left_edge < 0 ) || ( cart_dropdown_left_edge == cart_menu_item_left_edge && cart_dropdown_left_edge - cart_dropdown_width < 0 ) ) { 1718 cart_dropdown.css({ 1719 'left': '0', 1720 'right': 'auto' 1721 }); 1722 } else { 1723 cart_dropdown.css({ 1724 'left': 'auto', 1725 'right': '0' 1726 }); 1727 } 1728 } else { 1729 if( ( cart_dropdown_left_edge == cart_menu_item_left_edge && cart_dropdown_right_edge > window_right_edge ) || ( cart_dropdown_left_edge < cart_menu_item_left_edge && cart_dropdown_right_edge + cart_dropdown_width > window_right_edge ) ) { 1730 cart_dropdown.css({ 1731 'left': 'auto', 1732 'right': '0' 1733 }); 1734 } else { 1735 cart_dropdown.css({ 1736 'left': '0', 1737 'right': 'auto' 1738 }); 1739 } 1740 } 1741 }); 1742 }); 1743 } 1744 1745 // Position main menu cart dropdown correctly on side-header 1746 jQuery( '.fusion-navbar-nav .cart' ).find( '.cart-contents' ).position_cart_dropdown(); 1747 1748 jQuery(window).on( 'resize', function() { 1749 jQuery( '.fusion-navbar-nav .cart' ).find( '.cart-contents' ).position_cart_dropdown(); 1750 }); 1751 1752 // Position main menu search formn correctly on side-header 1753 jQuery( '.fusion-navbar-nav .search-link' ).click( function() { 1754 setTimeout( function() { 1755 jQuery( '.fusion-navbar-nav .search-link' ).parent().find( '.main-nav-search-form' ).position_menu_search_form(); 1756 }, 5 ); 1757 }); 1758 1759 jQuery(window).on( 'resize', function() { 1760 jQuery( '.fusion-navbar-nav .main-nav-search' ).find( '.main-nav-search-form' ).position_menu_search_form(); 1761 }); 1762 1763 // Calculate megamenu position 1764 if( jQuery.fn.fusion_position_megamenu ) { 1765 jQuery( '.fusion-navbar-nav' ).fusion_position_megamenu(); 1766 1767 jQuery( '.fusion-navbar-nav .fusion-megamenu-menu' ).mouseenter( function() { 1768 jQuery( this ).parent().fusion_position_megamenu(); 1769 }); 1770 1771 jQuery(window).resize(function() { 1772 jQuery( '.fusion-navbar-nav' ).fusion_position_megamenu(); 1773 }); 1774 } 1775 1776 // Calculate megamenu column widths 1777 if( jQuery.fn.fusion_position_megamenu ) {
1778 jQuery( '.fusion-navbar-nav' ).calc_mengamenu_responsive_column_widths(); 1779 1780 jQuery(window).resize(function() { 1781 jQuery( '.fusion-navbar-nav' ).calc_mengamenu_responsive_column_widths(); 1782 }); 1783 } 1784 1785 jQuery('.fusion-megamenu-menu').mouseenter(function() { 1786 if(jQuery(this).find('.shortcode-map').length >= 1) { 1787 jQuery(this).find('.shortcode-map').each(function() { 1788 jQuery( this ).reinitialize_google_map(); 1789 }); 1790 } 1791 }); 1792 1793 jQuery(".my-show").click(function(){ 1794 jQuery(".my-hidden").css('visibility', 'visible'); 1795 }); 1796 1797 if (jQuery(".demo_store").length ) { 1798 jQuery("#wrapper").css('margin-top', jQuery(".demo_store").outerHeight()); 1799 if(jQuery("#slidingbar-area").outerHeight() > 0) { 1800 jQuery(".header-wrapper").css('margin-top', '0'); 1801 } 1802 if(jQuery('.sticky-header').length ) { 1803 jQuery('.sticky-header').css('margin-top', jQuery('.demo_store').outerHeight()); 1804 } 1805 } 1806 1807 // sliding bar 1808 var slidingbar_state = 0; 1809 1810 if(jQuery('#slidingbar-area.open_onload').length ) { 1811 jQuery("div#slidingbar").slideDown(240,'easeOutQuad'); 1812 jQuery('.sb-toggle').addClass('open'); 1813 slidingbar_state = 1; 1814 1815 if(jQuery('#slidingbar .shortcode-map').length >= 1) { 1816 jQuery('#slidingbar').find('.shortcode-map').each(function() { 1817 jQuery( this ).reinitialize_google_map(); 1818 }); 1819 } 1820 1821 jQuery('#slidingbar-area').removeClass('open_onload'); 1822 } 1823 1824 jQuery( '.sb-toggle' ).click(function(){ 1825 //Expand 1826 if(slidingbar_state == 0) { 1827 jQuery( 'div#slidingbar' ).slideDown( 240, 'easeOutQuad' ); 1828 jQuery( '.sb-toggle' ).addClass( 'open' ); 1829 slidingbar_state = 1; 1830 1831 if(jQuery( '#slidingbar .shortcode-map' ).length ) { 1832 jQuery( '#slidingbar' ).find( '.shortcode-map' ).each(function() { 1833 jQuery( this ).reinitialize_google_map(); 1834 }); 1835 } 1836 1837 //Collapse 1838 } else if( slidingbar_state == 1 ) { 1839 jQuery( 'div#slidingbar' ).slideUp(240,'easeOutQuad'); 1840 jQuery( '.sb-toggle' ).removeClass( 'open' ); 1841 slidingbar_state = 0; 1842 } 1843 }); 1844 1845 // Foter without social icons 1846 if( ! jQuery( '.fusion-social-links-footer' ).find( '.fusion-social-networks' ).children().length ) { 1847 jQuery( '.fusion-social-links-footer' ).hide(); 1848 jQuery( '#footer .copyright' ).css( 'padding-bottom', '0' ); 1849 } 1850 1851 // to top 1852 if(jQuery().UItoTop) { 1853 if(cssua.ua.mobile && js_local_vars.status_totop_mobile == '1') { 1854 jQuery().UItoTop({ easingType: 'easeOutQuart' }); 1855 } else if( ! cssua.ua.mobile ) { 1856 jQuery().UItoTop({ easingType: 'easeOutQuart' }); 1857 } 1858 } 1859 1860 // sticky header resizing control 1861 jQuery(window).on('resize', function() { 1862 // check for woo demo bar which can take on 2 lines and thus sticky position must be calculated 1863 if(jQuery(".demo_store").length) { 1864 jQuery("#wrapper").css('margin-top', jQuery(".demo_store").outerHeight()); 1865 if(jQuery('.sticky-header').length) { 1866 jQuery(".sticky-header").css('margin-top', jQuery(".demo_store").outerHeight()); 1867 } 1868 } 1869 1870 if(jQuery(".sticky-header").length ) { 1871 if(jQuery(window).width() < 765) { 1872 jQuery('body.admin-bar #header-sticky.sticky-header').css('top', '46px'); 1873 } else { 1874 jQuery('body.admin-bar #header-sticky.sticky-header').css('top', '32px'); 1875 } 1876 } 1877 }); 1878 1879 //top nav 1880 jQuery('.header-wrapper .mobile-topnav-holder').append('<div class="mobile-selector"><span>'+js_local_vars.dropdown_goto+'</span></div>'); 1881 jQuery('.header-wrapper .mobile-topnav-holder .mobile-selector').append('<div class="selector-down"></div>'); 1882 jQuery('.header-wrapper .mobile-topnav-holder').append(jQuery('.header-wrapper .top-menu ul#snav').clone()); 1883 jQuery('.header-wrapper .mobile-topnav-holder ul#snav').attr("class","mobile-topnav"); 1884 jQuery('.header-wrapper .mobile-topnav-holder ul#snav').attr("id","mobile-nav"); 1885 jQuery('.header-wrapper .mobile-topnav-holder ul#mobile-nav').children('.cart').each(function () { 1886 jQuery(this).children('.my-cart-link').text(js_local_vars.mobile_nav_cart); 1887 jQuery(this).children('.cart-contents').remove(); 1888 }); 1889 jQuery('.header-wrapper .mobile-topnav-holder ul#mobile-nav li').children('.login-box').remove(); 1890 jQuery('.header-wrapper .mobile-topnav-holder ul#mobile-nav').children('li').each(function () { 1891 var classes = 'mobile-nav-item'; 1892 1893 if(jQuery(this).hasClass('current-menu-item') || jQuery(this).hasClass('current-menu-parent') || jQuery(this).hasClass('current-menu-ancestor')) { 1894 classes += ' mobile-current-nav-item'; 1895 } 1896 jQuery( this ).attr( 'class', classes ); 1897 1898 if( jQuery( this ).attr('id' ) ) { 1899 jQuery( this ).attr( 'id', jQuery( this ).attr( 'id' ).replace( 'menu-item', 'mobile-topmenu
1899-item' ) ); 1900 } 1901 jQuery( this ).attr( 'style', '' ); 1902 }); 1903 jQuery('.header-wrapper .mobile-topnav-holder .mobile-selector').click(function(){ 1904 jQuery('.header-wrapper .mobile-topnav-holder #mobile-nav').slideToggle(200,'easeOutQuad'); 1905 }); 1906 1907 //main nav 1908 if(js_local_vars.mobile_menu_design == 'classic') { 1909 jQuery('.header-wrapper .mobile-nav-holder').append('<div class="mobile-selector"><span>'+js_local_vars.dropdown_goto+'</span></div>'); 1910 jQuery('.header-wrapper .mobile-nav-holder .mobile-selector').append('<div class="selector-down"></div>'); 1911 } 1912 jQuery('.header-wrapper .mobile-nav-holder').append(jQuery('.header-wrapper .nav-holder .fusion-navbar-nav').clone()); 1913 jQuery('.header-wrapper .mobile-nav-holder .fusion-navbar-nav').attr("id","mobile-nav"); 1914 jQuery('.header-wrapper .mobile-nav-holder ul#mobile-nav').removeClass('fusion-navbar-nav'); 1915 jQuery('.header-wrapper .mobile-nav-holder ul#mobile-nav').children('.cart').remove(); 1916 jQuery('.header-wrapper .mobile-nav-holder ul#mobile-nav .mobile-nav-item').children('.login-box').remove(); 1917 1918 jQuery('.header-wrapper .mobile-nav-holder ul#mobile-nav li').children('#main-nav-search-link').each(function () { 1919 jQuery(this).parents('li').remove(); 1920 }); 1921 jQuery('.header-wrapper .mobile-nav-holder ul#mobile-nav').find('li').each(function () { 1922 var classes = 'mobile-nav-item'; 1923 1924 if(jQuery(this).hasClass('current-menu-item') || jQuery(this).hasClass('current-menu-parent') || jQuery(this).hasClass('current-menu-ancestor')) { 1925 classes += ' mobile-current-nav-item'; 1926 } 1927 jQuery( this ).attr( 'class', classes ); 1928 if( jQuery( this ).attr( 'id' ) ) { 1929 jQuery( this ).attr( 'id', jQuery( this ).attr( 'id' ).replace( 'menu-item', 'mobile-menu-item' ) ); 1930 } 1931 jQuery( this ).attr( 'style', '' ); 1932 }); 1933 jQuery('.header-wrapper .mobile-nav-holder .mobile-selector').click(function(){ 1934 if( jQuery('.header-wrapper .mobile-nav-holder #mobile-nav').hasClass( 'mobile-menu-expanded' ) ) { 1935 jQuery('.header-wrapper .mobile-nav-holder #mobile-nav').removeClass( 'mobile-menu-expanded' ); 1936 } else { 1937 jQuery('.header-wrapper .mobile-nav-holder #mobile-nav').addClass( 'mobile-menu-expanded' ); 1938 } 1939 jQuery('.header-wrapper .mobile-nav-holder #mobile-nav').slideToggle(200,'easeOutQuad'); 1940 }); 1941 1942 //side header main nav 1943 if(js_local_vars.mobile_menu_design == 'classic') { 1944 jQuery('.sh-mobile-nav-holder').append('<div class="mobile-selector"><span>'+js_local_vars.dropdown_goto+'</span></div>'); 1945 jQuery('.sh-mobile-nav-holder .mobile-selector').append('<div class="selector-down"></div>'); 1946 } 1947 jQuery('.sh-mobile-nav-holder').append(jQuery('.nav-holder .fusion-navbar-nav').clone()); 1948 jQuery('.sh-mobile-nav-holder .fusion-navbar-nav').attr("id","mobile-nav"); 1949 jQuery('.sh-mobile-nav-holder ul#mobile-nav').removeClass('fusion-navbar-nav'); 1950 jQuery('.sh-mobile-nav-holder ul#mobile-nav').children('.cart').remove(); 1951 jQuery('.sh-mobile-nav-holder ul#mobile-nav .mobile-nav-item').children('.login-box').remove(); 1952 1953 jQuery('.sh-mobile-nav-holder ul#mobile-nav li').children('#main-nav-search-link').each(function () { 1954 jQuery(this).parents('li').remove(); 1955 }); 1956 jQuery('.sh-mobile-nav-holder ul#mobile-nav').find('li').each(function () { 1957 var classes = 'mobile-nav-item'; 1958 1959 if(jQuery(this).hasClass('current-menu-item') || jQuery(this).hasClass('current-menu-parent') || jQuery(this).hasClass('current-menu-ancestor')) { 1960 classes += ' mobile-current-nav-item'; 1961 } 1962 jQuery( this ).attr( 'class', classes ); 1963 if( jQuery( this ).attr( 'id' ) ) { 1964 jQuery( this ).attr( 'id', jQuery( this ).attr( 'id' ).replace( 'menu-item', 'mobile-menu-item' ) ); 1965 } 1966 jQuery( this ).attr( 'style', '' ); 1967 }); 1968 jQuery('.sh-mobile-nav-holder .mobile-selector').click(function(){ 1969 if( jQuery('.sh-mobile-nav-holder #mobile-nav').hasClass( 'mobile-menu-expanded' ) ) { 1970 jQuery('.sh-mobile-nav-holder #mobile-nav').removeClass( 'mobile-menu-expanded' ); 1971 } else { 1972 jQuery('.sh-mobile-nav-holder #mobile-nav').addClass( 'mobile-menu-expanded' ); 1973 } 1974 jQuery('.sh-mobile-nav-holder #mobile-nav').slideToggle(200,'easeOutQuad'); 1975 }); 1976 1977 //sticky header nav 1978 jQuery('.sticky-header .mobile-nav-holder').append('<div class="mobile-selector"><span>'+js_local_vars.dropdown_goto+'</span></div>'); 1979 jQuery('.sticky-header .mobile-nav-holder .mobile-selector').append('<div class="selector-down"></div>'); 1980 jQuery('.sticky-header .mobile-nav-holder').append(jQuery('.sticky-header .nav-holder ul.navigation').clone()); 1981 jQuery('.sticky-header .mobile-nav-holder ul.navigation').attr("class","navigation mobile-sticky-nav"); 1982 jQuery('.sticky-header .mobile-nav-holder ul.navigation').removeClass('fusion-navbar-nav'); 1983 jQuery('.sticky-header .mobile-nav-holder .mobile-sticky-nav').children( '.cart' ).each(function () { 1984 jQuery(this).children('.my-cart-link').text(js_local_vars.mobile_nav_cart);
1985 jQuery(this).children('.cart-contents').remove(); 1986 }); 1987 jQuery('.sticky-header .mobile-nav-holder .mobile-sticky-nav li').children('.login-box').remove(); 1988 jQuery('.sticky-header .mobile-nav-holder ul.navigation').attr("id","mobile-nav"); 1989 jQuery('.sticky-header .mobile-nav-holder .mobile-sticky-nav').find('li').each(function () { 1990 var classes = 'mobile-nav-item'; 1991 1992 if(jQuery(this).hasClass('current-menu-item') || jQuery(this).hasClass('current-menu-parent') || jQuery(this).hasClass('current-menu-ancestor')) { 1993 classes += ' mobile-current-nav-item'; 1994 } 1995 jQuery( this ).attr( 'class', classes ); 1996 1997 jQuery( this ).removeAttr( 'id' ); 1998 jQuery( this ).children( 'a' ).css( 'style', '' ); 1999 }); 2000 jQuery('.sticky-header .mobile-nav-holder .mobile-sticky-nav li').children('#sticky-nav-search-link').each(function () { 2001 jQuery(this).parents('li').remove(); 2002 }); 2003 jQuery('.sticky-header .mobile-nav-holder .mobile-selector').click(function(){ 2004 jQuery('.sticky-header .mobile-nav-holder .mobile-sticky-nav').slideToggle(200,'easeOutQuad'); 2005 }); 2006 jQuery('body #header-sticky.sticky-header .sticky-shadow .mobile-nav-holder').css('padding-left', jQuery('.sticky-header .sticky-shadow .logo').width() + 25 + "px"); 2007 2008 // Make megamenu items mobile ready 2009 jQuery('.header-wrapper .mobile-nav-holder .navigation > .mobile-nav-item, .sticky-header .mobile-nav-holder .navigation > .mobile-nav-item, .sh-mobile-nav-holder .navigation > .mobile-nav-item').each(function() { 2010 jQuery(this).find('.fusion-megamenu-widgets-container').remove(); 2011 2012 jQuery(this).find('.fusion-megamenu-holder > ul').each( function() { 2013 jQuery(this).attr('class', 'sub-menu'); 2014 jQuery(this).attr('style', ''); 2015 jQuery(this).find('> li').each( function() { 2016 2017 // add menu needed menu classes to li elements 2018 var classes = 'mobile-nav-item'; 2019 2020 if(jQuery(this).hasClass('current-menu-item') || jQuery(this).hasClass('current-menu-parent') || jQuery(this).hasClass('current-menu-ancestor') || jQuery(this).hasClass('mobile-current-nav-item')) { 2021 classes += ' mobile-current-nav-item'; 2022 } 2023 jQuery( this ).attr( 'class', classes ); 2024 2025 // Append column titles and title links correctly 2026 if( ! jQuery(this).find('.fusion-megamenu-title a, > a').length ) { 2027 jQuery(this).find('.fusion-megamenu-title').each( function() { 2028 if( ! jQuery( this ).children( 'a' ).length ) { 2029 jQuery( this ).append( '<a href="#">' + jQuery( this ).text() + '</a>' ); 2030 } 2031 }); 2032 2033 if( ! jQuery(this).find('.fusion-megamenu-title').length ) { 2034 2035 var parent_li = jQuery(this); 2036 2037 jQuery( this ).find( '.sub-menu').each( function() { 2038 parent_li.after( jQuery( this ) ); 2039 2040 }); 2041 jQuery( this ).remove(); 2042 } 2043 } 2044 jQuery( this ).prepend( jQuery( this ).find( '.fusion-megamenu-title a, > a' ) ); 2045 2046 jQuery( this ).find( '.fusion-megamenu-title' ).remove(); 2047 }); 2048 jQuery( this ).closest( '.mobile-nav-item' ).append( jQuery( this ) ); 2049 }); 2050 2051 jQuery( this ).find( '.fusion-megamenu-wrapper, .caret, .fusion-megamenu-bullet' ).remove(); 2052 }); 2053 2054 // Make mobile menu sub-menu toggles 2055 if( js_local_vars.submenu_slideout == 1 ) { 2056 jQuery('.header-wrapper .mobile-topnav-holder .mobile-topnav li, .header-wrapper .mobile-nav-holder .navigation li, .sticky-header .mobile-nav-holder .navigation li, .sh-mobile-nav-holder .navigation li').each(function() { 2057 var classes = 'mobile-nav-item'; 2058 2059 if(jQuery(this).hasClass('current-menu-item') || jQuery(this).hasClass('current-menu-parent') || jQuery(this).hasClass('current-menu-ancestor') || jQuery(this).hasClass('mobile-current-nav-item')) { 2060 classes += ' mobile-current-nav-item'; 2061 } 2062 jQuery( this ).attr( 'class', classes ); 2063 2064 if( jQuery( this ).find( ' > ul' ).length ) { 2065 jQuery( this ).prepend('<span href="#" aria-haspopup="true" class="open-submenu"></span>' ); 2066 2067 jQuery( this ).find( ' > ul' ).hide(); 2068 } 2069 }); 2070 2071 jQuery('.header-wrapper .mobile-topnav-holder .open-submenu, .header-wrapper .mobile-nav-holder .open-submenu, .sticky-header .mobile-nav-holder .open-submenu, .sh-mobile-nav-holder .open-submenu').click( function(e) { 2072 2073 e.stopPropagation(); 2074 jQuery( this ).parent().children( '.sub-menu' ).slideToggle(200,'easeOutQuad'); 2075 2076 }); 2077 } 2078 2079 jQuery( '.mobile-menu-icons .fusionicon-bars' ).click(function() { 2080 jQuery('.header-wrapper #mobile-nav, .sh-mobile-nav-holder #mobile-nav').slideToggle(200,'easeOutQuad'); 2081 }); 2082 2083 jQuery( '.mobile-menu-icons .fusionicon-search' ).click(function() { 2084 jQuery('.header-wrapper .mobile-header-search .searchform').slideToggle(200,'easeOutQuad'); 2085 }); 2086 2087 // adjust mobile menu when it falls to 2 rows 2088 var mobile_menu_sep_added = false;
2089 2090 function adjust_mobile_menu_settings() { 2091 var menu_width = 0; 2092 2093 if( Modernizr.mq( 'only screen and (max-width: 800px)' ) ) { 2094 jQuery( '.top-menu #snav' ).children( 'li' ).each( function() { 2095 menu_width += jQuery( this ).outerWidth( true ) + 2; 2096 }); 2097 2098 if( menu_width > jQuery( window ).width() && jQuery( window ).width() > 318 ) { 2099 if( ! mobile_menu_sep_added ) { 2100 jQuery( '.top-menu #snav' ).append( '<div class="mobile-menu-sep"></div>' ); 2101 jQuery( '.top-menu #snav' ).css( 'position', 'relative' ); 2102 jQuery( '.mobile-menu-sep' ).css( { 2103 'position': 'absolute', 2104 'top': jQuery( '.top-menu #snav li' ).height() - 1 + 'px', 2105 'width': '100%', 2106 'border-bottom-width': '1px', 2107 'border-bottom-style': 'solid' 2108 }); 2109 mobile_menu_sep_added = true; 2110 } 2111 } else { 2112 jQuery( '.top-menu #snav' ).css( 'position', '' ); 2113 jQuery( '.top-menu #snav' ).find( '.mobile-menu-sep' ).remove(); 2114 mobile_menu_sep_added = false; 2115 } 2116 } else { 2117 jQuery( '.top-menu #snav' ).css( 'position', '' ); 2118 jQuery( '.top-menu #snav' ).find( '.mobile-menu-sep' ).remove(); 2119 mobile_menu_sep_added = false; 2120 } 2121 } 2122 2123 adjust_mobile_menu_settings(); 2124 2125 jQuery( window ).on( 'resize', function() { 2126 adjust_mobile_menu_settings(); 2127 }); 2128 2129 // One page scrolling effect 2130 var adminbar_height = 0; 2131 var sticky_height = 0; 2132 2133 if( jQuery( '#wpadminbar' ).length ) { 2134 adminbar_height = parseInt( jQuery( '#wpadminbar' ).outerHeight() ); 2135 } 2136 2137 if( jQuery( '.sticky-header' ).length ) { 2138 sticky_height = 65; 2139 } 2140 2141 jQuery(window).on('resize', function() { 2142 if( jQuery( '#wpadminbar' ).length ) { 2143 adminbar_height = parseInt( jQuery( '#wpadminbar' ).outerHeight() ); 2144 } 2145 2146 if( jQuery( '.sticky-header' ).length ) { 2147 sticky_height = jQuery( '.sticky-shadow' ).height(); 2148 } 2149 }); 2150 2151 jQuery('.fusion-navbar-nav a:not([href=#], .fusion-megamenu-widgets-container a, .search-link), .top-menu .menu a:not([href=#]), .mobile-nav-item a:not([href=#], .search-link), a.fusion-button:not([href=#]), a.fusion-one-page-text-link:not([href=#])').click(function() { 2152 2153 if (location.pathname.replace(/^\//,'') == this.pathname.replace(/^\//,'') || location.hostname == this.hostname) { 2154 if(this.hash) { 2155 var target = jQuery(this.hash); 2156 target = target.length ? target : jQuery('[name=' + this.hash.slice(1) +']'); 2157 if (target.length && this.hash.slice(1) != '' ) { 2158 jQuery( '#nav .fusion-navbar-nav li' ).removeClass( 'current-menu-item' ); 2159 jQuery('html, body').animate({ 2160 scrollTop: target.offset().top - sticky_height 2161 }, 850, 'easeInOutExpo'); 2162 return false; 2163 } 2164 } 2165 } 2166 }); 2167 2168 var scrollspy_target = '.header-wrapper #nav .fusion-navbar-nav li > a'; 2169 var sticky_scroll = 70; 2170 var is_tfs_parallax_sticky_scroll = false; 2171 2172 if( jQuery( '.tfs_parallax' ).length && jQuery( '.header-v1' ).length && jQuery( '#sliders-container' ).index() > jQuery( '#header-wrapper' ).index() ) { 2173 if( ! is_tfs_parallax_sticky_scroll ) { 2174 if( adminbar_height > 0 ) { 2175 sticky_scroll = sticky_scroll + jQuery( '.header-v1' ).height() + 15; 2176 } else { 2177 sticky_scroll = sticky_scroll + jQuery( '.header-v1' ).height() + 30; 2178 } 2179 is_tfs_parallax_sticky_scroll = true; 2180 } 2181 } 2182 2183 jQuery('body').scrollspy({ 2184 target: scrollspy_target, 2185 offset: parseInt( adminbar_height + sticky_scroll ) 2186 }); 2187 2188 jQuery('body').on('activate.bs.scrollspy', function () { 2189 2190 if( jQuery( '.sticky-header' ).length ) { 2191 var current_menu_item_id = jQuery( '.header-wrapper' ).find( '.nav-holder' ).find( '.current-menu-item' ).attr( 'id' ); 2192 2193 jQuery( '.sticky-header' ).find( '.nav-holder .fusion-navbar-nav' ).children().removeClass( 'current-menu-item' ); 2194 2195 jQuery( '.sticky-header' ).find( '.nav-holder .fusion-navbar-nav' ).children( '.' + current_menu_item_id ).addClass( 'current-menu-item' ); 2196 2197 } 2198 }); 2199 2200 // side nav drop downs 2201 jQuery('.side-nav-left .side-nav li').each(function() { 2202 if(jQuery(this).find('> .children').length) { 2203 if( jQuery( '.rtl' ).length ) { 2204 jQuery(this).find('> a').prepend('<span class="arrow"></span>'); 2205 } else { 2206 jQuery(this).find('> a').append('<span class="arrow"></span>'); 2207 } 2208 } 2209 }); 2210 2211 jQuery('.side-nav-right .side-nav li').each(function() { 2212 if(jQuery(this).find('> .children').length) { 2213 if( jQuery( 'body.rtl' ).length ) { 2214 jQuery(this).find('> a').append('<span class="arrow"></span>'); 2215 } else { 2216 jQuery(this).find('> a').prepend('<span class="arrow"></span>'); 2217 } 2218 } 2219 }); 2220 2221 jQuery('.side-nav .current_page_item').each(function() { 2222 if(jQuery(this).find('.children').length ){ 2223 jQuery(this).find('.children').show('slow'); 2224 } 2225 }); 2226 2227 jQuery('.side-nav .current_page_item').each(function() { 2228 if(jQuery(this).parent().hasClass('side-nav')) { 2229 jQuery(this).find('ul').show('slow'); 2230 } 2231 2232 if(jQuery(this).parent().hasClass('children')){ 2233 jQuery(this).parents('ul').show('slow'); 2234 } 2235 }); 2236 2237 if ('ontouchstart' in document.documentElement || navigator.msMaxTouchPoints) { 2238 jQuery('.nav-holder .submenu li.menu-item-has-children > a, .order-dropdown > li .current-li').on("click", function (e) { 2239 var link = jQuery(this); 2240 if (link.hasClass('hover')) { 2241 link.removeClass("hover"); 2242 return true; 2243 } else { 2244 link.addClass("hover"); 2245 jQuery('.nav-holder li.menu-item-has-children > a, .order-dropdown > li .current-li').not(this).removeClass("hover"); 2246 return false;
2247 } 2248 }); 2249 2250 2251 jQuery('.sub-menu li, .mobile-nav-item li').not('li.menu-item-has-children').on("click", function (e) { 2252 var link = jQuery(this).find('a').attr('href'); 2253 window.location = link; 2254 2255 return true; 2256 }); 2257 } 2258 2259 // Touch support for win phone devices 2260 jQuery( '#nav li.menu-item-has-children a, .top-menu li.menu-item-has-children a, #sticky-nav li.menu-item-has-children a, .side-nav li.page_item_has_children a' ).each( function() { 2261 jQuery( this ).attr( 'aria-haspopup', 'true' ); 2262 }); 2263 2264 2265 // Blog Timeline Sidebar handling 2266 if( jQuery( '.timeline-sidebar-layout, .blog-timeline-layout' ).length ) { 2267 var content_style = jQuery( '#content' ).attr( 'style' ); 2268 var sidebar_1_style = jQuery( '#sidebar' ).attr( 'style' ); 2269 var sidebar_2_style = jQuery( '#sidebar-2' ).attr( 'style' ); 2270 var break_point_triggered = false; 2271 var complete_content_width; 2272 2273 calc_timeline_positioning(); 2274 2275 jQuery(window).on('resize', function() { 2276 calc_timeline_positioning(); 2277 }); 2278 } 2279 2280 function calc_timeline_positioning() { 2281 if( jQuery( '.timeline-layout' ).length ) { 2282 var timeline_container = '.timeline-layout'; 2283 } else { 2284 var timeline_container = '.blog-timeline-layout'; 2285 } 2286 2287 if( jQuery( '#content' ).width() > 775 ) { 2288 jQuery( '.timeline-icon' ).removeClass( 'has-sidebar' ); 2289 jQuery( timeline_container ).removeClass( 'timeline-sidebar-layout' ); 2290 } else { 2291 jQuery( '.timeline-icon' ).addClass( 'has-sidebar' ); 2292 jQuery( timeline_container ).addClass( 'timeline-sidebar-layout' ); 2293 } 2294 2295 if( ! break_point_triggered ) { 2296 if( jQuery( '#sidebar-2' ).length ) { 2297 var content_margin = jQuery( '#content' ).outerWidth( true ) - jQuery( '#content' ).width(); 2298 complete_content_width = jQuery( timeline_container ).outerWidth( true ) + content_margin + jQuery( '#sidebar-2' ).outerWidth( true ); 2299 } else { 2300 complete_content_width = jQuery( timeline_container ).width() + jQuery( '#content' ).width() * 0.06 + jQuery( '#sidebar' ).outerWidth( true ); 2301 } 2302 } 2303 2304 if( jQuery( '#main .avada-row' ).width() < complete_content_width ) { 2305 break_point_triggered = true; 2306 2307 jQuery( '#content' ).css( 'cssText', "float: none;margin:0 !important;width: 100% !important;" ); 2308 jQuery( '.sidebar' ).css( 'cssText', "float: none;margin:0 !important;padding:0 !important;width: 100% !important;clear:both;" ); 2309 } else { 2310 break_point_triggered = false; 2311 2312 jQuery( '#content' ).attr( 'style', content_style ); 2313 jQuery( '#sidebar' ).attr( 'style', sidebar_1_style ); 2314 jQuery( '#sidebar-2' ).attr( 'style', sidebar_2_style ); 2315 } 2316 } 2317 2318 // Ubermenu responsive fix 2319 if(jQuery('.megaResponsive').length >= 1) { 2320 jQuery('.mobile-nav-holder.main-menu').addClass('set-invisible'); 2321 } 2322 2323 // WPML search form input add 2324 if( js_local_vars.language_flag != '') { 2325 jQuery('.search-field, .searchform').each( function() { 2326 if( ! jQuery( this ).find( 'input[name="lang"]' ).length && ! jQuery( this ).parents( '.searchform' ).find( 'input[name="lang"]' ).length ) { 2327 jQuery( this ).append('<input type="hidden" name="lang" value="'+js_local_vars.language_flag+'"/>'); 2328 } 2329 }); 2330 } 2331 2332 jQuery( '#wrapper .share-box' ).each( function() { 2333 if( ! jQuery( 'meta[property="og:title"]' ).length ) { 2334 jQuery( 'head title' ).after( '<meta property="og:title" content="' + jQuery( this ).data( 'title' ) + '"/>' ); 2335 jQuery( 'head title' ).after( '<meta property="og:description" content="' + jQuery( this ).data( 'description' ) + '"/>' ); 2336 jQuery( 'head title' ).after( '<meta property="og:type" content="article"/>' ); 2337 jQuery( 'head title' ).after( '<meta property="og:url" content="' + jQuery( this ).data( 'link' ) + '"/>' ); 2338 jQuery( 'head title' ).after( '<meta property="og:image" content="' + jQuery( this ).data( 'image' ) + '"/>' ); 2339 } 2340 }); 2341 2342 sharebox_h4_width = jQuery('#wrapper .share-box h4').outerWidth(); 2343 sharebox_ul = jQuery('.share-box ul').outerWidth(); 2344 // social share box alignment on resize 2345 if( sharebox_h4_width + sharebox_ul > jQuery('.post-content').width() && ! jQuery('.single-avada_portfolio').length ) { 2346 jQuery('#wrapper .share-box').css('height', 'auto'); 2347 jQuery('#wrapper .share-box h4').css('float', 'none').css('line-height', '20px').css('padding-bottom', '25px').css('padding-top', '25px'); 2348 jQuery('.share-box ul').css('float', 'none').css('margin-top', '0').css('overflow', 'hidden').css('padding', '0 25px 25px'); 2349 } else { 2350 jQuery('#wrapper .share-box').css( 'height', '' ); 2351 } 2352 2353 // Chrome soical icons drop to second row bug quirks 2354 header_social_social_networks = 0; 2355 jQuery('.header-social .social-networks li').each(function() { 2356 header_social_social_networks += jQuery(this).outerWidth(true); 2357 }); 2358 if(header_social_social_networks > jQuery('.header-social .social-networks').css('max-width')) { 2359 header_social_social_networks = jQuery('.header-social .social-networks').css('max-width'); 2360 } 2361 2362 jQuery(window).on('resize', function() { 2363 jQuery('.title').each(function(index) { 2364 if(special_titles_width[index] > jQuery(this).parent().width()) { 2365 jQuery(this).addClass('border-below-title'); 2366 } else { 2367 jQuery(this).removeClass('border-below-title'); 2368 } 2369 }); 2370 2371 // social share box alignment on resize 2372 if( sharebox_h4_width + sharebox_ul > jQuery('#content').width() ) { 2373 jQuery('#wrapper .share-box').css('height', 'auto'); 2374 jQuery('#wrapper .share-box h4').css('float', 'none').css('line-height', '20px').css('padding-bottom', '25px').css('padding-top', '25px'); 2375 jQuery('.share-box ul').css('float', 'none').css('margin-top', '0').css('overflow', 'hidden').css('padding', '0 25px 25px'); 2376 } else { 2377 jQuery('#wrapper .share-box').css( 'height', '' ); 2378 //jQuery('#wrapper .share-box, #wrapper .share-box h4, .share-box ul').attr("style", ""); 2379 } 2380 2381 // Chrome soical icons drop to second row bug quirks 2382 if(jQuery(window).width() >= 784) { 2383 jQuery('.header-social .social-networks').css('width', header_social_social_networks); 2384 } else { 2385 jQuery('.header-social .social-networks').css('width', ''); 2386 } 2387 }); 2388 2389 /* search icon show/hide */ 2390 jQuery(document).click(function() { 2391 jQuery('.main-nav-search-form').hide(); 2392 jQuery('.main-nav-search-form').parent().removeClass( 'search-box-open' ); 2393 }); 2394 jQuery('.main-nav-search-form').click(function(e) { 2395 e.stopPropagation(); 2396 }); 2397 jQuery('.main-nav-search .search-link').click(function(e) { 2398 e.stopPropagation(); 2399 if(jQuery(this).parent().find('.main-nav-search-form').css('display') == 'block') { 2400 jQuery(this).parent().find('.main-nav-search-form').hide(); 2401 jQuery(this).parent().removeClass( 'search-box-open' ); 2402 } else { 2403 2404 jQuery(this).parent().find('.main-nav-search-form').removeAttr( 'style' ); 2405 jQuery(this).parent().find('.main-nav-search-form').show(); 2406 jQuery(this).parent().addClass( 'search-box-open' ); 2407 2408 // position main menu search box on click positioning 2409 if( js_local_vars.header_position == 'Top' ) { 2410 if( ! jQuery( 'body.rtl' ).length && jQuery(this).parent().find('.main-nav-search-form').offset().left < 0 ) { 2411 jQuery(this).parent().find('.main-nav-search-form').css({ 2412 'left': '0', 2413 'right': 'auto' 2414 }); 2415 } 2416 2417 if( jQuery( 'body.rtl' ).length && jQuery(this).parent().find('.main-nav-search-form').offset().left + jQuery(this).parent().find('.main-nav-search-form').width() > jQuery( window ).width() ) { 2418 jQuery(this).parent().find('.main-nav-search-form').css({ 2419 'left': 'auto', 2420 'right': '0' 2421 }); 2422 } 2423 } 2424 } 2425 }); 2426 2427 // Position main menu search box correctly 2428 if( js_local_vars.header_position == 'Top' ) { 2429 jQuery(window).on( 'resize', function() { 2430 jQuery( '.main-nav-search' ).each( function() { 2431 if( jQuery( this ).hasClass( 'search-box-open' ) ) { 2432 var search_form = jQuery( this ).find( '.main-nav-search-form' ), 2433 search_form_width = search_form.outerWidth(), 2434 search_form_left_edge = search_form.offset().left, 2435 search_form_right_edge = search_form_left_edge + search_form_width, 2436 search_menu_item_left_edge = search_form.parent().offset().left, 2437 window_right_edge = jQuery( window ).width(); 2438 2439 2440 if( ! jQuery( 'body.rtl' ).length ) { 2441 if( ( search_form_left_edge < search_menu_item_left_edge && search_form_left_edge < 0 ) || ( search_form_left_edge == search_menu_item_left_edge && search_form_left_edge - search_form_width < 0 ) ) { 2442 search_form.css({ 2443 'left': '0', 2444 'right': 'auto' 2445 }); 2446 } else { 2447 search_form.css({ 2448 'left': 'auto', 2449 'right': '0' 2450 }); 2451 } 2452 } else { 2453 if( ( search_form_left_edge == search_menu_item_left_edge && search_form_right_edge > window_right_edge ) || ( search_form_left_edge < search_menu_item_left_edge && search_form_right_edge + search_form_width > window_right_edge ) ) { 2454 search_form.css({ 2455 'left': 'auto', 2456 'right': '0' 2457 }); 2458 } else { 2459 search_form.css({ 2460 'left': '0', 2461 'right': 'auto' 2462 }); 2463 } 2464 } 2465 } 2466 }); 2467 }); 2468 } 2469 2470 var special_titles_width = []; 2471 jQuery('.title').each(function(index) { 2472 special_titles_width[index] = jQuery(this).find('h1,h2,h3,h4,h5,h6').width(); 2473 if(jQuery(this).find('h1,h2,h3,h4,h5,h6').width() > jQuery(this).parent().width()) { 2474 jQuery(this).addClass('border-below-title'); 2475 } 2476 }); 2477 2478 // Tabs 2479 // On page load 2480 // Direct linked tab handling 2481 jQuery( '.fusion-tabs' ).fusion_switch_tab_on_link_click(); 2482 2483 //On Click Event 2484 jQuery(".nav-tabs li").click(function(e) { 2485 var clicked_tab = jQuery(this); 2486 var tab_content_to_activate = jQuery(this).find("a").attr("href"); 2487 var map_id = clicked_tab.attr('id'); 2488 2489 // To make premium sliders work in tabs 2490 jQuery(window).trigger('resize'); 2491 2492 setTimeout( function(){ 2493 clicked_tab.parents( '.fusion-tabs' ).find( tab_content_to_activate ).find( '.shortcode-map' ).each(function() { 2494 jQuery( this ).reinitialize_google_map(); 2495 }); 2496 2497 if( clicked_tab.parents( '.fusion-tabs' ).find( tab_content_to_activate ).find( '.es-carousel-wrapper' ).length ) { 2498 generateCarousel(); 2499 } 2500 2501 clicked_tab.parents( '.fusion-tabs' ).find( tab_content_to_activate ).find( '.portfolio' ).each( function() { 2502 jQuery( this).find( '.portfolio-wrapper' ).isotope( 'layout' ); 2503 }); 2504 2505 2506 if( clicked_tab.parents( '.fusion-tabs' ).find( tab_content_to_activate ).find( '.flexslider' ).length ) { 2507 jQuery( window ).trigger( 'resize' ); 2508 } 2509 2510 clicked_tab.parents( '.fusion-tabs' ).find( tab_content_to_activate ).find( '.fusion-blog-shortcode' ).each( function() { 2511 var columns = 2; 2512 for( i = 1; i < 7; i++ ) { 2513 if( jQuery( this ).find( '.grid-layout' ).hasClass( 'grid-layout-' + i ) ) { 2514 columns = i; 2515 } 2516 } 2517 2518 var grid_width = Math.floor( 100 / columns * 100 ) / 100 + '%'; 2519 jQuery( this ).find( '.grid-layout' ).find( '.post' ).css( 'width', grid_width ); 2520 2521 jQuery( this).find( '.grid-layout' ).isotope(); 2522
2523 calc_select_arrow_dimensions(); 2524 }); 2525 }, 350); 2526 2527 e.preventDefault(); 2528 }); 2529 2530 // Tabs Widget 2531 jQuery( '.tabs-widget .tabset li a' ).click( function( e ) { 2532 e.preventDefault(); 2533 }); 2534 2535 // When page loads 2536 jQuery( '.tabs-widget' ).each(function() { 2537 jQuery( this ).find( '.tabset li:first' ).addClass( 'active' ).show(); //Activate first tab 2538 jQuery( this ).find( '.tab_content:first' ).show(); //Show first tab content 2539 }); 2540 2541 //On Click Event 2542 jQuery( '.tabs-widget .tabset li' ).click(function(e) { 2543 var tab_to_activate = jQuery( this ).find( 'a' ).attr( 'href' ); 2544 2545 jQuery( this ).parent().find( ' > li' ).removeClass( 'active' ); //Remove all 'active' classes 2546 jQuery( this ).addClass( 'active' ); // Add 'active' class to selected tab 2547 2548 jQuery( this ).parents( '.tabs-widget' ).find( '.tab_content' ).hide(); //Hide all tab content 2549 jQuery( this ).parents( '.tabs-widget' ).find( tab_to_activate ).fadeIn(); //Fade in the new active tab content 2550 }); 2551 2552 jQuery('.woocommerce .images #carousel a').click(function(e) { 2553 e.preventDefault(); 2554 }); 2555 2556 jQuery('.tooltip-shortcode, .author_social .social-networks li, #footer .social-networks li, .footer-area .social-networks li, .sidebar .social-networks li, .social_links_shortcode li, .share-box li, .social-icon, .social li').mouseenter(function(e){ 2557 jQuery(this).find('.popup').hoverFlow(e.type, { 2558 'opacity' :'show' 2559 }); 2560 }); 2561 2562 jQuery('.tooltip-shortcode, .author_social .social-networks li, #footer .social-networks li, .footer-area .social-networks li, .sidebar .social-networks li, .social_links_shortcode li, .share-box li, .social-icon, .social li').mouseleave(function(e){ 2563 jQuery(this).find('.popup').hoverFlow(e.type, { 2564 'opacity' :'hide' 2565 }); 2566 }); 2567 2568 jQuery('.portfolio-tabs a').click(function(e){ 2569 e.preventDefault(); 2570 2571 var selector = jQuery(this).attr('data-filter'); 2572 jQuery(this).parents('.portfolio').find('.portfolio-wrapper').isotope({ filter: selector }); 2573 2574 jQuery(this).parents('ul').find('li').removeClass('active'); 2575 jQuery(this).parent().addClass('active'); 2576 }); 2577 2578 jQuery( '.faq-tabs a' ).click( function(e) { 2579 e.preventDefault(); 2580 2581 var selector = jQuery( this ).attr( 'data-filter' ); 2582 2583 jQuery ('.faqs .faqs-wrapper .faq-item' ).fadeOut(); 2584 2585 setTimeout( function() { 2586 jQuery( '.faqs .faqs-wrapper .faq-item' + selector ).fadeIn(); 2587 }, 400 ); 2588 2589 2590 jQuery( this ).parents( 'ul' ).find( 'li' ).removeClass( 'active' ); 2591 jQuery( this ).parent().addClass( 'active' ); 2592 }); 2593 2594 function isScrolledIntoView(elem) 2595 { 2596 var docViewTop = jQuery(window).scrollTop(); 2597 var docViewBottom = docViewTop + jQuery(window).height(); 2598 2599 var elemTop = jQuery(elem).offset().top; 2600 var elemBottom = elemTop + jQuery(elem).height(); 2601 2602 return ((elemBottom <= docViewBottom) && (elemTop >= docViewTop)); 2603 } 2604 2605 jQuery('.fusion-alert .close').click(function(e) { 2606 e.preventDefault(); 2607 2608 jQuery(this).parent().slideUp(); 2609 }); 2610 2611 jQuery('input, textarea').placeholder(); 2612 2613 function checkForImage(url) { 2614 return(url.match(/\.(jpeg|jpg|gif|png)$/) != null); 2615 } 2616 2617 if(Modernizr.mq('only screen and (max-width: 479px)')) { 2618 jQuery('.overlay-full.layout-text-left .slide-excerpt p').each(function () { 2619 var excerpt = jQuery(this).html(); 2620 var wordArray = excerpt.split(/[\s\.\?]+/); //Split based on regular expression for spaces 2621 var maxWords = 10; //max number of words 2622 var total_words = wordArray.length; //current total of words 2623 var newString = ""; 2624 //Roll back the textarea value with the words that it had previously before the maximum was reached 2625 if (total_words > maxWords+1) { 2626 for (var i = 0; i < maxWords; i++) { 2627 newString += wordArray[i] + " "; 2628 } 2629 jQuery(this).html(newString); 2630 } 2631 }); 2632 2633 jQuery('.portfolio .gallery-icon').each(function () { 2634 var img = jQuery(this).attr('href'); 2635 2636 if(checkForImage(img) == true) { 2637 jQuery(this).parents('.image').find('> img').attr('src', img).attr('width', '').attr('height', ''); 2638 } 2639 jQuery(this).parents('.portfolio-item').css('width', 'auto'); 2640 jQuery(this).parents('.portfolio-item').css('height', 'auto'); 2641 jQuery(this).parents('.portfolio-one:not(.portfolio-one-text)').find('.portfolio-item').css('margin', '0'); 2642 }); 2643 2644 if(jQuery('.portfolio').length >= 1) { 2645 jQuery('.portfolio-wrapper').isotope(); 2646 } 2647 } 2648 2649 if(Modernizr.mq('only screen and (max-width: 800px)')) {
2650 jQuery('.tabs-vertical').addClass('tabs-horizontal').removeClass('tabs-vertical'); 2651 } 2652 2653 jQuery(window).on('resize', function() { 2654 if(Modernizr.mq('only screen and (max-width: 800px)')) { 2655 jQuery('.tabs-vertical').addClass('tabs-original-vertical'); 2656 jQuery('.tabs-vertical').addClass('tabs-horizontal').removeClass('tabs-vertical'); 2657 } else { 2658 jQuery('.tabs-original-vertical').removeClass('tabs-horizontal').addClass('tabs-vertical'); 2659 } 2660 }); 2661 2662 // Woocommerce 2663 jQuery('.catalog-ordering .orderby .current-li a').html(jQuery('.catalog-ordering .orderby ul li.current a').html()); 2664 jQuery('.catalog-ordering .sort-count .current-li a').html(jQuery('.catalog-ordering .sort-count ul li.current a').html()); 2665 jQuery('.woocommerce #calc_shipping_state').parent().addClass('fusion-column fusion-one-half spacing-yes'); 2666 jQuery('.woocommerce #calc_shipping_postcode').parent().addClass('fusion-column fusion-one-half spacing-yes last'); 2667 jQuery('.woocommerce .shop_table .variation dd').after('<br />'); 2668 jQuery('.woocommerce .avada-myaccount-data th.order-actions').text(js_local_vars.order_actions); 2669 2670 jQuery( 'body.rtl .woocommerce .wc-forward' ).each( function() { 2671 var checkout_button = jQuery( this ); 2672 checkout_button.val( '\u2190 ' + checkout_button.val().replace( '\u2192', '' ) ); 2673 }); 2674 2675 var avada_myaccount_active = jQuery('.avada-myaccount-nav').find('.active a'); 2676 2677 if(avada_myaccount_active.hasClass('address') ) { 2678 jQuery('.avada-myaccount-data .edit_address_heading').fadeIn(); 2679 } else { 2680 jQuery('.avada-myaccount-data h2:nth-of-type(1)').fadeIn(); 2681 } 2682 2683 if(avada_myaccount_active.hasClass('downloads') ) { 2684 jQuery('.avada-myaccount-data .digital-downloads').fadeIn(); 2685 } else if(avada_myaccount_active.hasClass('orders') ) { 2686 jQuery('.avada-myaccount-data .my_account_orders').fadeIn(); 2687 } else if(avada_myaccount_active ) { 2688 jQuery('.avada-myaccount-data .myaccount_address, .avada-myaccount-data .addresses').fadeIn(); 2689 } 2690 2691 jQuery('body.rtl .avada-myaccount-data .my_account_orders .order-status').each( function() { 2692 jQuery( this ).css( 'text-align', 'right' ); 2693 }); 2694 2695 jQuery('.woocommerce input').each(function() { 2696 if(!jQuery(this).has('#coupon_code')) { 2697 name = jQuery(this).attr('id'); 2698 jQuery(this).attr('placeholder', jQuery(this).parent().find('label[for='+name+']').text()); 2699 } 2700 }); 2701 2702 if(jQuery('.woocommerce #reviews #comments .comment_container .comment-text').length ) { 2703 jQuery('.woocommerce #reviews #comments .comment_container').append('<div class="clear"></div>'); 2704 } 2705 2706 if( jQuery('.woocommerce.single-product .related.products > h2').length ) { 2707 jQuery('.woocommerce.single-product .related.products > h2').addClass( 'title-heading-left' ); 2708 jQuery('.woocommerce.single-product .related.products > h2').wrap( '<div class="fusion-title title"></div>' ); 2709 jQuery('.woocommerce.single-product .related.products > .title').append( '<div class="title-sep-container"><div class="title-sep sep-double"></div></div>' ); 2710 } 2711 2712 if( jQuery('.woocommerce.single-product .upsells.products > h2').length ) { 2713 jQuery('.woocommerce.single-product .upsells.products > h2').addClass( 'title-heading-left' ); 2714 jQuery('.woocommerce.single-product .upsells.products > h2').wrap( '<div class="fusion-title title"></div>' ); 2715 jQuery('.woocommerce.single-product .upsells.products > .title').append( '<div class="title-sep-container"><div class="title-sep sep-double"></div></div>' ); 2716 } 2717 2718 if(jQuery('body .sidebar').css('display') == "block") { 2719 jQuery('body').addClass('has-sidebar'); 2720 calcTabsLayout('.woocommerce-tabs .tabs-horizontal'); 2721 } 2722 2723 jQuery('.sidebar .products,.footer-area .products,#slidingbar-area .products').each(function() { 2724 jQuery(this).removeClass('products-4'); 2725 jQuery(this).removeClass('products-3'); 2726 jQuery(this).removeClass('products-2'); 2727 jQuery(this).addClass('products-1'); 2728 }); 2729 2730 jQuery('.products-6 li, .products-5 li, .products-4 li, .products-3 li, .products-3 li').removeClass('last'); 2731 2732 // Woocommerce nested products plugin support 2733 jQuery( '.subcategory-products' ).each( function() {
2734 jQuery( this ).addClass( 'products-' + js_local_vars.woocommerce_shop_page_columns ); 2735 }); 2736 2737 jQuery('.woocommerce-tabs ul.tabs li a').unbind( 'click' ); 2738 jQuery('.woocommerce-tabs > ul.tabs li a').click(function(){ 2739 2740 var tab = jQuery( this ); 2741 var tabs_wrapper = tab.closest( '.woocommerce-tabs' ); 2742 2743 jQuery( 'ul.tabs li', tabs_wrapper ).removeClass( 'active' ); 2744 jQuery( '> div.panel', tabs_wrapper ).hide(); 2745 jQuery( 'div' + tab.attr( 'href' ), tabs_wrapper ).show(); 2746 tab.parent().addClass( 'active' ); 2747 2748 return false; 2749 }); 2750 2751 2752 jQuery('.woocommerce-checkout-nav a,.continue-checkout').click(function(e) { 2753 e.preventDefault(); 2754 2755 if( ! jQuery( '.woocommerce .avada-checkout' ).find( '.woocommerce-invalid' ).is( ':visible' ) ) { 2756 var data_name = $(this).attr('data-name'); 2757 var name = data_name; 2758 if(data_name != '#order_review') { 2759 name = '.' + data_name; 2760 } 2761 2762 jQuery('form.checkout .col-1, form.checkout .col-2, form.checkout #order_review_heading, form.checkout #order_review').hide(); 2763 2764 jQuery('form.checkout').find(name).fadeIn(); 2765 if(name == '#order_review') { 2766 jQuery('form.checkout').find('#order_review_heading').fadeIn(); 2767 } 2768 2769 jQuery('.woocommerce-checkout-nav li').removeClass('active'); 2770 jQuery('.woocommerce-checkout-nav').find('[data-name='+data_name+']').parent().addClass('active'); 2771 2772 if( jQuery( this ).hasClass( 'continue-checkout' ) && jQuery( window ).scrollTop() > 0 ) { 2773 jQuery('html, body').animate({scrollTop: jQuery( '.woocommerce-content-box.avada-checkout' ).offset().top - adminbar_height - sticky_height }, 500); 2774 } 2775 2776 calc_select_arrow_dimensions(); 2777 } 2778 }); 2779 2780 jQuery('.avada-myaccount-nav a').click(function(e) { 2781 e.preventDefault(); 2782 2783 jQuery('.avada-myaccount-data h2, .avada-myaccount-data .digital-downloads, .avada-myaccount-data .my_account_orders, .avada-myaccount-data .myaccount_address, .avada-myaccount-data .addresses, .avada-myaccount-data .edit-account-heading, .avada-myaccount-data .edit-account-form').hide(); 2784 2785 if(jQuery(this).hasClass('downloads') ) { 2786 jQuery('.avada-myaccount-data h2:nth-of-type(1), .avada-myaccount-data .digital-downloads').fadeIn(); 2787 } else if(jQuery(this).hasClass('orders') ) { 2788 2789 if( jQuery(this).parents('.avada-myaccount-nav').find('.downloads').length ) { 2790 heading = jQuery('.avada-myaccount-data h2:nth-of-type(2)'); 2791 } else { 2792 heading = jQuery('.avada-myaccount-data h2:nth-of-type(1)'); 2793 } 2794 2795 heading.fadeIn(); 2796 jQuery('.avada-myaccount-data .my_account_orders').fadeIn(); 2797 } else if(jQuery(this).hasClass('address') ) { 2798 2799 if( jQuery(this).parents('.avada-myaccount-nav').find('.downloads').length && jQuery(this).parents('.avada-myaccount-nav').find('.orders').length ) { 2800 heading = jQuery('.avada-myaccount-data h2:nth-of-type(3)'); 2801 } else if( jQuery(this).parents('.avada-myaccount-nav').find('.downloads').length || jQuery(this).parents('.avada-myaccount-nav').find('.orders').length ) { 2802 heading = jQuery('.avada-myaccount-data h2:nth-of-type(2)'); 2803 } else { 2804 heading = jQuery('.avada-myaccount-data h2:nth-of-type(1)'); 2805 } 2806 2807 heading.fadeIn(); 2808 jQuery('.avada-myaccount-data .myaccount_address, .avada-myaccount-data .addresses').fadeIn(); 2809 } else if(jQuery(this).hasClass('account') ) { 2810 jQuery('.avada-myaccount-data .edit-account-heading, .avada-myaccount-data .edit-account-form').fadeIn(); 2811 } 2812 2813 jQuery('.avada-myaccount-nav li').removeClass('active'); 2814 jQuery(this).parent().addClass('active'); 2815 }); 2816 2817 jQuery('a.add_to_cart_button').click(function(e) { 2818 var link = this; 2819 jQuery(link).closest('.product').find('.cart-loading').find('i').removeClass('fusionicon-check-square-o').addClass('fusionicon-spinner'); 2820 jQuery(this).closest('.product').find('.cart-loading').fadeIn(); 2821 setTimeout(function(){ 2822 jQuery(link).closest('.product').find('.product-images img').animate({opacity: 0.75}); 2823 jQuery(link).closest('.product').find('.cart-loading').find('i').hide().removeClass('fusionicon-spinner').addClass('fusionicon-check-square-o').fadeIn(); 2824 2825 setTimeout(function(){
2826 jQuery(link).closest('.product').find('.cart-loading').fadeOut().closest('.product').find('.product-images img').animate({opacity: 1});; 2827 }, 2000); 2828 }, 2000); 2829 }); 2830 2831 jQuery('li.product').mouseenter(function() { 2832 if(jQuery(this).find('.cart-loading').find('i').hasClass('fusionicon-check-square-o')) { 2833 jQuery(this).find('.cart-loading').fadeIn(); 2834 } 2835 }).mouseleave(function() { 2836 if(jQuery(this).find('.cart-loading').find('i').hasClass('fusionicon-check-square-o')) { 2837 jQuery(this).find('.cart-loading').fadeOut(); 2838 } 2839 }); 2840 2841 // Avada dropdown styles 2842 if( ! Boolean( Number( js_local_vars.avada_styles_dropdowns ) ) ) { 2843 2844 if ( jQuery( '.woocommerce .country_select' ).length ) { 2845 jQuery( '.woocommerce .country_select' ).parent().addClass( 'avada-select' ); 2846 jQuery( '.woocommerce .validate-state' ).parent().addClass( 'avada-select' ); 2847 } 2848 2849 jQuery( '.cart-collaterals #calc_shipping_country, .widget_layered_nav select').wrap('<p class="avada-select-parent"></p>').after('<div class="select-arrow"></div>'); 2850 jQuery( '.cart-collaterals select#calc_shipping_state' ).after('<div class="select-arrow"></div>'); 2851 2852 setTimeout( function() { 2853 // Billing address - Only add styling if woocommerce enhanced country selects are disabled 2854 if( ! jQuery( '#billing_country_field .chosen-container' ).length && ! jQuery( '#billing_country_field .select2-container' ).length ) { 2855 // Wrap the country select 2856 jQuery( '#billing_country_field select.country_select' ).wrap( '<p class="avada-select-parent"></p>' ).after( '<span class="select-arrow"></span>' ); 2857 2858 // If there is a state select for the initially selected country, wrap it 2859 if ( jQuery( '#billing_state_field select.state_select' ).length ) { 2860 jQuery( '#billing_state_field' ).addClass( 'avada-select-parent' ).append( '<div class="select-arrow"></div>' ); 2861 } 2862 2863 // When the country is changed 2864 jQuery( "#billing_country" ).change( function() { 2865 // Timeout is needed that woocommerce js can kick in first 2866 setTimeout( function() { 2867 // If the new country has no state field at all or if it is just an input, undo custom styles 2868 if ( jQuery( '#billing_state_field input#billing_state' ).length || jQuery( '#billing_state_field' ).is( ':hidden' ) ) { 2869 jQuery( '#billing_state_field .select-arrow' ).remove(); 2870 jQuery( '#billing_state_field' ).removeClass( 'avada-select-parent' ); 2871 } 2872 2873 // If the new country has a state select 2874 if ( jQuery( '#billing_state_field select.state_select' ).length ) { 2875 // Add the correct wrapper class (always needed due to woocommerce classes reset) 2876 jQuery( '#billing_state_field' ).addClass( 'avada-select-parent' ); 2877 2878 // If the last country wasn't already having a state select, add the arrow container and calculate dimensions 2879 if ( ! jQuery( '#billing_state_field .select-arrow' ).length ) { 2880 jQuery( '#billing_state_field' ).append( '<div class="select-arrow"></div>' ); 2881 2882 calc_select_arrow_dimensions(); 2883 } 2884 } 2885 }, 1 ); 2886 }); 2887 } 2888 2889 // Shipping address - Only add styling if woocommerce enhanced country selects are disabled 2890 if( ! jQuery( '#shipping_country_field .chosen-container').length && ! jQuery( '#shipping_country_field .select2-container' ).length ) { 2891 jQuery( '#shipping_country_field select.country_select').wrap('<p class="avada-select-parent"></p>').after('<span class="select-arrow"></span>'); 2892 2893 // If there is a state select for the initially selected country, wrap it 2894 if ( jQuery( '#shipping_state_field select.state_select' ).length ) { 2895 jQuery( '#shipping_state_field' ).addClass( 'avada-select-parent' ).append( '<div class="select-arrow"></div>' ); 2896 } 2897 2898 jQuery( "#shipping_country" ).change( function() { 2899 // Timeout is needed that woocommerce js can kick in first 2900 setTimeout( function() { 2901 // If the new country has no state field at all or if it is just an input, undo custom styles 2902 if ( jQuery( '#shipping_state_field input#shipping_state' ).length || jQuery( '#shipping_state_field' ).is( ':hidden' ) ) { 2903 jQuery( '#shipping_state_field .select-arrow' ).remove(); 2904 jQuery( '#shipping_state_field' ).removeClass( 'avada-select-parent' ); 2905 } 2906 2907 // If the new country has a state select 2908 if ( jQuery( '#shipping_state_field select.state_select' ).length ) { 2909 // Add the correct wrapper class (always needed due to woocommerce classes reset) 2910 jQuery( '#shipping_state_field' ).addClass( 'avada-select-parent' ); 2911 2912 // If the last country wasn't already having a state select, add the arrow container and calculate dimensions 2913 if ( ! jQuery( '#shipping_state_field .select-arrow' ).length ) { 2914 jQuery( '#shipping_state_field' ).append( '<div class="select-arrow">
2914</div>' ); 2915 2916 calc_select_arrow_dimensions(); 2917 } 2918 } 2919 }, 1 ); 2920 }); 2921 } 2922 }, 1 ); 2923 2924 jQuery( '#calc_shipping_country' ).change( function() { 2925 if ( jQuery( '.avada-shipping-calculator-form select#calc_shipping_state').length && ! jQuery( '.avada-shipping-calculator-form #calc_shipping_state' ).parent().find( '.select-arrow' ).length ) { 2926 jQuery( '.avada-shipping-calculator-form select#calc_shipping_state').after( '<div class="select-arrow"></div>' ); 2927 } 2928 2929 if ( jQuery( '.avada-shipping-calculator-form input#calc_shipping_state' ).length ) { 2930 jQuery( '.avada-shipping-calculator-form #calc_shipping_state' ).parent().children( '.select-arrow' ).remove(); 2931 } 2932 2933 calc_select_arrow_dimensions(); 2934 }); 2935 2936 // wrap variation forms select and add arrow 2937 jQuery('table.variations select, .variations-table select, .product-addon select').wrap('<div class="avada-select-parent"></div>'); 2938 jQuery('<div class="select-arrow"></div>').appendTo('table.variations .avada-select-parent, .variations-table .avada-select-parent, .product-addon .avada-select-parent'); 2939 2940 // wrap cf7 select and add arrow 2941 jQuery('.wpcf7-select:not([multiple])').wrap('<div class="wpcf7-select-parent"></div>'); 2942 jQuery('<div class="select-arrow"></div>').appendTo('.wpcf7-select-parent'); 2943 2944 // wrap gravity forms select and add arrow 2945 jQuery('.gform_wrapper select:not([multiple])').each( function() { 2946 var current_select = jQuery( this ); 2947 2948 setTimeout( function() { 2949 if( ! current_select.siblings( '.chosen-container' ).length ) { 2950 var select_width = current_select.css('width'); 2951 current_select.wrap('<div class="gravity-select-parent"></div>'); 2952 current_select.parent().width( select_width ); 2953 current_select.css( 'cssText', "width: 100% !important;" ); 2954 jQuery('<div class="select-arrow"></div>').appendTo( current_select.parent( '.gravity-select-parent' ) ); 2955 } 2956 }, 150 ); 2957 }); 2958 2959 // wrap woo and bbpress select and add arrow 2960 jQuery('#bbp_stick_topic_select, #bbp_topic_status_select, #bbp_forum_id, #bbp_destination_topic').wrap('<div class="avada-select-parent"></div>').after('<div class="select-arrow"></div>'); 2961 2962 jQuery('.variations_form select').change(function() { 2963 if ( jQuery('.product #slider').length ) { 2964 jQuery('.product #slider').flexslider(0); 2965 } 2966 }); 2967 2968 // wrap category and archive widget dropdowns 2969 jQuery('.widget_categories select, .widget_archive select ').css( 'width', '100%' ); 2970 jQuery('.widget_categories select, .widget_archive select ').wrap('<div class="avada-select-parent"></div>').after('<div class="select-arrow"></div>'); 2971 } 2972 2973 2974 // BBPress 2975 jQuery( '.bbp-template-notice' ).each( function() { 2976 if( jQuery( this ).hasClass( 'info' ) ) { 2977 jQuery( this ).attr( 'class', 'fusion-alert alert notice alert-dismissable alert-info alert-shadow' ); 2978 } else { 2979 jQuery( this ).attr( 'class', 'fusion-alert alert notice alert-dismissable alert-warning alert-shadow' ); 2980 } 2981 jQuery( this ).children( 'tt' ).contents().unwrap(); 2982 jQuery( this ).children( 'p' ).contents().unwrap(); 2983 jQuery( this ).prepend( '<button class="close toggle-alert" aria-hidden="true" data-dismiss="alert" type="button">×</button><span class="alert-icon"><i class="fa fa-lg fa-lg fa-cog"></i></span>' ); 2984 2985 jQuery( this ).children( '.close' ).click(function(e) { 2986 e.preventDefault(); 2987 2988 jQuery(this).parent().slideUp(); 2989 }); 2990 }); 2991 2992 jQuery( '.bbp-login-form' ).each( function() { 2993 jQuery( this ).children( 'tt' ).contents().unwrap(); 2994 }); 2995 2996 // Text area climit expandability 2997 jQuery( '.textarea-comment' ).each( function() { 2998 jQuery( this ).css( 'max-width', jQuery( '#content').width() ); 2999 }); 3000 3001 if(Modernizr.mq('only screen and (max-width: 800px)')) { 3002 jQuery('.fullwidth-faded').each(function() { 3003 var bkgd_img = jQuery(this).css('background-image'); 3004 jQuery(this).parent().css('background-image', bkgd_img); 3005 jQuery(this).remove(); 3006 }); 3007 } 3008 3009}); // end document_ready_1 3010 3011// set heights of select arrows correctly 3012jQuery(window).load(function() { 3013 calc_select_arrow_dimensions(); 3014 3015 if(cssua.ua.mobile == undefined) { 3016 // Change opacity of page title bar on scrolling 3017 if(js_local_vars.page_title_fading == '1') { 3018 if(js_local_vars.header_position == 'Left' || js_local_vars.header_position == 'Right') { 3019 jQuery('.page-title-wrapper').fusion_scroller({type: 'opacity', end_offset: '.entry-title'}); 3020 } else { 3021 jQuery('.page-title-wrapper').fusion_scroller({type: 'opacity', offset: 100}); 3022 } 3023 } 3024 3025 // Fading and blur effect for new fade="" param on full width boxes 3026 jQuery('.fullwidth-faded').fusion_scroller({type: 'fading_blur'}); 3027 } 3028}); 3029 3030function calc_select_arrow_dimensions() { 3031 jQuery( '.avada-select-parent .select-arrow, .gravity-select-parent .select-arrow, .wpcf7-select-parent .select-arrow' ).each( function() { 3032 if( jQuery( this ).prev().innerHeight() > 0 ) { 3033 jQuery( this ).css( { 3034 height: jQuery( this ).prev().innerHeight(), 3035 width: jQuery( this ).prev().innerHeight(), 3036 'line-height': jQuery( this ).prev().innerHeight() + 'px' 3037 }); 3038 } 3039 }); 3040} 3041 3042// unwrap gravity selects that get a chzn field appended on the fly 3043jQuery(document).bind('gform_post_conditional_logic', function(){ 3044 var select = jQuery('.gform_wrapper select'); 3045 jQuery(select).each(function() { 3046 if(jQuery(this).hasClass('chzn-done') && jQuery(this).parent().hasClass('gravity-select-parent')) { 3047 jQuery(this).parent().find('.select-arrow').remove(); 3048 jQuery(this).unwrap('<div class="gravity-select-parent"></div>'); 3049 } 3050 }); 3051}); 3052 3053 3054 3055/*! 3056 * Bootstrap v3.1.1 (http://getbootstrap.com) 3057 * Copyright 2011-2014 Twitter, Inc. 3058 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) 3059 * scrollspy.js 3060 * modified by ThemeFusion 2014 3061 */ 3062 3063+function ($) { 3064 'use strict'; 3065 3066 // SCROLLSPY CLASS DEFINITION 3067 // ========================== 3068 3069 function ScrollSpy(element, options) { 3070 var href; 3071 var process = $.proxy(this.process, this); 3072 3073 this.$element = $(element).is('body') ? $(window) : $(element); 3074 this.$body = $('body'); 3075 this.$scrollElement = this.$element.on('scroll.bs.scroll-spy.data-api', process); 3076 this.options = $.extend({}, ScrollSpy.DEFAULTS, options); 3077 this.selector = (this.options.target 3078 || ((href = $(element).attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '')) //strip for ie7 3079 || ''); 3080 this.offsets = $([]); 3081 this.targets = $([]); 3082 this.activeTarget = null; 3083 3084 this.refresh(); 3085 this.process(); 3086 } 3087 3088 ScrollSpy.DEFAULTS = { 3089 offset: 10 3090 }; 3091 3092 ScrollSpy.prototype.refresh = function () { 3093 var offsetMethod = this.$element[0] == window ? 'offset' : 'position'; 3094 3095 this.offsets = $([]); 3096 this.targets = $([]); 3097 3098 var self = this; 3099 var $targets = this.$body 3100 .find(this.selector) 3101 .map(function () { 3102 var $el = $(this); 3103 var href = $el.data('target') || $el.attr('href'); 3104 var $href = /^#./.test(href) && $(href); 3105 3106 return ($href 3107 && $href.length 3108 && $href.is(':visible') 3109 && [[ $href[offsetMethod]().top + (!$.isWindow(self.$scrollElement.get(0)) && self.$scrollElement.scrollTop()), href ]]) || null; 3110 }) 3111 .sort(function (a, b) { return a[0] - b[0]; }) 3112 .each(function () { 3113 self.offsets.push(this[0]); 3114 self.targets.push(this[1]); 3115 }); 3116 }; 3117 3118 ScrollSpy.prototype.process = function () { 3119 var scrollTop = this.$scrollElement.scrollTop() + this.options.offset; 3120 var scrollHeight = this.$scrollElement[0].scrollHeight || this.$body[0].scrollHeight; 3121 var maxScroll = scrollHeight - this.$scrollElement.height(); 3122 var offsets = this.offsets; 3123 var targets = this.targets; 3124 var activeTarget = this.activeTarget; 3125 var i; 3126 3127 if (scrollTop >= maxScroll) { 3128 return activeTarget != (i = targets.last()[0]) && this.activate(i); 3129 } 3130 3131 for (i = offsets.length; i--;) { 3132 activeTarget != targets[i] 3133 && scrollTop >= offsets[i] 3134 && (!offsets[i + 1] || scrollTop <= offsets[i + 1]) 3135 && this.activate( targets[i] ); 3136 } 3137 }; 3138 3139 ScrollSpy.prototype.activate = function (target) { 3140 this.activeTarget = target; 3141 3142 $(this.selector) 3143 .parents('.current-menu-item') 3144 .removeClass('current-menu-item'); 3145 3146 var selector = this.selector + 3147 '[data-target="' + target + '"],' + 3148 this.selector + '[href="' + target + '"]'; 3149 3150 var active = $(selector) 3151 .parents('li') 3152 .addClass('current-menu-item'); 3153 3154 if (active.parent('.sub-menu').length) { 3155 active = active 3156 .closest('li.fusion-dropdown-menu') 3157 .addClass('current-menu-item'); 3158 } 3159 3160 active.trigger('activate.bs.scrollspy'); 3161 }; 3162 3163 3164 // SCROLLSPY PLUGIN DEFINITION 3165 // =========================== 3166 3167 var old = $.fn.scrollspy; 3168 3169 $.fn.scrollspy = function (option) { 3170 return this.each(function () { 3171 var $this = $(this); 3172 var data = $this.data('bs.scrollspy'); 3173 var options = typeof option == 'object' && option; 3174 3175 if (!data) $this.data('bs.scrollspy', (data = new ScrollSpy(this, options))); 3176 if (typeof option == 'string') data[option](); 3177 }); 3178 }; 3179 3180 $.fn.scrollspy.Constructor = ScrollSpy; 3181 3182 3183 // SCROLLSPY NO CONFLICT 3184 // ===================== 3185 3186 $.fn.scrollspy.noConflict = function () { 3187 $.fn.scrollspy = old; 3188 return this; 3189 }; 3190 3191 3192 // SCROLLSPY DATA-API 3193 // ================== 3194 3195 $(window).on('load', function () { 3196 $('[data-spy="scroll"]').each(function () { 3197 var $spy = $(this); 3198 $spy.scrollspy($spy.data()); 3199 }); 3200 }); 3201 3202}(jQuery); 3203 3204// Generated by CoffeeScript 1.6.2 3205/* 3206jQuery Waypoints - v2.0.3 3207Copyright (c) 2011-2013 Caleb Troughton 3208Dual licensed under the MIT license and GPL license. 3209https://github.com/imakewebthings/jquery-waypoints/blob/master/licenses.txt 3210*/ 3211 3212 3213(function() { 3214 var __indexOf = [].indexOf || function(item) { for (var i = 0, l = this.length; i < l; i++) { if (i in this && this[i] === item) return i; } return -1; }, 3215 __slice = [].slice; 3216 3217 (function(root, factory) { 3218 if (typeof define === 'function' && define.amd) { 3219 return define('waypoints', ['jquery'], function($) { 3220 return factory($, root); 3221 }); 3222 } else { 3223 return factory(root.jQuery, root); 3224 } 3225 })(this, function($, window) { 3226 var $w, Context, Waypoint, allWaypoints, contextCounter, contextKey, contexts, isTouch, jQMethods, methods, resizeEvent, scrollEvent, waypointCounter, waypointKey, wp, wps; 3227 3228 $w = $(window); 3229 isTouch = __indexOf.call(window, 'ontouchstart') >= 0; 3230 allWaypoints = { 3231 horizontal: {}, 3232 vertical: {} 3233 }; 3234 contextCounter = 1; 3235 contexts = {}; 3236 contextKey = 'waypoints-context-id'; 3237 resizeEvent = 'resize.waypoints'; 3238 scrollEvent = 'scroll.waypoints'; 3239 waypointCounter = 1; 3240 waypointKey = 'waypoints-waypoint-ids'; 3241 wp = 'waypoint'; 3242 wps = 'waypoints'; 3243 Context = (function() { 3244 function Context($element) { 3245 var _this = this; 3246 3247 this.$element = $element; 3248 this.element = $element[0]; 3249 this.didResize = false;
vendor: 9,021 bytes, lines 3250-3577
3250 this.didScroll = false; 3251 this.id = 'context' + contextCounter++; 3252 this.oldScroll = { 3253 x: $element.scrollLeft(), 3254 y: $element.scrollTop() 3255 }; 3256 this.waypoints = { 3257 horizontal: {}, 3258 vertical: {} 3259 }; 3260 $element.data(contextKey, this.id); 3261 contexts[this.id] = this; 3262 $element.bind(scrollEvent, function() { 3263 var scrollHandler; 3264 3265 if (!(_this.didScroll || isTouch)) { 3266 _this.didScroll = true; 3267 scrollHandler = function() { 3268 _this.doScroll(); 3269 return _this.didScroll = false; 3270 }; 3271 return window.setTimeout(scrollHandler, $[wps].settings.scrollThrottle); 3272 } 3273 }); 3274 $element.bind(resizeEvent, function() { 3275 var resizeHandler; 3276 3277 if (!_this.didResize) { 3278 _this.didResize = true; 3279 resizeHandler = function() { 3280 $[wps]('refresh'); 3281 return _this.didResize = false; 3282 }; 3283 return window.setTimeout(resizeHandler, $[wps].settings.resizeThrottle); 3284 } 3285 }); 3286 } 3287 3288 Context.prototype.doScroll = function() { 3289 var axes, 3290 _this = this; 3291 3292 axes = { 3293 horizontal: { 3294 newScroll: this.$element.scrollLeft(), 3295 oldScroll: this.oldScroll.x, 3296 forward: 'right', 3297 backward: 'left' 3298 }, 3299 vertical: { 3300 newScroll: this.$element.scrollTop(), 3301 oldScroll: this.oldScroll.y, 3302 forward: 'down', 3303 backward: 'up' 3304 } 3305 }; 3306 if (isTouch && (!axes.vertical.oldScroll || !axes.vertical.newScroll)) { 3307 $[wps]('refresh'); 3308 } 3309 $.each(axes, function(aKey, axis) { 3310 var direction, isForward, triggered; 3311 3312 triggered = []; 3313 isForward = axis.newScroll > axis.oldScroll; 3314 direction = isForward ? axis.forward : axis.backward; 3315 $.each(_this.waypoints[aKey], function(wKey, waypoint) { 3316 var _ref, _ref1; 3317 3318 if ((axis.oldScroll < (_ref = waypoint.offset) && _ref <= axis.newScroll)) { 3319 return triggered.push(waypoint); 3320 } else if ((axis.newScroll < (_ref1 = waypoint.offset) && _ref1 <= axis.oldScroll)) { 3321 return triggered.push(waypoint); 3322 } 3323 }); 3324 triggered.sort(function(a, b) { 3325 return a.offset - b.offset; 3326 }); 3327 if (!isForward) { 3328 triggered.reverse(); 3329 } 3330 return $.each(triggered, function(i, waypoint) { 3331 if (waypoint.options.continuous || i === triggered.length - 1) { 3332 return waypoint.trigger([direction]); 3333 } 3334 }); 3335 }); 3336 return this.oldScroll = { 3337 x: axes.horizontal.newScroll, 3338 y: axes.vertical.newScroll 3339 }; 3340 }; 3341 3342 Context.prototype.refresh = function() { 3343 var axes, cOffset, isWin, 3344 _this = this; 3345 3346 isWin = $.isWindow(this.element); 3347 cOffset = this.$element.offset(); 3348 this.doScroll(); 3349 axes = { 3350 horizontal: { 3351 contextOffset: isWin ? 0 : cOffset.left, 3352 contextScroll: isWin ? 0 : this.oldScroll.x, 3353 contextDimension: this.$element.width(), 3354 oldScroll: this.oldScroll.x, 3355 forward: 'right', 3356 backward: 'left', 3357 offsetProp: 'left' 3358 }, 3359 vertical: { 3360 contextOffset: isWin ? 0 : cOffset.top, 3361 contextScroll: isWin ? 0 : this.oldScroll.y, 3362 contextDimension: isWin ? $[wps]('viewportHeight') : this.$element.height(), 3363 oldScroll: this.oldScroll.y, 3364 forward: 'down', 3365 backward: 'up', 3366 offsetProp: 'top' 3367 } 3368 }; 3369 return $.each(axes, function(aKey, axis) { 3370 return $.each(_this.waypoints[aKey], function(i, waypoint) { 3371 var adjustment, elementOffset, oldOffset, _ref, _ref1; 3372 3373 adjustment = waypoint.options.offset; 3374 oldOffset = waypoint.offset; 3375 elementOffset = $.isWindow(waypoint.element) ? 0 : waypoint.$element.offset()[axis.offsetProp]; 3376 if ($.isFunction(adjustment)) { 3377 adjustment = adjustment.apply(waypoint.element); 3378 } else if (typeof adjustment === 'string') { 3379 adjustment = parseFloat(adjustment); 3380 if (waypoint.options.offset.indexOf('%') > -1) { 3381 adjustment = Math.ceil(axis.contextDimension * adjustment / 100); 3382 } 3383 } 3384 waypoint.offset = elementOffset - axis.contextOffset + axis.contextScroll - adjustment; 3385 if ((waypoint.options.onlyOnScroll && (oldOffset != null)) || !waypoint.enabled) { 3386 return; 3387 } 3388 if (oldOffset !== null && (oldOffset < (_ref = axis.oldScroll) && _ref <= waypoint.offset)) { 3389 return waypoint.trigger([axis.backward]); 3390 } else if (oldOffset !== null && (oldOffset > (_ref1 = axis.oldScroll) && _ref1 >= waypoint.offset)) { 3391 return waypoint.trigger([axis.forward]); 3392 } else if (oldOffset === null && axis.oldScroll >= waypoint.offset) { 3393 return waypoint.trigger([axis.forward]); 3394 } 3395 }); 3396 }); 3397 }; 3398 3399 Context.prototype.checkEmpty = function() { 3400 if ($.isEmptyObject(this.waypoints.horizontal) && $.isEmptyObject(this.waypoints.vertical)) { 3401 this.$element.unbind([resizeEvent, scrollEvent].join(' ')); 3402 return delete contexts[this.id]; 3403 } 3404 }; 3405 3406 return Context; 3407 3408 })(); 3409 Waypoint = (function() { 3410 function Waypoint($element, context, options) { 3411 var idList, _ref; 3412 3413 options = $.extend({}, $.fn[wp].defaults, options); 3414 if (options.offset === 'bottom-in-view') { 3415 options.offset = function() { 3416 var contextHeight; 3417 3418 contextHeight = $[wps]('viewportHeight'); 3419 if (!$.isWindow(context.element)) { 3420 contextHeight = context.$element.height(); 3421 } 3422 return contextHeight - $(this).outerHeight(); 3423 }; 3424 } 3425 this.$element = $element; 3426 this.element = $element[0]; 3427 this.axis = options.horizontal ? 'horizontal' : 'vertical'; 3428 this.callback = options.handler; 3429 this.context = context; 3430 this.enabled = options.enabled; 3431 this.id = 'waypoints' + waypointCounter++; 3432 this.offset = null; 3433 this.options = options; 3434 context.waypoints[this.axis][this.id] = this; 3435 allWaypoints[this.axis][this.id] = this; 3436 idList = (_ref = $element.data(waypointKey)) != null ? _ref : []; 3437 idList.push(this.id); 3438 $element.data(waypointKey, idList); 3439 } 3440 3441 Waypoint.prototype.trigger = function(args) { 3442 if (!this.enabled) { 3443 return; 3444 } 3445 if (this.callback != null) { 3446 this.callback.apply(this.element, args); 3447 } 3448 if (this.options.triggerOnce) { 3449 return this.destroy(); 3450 } 3451 }; 3452 3453 Waypoint.prototype.disable = function() { 3454 return this.enabled = false; 3455 }; 3456 3457 Waypoint.prototype.enable = function() { 3458 this.context.refresh(); 3459 return this.enabled = true; 3460 }; 3461 3462 Waypoint.prototype.destroy = function() { 3463 delete allWaypoints[this.axis][this.id]; 3464 delete this.context.waypoints[this.axis][this.id]; 3465 return this.context.checkEmpty(); 3466 }; 3467 3468 Waypoint.getWaypointsByElement = function(element) { 3469 var all, ids; 3470 3471 ids = $(element).data(waypointKey); 3472 if (!ids) { 3473 return []; 3474 } 3475 all = $.extend({}, allWaypoints.horizontal, allWaypoints.vertical); 3476 return $.map(ids, function(id) { 3477 return all[id]; 3478 }); 3479 }; 3480 3481 return Waypoint; 3482 3483 })(); 3484 methods = { 3485 init: function(f, options) { 3486 var _ref; 3487 3488 if (options == null) { 3489 options = {}; 3490 } 3491 if ((_ref = options.handler) == null) { 3492 options.handler = f; 3493 } 3494 this.each(function() { 3495 var $this, context, contextElement, _ref1; 3496 3497 $this = $(this); 3498 contextElement = (_ref1 = options.context) != null ? _ref1 : $.fn[wp].defaults.context; 3499 if (!$.isWindow(contextElement)) { 3500 contextElement = $this.closest(contextElement); 3501 } 3502 contextElement = $(contextElement); 3503 context = contexts[contextElement.data(contextKey)]; 3504 if (!context) { 3505 context = new Context(contextElement); 3506 } 3507 return new Waypoint($this, context, options); 3508 }); 3509 $[wps]('refresh'); 3510 return this; 3511 }, 3512 disable: function() { 3513 return methods._invoke(this, 'disable'); 3514 }, 3515 enable: function() { 3516 return methods._invoke(this, 'enable'); 3517 }, 3518 destroy: function() { 3519 return methods._invoke(this, 'destroy'); 3520 }, 3521 prev: function(axis, selector) { 3522 return methods._traverse.call(this, axis, selector, function(stack, index, waypoints) { 3523 if (index > 0) { 3524 return stack.push(waypoints[index - 1]); 3525 } 3526 }); 3527 }, 3528 next: function(axis, selector) { 3529 return methods._traverse.call(this, axis, selector, function(stack, index, waypoints) { 3530 if (index < waypoints.length - 1) { 3531 return stack.push(waypoints[index + 1]); 3532 } 3533 }); 3534 }, 3535 _traverse: function(axis, selector, push) { 3536 var stack, waypoints; 3537 3538 if (axis == null) { 3539 axis = 'vertical'; 3540 } 3541 if (selector == null) { 3542 selector = window; 3543 } 3544 waypoints = jQMethods.aggregate(selector); 3545 stack = []; 3546 this.each(function() { 3547 var index; 3548 3549 index = $.inArray(this, waypoints[axis]); 3550 return push(stack, index, waypoints[axis]); 3551 }); 3552 return this.pushStack(stack); 3553 }, 3554 _invoke: function($elements, method) { 3555 $elements.each(function() { 3556 var waypoints; 3557 3558 waypoints = Waypoint.getWaypointsByElement(this); 3559 return $.each(waypoints, function(i, waypoint) { 3560 waypoint[method](); 3561 return true; 3562 }); 3563 }); 3564 return this; 3565 } 3566 }; 3567 $.fn[wp] = function() { 3568 var args, method; 3569 3570 method = arguments[0], args = 2 <= arguments.length ? __slice.call(arguments, 1) : []; 3571 if (methods[method]) { 3572 return methods[method].apply(this, args); 3573 } else if ($.isFunction(method)) { 3574 return methods.init.apply(this, arguments); 3575 } else if ($.isPlainObject(method)) { 3576 return methods.init.apply(this, [null, method]); 3577 }
3577 else if (!method) { 3578 return $.error("jQuery Waypoints needs a callback function or handler option."); 3579 } else { 3580 return $.error("The " + method + " method does not exist in jQuery Waypoints."); 3581 } 3582 }; 3583 $.fn[wp].defaults = { 3584 context: window, 3585 continuous: true, 3586 enabled: true, 3587 horizontal: false, 3588 offset: 0, 3589 triggerOnce: false 3590 }; 3591 jQMethods = { 3592 refresh: function() { 3593 return $.each(contexts, function(i, context) { 3594 return context.refresh(); 3595 }); 3596 }, 3597 viewportHeight: function() { 3598 var _ref; 3599 3600 return (_ref = window.innerHeight) != null ? _ref : $w.height(); 3601 }, 3602 aggregate: function(contextSelector) { 3603 var collection, waypoints, _ref; 3604 3605 collection = allWaypoints; 3606 if (contextSelector) { 3607 collection = (_ref = contexts[$(contextSelector).data(contextKey)]) != null ? _ref.waypoints : void 0; 3608 } 3609 if (!collection) { 3610 return []; 3611 } 3612 waypoints = { 3613 horizontal: [], 3614 vertical: [] 3615 }; 3616 $.each(waypoints, function(axis, arr) { 3617 $.each(collection[axis], function(key, waypoint) { 3618 return arr.push(waypoint); 3619 }); 3620 arr.sort(function(a, b) { 3621 return a.offset - b.offset; 3622 }); 3623 waypoints[axis] = $.map(arr, function(waypoint) { 3624 return waypoint.element; 3625 }); 3626 return waypoints[axis] = $.unique(waypoints[axis]); 3627 }); 3628 return waypoints; 3629 }, 3630 above: function(contextSelector) { 3631 if (contextSelector == null) { 3632 contextSelector = window; 3633 } 3634 return jQMethods._filter(contextSelector, 'vertical', function(context, waypoint) { 3635 return waypoint.offset <= context.oldScroll.y; 3636 }); 3637 }, 3638 below: function(contextSelector) { 3639 if (contextSelector == null) { 3640 contextSelector = window; 3641 } 3642 return jQMethods._filter(contextSelector, 'vertical', function(context, waypoint) { 3643 return waypoint.offset > context.oldScroll.y; 3644 }); 3645 }, 3646 left: function(contextSelector) { 3647 if (contextSelector == null) { 3648 contextSelector = window; 3649 } 3650 return jQMethods._filter(contextSelector, 'horizontal', function(context, waypoint) { 3651 return waypoint.offset <= context.oldScroll.x; 3652 }); 3653 }, 3654 right: function(contextSelector) { 3655 if (contextSelector == null) { 3656 contextSelector = window; 3657 } 3658 return jQMethods._filter(contextSelector, 'horizontal', function(context, waypoint) { 3659 return waypoint.offset > context.oldScroll.x; 3660 }); 3661 }, 3662 enable: function() { 3663 return jQMethods._invoke('enable'); 3664 }, 3665 disable: function() { 3666 return jQMethods._invoke('disable'); 3667 }, 3668 destroy: function() { 3669 return jQMethods._invoke('destroy'); 3670 }, 3671 extendFn: function(methodName, f) { 3672 return methods[methodName] = f; 3673 }, 3674 _invoke: function(method) { 3675 var waypoints; 3676 3677 waypoints = $.extend({}, allWaypoints.vertical, allWaypoints.horizontal); 3678 return $.each(waypoints, function(key, waypoint) { 3679 waypoint[method](); 3680 return true; 3681 }); 3682 }, 3683 _filter: function(selector, axis, test) { 3684 var context, waypoints; 3685 3686 context = contexts[$(selector).data(contextKey)]; 3687 if (!context) { 3688 return []; 3689 } 3690 waypoints = []; 3691 $.each(context.waypoints[axis], function(i, waypoint) { 3692 if (test(context, waypoint)) { 3693 return waypoints.push(waypoint); 3694 } 3695 }); 3696 waypoints.sort(function(a, b) { 3697 return a.offset - b.offset; 3698 }); 3699 return $.map(waypoints, function(waypoint) { 3700 return waypoint.element; 3701 }); 3702 } 3703 }; 3704 $[wps] = function() { 3705 var args, method; 3706 3707 method = arguments[0], args = 2 <= arguments.length ? __slice.call(arguments, 1) : []; 3708 if (jQMethods[method]) { 3709 return jQMethods[method].apply(null, args); 3710 } else { 3711 return jQMethods.aggregate.call(null, method); 3712 } 3713 }; 3714 $[wps].settings = { 3715 resizeThrottle: 100, 3716 scrollThrottle: 30 3717 }; 3718 return $w.load(function() { 3719 return $[wps]('refresh'); 3720 }); 3721 }); 3722 3723}).call(this); 3724 3725/*! http://mths.be/placeholder v2.0.7 by @mathias */ 3726;(function(window, document, $) { 3727 3728 var isInputSupported = 'placeholder' in document.createElement('input'); 3729 var isTextareaSupported = 'placeholder' in document.createElement('textarea'); 3730 var prototype = $.fn; 3731 var valHooks = $.valHooks; 3732 var propHooks = $.propHooks; 3733 var hooks; 3734 var placeholder; 3735 3736 if (isInputSupported && isTextareaSupported) { 3737 3738 placeholder = prototype.placeholder = function() { 3739 return this; 3740 }; 3741 3742 placeholder.input = placeholder.textarea = true; 3743 3744 } else { 3745 3746 placeholder = prototype.placeholder = function() { 3747 var $this = this; 3748 $this 3749 .filter((isInputSupported ? 'textarea' : ':input') + '[placeholder]') 3750 .not('.placeholder') 3751 .bind({
3752 'focus.placeholder': clearPlaceholder, 3753 'blur.placeholder': setPlaceholder 3754 }) 3755 .data('placeholder-enabled', true) 3756 .trigger('blur.placeholder'); 3757 return $this; 3758 }; 3759 3760 placeholder.input = isInputSupported; 3761 placeholder.textarea = isTextareaSupported; 3762 3763 hooks = { 3764 'get': function(element) { 3765 var $element = $(element); 3766 3767 var $passwordInput = $element.data('placeholder-password'); 3768 if ($passwordInput) { 3769 return $passwordInput[0].value; 3770 } 3771 3772 return $element.data('placeholder-enabled') && $element.hasClass('placeholder') ? '' : element.value; 3773 }, 3774 'set': function(element, value) { 3775 var $element = $(element); 3776 3777 var $passwordInput = $element.data('placeholder-password'); 3778 if ($passwordInput) { 3779 return $passwordInput[0].value = value; 3780 } 3781 3782 if (!$element.data('placeholder-enabled')) { 3783 return element.value = value; 3784 } 3785 if (value == '') { 3786 element.value = value; 3787 // Issue #56: Setting the placeholder causes problems if the element continues to have focus. 3788 if (element != safeActiveElement()) { 3789 // We can't use `triggerHandler` here because of dummy text/password inputs :( 3790 setPlaceholder.call(element); 3791 } 3792 } else if ($element.hasClass('placeholder')) { 3793 clearPlaceholder.call(element, true, value) || (element.value = value); 3794 } else { 3795 element.value = value; 3796 } 3797 // `set` can not return `undefined`; see http://jsapi.info/jquery/1.7.1/val#L2363 3798 return $element; 3799 } 3800 }; 3801 3802 if (!isInputSupported) { 3803 valHooks.input = hooks; 3804 propHooks.value = hooks; 3805 } 3806 if (!isTextareaSupported) { 3807 valHooks.textarea = hooks; 3808 propHooks.value = hooks; 3809 } 3810 3811 $(function() { 3812 // Look for forms 3813 $(document).delegate('form', 'submit.placeholder', function() { 3814 // Clear the placeholder values so they don't get submitted 3815 var $inputs = $('.placeholder', this).each(clearPlaceholder); 3816 setTimeout(function() { 3817 $inputs.each(setPlaceholder); 3818 }, 10); 3819 }); 3820 }); 3821 3822 // Clear placeholder values upon page reload 3823 $(window).bind('beforeunload.placeholder', function() { 3824 $('.placeholder').each(function() { 3825 this.value = ''; 3826 }); 3827 }); 3828 3829 } 3830 3831 function args(elem) { 3832 // Return an object of element attributes 3833 var newAttrs = {}; 3834 var rinlinejQuery = /^jQuery\d+$/; 3835 $.each(elem.attributes, function(i, attr) { 3836 if (attr.specified && !rinlinejQuery.test(attr.name)) { 3837 newAttrs[attr.name] = attr.value; 3838 } 3839 }); 3840 return newAttrs; 3841 } 3842 3843 function clearPlaceholder(event, value) { 3844 var input = this; 3845 var $input = $(input); 3846 if (input.value == $input.attr('placeholder') && $input.hasClass('placeholder')) { 3847 if ($input.data('placeholder-password')) { 3848 $input = $input.hide().next().show().attr('id', $input.removeAttr('id').data('placeholder-id')); 3849 // If `clearPlaceholder` was called from `$.valHooks.input.set` 3850 if (event === true) { 3851 return $input[0].value = value; 3852 } 3853 $input.focus(); 3854 } else { 3855 input.value = ''; 3856 $input.removeClass('placeholder'); 3857 input == safeActiveElement() && input.select(); 3858 } 3859 } 3860 } 3861 3862 function setPlaceholder() { 3863 var $replacement; 3864 var input = this; 3865 var $input = $(input); 3866 var id = this.id; 3867 if (input.value == '') { 3868 if (input.type == 'password') { 3869 if (!$input.data('placeholder-textinput')) { 3870 try { 3871 $replacement = $input.clone().attr({ 'type': 'text' }); 3872 } catch(e) { 3873 $replacement = $('<input>').attr($.extend(args(this), { 'type': 'text' })); 3874 } 3875 $replacement 3876 .removeAttr('name') 3877 .data({ 3878 'placeholder-password': $input, 3879 'placeholder-id': id 3880 }) 3881 .bind('focus.placeholder', clearPlaceholder); 3882 $input 3883 .data({ 3884 'placeholder-textinput': $replacement, 3885 'placeholder-id': id 3886 }) 3887 .before($replacement); 3888 } 3889 $input = $input.removeAttr('id').hide().prev().attr('id', id).show(); 3890 // Note: `$input[0] != input` now! 3891 } 3892 $input.addClass('placeholder'); 3893 $input[0].value = $input.attr('placeholder'); 3894 } else { 3895 $input.removeClass('placeholder'); 3896 } 3897 } 3898 3899 function safeActiveElement() { 3900 // Avoid IE9 `document.activeElement` of death 3901 // https://github.com/mathiasbynens/jquery-placeholder/pull/99 3902 try { 3903 return document.activeElement; 3904 } catch (err) {} 3905 } 3906 3907}(this, document, jQuery)); 3908 3909/*! 3910 * Isotope PACKAGED v2.0.0 3911 * Filter & sort magical layouts 3912 * http://isotope.metafizzy.co 3913 */ 3914 3915(function(t){function e(){}function i(t){function i(e){e.prototype.option||(e.prototype.option=function(e){t.isPlainObject(e)&&(this.options=t.extend(!0,this.options,e))})}function n(e,i){t.fn[e]=function(n){if("string"==typeof n){for(var s=o.call(arguments,1
3915),a=0,u=this.length;u>a;a++){var p=this[a],h=t.data(p,e);if(h)if(t.isFunction(h[n])&&"_"!==n.charAt(0)){var f=h[n].apply(h,s);if(void 0!==f)return f}else r("no such method '"+n+"' for "+e+" instance");else r("cannot call methods on "+e+" prior to initialization; "+"attempted to call '"+n+"'")}return this}return this.each(function(){var o=t.data(this,e);o?(o.option(n),o._init()):(o=new i(this,n),t.data(this,e,o))})}}if(t){var r="undefined"==typeof console?e:function(t){console.error(t)};return t.bridget=function(t,e){i(e),n(t,e)},t.bridget}}var o=Array.prototype.slice;"function"==typeof define&&define.amd?define("jquery-bridget/jquery.bridget",["jquery"],i):i(t.jQuery)})(window),function(t){function e(e){var i=t.event;return i.target=i.target||i.srcElement||e,i}var i=document.documentElement,o=function(){};i.addEventListener?o=function(t,e,i){t.addEventListener(e,i,!1)}:i.attachEvent&&(o=function(t,i,o){t[i+o]=o.handleEvent?function(){var i=e(t);o.handleEvent.call(o,i)}:function(){var i=e(t);o.call(t,i)},t.attachEvent("on"+i,t[i+o])});var n=function(){};i.removeEventListener?n=function(t,e,i){t.removeEventListener(e,i,!1)}:i.detachEvent&&(n=function(t,e,i){t.detachEvent("on"+e,t[e+i]);try{delete t[e+i]}catch(o){t[e+i]=void 0}});var r={bind:o,unbind:n};"function"==typeof define&&define.amd?define("eventie/eventie",r):"object"==typeof exports?module.exports=r:t.eventie=r}(this),function(t){function e(t){"function"==typeof t&&(e.isReady?t():r.push(t))}function i(t){var i="readystatechange"===t.type&&"complete"!==n.readyState;if(!e.isReady&&!i){e.isReady=!0;for(var o=0,s=r.length;s>o;o++){var a=r[o];a()}}}function o(o){return o.bind(n,"DOMContentLoaded",i),o.bind(n,"readystatechange",i),o.bind(t,"load",i),e}var n=t.document,r=[];e.isReady=!1,"function"==typeof define&&define.amd?(e.isReady="function"==typeof requirejs,define("doc-ready/doc-ready",["eventie/eventie"],o)):t.docReady=o(t.eventie)}(this),function(){function t(){}function e(t,e){for(var i=t.length;i--;)if(t[i].listener===e)return i;return-1}function i(t){return function(){return this[t].apply(this,arguments)}}var o=t.prototype,n=this,r=n.EventEmitter;o.getListeners=function(t){var e,i,o=this._getEvents();if(t instanceof RegExp){e={};for(i in o)o.hasOwnProperty(i)&&t.test(i)&&(e[i]=o[i])}else e=o[t]||(o[t]=[]);return e},o.flattenListeners=function(t){var e,i=[];for(e=0;t.length>e;e+=1)i.push(t[e].listener);return i},o.getListenersAsObject=function(t){var e,i=this.getListeners(t);return i instanceof Array&&(e={},e[t]=i),e||i},o.addListener=function(t,i){var o,n=this.getListenersAsObject(t),r="object"==typeof i;for(o in n)n.hasOwnProperty(o)&&-1===e(n[o],i)&&n[o].push(r?i:{listener:i,once:!1});return this},o.on=i("addListener"),o.addOnceListener=function(t,e){return this.addListener(t,{listener:e,once:!0})},o.once=i("addOnceListener"),o.defineEvent=function(t){return this.getListeners(t),this},o.defineEvents=function(t){for(var e=0;t.length>e;e+=1)this.defineEvent(t[e]);return this},o.removeListener=function(t,i){var o,n,r=this.getListenersAsObject(t);for(n in r)r.hasOwnProperty(n)&&(o=e(r[n],i),-1!==o&&r[n].splice(o,1));return this},o.off=i("removeListener"),o.addListeners=function(t,e){return this.manipulateListeners(!1,t,e)},o.removeListeners=function(t,e){return this.manipulateListeners(!0,t,e)},o.manipulateListeners=function(t,e,i){var o,n,r=t?this.removeListener:this.addListener,s=t?this.removeListeners:this.addListeners;if("object"!=typeof e||e instanceof RegExp)for(o=i.length;o--;)r.call(this,e,i[o]);else for(o in e)e.hasOwnProperty(o)&&(n=e[o])&&("function"==typeof n?r.call(this,o,n):s.call(this,o,n));return this},o.removeEvent=function(t){var e,i=typeof t,o=this._getEvents();if("string"===i)delete o[t];else if(t instanceof RegExp)for(e in o)o.hasOwnProperty(e)&&t.test(e)&&delete o[e];else delete this._events;return this},o.removeAllListeners=i("removeEvent"),o.emitEvent=function(t,e){var i,o,n,r,s=this.getListenersAsObject(t);for(n in s)if(s.hasOwnProperty(n))for(o=s[n].length;o--;)i=s[n][o],i.once===!0&&this.removeListener(t,i.listener),r=i.listener.apply(this,e||[]),r===this._getOnceReturnValue()&&this.removeListener(t,i.listener);return this},o.trigger=i("emitEvent"),o.emit=function(t){var e=Array.prototype.slice.call(arguments,1
3915);return this.emitEvent(t,e)},o.setOnceReturnValue=function(t){return this._onceReturnValue=t,this},o._getOnceReturnValue=function(){return this.hasOwnProperty("_onceReturnValue")?this._onceReturnValue:!0},o._getEvents=function(){return this._events||(this._events={})},t.noConflict=function(){return n.EventEmitter=r,t},"function"==typeof define&&define.amd?define("eventEmitter/EventEmitter",[],function(){return t}):"object"==typeof module&&module.exports?module.exports=t:this.EventEmitter=t}.call(this),function(t){function e(t){if(t){if("string"==typeof o[t])return t;t=t.charAt(0).toUpperCase()+t.slice(1);for(var e,n=0,r=i.length;r>n;n++)if(e=i[n]+t,"string"==typeof o[e])return e}}var i="Webkit Moz ms Ms O".split(" "),o=document.documentElement.style;"function"==typeof define&&define.amd?define("get-style-property/get-style-property",[],function(){return e}):"object"==typeof exports?module.exports=e:t.getStyleProperty=e}(window),function(t){function e(t){var e=parseFloat(t),i=-1===t.indexOf("%")&&!isNaN(e);return i&&e}function i(){for(var t={width:0,height:0,innerWidth:0,innerHeight:0,outerWidth:0,outerHeight:0},e=0,i=s.length;i>e;e++){var o=s[e];t[o]=0}return t}function o(t){function o(t){if("string"==typeof t&&(t=document.querySelector(t)),t&&"object"==typeof t&&t.nodeType){var o=r(t);if("none"===o.display)return i();var n={};n.width=t.offsetWidth,n.height=t.offsetHeight;for(var h=n.isBorderBox=!(!p||!o[p]||"border-box"!==o[p]),f=0,c=s.length;c>f;f++){var d=s[f],l=o[d];l=a(t,l);var y=parseFloat(l);n[d]=isNaN(y)?0:y}var m=n.paddingLeft+n.paddingRight,g=n.paddingTop+n.paddingBottom,v=n.marginLeft+n.marginRight,_=n.marginTop+n.marginBottom,I=n.borderLeftWidth+n.borderRightWidth,L=n.borderTopWidth+n.borderBottomWidth,z=h&&u,S=e(o.width);S!==!1&&(n.width=S+(z?0:m+I));var b=e(o.height);return b!==!1&&(n.height=b+(z?0:g+L)),n.innerWidth=n.width-(m+I),n.innerHeight=n.height-(g+L),n.outerWidth=n.width+v,n.outerHeight=n.height+_,n}}function a(t,e){if(n||-1===e.indexOf("%"))return e;var i=t.style,o=i.left,r=t.runtimeStyle,s=r&&r.left;return s&&(r.left=t.currentStyle.left),i.left=e,e=i.pixelLeft,i.left=o,s&&(r.left=s),e}var u,p=t("boxSizing");return function(){if(p){var t=document.createElement("div");t.style.width="200px",t.style.padding="1px 2px 3px 4px",t.style.borderStyle="solid",t.style.borderWidth="1px 2px 3px 4px",t.style[p]="border-box";var i=document.body||document.documentElement;i.appendChild(t);var o=r(t);u=200===e(o.width),i.removeChild(t)}}(),o}var n=t.getComputedStyle,r=n?function(t){return n(t,null)}:function(t){return t.currentStyle},s=["paddingLeft","paddingRight","paddingTop","paddingBottom","marginLeft","marginRight","marginTop","marginBottom","borderLeftWidth","borderRightWidth","borderTopWidth","borderBottomWidth"];"function"==typeof define&&define.amd?define("get-size/get-size",["get-style-property/get-style-property"],o):"object"==typeof exports?module.exports=o(require("get-style-property")):t.getSize=o(t.getStyleProperty)}(window),function(t,e){function i(t,e){return t[a](e)}function o(t){if(!t.parentNode){var e=document.createDocumentFragment();e.appendChild(t)}}function n(t,e){o(t);for(var i=t.parentNode.querySelectorAll(e),n=0,r=i.length;r>n;n++)if(i[n]===t)return!0;return!1}function r(t,e){return o(t),i(t,e)}var s,a=function(){if(e.matchesSelector)return"matchesSelector";for(var t=["webkit","moz","ms","o"],i=0,o=t.length;o>i;i++){var n=t[i],r=n+"MatchesSelector";if(e[r])return r}}();if(a){var u=document.createElement("div"),p=i(u,"div");s=p?i:r}else s=n;"function"==typeof define&&define.amd?define("matches-selector/matches-selector",[],function(){return s}):window.matchesSelector=s}(this,Element.prototype),function(t){function e(t,e){for(var i in e)t[i]=e[i];return t}function i(t){for(var e in t)return!1;return e=null,!0}function o(t){return t.replace(/([A-Z])/g,function(t){return"-"+t.toLowerCase()})}function n(t,n,r){function a(t,e){t&&(this.element=t,this.layout=e,this.position={x:0,y:0},this._create())}var u=r("transition"),p=r("transform"),h=u&&p,f=!!r("perspective"),c={WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"otransitionend",transition:"transitionend"}[u],d=["transform","transition","transitionDuration","transitionProperty"],l=function(){for(var t={},e=0,i=d.length;i>e;e++){var o=d[e],n=r(o);n&&n!==o&&(t[o]=n)}return t}();e(a.prototype,t.prototype),a.prototype._create=function(){this._transn={ingProperties:{},clean:{},onEnd:{}},this.css({position:"absolute"})},a.prototype.handleEvent=function(t){var e="on"+t.type;this[e]&&this[e](t)},a.prototype.getSize=function(){this.size=n(this.element)},a.prototype.css=function(t){var e=this.element.style;for(var i in t){var o=l[i]||i;e[o]=t[i]}},a.prototype.getPosition=function(){var t=s(this.element),e=this.layout.options,i=e.isOriginLeft,o=e.isOriginTop,n=parseInt(t[i?"left":"right"],10),r=parseInt(t[o?"top":"bottom"],10);n=isNaN(n)?0:n,r=isNaN(r)?0:r;var a=this.layout.size;n-=i?a.paddingLeft:a.paddingRight,r-=o?a.paddingTop:a.paddingBottom,this.position.x=n,this.position.y=r},a.prototype.layoutPosition=function(){var t=this.layout.size,e=this.layout.options,i={};
3915e.isOriginLeft?(i.left=this.position.x+t.paddingLeft+"px",i.right=""):(i.right=this.position.x+t.paddingRight+"px",i.left=""),e.isOriginTop?(i.top=this.position.y+t.paddingTop+"px",i.bottom=""):(i.bottom=this.position.y+t.paddingBottom+"px",i.top=""),this.css(i),this.emitEvent("layout",[this])};var y=f?function(t,e){return"translate3d("+t+"px, "+e+"px, 0)"}:function(t,e){return"translate("+t+"px, "+e+"px)"};a.prototype._transitionTo=function(t,e){this.getPosition();var i=this.position.x,o=this.position.y,n=parseInt(t,10),r=parseInt(e,10),s=n===this.position.x&&r===this.position.y;if(this.setPosition(t,e),s&&!this.isTransitioning)return this.layoutPosition(),void 0;var a=t-i,u=e-o,p={},h=this.layout.options;a=h.isOriginLeft?a:-a,u=h.isOriginTop?u:-u,p.transform=y(a,u),this.transition({to:p,onTransitionEnd:{transform:this.layoutPosition},isCleaning:!0})},a.prototype.goTo=function(t,e){this.setPosition(t,e),this.layoutPosition()},a.prototype.moveTo=h?a.prototype._transitionTo:a.prototype.goTo,a.prototype.setPosition=function(t,e){this.position.x=parseInt(t,10),this.position.y=parseInt(e,10)},a.prototype._nonTransition=function(t){this.css(t.to),t.isCleaning&&this._removeStyles(t.to);for(var e in t.onTransitionEnd)t.onTransitionEnd[e].call(this)},a.prototype._transition=function(t){if(!parseFloat(this.layout.options.transitionDuration))return this._nonTransition(t),void 0;var e=this._transn;for(var i in t.onTransitionEnd)e.onEnd[i]=t.onTransitionEnd[i];for(i in t.to)e.ingProperties[i]=!0,t.isCleaning&&(e.clean[i]=!0);if(t.from){this.css(t.from);var o=this.element.offsetHeight;o=null}this.enableTransition(t.to),this.css(t.to),this.isTransitioning=!0};var m=p&&o(p)+",opacity";a.prototype.enableTransition=function(){this.isTransitioning||(this.css({transitionProperty:m,transitionDuration:this.layout.options.transitionDuration}),this.element.addEventListener(c,this,!1))},a.prototype.transition=a.prototype[u?"_transition":"_nonTransition"],a.prototype.onwebkitTransitionEnd=function(t){this.ontransitionend(t)},a.prototype.onotransitionend=function(t){this.ontransitionend(t)};var g={"-webkit-transform":"transform","-moz-transform":"transform","-o-transform":"transform"};a.prototype.ontransitionend=function(t){if(t.target===this.element){var e=this._transn,o=g[t.propertyName]||t.propertyName;if(delete e.ingProperties[o],i(e.ingProperties)&&this.disableTransition(),o in e.clean&&(this.element.style[t.propertyName]="",delete e.clean[o]),o in e.onEnd){var n=e.onEnd[o];n.call(this),delete e.onEnd[o]}this.emitEvent("transitionEnd",[this])}},a.prototype.disableTransition=function(){this.removeTransitionStyles(),this.element.removeEventListener(c,this,!1),this.isTransitioning=!1},a.prototype._removeStyles=function(t){var e={};for(var i in t)e[i]="";this.css(e)};var v={transitionProperty:"",transitionDuration:""};return a.prototype.removeTransitionStyles=function(){this.css(v)},a.prototype.removeElem=function(){this.element.parentNode.removeChild(this.element),this.emitEvent("remove",[this])},a.prototype.remove=function(){if(!u||!parseFloat(this.layout.options.transitionDuration))return this.removeElem(),void 0;var t=this;this.on("transitionEnd",function(){return t.removeElem(),!0}),this.hide()},a.prototype.reveal=function(){delete this.isHidden,this.css({display:""});var t=this.layout.options;this.transition({from:t.hiddenStyle,to:t.visibleStyle,isCleaning:!0})},a.prototype.hide=function(){this.isHidden=!0,this.css({display:""});var t=this.layout.options;this.transition({from:t.visibleStyle,to:t.hiddenStyle,isCleaning:!0,onTransitionEnd:{opacity:function(){this.isHidden&&this.css({display:"none"})}}})},a.prototype.destroy=function(){this.css({position:"",left:"",right:"",top:"",bottom:"",transition:"",transform:""})},a}var r=t.getComputedStyle,s=r?function(t){return r(t,null)}:function(t){return t.currentStyle};"function"==typeof define&&define.amd?define("outlayer/item",["eventEmitter/EventEmitter","get-size/get-size","get-style-property/get-style-property"],n):(t.Outlayer={},t.Outlayer.Item=n(t.EventEmitter,t.getSize,t.getStyleProperty))}(window),function(t){function e(t,e){for(var i in e)t[i]=e[i];return t}function i(t){return"[object Array]"===f.call(t)}function o(t){var e=[];
3915if(i(t))e=t;else if(t&&"number"==typeof t.length)for(var o=0,n=t.length;n>o;o++)e.push(t[o]);else e.push(t);return e}function n(t,e){var i=d(e,t);-1!==i&&e.splice(i,1)}function r(t){return t.replace(/(.)([A-Z])/g,function(t,e,i){return e+"-"+i}).toLowerCase()}function s(i,s,f,d,l,y){function m(t,i){if("string"==typeof t&&(t=a.querySelector(t)),!t||!c(t))return u&&u.error("Bad "+this.constructor.namespace+" element: "+t),void 0;this.element=t,this.options=e({},this.constructor.defaults),this.option(i);var o=++g;this.element.outlayerGUID=o,v[o]=this,this._create(),this.options.isInitLayout&&this.layout()}var g=0,v={};return m.namespace="outlayer",m.Item=y,m.defaults={containerStyle:{position:"relative"},isInitLayout:!0,isOriginLeft:!0,isOriginTop:!0,isResizeBound:!0,isResizingContainer:!0,transitionDuration:"0.4s",hiddenStyle:{opacity:0,transform:"scale(0.001)"},visibleStyle:{opacity:1,transform:"scale(1)"}},e(m.prototype,f.prototype),m.prototype.option=function(t){e(this.options,t)},m.prototype._create=function(){this.reloadItems(),this.stamps=[],this.stamp(this.options.stamp),e(this.element.style,this.options.containerStyle),this.options.isResizeBound&&this.bindResize()},m.prototype.reloadItems=function(){this.items=this._itemize(this.element.children)},m.prototype._itemize=function(t){for(var e=this._filterFindItemElements(t),i=this.constructor.Item,o=[],n=0,r=e.length;r>n;n++){var s=e[n],a=new i(s,this);o.push(a)}return o},m.prototype._filterFindItemElements=function(t){t=o(t);for(var e=this.options.itemSelector,i=[],n=0,r=t.length;r>n;n++){var s=t[n];if(c(s))if(e){l(s,e)&&i.push(s);for(var a=s.querySelectorAll(e),u=0,p=a.length;p>u;u++)i.push(a[u])}else i.push(s)}return i},m.prototype.getItemElements=function(){for(var t=[],e=0,i=this.items.length;i>e;e++)t.push(this.items[e].element);return t},m.prototype.layout=function(){this._resetLayout(),this._manageStamps();var t=void 0!==this.options.isLayoutInstant?this.options.isLayoutInstant:!this._isLayoutInited;this.layoutItems(this.items,t),this._isLayoutInited=!0},m.prototype._init=m.prototype.layout,m.prototype._resetLayout=function(){this.getSize()},m.prototype.getSize=function(){this.size=d(this.element)},m.prototype._getMeasurement=function(t,e){var i,o=this.options[t];o?("string"==typeof o?i=this.element.querySelector(o):c(o)&&(i=o),this[t]=i?d(i)[e]:o):this[t]=0},m.prototype.layoutItems=function(t,e){t=this._getItemsForLayout(t),this._layoutItems(t,e),this._postLayout()},m.prototype._getItemsForLayout=function(t){for(var e=[],i=0,o=t.length;o>i;i++){var n=t[i];n.isIgnored||e.push(n)}return e},m.prototype._layoutItems=function(t,e){function i(){o.emitEvent("layoutComplete",[o,t])}var o=this;if(!t||!t.length)return i(),void 0;this._itemsOn(t,"layout",i);for(var n=[],r=0,s=t.length;s>r;r++){var a=t[r],u=this._getItemLayoutPosition(a);u.item=a,u.isInstant=e||a.isLayoutInstant,n.push(u)}this._processLayoutQueue(n)},m.prototype._getItemLayoutPosition=function(){return{x:0,y:0}},m.prototype._processLayoutQueue=function(t){for(var e=0,i=t.length;i>e;e++){var o=t[e];this._positionItem(o.item,o.x,o.y,o.isInstant)}},m.prototype._positionItem=function(t,e,i,o){o?t.goTo(e,i):t.moveTo(e,i)},m.prototype._postLayout=function(){this.resizeContainer()},m.prototype.resizeContainer=function(){if(this.options.isResizingContainer){var t=this._getContainerSize();t&&(this._setContainerMeasure(t.width,!0),this._setContainerMeasure(t.height,!1))}},m.prototype._getContainerSize=h,m.prototype._setContainerMeasure=function(t,e){if(void 0!==t){var i=this.size;i.isBorderBox&&(t+=e?i.paddingLeft+i.paddingRight+i.borderLeftWidth+i.borderRightWidth:i.paddingBottom+i.paddingTop+i.borderTopWidth+i.borderBottomWidth),t=Math.max(t,0),this.element.style[e?"width":"height"]=t+"px"}},m.prototype._itemsOn=function(t,e,i){function o(){return n++,n===r&&i.call(s),!0}for(var n=0,r=t.length,s=this,a=0,u=t.length;u>a;a++){var p=t[a];p.on(e,o)}},m.prototype.ignore=function(t){var e=this.getItem(t);e&&(e.isIgnored=!0)},m.prototype.unignore=function(t){var e=this.getItem(t);e&&delete e.isIgnored},m.prototype.stamp=function(t){if(t=this._find(t)){this.stamps=this.stamps.
3915concat(t);for(var e=0,i=t.length;i>e;e++){var o=t[e];this.ignore(o)}}},m.prototype.unstamp=function(t){if(t=this._find(t))for(var e=0,i=t.length;i>e;e++){var o=t[e];n(o,this.stamps),this.unignore(o)}},m.prototype._find=function(t){return t?("string"==typeof t&&(t=this.element.querySelectorAll(t)),t=o(t)):void 0},m.prototype._manageStamps=function(){if(this.stamps&&this.stamps.length){this._getBoundingRect();for(var t=0,e=this.stamps.length;e>t;t++){var i=this.stamps[t];this._manageStamp(i)}}},m.prototype._getBoundingRect=function(){var t=this.element.getBoundingClientRect(),e=this.size;this._boundingRect={left:t.left+e.paddingLeft+e.borderLeftWidth,top:t.top+e.paddingTop+e.borderTopWidth,right:t.right-(e.paddingRight+e.borderRightWidth),bottom:t.bottom-(e.paddingBottom+e.borderBottomWidth)}},m.prototype._manageStamp=h,m.prototype._getElementOffset=function(t){var e=t.getBoundingClientRect(),i=this._boundingRect,o=d(t),n={left:e.left-i.left-o.marginLeft,top:e.top-i.top-o.marginTop,right:i.right-e.right-o.marginRight,bottom:i.bottom-e.bottom-o.marginBottom};return n},m.prototype.handleEvent=function(t){var e="on"+t.type;this[e]&&this[e](t)},m.prototype.bindResize=function(){this.isResizeBound||(i.bind(t,"resize",this),this.isResizeBound=!0)},m.prototype.unbindResize=function(){this.isResizeBound&&i.unbind(t,"resize",this),this.isResizeBound=!1},m.prototype.onresize=function(){function t(){e.resize(),delete e.resizeTimeout}this.resizeTimeout&&clearTimeout(this.resizeTimeout);var e=this;this.resizeTimeout=setTimeout(t,100)},m.prototype.resize=function(){this.isResizeBound&&this.needsResizeLayout()&&this.layout()},m.prototype.needsResizeLayout=function(){var t=d(this.element),e=this.size&&t;return e&&t.innerWidth!==this.size.innerWidth},m.prototype.addItems=function(t){var e=this._itemize(t);return e.length&&(this.items=this.items.concat(e)),e},m.prototype.appended=function(t){var e=this.addItems(t);e.length&&(this.layoutItems(e,!0),this.reveal(e))},m.prototype.prepended=function(t){var e=this._itemize(t);if(e.length){var i=this.items.slice(0);this.items=e.concat(i),this._resetLayout(),this._manageStamps(),this.layoutItems(e,!0),this.reveal(e),this.layoutItems(i)}},m.prototype.reveal=function(t){var e=t&&t.length;if(e)for(var i=0;e>i;i++){var o=t[i];o.reveal()}},m.prototype.hide=function(t){var e=t&&t.length;if(e)for(var i=0;e>i;i++){var o=t[i];o.hide()}},m.prototype.getItem=function(t){for(var e=0,i=this.items.length;i>e;e++){var o=this.items[e];if(o.element===t)return o}},m.prototype.getItems=function(t){if(t&&t.length){for(var e=[],i=0,o=t.length;o>i;i++){var n=t[i],r=this.getItem(n);r&&e.push(r)}return e}},m.prototype.remove=function(t){t=o(t);var e=this.getItems(t);if(e&&e.length){this._itemsOn(e,"remove",function(){this.emitEvent("removeComplete",[this,e])});for(var i=0,r=e.length;r>i;i++){var s=e[i];s.remove(),n(s,this.items)}}},m.prototype.destroy=function(){var t=this.element.style;t.height="",t.position="",t.width="";for(var e=0,i=this.items.length;i>e;e++){var o=this.items[e];o.destroy()}this.unbindResize(),delete this.element.outlayerGUID,p&&p.removeData(this.element,this.constructor.namespace)},m.data=function(t){var e=t&&t.outlayerGUID;return e&&v[e]},m.create=function(t,i){function o(){m.apply(this,arguments)}return Object.create?o.prototype=Object.create(m.prototype):e(o.prototype,m.prototype),o.prototype.constructor=o,o.defaults=e({},m.defaults),e(o.defaults,i),o.prototype.settings={},o.namespace=t,o.data=m.data,o.Item=function(){y.apply(this,arguments)},o.Item.prototype=new y,s(function(){for(var e=r(t),i=a.querySelectorAll(".js-"+e),n="data-"+e+"-options",s=0,h=i.length;h>s;s++){var f,c=i[s],d=c.getAttribute(n);try{f=d&&JSON.parse(d)}catch(l){u&&u.error("Error parsing "+n+" on "+c.nodeName.toLowerCase()+(c.id?"#"+c.id:"")+": "+l);continue}var y=new o(c,f);p&&p.data(c,t,y)}}),p&&p.bridget&&p.bridget(t,o),o},m.Item=y,m}var a=t.document,u=t.console,p=t.jQuery,h=function(){},f=Object.prototype.toString,c="object"==typeof HTMLElement?function(t){return t instanceof HTMLElement}:function(t){return t&&"object"==typeof t&&1===t.nodeType&&"string"==typeof t.nodeName},d=Array.prototype.indexOf?function(t,e){return t.indexOf(e)}:function(t,e){for(var i=0,o=t.length;o>i;i++)if(t[i]===e)return i;return-1};"function"==typeof define&&define.amd?define("outlayer/outlayer",["eventie/eventie","doc-ready/doc-ready","eventEmitter/EventEmitter","get-size/get-size","matches-selector/matches-selector","./item"],s):t.Outlayer=s(t.eventie,t.docReady,t.EventEmitter,t.getSize,t.matchesSelector,t.Outlayer.Item)}(window),function(t){function e(t){function e(){t.Item.apply(this,arguments)}return e.prototype=new t.Item,e.prototype._create=function(){this.id=this.layout.itemGUID++,t.Item.prototype._create.call(this),this.sortData={}},e.prototype.updateSortData=function(){if(!this.isIgnored){this.sortData.id=this.id,this.sortData["original-order"]=this.id,this.sortData.random=Math.random();var t=this.layout.options.getSortData,e=this.layout._sorters;for(var i in t){var o=e[i];this.sortData[i]=o(this.element,this)}}},e}"function"==typeof define&&define.amd?define("isotope/js/item",["outlayer/outlayer"],e):(t.Isotope=t.Isotope||{},t.Isotope.Item=e(t.Outlayer))}(window),function(t){function e(t,e){function i(t){this.isotope=t,t&&(this.options=t.options[this.namespace],this.element=t.element,this.items=t.filteredItems,this.size=t.size)}return function(){function t(t){return function(){return e.prototype[t].apply(this.isotope,arguments)}}for(var o=["_resetLayout","_getItemLayoutPosition","_manageStamp","_getContainerSize","_getElementOffset","needsResizeLayout"],n=0,r=o.length;r>n;n++){var s=o[n];i.prototype[s]=t(s)}}(),i.prototype.needsVerticalResizeLayout=function(){var e=t(this.isotope.element),i=this.isotope.size&&e;
3915return i&&e.innerHeight!==this.isotope.size.innerHeight},i.prototype._getMeasurement=function(){this.isotope._getMeasurement.apply(this,arguments)},i.prototype.getColumnWidth=function(){this.getSegmentSize("column","Width")},i.prototype.getRowHeight=function(){this.getSegmentSize("row","Height")},i.prototype.getSegmentSize=function(t,e){var i=t+e,o="outer"+e;if(this._getMeasurement(i,o),!this[i]){var n=this.getFirstItemSize();this[i]=n&&n[o]||this.isotope.size["inner"+e]}},i.prototype.getFirstItemSize=function(){var e=this.isotope.filteredItems[0];return e&&e.element&&t(e.element)},i.prototype.layout=function(){this.isotope.layout.apply(this.isotope,arguments)},i.prototype.getSize=function(){this.isotope.getSize(),this.size=this.isotope.size},i.modes={},i.create=function(t,e){function o(){i.apply(this,arguments)}return o.prototype=new i,e&&(o.options=e),o.prototype.namespace=t,i.modes[t]=o,o},i}"function"==typeof define&&define.amd?define("isotope/js/layout-mode",["get-size/get-size","outlayer/outlayer"],e):(t.Isotope=t.Isotope||{},t.Isotope.LayoutMode=e(t.getSize,t.Outlayer))}(window),function(t){function e(t,e){var o=t.create("masonry");return o.prototype._resetLayout=function(){this.getSize(),this._getMeasurement("columnWidth","outerWidth"),this._getMeasurement("gutter","outerWidth"),this.measureColumns();var t=this.cols;for(this.colYs=[];t--;)this.colYs.push(0);this.maxY=0},o.prototype.measureColumns=function(){if(this.getContainerWidth(),!this.columnWidth){var t=this.items[0],i=t&&t.element;this.columnWidth=i&&e(i).outerWidth||this.containerWidth}this.columnWidth+=this.gutter,this.cols=Math.floor((this.containerWidth+this.gutter)/this.columnWidth),this.cols=Math.max(this.cols,1)},o.prototype.getContainerWidth=function(){var t=this.options.isFitWidth?this.element.parentNode:this.element,i=e(t);this.containerWidth=i&&i.innerWidth},o.prototype._getItemLayoutPosition=function(t){t.getSize();var e=t.size.outerWidth%this.columnWidth,o=e&&1>e?"round":"ceil",n=Math[o](t.size.outerWidth/this.columnWidth);n=Math.min(n,this.cols);for(var r=this._getColGroup(n),s=Math.min.apply(Math,r),a=i(r,s),u={x:this.columnWidth*a,y:s},p=s+t.size.outerHeight,h=this.cols+1-r.length,f=0;h>f;f++)this.colYs[a+f]=p;return u},o.prototype._getColGroup=function(t){if(2>t)return this.colYs;for(var e=[],i=this.cols+1-t,o=0;i>o;o++){var n=this.colYs.slice(o,o+t);e[o]=Math.max.apply(Math,n)}return e},o.prototype._manageStamp=function(t){var i=e(t),o=this._getElementOffset(t),n=this.options.isOriginLeft?o.left:o.right,r=n+i.outerWidth,s=Math.floor(n/this.columnWidth);s=Math.max(0,s);var a=Math.floor(r/this.columnWidth);a-=r%this.columnWidth?0:1,a=Math.min(this.cols-1,a);for(var u=(this.options.isOriginTop?o.top:o.bottom)+i.outerHeight,p=s;a>=p;p++)this.colYs[p]=Math.max(u,this.colYs[p])},o.prototype._getContainerSize=function(){this.maxY=Math.max.apply(Math,this.colYs);var t={height:this.maxY};return this.options.isFitWidth&&(t.width=this._getContainerFitWidth()),t},o.prototype._getContainerFitWidth=function(){for(var t=0,e=this.cols;--e&&0===this.colYs[e];)t++;return(this.cols-t)*this.columnWidth-this.gutter},o.prototype.needsResizeLayout=function(){var t=this.containerWidth;return this.getContainerWidth(),t!==this.containerWidth},o}var i=Array.prototype.indexOf?function(t,e){return t.indexOf(e)}:function(t,e){for(var i=0,o=t.length;o>i;i++){var n=t[i];if(n===e)return i}return-1};"function"==typeof define&&define.amd?define("masonry/masonry",["outlayer/outlayer","get-size/get-size"],e):t.Masonry=e(t.Outlayer,t.getSize)}(window),function(t){function e(t,e){for(var i in e)t[i]=e[i];return t}function i(t,i){var o=t.create("masonry"),n=o.prototype._getElementOffset,r=o.prototype.layout,s=o.prototype._getMeasurement;e(o.prototype,i.prototype),o.prototype._getElementOffset=n,o.prototype.layout=r,o.prototype._getMeasurement=s;var a=o.prototype.measureColumns;o.prototype.measureColumns=function(){this.items=this.isotope.filteredItems,a.call(this)};var u=o.prototype._manageStamp;return o.prototype._manageStamp=function(){this.options.isOriginLeft=this.isotope.options.isOriginLeft,this.options.isOriginTop=this.isotope.options.isOriginTop,u.apply(this,arguments)},o}"function"==typeof define&&define.amd?define("isotope/js/layout-modes/masonry",["../layout-mode","masonry/masonry"],i):i(t.Isotope.LayoutMode,t.Masonry)}(window),function(t){function e(t){var e=t.create("fitRows");return e.prototype._resetLayout=function(){this.x=0,this.y=0,this.maxY=0},e.prototype._getItemLayoutPosition=function(t){t.getSize(),0!==this.x&&t.size.outerWidth+this.x>this.isotope.size.innerWidth&&(this.x=0,this.y=this.maxY);var e={x:this.x,y:this.y};return this.maxY=Math.max(this.maxY,this.y+t.size.outerHeight),this.x+=t.size.outerWidth,e},e.prototype._getContainerSize=function(){return{height:this.maxY}},e}"function"==typeof define&&define.amd?define("isotope/js/layout-modes/fit-rows",["../layout-mode"],e):e(t.Isotope.LayoutMode)}(window),function(t){function e(t){var e=t.create("vertical",{horizontalAlignment:0});return e.prototype._resetLayout=function(){this.y=0},e.prototype._getItemLayoutPosition=function(t){t.getSize();var e=(this.isotope.size.innerWidth-t.size.outerWidth)*this.options.horizontalAlignment,i=this.y;return this.y+=t.size.outerHeight,{x:e,y:i}},e.prototype._getContainerSize=function(){return{height:this.y}},e}"function"==typeof define&&define.amd?define("isotope/js/layout-modes/vertical",["../layout-mode"],e):e(t.Isotope.LayoutMode)}(window),function(t){function e(t,e){for(var i in e)t[i]=e[i];return t}function i(t){return"[object Array]"===h.call(t)}function o(t){var e=[];
3915if(i(t))e=t;else if(t&&"number"==typeof t.length)for(var o=0,n=t.length;n>o;o++)e.push(t[o]);else e.push(t);return e}function n(t,e){var i=f(e,t);-1!==i&&e.splice(i,1)}function r(t,i,r,u,h){function f(t,e){return function(i,o){for(var n=0,r=t.length;r>n;n++){var s=t[n],a=i.sortData[s],u=o.sortData[s];if(a>u||u>a){var p=void 0!==e[s]?e[s]:e,h=p?1:-1;return(a>u?1:-1)*h}}return 0}}var c=t.create("isotope",{layoutMode:"masonry",isJQueryFiltering:!0,sortAscending:!0});c.Item=u,c.LayoutMode=h,c.prototype._create=function(){this.itemGUID=0,this._sorters={},this._getSorters(),t.prototype._create.call(this),this.modes={},this.filteredItems=this.items,this.sortHistory=["original-order"];for(var e in h.modes)this._initLayoutMode(e)},c.prototype.reloadItems=function(){this.itemGUID=0,t.prototype.reloadItems.call(this)},c.prototype._itemize=function(){for(var e=t.prototype._itemize.apply(this,arguments),i=0,o=e.length;o>i;i++){var n=e[i];n.id=this.itemGUID++}return this._updateItemsSortData(e),e},c.prototype._initLayoutMode=function(t){var i=h.modes[t],o=this.options[t]||{};this.options[t]=i.options?e(i.options,o):o,this.modes[t]=new i(this)},c.prototype.layout=function(){return!this._isLayoutInited&&this.options.isInitLayout?(this.arrange(),void 0):(this._layout(),void 0)},c.prototype._layout=function(){var t=this._getIsInstant();this._resetLayout(),this._manageStamps(),this.layoutItems(this.filteredItems,t),this._isLayoutInited=!0},c.prototype.arrange=function(t){this.option(t),this._getIsInstant(),this.filteredItems=this._filter(this.items),this._sort(),this._layout()},c.prototype._init=c.prototype.arrange,c.prototype._getIsInstant=function(){var t=void 0!==this.options.isLayoutInstant?this.options.isLayoutInstant:!this._isLayoutInited;return this._isInstant=t,t},c.prototype._filter=function(t){function e(){f.reveal(n),f.hide(r)}var i=this.options.filter;i=i||"*";for(var o=[],n=[],r=[],s=this._getFilterTest(i),a=0,u=t.length;u>a;a++){var p=t[a];if(!p.isIgnored){var h=s(p);h&&o.push(p),h&&p.isHidden?n.push(p):h||p.isHidden||r.push(p)}}var f=this;return this._isInstant?this._noTransition(e):e(),o},c.prototype._getFilterTest=function(t){return s&&this.options.isJQueryFiltering?function(e){return s(e.element).is(t)}:"function"==typeof t?function(e){return t(e.element)}:function(e){return r(e.element,t)}},c.prototype.updateSortData=function(t){this._getSorters(),t=o(t);var e=this.getItems(t);e=e.length?e:this.items,this._updateItemsSortData(e) 3916},c.prototype._getSorters=function(){var t=this.options.getSortData;for(var e in t){var i=t[e];this._sorters[e]=d(i)}},c.prototype._updateItemsSortData=function(t){for(var e=0,i=t.length;i>e;e++){var o=t[e];o.updateSortData()}};var d=function(){function t(t){if("string"!=typeof t)return t;var i=a(t).split(" "),o=i[0],n=o.match(/^\[(.+)\]$/),r=n&&n[1],s=e(r,o),u=c.sortDataParsers[i[1]];return t=u?function(t){return t&&u(s(t))}:function(t){return t&&s(t)}}function e(t,e){var i;return i=t?function(e){return e.getAttribute(t)}:function(t){var i=t.querySelector(e);return i&&p(i)}}return t}();c.sortDataParsers={parseInt:function(t){return parseInt(t,10)},parseFloat:function(t){return parseFloat(t)}},c.prototype._sort=function(){var t=this.options.sortBy;if(t){var e=[].concat.apply(t,this.sortHistory),i=f(e,this.options.sortAscending);this.filteredItems.sort(i),t!==this.sortHistory[0]&&this.sortHistory.unshift(t)}},c.prototype._mode=function(){var t=this.options.layoutMode,e=this.modes[t];if(!e)throw Error("No layout mode: "+t);return e.options=this.options[t],e},c.prototype._resetLayout=function(){t.prototype._resetLayout.call(this),this._mode()._resetLayout()},c.prototype._getItemLayoutPosition=function(t){return this._mode()._getItemLayoutPosition(t)},c.prototype._manageStamp=function(t){this._mode()._manageStamp(t)},c.prototype._getContainerSize=function(){return this._mode()._getContainerSize()},c.prototype.needsResizeLayout=function(){return this._mode().needsResizeLayout()},c.prototype.appended=function(t){var e=this.addItems(t);if(e.length){var i=this._filterRevealAdded(e);this.filteredItems=this.filteredItems.concat(i)}},c.prototype.prepended=function(t){var e=this._itemize(t);if(e.length){var i=this.items.slice(0);this.items=e.concat(i),this._resetLayout(),this._manageStamps();var o=this._filterRevealAdded(e);this.layoutItems(i),this.filteredItems=o.concat(this.filteredItems)}},c.prototype._filterRevealAdded=function(t){var e=this._noTransition(function(){return this._filter(t)});return this.layoutItems(e,!0),this.reveal(e),t},c.prototype.insert=function(t){var e=this.addItems(t);if(e.length){var i,o,n=e.length;for(i=0;n>i;i++)o=e[i],this.element.appendChild(o.element);var r=this._filter(e);for(this._noTransition(function(){this.hide(r)}),i=0;n>i;i++)e[i].isLayoutInstant=!0;for(this.arrange(),i=0;n>i;i++)delete e[i].isLayoutInstant;this.reveal(r)}};var l=c.prototype.remove;return c.prototype.remove=function(t){t=o(t);var e=this.getItems(t);if(l.call(this,t),e&&e.length)for(var i=0,r=e.length;r>i;i++){var s=e[i];n(s,this.filteredItems)}},c.prototype._noTransition=function(t){var e=this.options.transitionDuration;this.options.transitionDuration=0;var i=t.call(this);return this.options.transitionDuration=e,i},c}var s=t.jQuery,a=String.prototype.trim?function(t){return t.trim()}:function(t){return t.replace(/^\s+|\s+$/g,"")},u=document.documentElement,p=u.textContent?function(t){return t.textContent}:function(t){return t.innerText},h=Object.prototype.toString,f=Array.prototype.indexOf?function(t,e){return t.indexOf(e)}:function(t,e){for(var i=0,o=t.length;o>i;i++)if(t[i]===e)return i;return-1};"function"==typeof define&&define.amd?define(["outlayer/outlayer","get-size/get-size","matches-selector/matches-selector","isotope/js/item","isotope/js/layout-mode","isotope/js/layout-modes/masonry","isotope/js/layout-modes/fit-rows","isotope/js/layout-modes/vertical"],r):t.Isotope=r(t.Outlayer,t.getSize,t.matchesSelector,t.Isotope.Item,t.Isotope.LayoutMode)}(window); 3917 3918 /*! 3919 * hoverIntent r7 // 2013.03.11 // jQuery 1.9.1+ 3920 * http://cherne.net/brian/resources/jquery.hoverIntent.html 3921 * 3922 * You may use hoverIntent under the terms of the MIT license. Basically that 3923 * means you are free to use hoverIntent as long as this header is left intact. 3924 * Copyright 2007, 2013 Brian Cherne 3925 */ 3926 3927/* hoverIntent is similar to jQuery's built-in "hover" method except that 3928 * instead of firing the handlerIn function immediately, hoverIntent checks 3929 * to see if the user's mouse has slowed down (beneath the sensitivity 3930 * threshold) before firing the event. The handlerOut function is only 3931 * called after a matching handlerIn. 3932 * 3933 * // basic usage ... just like .hover() 3934 * .hoverIntent( handlerIn, handlerOut ) 3935 * .hoverIntent( handlerInOut ) 3936 * 3937 * // basic usage ... with event delegation! 3938 * .hoverIntent( handlerIn, handlerOut, selector ) 3939 * .hoverIntent( handlerInOut, selector ) 3940 * 3941 * // using a basic configuration object 3942 * .hoverIntent( config ) 3943 * 3944 * @param handlerIn function OR configuration object 3945 * @param handlerOut function OR selector for delegation OR undefined 3946 * @param selector selector OR undefined 3947 * @author Brian Cherne <brian(at)cherne(dot)net> 3948 */ 3949(function($) { 3950 $.fn.hoverIntent = function(handlerIn,handlerOut,selector) { 3951 3952 // default configuration values 3953 var cfg = { 3954 interval: 100, 3955 sensitivity: 7, 3956 timeout: 0 3957 }; 3958
3959 if ( typeof handlerIn === "object" ) { 3960 cfg = $.extend(cfg, handlerIn ); 3961 } else if ($.isFunction(handlerOut)) { 3962 cfg = $.extend(cfg, { over: handlerIn, out: handlerOut, selector: selector } ); 3963 } else { 3964 cfg = $.extend(cfg, { over: handlerIn, out: handlerIn, selector: handlerOut } ); 3965 } 3966 3967 // instantiate variables 3968 // cX, cY = current X and Y position of mouse, updated by mousemove event 3969 // pX, pY = previous X and Y position of mouse, set by mouseover and polling interval 3970 var cX, cY, pX, pY; 3971 3972 // A private function for getting mouse position 3973 var track = function(ev) { 3974 cX = ev.pageX; 3975 cY = ev.pageY; 3976 }; 3977 3978 // A private function for comparing current and previous mouse position 3979 var compare = function(ev,ob) { 3980 ob.hoverIntent_t = clearTimeout(ob.hoverIntent_t); 3981 // compare mouse positions to see if they've crossed the threshold 3982 if ( ( Math.abs(pX-cX) + Math.abs(pY-cY) ) < cfg.sensitivity ) { 3983 $(ob).off("mousemove.hoverIntent",track); 3984 // set hoverIntent state to true (so mouseOut can be called) 3985 ob.hoverIntent_s = 1; 3986 return cfg.over.apply(ob,[ev]); 3987 } else { 3988 // set previous coordinates for next time 3989 pX = cX; pY = cY; 3990 // use self-calling timeout, guarantees intervals are spaced out properly (avoids JavaScript timer bugs) 3991 ob.hoverIntent_t = setTimeout( function(){compare(ev, ob);} , cfg.interval ); 3992 } 3993 }; 3994 3995 // A private function for delaying the mouseOut function 3996 var delay = function(ev,ob) { 3997 ob.hoverIntent_t = clearTimeout(ob.hoverIntent_t); 3998 ob.hoverIntent_s = 0; 3999 return cfg.out.apply(ob,[ev]); 4000 }; 4001 4002 // A private function for handling mouse 'hovering' 4003 var handleHover = function(e) { 4004 // copy objects to be passed into t (required for event object to be passed in IE) 4005 var ev = jQuery.extend({},e); 4006 var ob = this; 4007 4008 // cancel hoverIntent timer if it exists 4009 if (ob.hoverIntent_t) { ob.hoverIntent_t = clearTimeout(ob.hoverIntent_t); } 4010 4011 // if e.type == "mouseenter" 4012 if (e.type == "mouseenter") { 4013 // set "previous" X and Y position based on initial entry point 4014 pX = ev.pageX; pY = ev.pageY; 4015 // update "current" X and Y position based on mousemove 4016 $(ob).on("mousemove.hoverIntent",track); 4017 // start polling interval (self-calling timeout) to compare mouse coordinates over time 4018 if (ob.hoverIntent_s != 1) { ob.hoverIntent_t = setTimeout( function(){compare(ev,ob);} , cfg.interval );} 4019 4020 // else e.type == "mouseleave" 4021 } else { 4022 // unbind expensive mousemove event 4023 $(ob).off("mousemove.hoverIntent",track); 4024 // if hoverIntent state is true, then call the mouseOut function after the specified delay 4025 if (ob.hoverIntent_s == 1) { ob.hoverIntent_t = setTimeout( function(){delay(ev,ob);} , cfg.timeout );} 4026 } 4027 }; 4028 4029 // listen for mouseenter and mouseleave 4030 return this.on({'mouseenter.hoverIntent':handleHover,'mouseleave.hoverIntent':handleHover}, cfg.selector); 4031 }; 4032})(jQuery); 4033 4034/* 4035|-------------------------------------------------------------------------- 4036| UItoTop jQuery Plugin 1.2 by Matt Varone 4037| http://www.mattvarone.com/web-design/uitotop-jquery-plugin/ 4038|-------------------------------------------------------------------------- 4039*/ 4040(function($){ 4041 $.fn.UItoTop = function(options) { 4042 4043 var defaults = { 4044 text: '', 4045 min: 200, 4046 inDelay:600, 4047 outDelay:400, 4048 containerID: 'toTop', 4049 containerHoverID: 'toTopHover', 4050 scrollSpeed: 1200, 4051 easingType: 'linear' 4052 }, 4053 settings = $.extend(defaults, options), 4054 containerIDhash = '#' + settings.containerID, 4055 containerHoverIDHash = '#'+settings.containerHoverID; 4056 4057 $('body').append('<div class="to-top-container"><a href="#" id="'+settings.containerID+'">'+settings.text+'</a></div>'); 4058 $(containerIDhash).hide().on('click.UItoTop',function(){ 4059 $('html, body').animate({scrollTop:0}, settings.scrollSpeed, settings.easingType); 4060 $('#'+settings.containerHoverID, this).stop().animate({'opacity': 0 }, settings.inDelay, settings.easingType); 4061 return false; 4062 }) 4063 .prepend('<span id="'+settings.containerHoverID+'"></span>') 4064 .hover(function() { 4065 $(containerHoverIDHash, this).stop().animate({ 4066 'opacity': 1 4067 }, 600, 'linear'); 4068 }, function() { 4069 $(containerHoverIDHash, this).stop().animate({ 4070 'opacity': 0 4071 }, 700, 'linear'); 4072 }); 4073 4074 $(window).scroll(function() { 4075 var sd = $(window).scrollTop(); 4076 if(typeof document.body.style.maxHeight === "undefined") { 4077 $(containerIDhash).css({ 4078 'position': 'absolute', 4079 'top': sd + $(window).height() - 50 4080 }); 4081 } 4082 if ( sd > settings.min ) { 4083 $(containerIDhash).fadeIn(settings.inDelay); 4084 } else { 4085 $(containerIDhash).fadeOut(settings.Outdelay); 4086 } 4087 }); 4088}; 4089})(jQuery); 4090 4091(function( window, $, undefined ) { 4092 4093 /* 4094 * smartresize: debounced resize event for jQuery 4095 * 4096 * latest version and complete README available on Github: 4097 * https://github.com/louisremi/jquery.smartresize.js 4098 * 4099 * Copyright 2011 @louis_remi 4100 * Licensed under the MIT license. 4101 */ 4102 4103 var $event = $.event, resizeTimeout; 4104 4105 $event.special.smartresize = { 4106 setup: function() { 4107 $(this).bind( "resize", $event.special.smartresize.handler ); 4108 }, 4109 teardown: function() { 4110 $(this).unbind( "resize", $event.special.smartresize.handler ); 4111 }, 4112 handler: function( event, execAsap ) { 4113 // Save the context 4114 var context = this, 4115 args = arguments; 4116 4117 // set correct event type 4118 event.type = "smartresize"; 4119 4120 if ( resizeTimeout ) { clearTimeout( resizeTimeout ); } 4121 resizeTimeout = setTimeout(function() { 4122 jQuery.event.handle.apply( context, args ); 4123 }, execAsap === "execAsap"? 0 : 100 ); 4124 } 4125 }; 4126 4127 $.fn.smartresize = function( fn ) { 4128 return fn ? this.bind( "smartresize", fn ) : this.trigger( "smartresize", ["execAsap"] ); 4129 }; 4130 4131 $.Slideshow = function( options, element ) { 4132 4133 this.$el = $( element ); 4134 4135 /***** images ****/ 4136 4137 // list of image items 4138 this.$list = this.$el.find('ul.ei-slider-large'); 4139 // image items 4140 this.$imgItems = this.$list.children('li'); 4141 // total number of items 4142 this.itemsCount = this.$imgItems.length; 4143 // images 4144 this.$images = this.$imgItems.find('img:first'); 4145 4146 /***** thumbs ****/ 4147 4148 // thumbs wrapper 4149 this.$sliderthumbs = this.$el.find('ul.ei-slider-thumbs').hide(); 4150 // slider elements 4151 this.$sliderElems = this.$sliderthumbs.children('li'); 4152 // sliding div 4153 this.$sliderElem = this.$sliderthumbs.children('li.ei-slider-element'); 4154 // thumbs 4155 this.$thumbs = this.$sliderElems.not('.ei-slider-element'); 4156 4157 // initialize slideshow 4158 this._init( options ); 4159 4160 }; 4161 4162 $.Slideshow.defaults = { 4163 // animation types: 4164 // "sides" : new slides will slide in from left / right 4165 // "center": new slides will appear in the center 4166 animation : 'sides', // sides || center 4167 // if true the slider will automatically slide, and it will only stop if the user clicks on a thumb 4168 autoplay : false, 4169 // interval for the slideshow 4170 slideshow_interval : 3000, 4171 // speed for the sliding animation 4172 speed : 800, 4173 // easing for the sliding animation 4174 easing : '', 4175 // percentage of speed for the titles animation. Speed will be speed * titlesFactor 4176 titlesFactor : 0.60, 4177 // titles animation speed 4178 titlespeed : 800, 4179 // titles animation easing 4180 titleeasing : '', 4181 // maximum width for the thumbs in pixels 4182 thumbMaxWidth : 150 4183 }; 4184 4185 $.Slideshow.prototype = { 4186 _init : function( options ) { 4187 4188 this.options = $.extend( true, {}, $.Slideshow.defaults, options ); 4189 4190 // set the opacity of the title elements and the image items 4191 this.$imgItems.css( 'opacity', 0 ); 4192 this.$imgItems.find('div.ei-title > *').css( 'opacity', 0 ); 4193 4194 // index of current visible slider 4195 this.current = 0; 4196 4197 var _self = this; 4198 4199 // preload images 4200 // add loading status 4201 this.$loading = $('<div class="ei-slider-loading">Loading</div>').prependTo( _self.$el ); 4202 4203 $.when( this._preloadImages() ).done( function() { 4204 4205 // hide loading status 4206 _self.$loading.hide(); 4207 4208 // calculate size and position for each image 4209 _self._setImagesSize(); 4210 4211 // configure thumbs container 4212 _self._initThumbs(); 4213 4214 // show first 4215 _self.$imgItems.eq( _self.current ).css({ 4216 'opacity' : 1, 4217 'z-index' : 10 4218 }).show().find('div.ei-title > *').css( 'opacity', 1 ); 4219 4220 // if autoplay is true 4221 if( _self.options.autoplay ) { 4222 4223 _self._startSlideshow(); 4224 4225 } 4226 4227 // initialize the events 4228 _self._initEvents(); 4229 4230 }); 4231 4232 }, 4233 _preloadImages : function() { 4234 4235 // preloads all the large images 4236 4237 var _self = this, 4238 loaded = 0; 4239 4240 return $.Deferred( 4241 4242 function(dfd) { 4243 4244 _self.$images.each( function( i ) { 4245 4246 $('<img/>').load( function() { 4247 4248 if( ++loaded === _self.itemsCount ) { 4249 4250 dfd.resolve(); 4251 4252 } 4253 4254 }).attr( 'src', $(this).attr('src') ); 4255 4256 }); 4257 4258 } 4259 4260 ).promise(); 4261 4262 }, 4263 _setImagesSize : function() { 4264 4265 // save ei-slider's width
4266 this.elWidth = this.$el.width(); 4267 4268 var _self = this; 4269 4270 this.$images.each( function( i ) { 4271 4272 var $img = $(this); 4273 imgDim = _self._getImageDim( $img.attr('src') ); 4274 4275 $img.css({ 4276 width : imgDim.width, 4277 height : imgDim.height, 4278 marginLeft : imgDim.left, 4279 marginTop : imgDim.top 4280 }); 4281 4282 }); 4283 4284 }, 4285 _getImageDim : function( src ) { 4286 4287 var $img = new Image(); 4288 4289 $img.src = src; 4290 4291 var c_w = this.elWidth, 4292 c_h = this.$el.height(), 4293 r_w = c_h / c_w, 4294 4295 i_w = $img.width, 4296 i_h = $img.height, 4297 r_i = i_h / i_w, 4298 new_w, new_h, new_left, new_top; 4299 4300 if( r_w > r_i ) { 4301 4302 new_h = c_h; 4303 new_w = c_h / r_i; 4304 4305 } 4306 else { 4307 4308 new_h = c_w * r_i; 4309 new_w = c_w; 4310 4311 } 4312 4313 return { 4314 width : new_w, 4315 height : new_h, 4316 left : ( c_w - new_w ) / 2, 4317 top : ( c_h - new_h ) / 2 4318 }; 4319 4320 }, 4321 _initThumbs : function() { 4322 4323 // set the max-width of the slider elements to the one set in the plugin's options 4324 // also, the width of each slider element will be 100% / total number of elements 4325 this.$sliderElems.css({ 4326 'max-width' : this.options.thumbMaxWidth + 'px', 4327 'width' : 100 / this.itemsCount + '%' 4328 }); 4329 4330 // set the max-width of the slider and show it 4331 this.$sliderthumbs.css( 'max-width', this.options.thumbMaxWidth * this.itemsCount + 'px' ).show(); 4332 4333 }, 4334 _startSlideshow : function() { 4335 4336 var _self = this; 4337 4338 this.slideshow = setTimeout( function() { 4339 4340 var pos; 4341 4342 ( _self.current === _self.itemsCount - 1 ) ? pos = 0 : pos = _self.current + 1; 4343 4344 _self._slideTo( pos ); 4345 4346 if( _self.options.autoplay ) { 4347 4348 _self._startSlideshow(); 4349 4350 } 4351 4352 }, this.options.slideshow_interval); 4353 4354 }, 4355 // shows the clicked thumb's slide 4356 _slideTo : function( pos ) { 4357 4358 // return if clicking the same element or if currently animating 4359 if( pos === this.current || this.isAnimating ) 4360 return false; 4361 4362 this.isAnimating = true; 4363 4364 var $currentSlide = this.$imgItems.eq( this.current ), 4365 $nextSlide = this.$imgItems.eq( pos ), 4366 _self = this, 4367 4368 preCSS = {zIndex : 10}, 4369 animCSS = {opacity : 1}; 4370 4371 // new slide will slide in from left or right side 4372 if( this.options.animation === 'sides' ) { 4373 4374 preCSS.left = ( pos > this.current ) ? -1 * this.elWidth : this.elWidth; 4375 animCSS.left = 0; 4376 4377 } 4378 4379 // titles animation 4380 $nextSlide.find('div.ei-title > h2') 4381 .css( 'margin-right', 50 + 'px' ) 4382 .stop() 4383 .delay( this.options.speed * this.options.titlesFactor ) 4384 .animate({ marginRight : 0 + 'px', opacity : 1 }, this.options.titlespeed, this.options.titleeasing ) 4385 .end() 4386 .find('div.ei-title > h3') 4387 .css( 'margin-right', -50 + 'px' ) 4388 .stop() 4389 .delay( this.options.speed * this.options.titlesFactor ) 4390 .animate({ marginRight : 0 + 'px', opacity : 1 }, this.options.titlespeed, this.options.titleeasing ); 4391 4392 $.when( 4393 4394 // fade out current titles 4395 $currentSlide.css( 'z-index' , 1 ).find('div.ei-title > *').stop().fadeOut( this.options.speed / 2, function() { 4396 // reset style 4397 $(this).show().css( 'opacity', 0 ); 4398 }), 4399 4400 // animate next slide in 4401 $nextSlide.css( preCSS ).stop().animate( animCSS, this.options.speed, this.options.easing ), 4402 4403 // "sliding div" moves to new position 4404 this.$sliderElem.stop().animate({ 4405 left : this.$thumbs.eq( pos ).position().left 4406 }, this.options.speed ) 4407 4408 ).done( function() { 4409 4410 // reset values 4411 $currentSlide.css( 'opacity' , 0 ).find('div.ei-title > *').css( 'opacity', 0 ); 4412 _self.current = pos; 4413 _self.isAnimating = false; 4414 4415 }); 4416 4417 }, 4418 _initEvents : function() { 4419 4420 var _self = this; 4421 4422 // window resize 4423 $(window).on( 'smartresize.eislideshow', function( event ) { 4424 4425 // resize the images 4426 _self._setImagesSize(); 4427 4428 // reset position of thumbs sliding div 4429 _self.$sliderElem.css( 'left', _self.$thumbs.eq( _self.current ).position().left ); 4430 4431 }); 4432 4433 // click the thumbs 4434 this.$thumbs.on( 'click.eislideshow', function( event ) { 4435 4436 if( _self.options.autoplay ) { 4437 4438 clearTimeout( _self.slideshow ); 4439 _self.options.autoplay = false;
4440 4441 } 4442 4443 var $thumb = $(this), 4444 idx = $thumb.index() - 1; // exclude sliding div 4445 4446 _self._slideTo( idx ); 4447 4448 return false; 4449 4450 }); 4451 4452 } 4453 }; 4454 4455 var logError = function( message ) { 4456 4457 if ( this.console ) { 4458 4459 console.error( message ); 4460 4461 } 4462 4463 }; 4464 4465 $.fn.eislideshow = function( options ) { 4466 4467 if ( typeof options === 'string' ) { 4468 4469 var args = Array.prototype.slice.call( arguments, 1 ); 4470 4471 this.each(function() { 4472 4473 var instance = $.data( this, 'eislideshow' ); 4474 4475 if ( !instance ) { 4476 logError( "cannot call methods on eislideshow prior to initialization; " + 4477 "attempted to call method '" + options + "'" ); 4478 return; 4479 } 4480 4481 if ( !$.isFunction( instance[options] ) || options.charAt(0) === "_" ) { 4482 logError( "no such method '" + options + "' for eislideshow instance" ); 4483 return; 4484 } 4485 4486 instance[ options ].apply( instance, args ); 4487 4488 }); 4489 4490 } 4491 else { 4492 4493 this.each(function() { 4494 4495 var instance = $.data( this, 'eislideshow' ); 4496 if ( !instance ) { 4497 $.data( this, 'eislideshow', new $.Slideshow( options, this ) ); 4498 } 4499 4500 }); 4501 4502 } 4503 4504 return this; 4505 4506 }; 4507 4508})( window, jQuery ); 4509 4510/*! 4511 * imagesLoaded PACKAGED v3.0.4 4512 * JavaScript is all like "You images are done yet or what?" 4513 * MIT License 4514 */ 4515 4516(function(){"use strict";function e(){}function t(e,t){for(var n=e.length;n--;)if(e[n].listener===t)return n;return-1}function n(e){return function(){return this[e].apply(this,arguments)}}var i=e.prototype;i.getListeners=function(e){var t,n,i=this._getEvents();if("object"==typeof e){t={};for(n in i)i.hasOwnProperty(n)&&e.test(n)&&(t[n]=i[n])}else t=i[e]||(i[e]=[]);return t},i.flattenListeners=function(e){var t,n=[];for(t=0;e.length>t;t+=1)n.push(e[t].listener);return n},i.getListenersAsObject=function(e){var t,n=this.getListeners(e);return n instanceof Array&&(t={},t[e]=n),t||n},i.addListener=function(e,n){var i,r=this.getListenersAsObject(e),o="object"==typeof n;for(i in r)r.hasOwnProperty(i)&&-1===t(r[i],n)&&r[i].push(o?n:{listener:n,once:!1});return this},i.on=n("addListener"),i.addOnceListener=function(e,t){return this.addListener(e,{listener:t,once:!0})},i.once=n("addOnceListener"),i.defineEvent=function(e){return this.getListeners(e),this},i.defineEvents=function(e){for(var t=0;e.length>t;t+=1)this.defineEvent(e[t]);return this},i.removeListener=function(e,n){var i,r,o=this.getListenersAsObject(e);for(r in o)o.hasOwnProperty(r)&&(i=t(o[r],n),-1!==i&&o[r].splice(i,1));return this},i.off=n("removeListener"),i.addListeners=function(e,t){return this.manipulateListeners(!1,e,t)},i.removeListeners=function(e,t){return this.manipulateListeners(!0,e,t)},i.manipulateListeners=function(e,t,n){var i,r,o=e?this.removeListener:this.addListener,s=e?this.removeListeners:this.addListeners;if("object"!=typeof t||t instanceof RegExp)for(i=n.length;i--;)o.call(this,t,n[i]);else for(i in t)t.hasOwnProperty(i)&&(r=t[i])&&("function"==typeof r?o.call(this,i,r):s.call(this,i,r));return this},i.removeEvent=function(e){var t,n=typeof e,i=this._getEvents();if("string"===n)delete i[e];else if("object"===n)for(t in i)i.hasOwnProperty(t)&&e.test(t)&&delete i[t];else delete this._events;return this},i.removeAllListeners=n("removeEvent"),i.emitEvent=function(e,t){var n,i,r,o,s=this.getListenersAsObject(e);for(r in s)if(s.hasOwnProperty(r))for(i=s[r].length;i--;)n=s[r][i],n.once===!0&&this.removeListener(e,n.listener),o=n.listener.apply(this,t||[]),o===this._getOnceReturnValue()&&this.removeListener(e,n.listener);return this},i.trigger=n("emitEvent"),i.emit=function(e){var t=Array.prototype.slice.call(arguments,1);return this.emitEvent(e,t)},i.setOnceReturnValue=function(e){return this._onceReturnValue=e,this},i._getOnceReturnValue=function(){return this.hasOwnProperty("_onceReturnValue")?this._onceReturnValue:!0},i._getEvents=function(){return this._events||(this._events={})},"function"==typeof define&&define.amd?define(function(){return e}):"object"==typeof module&&module.exports?module.exports=e:this.EventEmitter=e}).call(this),function(e){"use strict";var t=document.documentElement,n=function(){};t.addEventListener?n=function(e,t,n){e.addEventListener(t,n,!1)}:t.attachEvent&&(n=function(t,n,i){t[n+i]=i.handleEvent?function(){var t=e.event;t.target=t.target||t.srcElement,i.handleEvent.call(i,t)}:function(){var n=e.event;n.target=n.target||n.srcElement,i.call(t,n)},t.attachEvent("on"+n,t[n+i])});var i=function(){};t.removeEventListener?i=function(e,t,n){e.removeEventListener(t,n,!1)}:t.detachEvent&&(i=function(e,t,n){e.detachEvent("on"+t,e[t+n]);try{delete e[t+n]}catch(i){e[t+n]=void 0}});var r={bind:n,unbind:i};"function"==typeof define&&define.amd?define(r):e.eventie=r}(this),function(e){"use strict";function t(e,t){for(var n in t)e[n]=t[n];return e}function n(e){return"[object Array]"===c.call(e)}function i(e){var t=[];if(n(e))t=e;else if("number"==typeof e.length)for(var i=0,r=e.length;r>i;i++)t.push(e[i]);else t.push(e);return t}function r(e,n){function r(e,n,s){if(!(this instanceof r))return new r(e,n);"string"==typeof e&&(e=document.querySelectorAll(e)),this.elements=i(e),this.options=t({},this.options),"function"==typeof n?s=n:t(this.options,n),s&&this.on("always",s),this.getImages(),o&&(this.jqDeferred=new o.Deferred);var a=this;setTimeout(function(){a.check()})}function c(e){this.img=e}r.prototype=new e,r.prototype.options={},r.prototype.getImages=function(){this.images=[];for(var e=0,t=this.elements.length;t>e;e++){var n=this.elements[e];"IMG"===n.nodeName&&this.addImage(n);for(var i=n.querySelectorAll("img"),r=0,o=i.length;o>r;r++){var s=i[r];this.addImage(s)}}},r.prototype.addImage=function(e){var t=new c(e);this.images.push(t)},r.prototype.check=function(){function e(e,r){return t.options.debug&&a&&s.log("confirm",e,r),t.progress(e),n++,n===i&&t.complete(),!0}var t=this,n=0,i=this.images.length;if(this.hasAnyBroken=!1,!i)return this.complete(),void 0;for(var r=0;i>r;r++){var o=this.images[r];o.on("confirm",e),o.check()}},r.prototype.progress=function(e){this.hasAnyBroken=this.hasAnyBroken||!e.isLoaded;var t=this;setTimeout(function(){t.emit("progress",t,e),t.jqDeferred&&t.jqDeferred.notify(t,e)})},r.prototype.complete=function(){var e=this.hasAnyBroken?"fail":"done";this.isComplete=!0;var t=this;setTimeout(function(){if(t.emit(e,t),t.emit("always",t),t.jqDeferred){var n=t.hasAnyBroken?"reject":"resolve";t.jqDeferred[n](t)}})},o&&(o.fn.imagesLoaded=function(e,t){var n=new r(this,e,t);return n.jqDeferred.promise(o(this))});var f={};return c.prototype=new e,c.prototype.check=function(){var e=f[this.img.src];if(e)return this.useCached(e),void 0;if(f[this.img.src]=this,this.img.complete&&void 0!==this.img.naturalWi
4516dth)return this.confirm(0!==this.img.naturalWidth,"naturalWidth"),void 0;var t=this.proxyImage=new Image;n.bind(t,"load",this),n.bind(t,"error",this),t.src=this.img.src},c.prototype.useCached=function(e){if(e.isConfirmed)this.confirm(e.isLoaded,"cached was confirmed");else{var t=this;e.on("confirm",function(e){return t.confirm(e.isLoaded,"cache emitted confirmed"),!0})}},c.prototype.confirm=function(e,t){this.isConfirmed=!0,this.isLoaded=e,this.emit("confirm",this,t)},c.prototype.handleEvent=function(e){var t="on"+e.type;this[t]&&this[t](e)},c.prototype.onload=function(){this.confirm(!0,"onload"),this.unbindProxyEvents()},c.prototype.onerror=function(){this.confirm(!1,"onerror"),this.unbindProxyEvents()},c.prototype.unbindProxyEvents=function(){n.unbind(this.proxyImage,"load",this),n.unbind(this.proxyImage,"error",this)},r}var o=e.jQuery,s=e.console,a=s!==void 0,c=Object.prototype.toString;"function"==typeof define&&define.amd?define(["eventEmitter/EventEmitter","eventie/eventie"],r):e.imagesLoaded=r(e.EventEmitter,e.eventie)}(window); 4517 4518/** 4519 * Infinite Scroll 4520 */ 4521(function(d){"function"===typeof define&&define.amd?define(["jquery"],d):d(jQuery)})(function(d,f){d.infinitescroll=function(a,b,c){this.element=d(c);this._create(a,b)||(this.failed=!0)};d.infinitescroll.defaults={loading:{finished:f,finishedMsg:"<em>Congratulations, you've reached the end of the internet.</em>",img:"",msg:null,msgText:"<em>Loading the next set of posts...</em>",selector:null,speed:"fast",start:f},state:{isDuringAjax:!1,isInvalidPage:!1,isDestroyed:!1,isDone:!1,isPaused:!1,isBeyondMaxPage:!1, 4522currPage:1},debug:!1,behavior:f,binder:d(window),nextSelector:"div.navigation a:first",navSelector:"div.navigation",contentSelector:null,extraScrollPx:150,itemSelector:"div.post",animate:!1,pathParse:f,dataType:"html",appendCallback:!0,bufferPx:40,errorCallback:function(){},infid:0,pixelsFromNavToBottom:f,path:f,prefill:!1,maxPage:f};d.infinitescroll.prototype={_binding:function(a){var b=this,c=b.options;c.v="2.0b2.120520";if(c.behavior&&this["_binding_"+c.behavior]!==f)this["_binding_"+c.behavior].call(this); 4523else{if("bind"!==a&&"unbind"!==a)return this._debug("Binding value "+a+" not valid"),!1;if("unbind"===a)this.options.binder.unbind("smartscroll.infscr."+b.options.infid);else this.options.binder[a]("smartscroll.infscr."+b.options.infid,function(){b.scroll()});this._debug("Binding",a)}},_create:function(a,b){var c=d.extend(!0,{},d.infinitescroll.defaults,a);this.options=c;var e=d(window);if(!this._validate(a))return!1;var g=d(c.nextSelector).attr("href");if(!g)return this._debug("Navigation selector not found"), 4524!1;c.path=c.path||this._determinepath(g);c.contentSelector=c.contentSelector||this.element;c.loading.selector=c.loading.selector||c.contentSelector;c.loading.msg=c.loading.msg||d('<div id="infscr-loading"><img alt="Loading..." src="'+c.loading.img+'" /><div>'+c.loading.msgText+"</div></div>");(new Image).src=c.loading.img;c.pixelsFromNavToBottom===f&&(c.pixelsFromNavToBottom=d(document).height()-d(c.navSelector).offset().top,this._debug("pixelsFromNavToBottom: "+c.pixelsFromNavToBottom));var h=this; 4525c.loading.start=c.loading.start||function(){d(c.navSelector).hide();c.loading.msg.insertAfter(c.loading.selector).show(c.loading.speed,d.proxy(function(){this.beginAjax(c)},h))};c.loading.finished=c.loading.finished||function(){c.state.isBeyondMaxPage||c.loading.msg.fadeOut(c.loading.speed)};c.callback=function(a,g,h){c.behavior&&a["_callback_"+c.behavior]!==f&&a["_callback_"+c.behavior].call(d(c.contentSelector)[0],g,h);b&&b.call(d(c.contentSelector)[0],g,c,h);c.prefill&&e.bind("resize.infinite-scroll", 4526a._prefill)};a.debug&&(!Function.prototype.bind||"object"!==typeof console&&"function"!==typeof console||"object"!==typeof console.log||"log info warn error assert dir clear profile profileEnd".split(" ").forEach(function(a){console[a]=this.call(console[a],console)},Function.prototype.bind));this._setup();c.prefill&&this._prefill();return!0},_prefill:function(){var a=this,b=d(window);this._prefill=function(){a.options.contentSelector.height()<=b.height()&&a.scroll();b.bind("resize.infinite-scroll", 4527function(){a.options.contentSelector.height()<=b.height()&&(b.unbind("resize.infinite-scroll"),a.scroll())})};this._prefill()},_debug:function(){!0===this.options.debug&&("undefined"!==typeof console&&"function"===typeof console.log?1===Array.prototype.slice.call(arguments).length&&"string"===typeof Array.prototype.slice.call(arguments)[0]?console.log(Array.prototype.slice.call(arguments).toString()):console.log(Array.prototype.slice.call(arguments)):Function.prototype.bind||"undefined"===typeof console|| 4528"object"!==typeof console.log||Function.prototype.call.call(console.log,console,Array.prototype.slice.call(arguments)))},_determinepath:function(a){var b=this.options;if(b.behavior&&this["_determinepath_"+b.behavior]!==f)return this["_determinepath_"+b.behavior].call(this,a);if(b.pathParse)return this._debug("pathParse manual"),b.pathParse(a,this.options.state.currPage+1);if(a.match(/^(.*2?)\b2\b(.*?$)/))a=a.match(/^(.*2?)\b2\b(.*?$)/).slice(1);else if(a.match(/^(.*?)\b2\b(.*?$)/))a=a.match(/^(.*?)\b2\b(.*?$)/).slice(1); 4529else if(a.match(/^(.*?)2(.*?$)/)){if(a.match(/^(.*?page=)2(\/.*|$)/))return a=a.match(/^(.*?page=)2(\/.*|$)/).slice(1);a=a.match(/^(.*?)2(.*?$)/).slice(1)}else{if(a.match(/^(.*?page=)1(\/.*|$)/))return a=a.match(/^(.*?page=)1(\/.*|$)/).slice(1);this._debug("Sorry, we couldn't parse your Next (Previous Posts) URL. Verify your the css selector points to the correct A tag. If you still get this error: yell, scream, and kindly ask for help at infinite-scroll.com.");b.state.isInvalidPage=!0}this._debug("determinePath", 4530a);return a},_error:function(a){var b=this.options;b.behavior&&this["_error_"+b.behavior]!==f?this["_error_"+b.behavior].call(this,a):("destroy"!==a&&"end"!==a&&(a="unknown"),this._debug("Error",a),("end"===a||b.state.isBeyondMaxPage)&&this._showdonemsg(),b.state.isDone=!0,b.state.currPage=1,b.state.isPau
4530sed=!1,b.state.isBeyondMaxPage=!1,this._binding("unbind"))},_loadcallback:function(a,b,c){var e=this.options,g=this.options.callback,h=e.state.isDone?"done":e.appendCallback?"append":"no-append"; 4531if(e.behavior&&this["_loadcallback_"+e.behavior]!==f)this["_loadcallback_"+e.behavior].call(this,a,b);else{switch(h){case "done":return this._showdonemsg(),!1;case "no-append":"html"===e.dataType&&(b=d("<div>"+b+"</div>").find(e.itemSelector));break;case "append":h=a.children();if(0===h.length)return this._error("end");for(b=document.createDocumentFragment();a[0].firstChild;)b.appendChild(a[0].firstChild);this._debug("contentSelector",d(e.contentSelector)[0]);d(e.contentSelector)[0].appendChild(b); 4532b=h.get()}e.loading.finished.call(d(e.contentSelector)[0],e);e.animate&&(a=d(window).scrollTop()+d(e.loading.msg).height()+e.extraScrollPx+"px",d("html,body").animate({scrollTop:a},800,function(){e.state.isDuringAjax=!1}));e.animate||(e.state.isDuringAjax=!1);g(this,b,c);e.prefill&&this._prefill()}},_nearbottom:function(){var a=this.options,b=0+d(document).height()-a.binder.scrollTop()-d(window).height();if(a.behavior&&this["_nearbottom_"+a.behavior]!==f)return this["_nearbottom_"+a.behavior].call(this); 4533this._debug("math:",b,a.pixelsFromNavToBottom);return b-a.bufferPx<a.pixelsFromNavToBottom},_pausing:function(a){var b=this.options;if(b.behavior&&this["_pausing_"+b.behavior]!==f)this["_pausing_"+b.behavior].call(this,a);else{"pause"!==a&&"resume"!==a&&null!==a&&this._debug("Invalid argument. Toggling pause value instead");switch(!a||"pause"!==a&&"resume"!==a?"toggle":a){case "pause":b.state.isPau
4533sed=!0;break;case "resume":b.state.isPaused=!1;break;case "toggle":b.state.isPaused=!b.state.isPaused}this._debug("Paused", 4534b.state.isPaused);return!1}},_setup:function(){var a=this.options;if(a.behavior&&this["_setup_"+a.behavior]!==f)this["_setup_"+a.behavior].call(this);else return this._binding("bind"),!1},_showdonemsg:function(){var a=this.options;a.behavior&&this["_showdonemsg_"+a.behavior]!==f?this["_showdonemsg_"+a.behavior].call(this):(a.loading.msg.find(".loading-spinner").hide().parent().find(".loading-msg").html(a.loading.finishedMsg).animate({opacity:1},2E3,function(){d(this).parent().fadeOut(a.loading.speed)}), 4535a.errorCallback.call(d(a.contentSelector)[0],"done"))},_validate:function(a){for(var b in a)if(b.indexOf&&-1<b.indexOf("Selector")&&0===d(a[b]).length)return this._debug("Your "+b+" found no elements."),!1;return!0},bind:function(){this._binding("bind")},destroy:function(){this.options.state.isDestroyed=!0;this.options.loading.finished();return this._error("destroy")},pause:function(){this._pausing("pause")},resume:function(){this._pausing("resume")},beginAjax:function(a){var b=this,c=a.path,e,g, 4536h;a.state.currPage++;if(a.maxPage!==f&&a.state.currPage>a.maxPage)a.state.isBeyondMaxPage=!0,this.destroy();else switch(e=d(a.contentSelector).is("table, tbody")?d("<tbody/>"):d("<div/>"),g="function"===typeof c?c(a.state.currPage):c.join(a.state.currPage),b._debug("heading into ajax",g),c="html"===a.dataType||"json"===a.dataType?a.dataType:"html+callback",a.appendCallback&&"html"===a.dataType&&(c+="+callback"),c){case "html+callback":b._debug("Using HTML via .load() method");e.load(g+" "+a.itemSelector, 4537f,function(a){b._loadcallback(e,a,g)});break;case "html":b._debug("Using "+c.toUpperCase()+" via $.ajax() method");d.ajax({url:g,dataType:a.dataType,complete:function(a,c){(h="undefined"!==typeof a.isResolved?a.isResolved():"success"===c||"notmodified"===c)?b._loadcallback(e,a.responseText,g):b._error("end")}});break;case "json":b._debug("Using "+c.toUpperCase()+" via $.ajax() method"),d.ajax({dataType:"json",type:"GET",url:g,success:function(c,d,k){h="undefined"!==typeof k.isResolved?k.isResolved(): 4538"success"===d||"notmodified"===d;a.appendCallback?a.template!==f?(c=a.template(c),e.append(c),h?b._loadcallback(e,c):b._error("end")):(b._debug("template must be defined."),b._error("end")):h?b._loadcallback(e,c,g):b._error("end")},error:function(){b._debug("JSON ajax request failed.");b._error("end")}})}},retrieve:function(a){a=a||null;var b=this.options;if(b.behavior&&this["retrieve_"+b.behavior]!==f)this["retrieve_"+b.behavior].call(this,a);else{if(b.state.isDestroyed)return this._debug("Instance is destroyed"), 4539!1;b.state.isDuringAjax=!0;b.loading.start.call(d(b.contentSelector)[0],b)}},scroll:function(){var a=this.options,b=a.state;a.behavior&&this["scroll_"+a.behavior]!==f?this["scroll_"+a.behavior].call(this):b.isDuringAjax||b.isInvalidPage||b.isDone||b.isDestroyed||b.isPaused||this._nearbottom()&&this.retrieve()},toggle:function(){this._pausing()},unbind:function(){this._binding("unbind")},update:function(a){d.isPlainObject(a)&&(this.options=d.extend(!0,this.options,a))}};d.fn.infinitescroll=function(a, 4540b){switch(typeof a){case "string":var c=Array.prototype.slice.call(arguments,1);this.each(function(){var b=d.data(this,"infinitescroll");if(!b||!d.isFunction(b[a])||"_"===a.charAt(0))return!1;b[a].apply(b,c)});break;case "object":this.each(function(){var c=d.data(this,"infinitescroll");c?c.update(a):(c=new d.infinitescroll(a,b,this),c.failed||d.data(this,"infinitescroll",c))})}return this};var k=d.event,l;k.special.smartscroll={setup:function(){d(this).bind("scroll",k.special.smartscroll.handler)}, 4541teardown:function(){d(this).unbind("scroll",k.special.smartscroll.handler)},handler:function(a,b){var c=this,e=arguments;a.type="smartscroll";l&&clearTimeout(l);l=setTimeout(function(){d(c).trigger("smartscroll",e)},"execAsap"===b?0:100)}};d.fn.smartscroll=function(a){return a?this.bind("smartscroll",a):this.trigger("smartscroll",["execAsap"])}}); 4542 4543// Init style shamelessly stolen from jQuery http://jquery.com 4544var Froogaloop = (function(){ 4545 // Define a local copy of Froogaloop 4546 function Froogaloop(iframe) { 4547 // The Froogaloop object is actually just the init constructor 4548 return new Froogaloop.fn.init(iframe); 4549 } 4550 4551 var eventCallbacks = {}, 4552 hasWindowEvent = false, 4553 isReady = false, 4554 slice = Array.prototype.slice, 4555 playerDomain = ''; 4556 4557 Froogaloop.fn = Froogaloop.prototype = { 4558 element: null, 4559 4560 init: function(iframe) { 4561 if (typeof iframe === "string") { 4562 iframe = document.getElementById(iframe); 4563 } 4564 4565 this.element = iframe; 4566 4567 // Register message event listeners 4568 playerDomain = getDomainFromUrl(this.element.getAttribute('src')); 4569 4570 return this; 4571 }, 4572 4573 /* 4574 * Calls a function to act upon the player. 4575 * 4576 * @param {string} method The name of the Javascript API method to call. Eg: 'play'. 4577 * @param {Array|Function} valueOrCallback params Array of parameters to pass when calling an API method 4578 * or callback function when the method returns a value. 4579 */ 4580 api: function(method, valueOrCallback) { 4581 if (!this.element || !method) { 4582 return false;
vendor: 4,285 bytes, lines 4583-4752
4583 } 4584 4585 var self = this, 4586 element = self.element, 4587 target_id = element.id !== '' ? element.id : null, 4588 params = !isFunction(valueOrCallback) ? valueOrCallback : null, 4589 callback = isFunction(valueOrCallback) ? valueOrCallback : null; 4590 4591 // Store the callback for get functions 4592 if (callback) { 4593 storeCallback(method, callback, target_id); 4594 } 4595 4596 postMessage(method, params, element); 4597 return self; 4598 }, 4599 4600 /* 4601 * Registers an event listener and a callback function that gets called when the event fires. 4602 * 4603 * @param eventName (String): Name of the event to listen for. 4604 * @param callback (Function): Function that should be called when the event fires. 4605 */ 4606 addEvent: function(eventName, callback) { 4607 if (!this.element) { 4608 return false; 4609 } 4610 4611 var self = this, 4612 element = self.element, 4613 target_id = element.id !== '' ? element.id : null; 4614 4615 4616 storeCallback(eventName, callback, target_id); 4617 4618 // The ready event is not registered via postMessage. It fires regardless. 4619 if (eventName != 'ready') { 4620 postMessage('addEventListener', eventName, element); 4621 } 4622 else if (eventName == 'ready' && isReady) { 4623 callback.call(null, target_id); 4624 } 4625 4626 return self; 4627 }, 4628 4629 /* 4630 * Unregisters an event listener that gets called when the event fires. 4631 * 4632 * @param eventName (String): Name of the event to stop listening for. 4633 */ 4634 removeEvent: function(eventName) { 4635 if (!this.element) { 4636 return false; 4637 } 4638 4639 var self = this, 4640 element = self.element, 4641 target_id = element.id !== '' ? element.id : null, 4642 removed = removeCallback(eventName, target_id); 4643 4644 // The ready event is not registered 4645 if (eventName != 'ready' && removed) { 4646 postMessage('removeEventListener', eventName, element); 4647 } 4648 } 4649 }; 4650 4651 /** 4652 * Handles posting a message to the parent window. 4653 * 4654 * @param method (String): name of the method to call inside the player. For api calls 4655 * this is the name of the api method (api_play or api_pause) while for events this method 4656 * is api_addEventListener. 4657 * @param params (Object or Array): List of parameters to submit to the method. Can be either 4658 * a single param or an array list of parameters. 4659 * @param target (HTMLElement): Target iframe to post the message to. 4660 */ 4661 function postMessage(method, params, target) { 4662 if (!target.contentWindow.postMessage) { 4663 return false; 4664 } 4665 4666 var url = target.getAttribute('src').split('?')[0], 4667 data = JSON.stringify({ 4668 method: method, 4669 value: params 4670 }); 4671 4672 if (url.substr(0, 2) === '//') { 4673 url = window.location.protocol + url; 4674 } 4675 4676 target.contentWindow.postMessage(data, url); 4677 } 4678 4679 /** 4680 * Event that fires whenever the window receives a message from its parent 4681 * via window.postMessage. 4682 */ 4683 function onMessageReceived(event) { 4684 var data, method; 4685 4686 try { 4687 data = JSON.parse(event.data); 4688 method = data.event || data.method; 4689 } 4690 catch(e) { 4691 //fail silently... like a ninja! 4692 } 4693 4694 if (method == 'ready' && !isReady) { 4695 isReady = true; 4696 } 4697 4698 // Handles messages from moogaloop only 4699 if (event.origin != playerDomain) { 4700 return false; 4701 } 4702 4703 var value = data.value, 4704 eventData = data.data, 4705 target_id = target_id === '' ? null : data.player_id, 4706 4707 callback = getCallback(method, target_id), 4708 params = []; 4709 4710 if (!callback) { 4711 return false; 4712 } 4713 4714 if (value !== undefined) { 4715 params.push(value); 4716 } 4717 4718 if (eventData) { 4719 params.push(eventData); 4720 } 4721 4722 if (target_id) { 4723 params.push(target_id); 4724 } 4725 4726 return params.length > 0 ? callback.apply(null, params) : callback.call(); 4727 } 4728 4729 4730 /** 4731 * Stores submitted callbacks for each iframe being tracked and each 4732 * event for that iframe. 4733 * 4734 * @param eventName (String): Name of the event. Eg. api_onPlay 4735 * @param callback (Function): Function that should get executed when the 4736 * event is fired. 4737 * @param target_id (String) [Optional]: If handling more than one iframe then 4738 * it stores the different callbacks for different iframes based on the iframe's 4739 * id. 4740 */ 4741 function storeCallback(eventName, callback, target_id) { 4742 if (target_id) { 4743 if (!eventCallbacks[target_id]) { 4744 eventCallbacks[target_id] = {}; 4745 } 4746 eventCallbacks[target_id][eventName] = callback; 4747 } 4748 else { 4749 eventCallbacks[eventName] = callback; 4750 } 4751 } 4752
4753 /** 4754 * Retrieves stored callbacks. 4755 */ 4756 function getCallback(eventName, target_id) { 4757 if (target_id) { 4758 return eventCallbacks[target_id][eventName]; 4759 } 4760 else { 4761 return eventCallbacks[eventName]; 4762 } 4763 } 4764 4765 function removeCallback(eventName, target_id) { 4766 if (target_id && eventCallbacks[target_id]) { 4767 if (!eventCallbacks[target_id][eventName]) { 4768 return false; 4769 } 4770 eventCallbacks[target_id][eventName] = null; 4771 } 4772 else { 4773 if (!eventCallbacks[eventName]) { 4774 return false; 4775 } 4776 eventCallbacks[eventName] = null; 4777 } 4778 4779 return true; 4780 } 4781 4782 /** 4783 * Returns a domain's root domain. 4784 * Eg. returns http://vimeo.com when http://vimeo.com/channels is sbumitted 4785 * 4786 * @param url (String): Url to test against. 4787 * @return url (String): Root domain of submitted url 4788 */ 4789 function getDomainFromUrl(url) { 4790 if (url.substr(0, 2) === '//') { 4791 url = window.location.protocol + url; 4792 } 4793 4794 var url_pieces = url.split('/'), 4795 domain_str = ''; 4796 4797 for(var i = 0, length = url_pieces.length; i < length; i++) { 4798 if(i<3) {domain_str += url_pieces[i];} 4799 else {break;} 4800 if(i<2) {domain_str += '/';} 4801 } 4802 4803 return domain_str; 4804 } 4805 4806 function isFunction(obj) { 4807 return !!(obj && obj.constructor && obj.call && obj.apply); 4808 } 4809 4810 function isArray(obj) { 4811 return toString.call(obj) === '[object Array]'; 4812 } 4813 4814 // Give the init function the Froogaloop prototype for later instantiation 4815 Froogaloop.fn.init.prototype = Froogaloop.fn; 4816 4817 // Listens for the message event. 4818 // W3C 4819 if (window.addEventListener) { 4820 window.addEventListener('message', onMessageReceived, false); 4821 } 4822 // IE 4823 else { 4824 window.attachEvent('onmessage', onMessageReceived); 4825 } 4826 4827 // Expose froogaloop to the global object 4828 return (window.Froogaloop = window.$f = Froogaloop); 4829 4830})(); 4831 4832/**! 4833 * easyPieChart 4834 * Lightweight plugin to render simple, animated and retina optimized pie charts 4835 * 4836 * @license 4837 * @author Robert Fleischmann <[email protected]> (http://robert-fleischmann.de) 4838 * @version 2.1.3 4839 **/ 4840 4841(function(root, factory) { 4842 if(typeof exports === 'object') { 4843 module.exports = factory(require('jquery')); 4844 } 4845 else if(typeof define === 'function' && define.amd) { 4846 define(['jquery'], factory); 4847 } 4848 else { 4849 factory(root.jQuery); 4850 } 4851}(this, function($) { 4852/** 4853 * Renderer to render the chart on a canvas object 4854 * @param {DOMElement} el DOM element to host the canvas (root of the plugin) 4855 * @param {object} options options object of the plugin 4856 */ 4857var CanvasRenderer = function(el, options) { 4858 var cachedBackground; 4859 var canvas = document.createElement('canvas'); 4860 4861 el.appendChild(canvas); 4862 4863 if (typeof(G_vmlCanvasManager) !== 'undefined') { 4864 G_vmlCanvasManager.initElement(canvas); 4865 } 4866 4867 var ctx = canvas.getContext('2d'); 4868 4869 canvas.width = canvas.height = options.size; 4870 4871 // canvas on retina devices 4872 var scaleBy = 1; 4873 if (window.devicePixelRatio > 1) { 4874 scaleBy = window.devicePixelRatio; 4875 canvas.style.width = canvas.style.height = [options.size, 'px'].join(''); 4876 canvas.width = canvas.height = options.size * scaleBy; 4877 ctx.scale(scaleBy, scaleBy); 4878 } 4879 4880 // move 0,0 coordinates to the center 4881 ctx.translate(options.size / 2, options.size / 2); 4882 4883 // rotate canvas -90deg 4884 ctx.rotate((-1 / 2 + options.rotate / 180) * Math.PI); 4885 4886 var radius = (options.size - options.lineWidth) / 2; 4887 if (options.scaleColor && options.scaleLength) { 4888 radius -= options.scaleLength + 2; // 2 is the distance between scale and bar 4889 } 4890 4891 // IE polyfill for Date 4892 Date.now = Date.now || function() { 4893 return +(new Date()); 4894 }; 4895 4896 /** 4897 * Draw a circle around the center of the canvas 4898 * @param {strong} color Valid CSS color string 4899 * @param {number} lineWidth Width of the line in px 4900 * @param {number} percent Percentage to draw (float between -1 and 1) 4901 */ 4902 var drawCircle = function(color, lineWidth, percent) { 4903 percent = Math.min(Math.max(-1, percent || 0), 1); 4904 var isNegative = percent <= 0 ? true : false; 4905 4906 ctx.beginPath(); 4907 ctx.arc(0, 0, radius, 0, Math.PI * 2 * percent, isNegative); 4908 4909 ctx.strokeStyle = color; 4910 ctx.lineWidth = lineWidth; 4911 4912 ctx.stroke(); 4913 }; 4914 4915 /** 4916 * Draw the scale of the chart 4917 */ 4918 var drawScale = function() { 4919 var offset; 4920 var length; 4921 4922 ctx.lineWidth = 1; 4923 ctx.fillStyle = options.scaleColor; 4924 4925 ctx.save(); 4926 for (var i = 24; i > 0; --i) { 4927 if (i % 6 === 0) { 4928 length = options.scaleLength; 4929 offset = 0; 4930 } else { 4931 length = options.scaleLength * 0.6; 4932 offset = options.scaleLength - length; 4933 } 4934 ctx.fillRect(-options.size/2 + offset, 0, length, 1); 4935 ctx.rotate(Math.PI / 12); 4936 }
4937 ctx.restore(); 4938 }; 4939 4940 /** 4941 * Request animation frame wrapper with polyfill 4942 * @return {function} Request animation frame method or timeout fallback 4943 */ 4944 var reqAnimationFrame = (function() { 4945 return window.requestAnimationFrame || 4946 window.webkitRequestAnimationFrame || 4947 window.mozRequestAnimationFrame || 4948 function(callback) { 4949 window.setTimeout(callback, 1000 / 60); 4950 }; 4951 }()); 4952 4953 /** 4954 * Draw the background of the plugin including the scale and the track 4955 */ 4956 var drawBackground = function() { 4957 if(options.scaleColor) drawScale(); 4958 if(options.trackColor) drawCircle(options.trackColor, options.lineWidth, 1); 4959 }; 4960 4961 /** 4962 * Canvas accessor 4963 */ 4964 this.getCanvas = function() { 4965 return canvas; 4966 }; 4967 4968 /** 4969 * Canvas 2D context 'ctx' accessor 4970 */ 4971 this.getCtx = function() { 4972 return ctx; 4973 }; 4974 4975 /** 4976 * Clear the complete canvas 4977 */ 4978 this.clear = function() { 4979 ctx.clearRect(options.size / -2, options.size / -2, options.size, options.size); 4980 }; 4981 4982 /** 4983 * Draw the complete chart 4984 * @param {number} percent Percent shown by the chart between -100 and 100 4985 */ 4986 this.draw = function(percent) { 4987 // do we need to render a background 4988 if (!!options.scaleColor || !!options.trackColor) { 4989 // getImageData and putImageData are supported 4990 if (ctx.getImageData && ctx.putImageData) { 4991 if (!cachedBackground) { 4992 drawBackground(); 4993 cachedBackground = ctx.getImageData(0, 0, options.size * scaleBy, options.size * scaleBy); 4994 } else { 4995 ctx.putImageData(cachedBackground, 0, 0); 4996 } 4997 } else { 4998 this.clear(); 4999 drawBackground(); 5000 } 5001 } else { 5002 this.clear(); 5003 } 5004 5005 ctx.lineCap = options.lineCap; 5006 5007 // if barcolor is a function execute it and pass the percent as a value 5008 var color; 5009 if (typeof(options.barColor) === 'function') { 5010 color = options.barColor(percent); 5011 } else { 5012 color = options.barColor; 5013 } 5014 5015 // draw bar 5016 drawCircle(color, options.lineWidth, percent / 100); 5017 }.bind(this); 5018 5019 /** 5020 * Animate from some percent to some other percentage 5021 * @param {number} from Starting percentage 5022 * @param {number} to Final percentage 5023 */ 5024 this.animate = function(from, to) { 5025 var startTime = Date.now(); 5026 options.onStart(from, to); 5027 var animation = function() { 5028 var process = Math.min(Date.now() - startTime, options.animate.duration); 5029 var currentValue = options.easing(this, process, from, to - from, options.animate.duration); 5030 this.draw(currentValue); 5031 options.onStep(from, to, currentValue); 5032 if (process >= options.animate.duration) { 5033 options.onStop(from, to); 5034 } else { 5035 reqAnimationFrame(animation); 5036 } 5037 }.bind(this); 5038 5039 reqAnimationFrame(animation); 5040 }.bind(this); 5041}; 5042 5043var EasyPieChart = function(el, opts) { 5044 var defaultOptions = { 5045 barColor: '#ef1e25', 5046 trackColor: '#f9f9f9', 5047 scaleColor: '#dfe0e0', 5048 scaleLength: 5, 5049 lineCap: 'round', 5050 lineWidth: 3, 5051 size: 110, 5052 rotate: 0, 5053 animate: { 5054 duration: 1000, 5055 enabled: true 5056 }, 5057 easing: function (x, t, b, c, d) { // more can be found here: http://gsgd.co.uk/sandbox/jquery/easing/ 5058 t = t / (d/2); 5059 if (t < 1) { 5060 return c / 2 * t * t + b; 5061 } 5062 return -c/2 * ((--t)*(t-2) - 1) + b; 5063 }, 5064 onStart: function(from, to) { 5065 return; 5066 }, 5067 onStep: function(from, to, currentValue) { 5068 return; 5069 }, 5070 onStop: function(from, to) { 5071 return; 5072 } 5073 }; 5074 5075 // detect present renderer 5076 if (typeof(CanvasRenderer) !== 'undefined') { 5077 defaultOptions.renderer = CanvasRenderer; 5078 } else if (typeof(SVGRenderer) !== 'undefined') { 5079 defaultOptions.renderer = SVGRenderer; 5080 } else { 5081 throw new Error('Please load either the SVG- or the CanvasRenderer'); 5082 } 5083 5084 var options = {}; 5085 var currentValue = 0; 5086 5087 /** 5088 * Initialize the plugin by creating the options object and initialize rendering 5089 */ 5090 var init = function() { 5091 this.el = el; 5092 this.options = options; 5093 5094 // merge user options into default options 5095 for (var i in defaultOptions) { 5096 if (defaultOptions.hasOwnProperty(i)) { 5097 options[i] = opts && typeof(opts[i]) !== 'undefined' ? opts[i] : defaultOptions[i]; 5098 if (typeof(options[i]) === 'function') { 5099 options[i] = options[i].bind(this); 5100 } 5101 } 5102 } 5103 5104 // check for jQuery easing 5105 if (typeof(options.easing) === 'string' && typeof(jQuery) !== 'undefined' && jQuery.isFunction(jQuery.easing[options.easing])) { 5106 options.easing = jQuery.easing[options.easing]; 5107 } else { 5108 options.easing = defaultOptions.easing; 5109 } 5110 5111 // process earlier animate option to avoid bc breaks 5112 if (typeof(options.animate) === 'number') { 5113 options.animate = { 5114 duration: options.animate, 5115 enabled: true 5116 }; 5117 } 5118 5119 if (typeof(options.animate) === 'boolean' && !options.animate) { 5120 options.animate = { 5121 duration: 1000, 5122 enabled: options.animate 5123 }; 5124 } 5125 5126 // create renderer 5127 this.renderer = new options.renderer(el, options); 5128 5129 // initial draw 5130 this.renderer.draw(currentValue); 5131 5132 // initial update 5133 if (el.dataset && el.dataset.percent) { 5134 this.update(parseFloat(el.dataset.percent)); 5135 } else if (el.getAttribute && el.getAttribute('data-percent')) { 5136 this.update(parseFloat(el.getAttribute('data-percent'))); 5137 } 5138 }.bind(this); 5139 5140 /** 5141 * Update the value of the chart 5142 * @param {number} newValue Number between 0 and 100 5143 * @return {object} Instance of the plugin for method chaining 5144 */ 5145 this.update = function(newValue) { 5146 newValue = parseFloat(newValue); 5147 if (options.animate.enabled) { 5148 this.renderer.animate(currentValue, newValue); 5149 } else { 5150 this.renderer.draw(newValue); 5151 } 5152 currentValue = newValue; 5153 return this; 5154 }.bind(this); 5155 5156 /** 5157 * Disable animation 5158 * @return {object} Instance of the plugin for method chaining 5159 */ 5160 this.disableAnimation = function() { 5161 options.animate.enabled = false;
5162 return this; 5163 }; 5164 5165 /** 5166 * Enable animation 5167 * @return {object} Instance of the plugin for method chaining 5168 */ 5169 this.enableAnimation = function() { 5170 options.animate.enabled = true; 5171 return this; 5172 }; 5173 5174 init(); 5175}; 5176 5177$.fn.easyPieChart = function(options) { 5178 return this.each(function() { 5179 var instanceOptions; 5180 5181 if (!$.data(this, 'easyPieChart')) { 5182 instanceOptions = $.extend({}, options, $(this).data()); 5183 $.data(this, 'easyPieChart', new EasyPieChart(this, instanceOptions)); 5184 } 5185 }); 5186}; 5187 5188})); 5189 5190/* 5191 * jQuery.appear 5192 * https://github.com/bas2k/jquery.appear/ 5193 * http://code.google.com/p/jquery-appear/ 5194 * 5195 * Copyright (c) 2009 Michael Hixson 5196 * Copyright (c) 2012 Alexander Brovikov 5197 * Licensed under the MIT license (http://www.opensource.org/licenses/mit-license.php) 5198 */ 5199(function($) { 5200 $.fn.appear = function(fn, options) { 5201 5202 var settings = $.extend({ 5203 5204 //arbitrary data to pass to fn 5205 data: undefined, 5206 5207 //call fn only on the first appear? 5208 one: true, 5209 5210 // X & Y accuracy 5211 accX: 0, 5212 accY: 0 5213 5214 }, options); 5215 5216 return this.each(function() { 5217 5218 var t = $(this); 5219 5220 //whether the element is currently visible 5221 t.appeared = false; 5222 5223 if (!fn) { 5224 5225 //trigger the custom event 5226 t.trigger('appear', settings.data); 5227 return; 5228 } 5229 5230 var w = $(window); 5231 5232 //fires the appear event when appropriate 5233 var check = function() { 5234 5235 //is the element hidden? 5236 if (!t.is(':visible')) { 5237 5238 //it became hidden 5239 t.appeared = false; 5240 return; 5241 } 5242 5243 //is the element inside the visible window? 5244 var a = w.scrollLeft(); 5245 var b = w.scrollTop(); 5246 var o = t.offset(); 5247 var x = o.left; 5248 var y = o.top; 5249 5250 var ax = settings.accX; 5251 var ay = settings.accY; 5252 var th = t.height(); 5253 var wh = w.height(); 5254 var tw = t.width(); 5255 var ww = w.width(); 5256 5257 if (y + th + ay >= b && 5258 y <= b + wh + ay && 5259 x + tw + ax >= a && 5260 x <= a + ww + ax) { 5261 5262 //trigger the custom event 5263 if (!t.appeared) t.trigger('appear', settings.data); 5264 5265 } else { 5266 5267 //it scrolled out of view 5268 t.appeared = false; 5269 } 5270 }; 5271 5272 //create a modified fn with some additional logic 5273 var modifiedFn = function() { 5274 5275 //mark the element as visible 5276 t.appeared = true; 5277 5278 //is this supposed to happen only once? 5279 if (settings.one) { 5280 5281 //remove the check 5282 w.unbind('scroll', check); 5283 var i = $.inArray(check, $.fn.appear.checks); 5284 if (i >= 0) $.fn.appear.checks.splice(i, 1); 5285 } 5286 5287 //trigger the original fn 5288 fn.apply(this, arguments); 5289 }; 5290 5291 //bind the modified fn to the element 5292 if (settings.one) t.one('appear', settings.data, modifiedFn); 5293 else t.bind('appear', settings.data, modifiedFn); 5294 5295 //check whenever the window scrolls 5296 w.scroll(check); 5297 5298 //check whenever the dom changes 5299 $.fn.appear.checks.push(check); 5300 5301 //check now 5302 (check)(); 5303 }); 5304 }; 5305 5306 //keep a queue of appearance checks 5307 $.extend($.fn.appear, { 5308 5309 checks: [], 5310 timeout: null, 5311 5312 //process the queue 5313 checkAll: function() { 5314 var length = $.fn.appear.checks.length; 5315 if (length > 0) while (length--) ($.fn.appear.checks[length])(); 5316 }, 5317 5318 //check the queue asynchronously 5319 run: function() { 5320 if ($.fn.appear.timeout) clearTimeout($.fn.appear.timeout); 5321 $.fn.appear.timeout = setTimeout($.fn.appear.checkAll, 20); 5322 } 5323 }); 5324 5325 //run checks when these methods are called 5326 $.each(['append', 'prepend', 'after', 'before', 'attr', 5327 'removeAttr', 'addClass', 'removeClass', 'toggleClass', 5328 'remove', 'css', 'show', 'hide'], function(i, n) { 5329 var old = $.fn[n]; 5330 if (old) { 5331 $.fn[n] = function() { 5332 var r = old.apply(this, arguments); 5333 $.fn.appear.run(); 5334 return r; 5335 } 5336 } 5337 }); 5338 5339})(jQuery); 5340 5341/* ======================================================================== 5342 * Bootstrap: transition.js v3.1.1 5343 * http://getbootstrap.com/javascript/#transitions 5344 * ======================================================================== 5345 * Copyright 2011-2014 Twitter, Inc. 5346 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) 5347 * ======================================================================== */ 5348 5349 5350+function ($) { 5351 'use strict'; 5352
5353 // CSS TRANSITION SUPPORT (Shoutout: http://www.modernizr.com/) 5354 // ============================================================ 5355 5356 function transitionEnd() { 5357 var el = document.createElement('bootstrap'); 5358 5359 var transEndEventNames = { 5360 'WebkitTransition' : 'webkitTransitionEnd', 5361 'MozTransition' : 'transitionend', 5362 'OTransition' : 'oTransitionEnd otransitionend', 5363 'transition' : 'transitionend' 5364 }; 5365 5366 for (var name in transEndEventNames) { 5367 if (el.style[name] !== undefined) { 5368 return { end: transEndEventNames[name] } 5369 } 5370 } 5371 5372 return false; // explicit for ie8 ( ._.) 5373 } 5374 5375 // http://blog.alexmaccaw.com/css-transitions 5376 $.fn.emulateTransitionEnd = function (duration) { 5377 var called = false, $el = this; 5378 $(this).one($.support.transition.end, function () { called = true }); 5379 var callback = function () { if (!called) $($el).trigger($.support.transition.end) }; 5380 setTimeout(callback, duration); 5381 return this; 5382 }; 5383 5384 $(function () { 5385 $.support.transition = transitionEnd(); 5386 }) 5387 5388}(jQuery); 5389 5390/* ======================================================================== 5391 * Bootstrap: collapse.js v3.1.1 5392 * http://getbootstrap.com/javascript/#collapse 5393 * ======================================================================== 5394 * Copyright 2011-2014 Twitter, Inc. 5395 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) 5396 * ======================================================================== */ 5397 5398 5399+function ($) { 5400 'use strict'; 5401 5402 // COLLAPSE PUBLIC CLASS DEFINITION 5403 // ================================ 5404 5405 var Collapse = function (element, options) { 5406 this.$element = $(element); 5407 this.options = $.extend({}, Collapse.DEFAULTS, options); 5408 this.transitioning = null; 5409 5410 if (this.options.parent) this.$parent = $(this.options.parent); 5411 if (this.options.toggle) this.toggle(); 5412 }; 5413 5414 Collapse.DEFAULTS = { 5415 toggle: true 5416 }; 5417 5418 Collapse.prototype.dimension = function () { 5419 var hasWidth = this.$element.hasClass('width'); 5420 return hasWidth ? 'width' : 'height'; 5421 }; 5422 5423 Collapse.prototype.show = function () { 5424 if (this.transitioning || this.$element.hasClass('in')) return; 5425 5426 var startEvent = $.Event('show.bs.collapse'); 5427 this.$element.trigger(startEvent); 5428 if (startEvent.isDefaultPrevented()) return; 5429 5430 var actives = this.$parent && this.$parent.find('> .fusion-panel > .in'); 5431 5432 if (actives && actives.length) { 5433 var hasData = actives.data('bs.collapse'); 5434 if (hasData && hasData.transitioning) return; 5435 actives.collapse('hide'); 5436 hasData || actives.data('bs.collapse', null) 5437 } 5438 5439 var dimension = this.dimension(); 5440 5441 this.$element 5442 .removeClass('collapse') 5443 .addClass('collapsing') 5444 [dimension](0); 5445 5446 this.transitioning = 1; 5447 5448 var complete = function () { 5449 this.$element 5450 .removeClass('collapsing') 5451 .addClass('collapse in') 5452 [dimension]('auto'); 5453 this.transitioning = 0; 5454 this.$element.trigger('shown.bs.collapse'); 5455 }; 5456 5457 if (!$.support.transition) return complete.call(this); 5458 5459 var scrollSize = $.camelCase(['scroll', dimension].join('-')); 5460 5461 this.$element 5462 .one($.support.transition.end, $.proxy(complete, this)) 5463 .emulateTransitionEnd(350) 5464 [dimension](this.$element[0][scrollSize]); 5465 }; 5466 5467 Collapse.prototype.hide = function () { 5468 if (this.transitioning || !this.$element.hasClass('in')) return; 5469 5470 var startEvent = $.Event('hide.bs.collapse'); 5471 this.$element.trigger(startEvent); 5472 if (startEvent.isDefaultPrevented()) return; 5473 5474 var dimension = this.dimension(); 5475 5476 this.$element 5477 [dimension](this.$element[dimension]()) 5478 [0].offsetHeight; 5479 5480 this.$element 5481 .addClass('collapsing') 5482 .removeClass('collapse') 5483 .removeClass('in'); 5484 5485 this.transitioning = 1; 5486 5487 var complete = function () { 5488 this.transitioning = 0; 5489 this.$element 5490 .trigger('hidden.bs.collapse') 5491 .removeClass('collapsing') 5492 .addClass('collapse'); 5493 }; 5494 5495 if (!$.support.transition) return complete.call(this); 5496 5497 this.$element 5498 [dimension](0) 5499 .one($.support.transition.end, $.proxy(complete, this)) 5500 .emulateTransitionEnd(350); 5501 }; 5502 5503 Collapse.prototype.toggle = function () { 5504 this[this.$element.hasClass('in') ? 'hide' : 'show'](); 5505 }; 5506 5507 5508 // COLLAPSE PLUGIN DEFINITION 5509 // ========================== 5510 5511 var old = $.fn.collapse; 5512 5513 $.fn.collapse = function (option) { 5514 return this.each(function () { 5515 var $this = $(this); 5516 var data = $this.data('bs.collapse'); 5517 var options = $.extend({}, Collapse.DEFAULTS, $this.data(), typeof option == 'object' && option); 5518 5519 if (!data && options.toggle && option == 'show') option = !option; 5520 if (!data) $this.data('bs.collapse', (data = new Collapse(this, options))); 5521 if (typeof option == 'string') data[option](); 5522 }) 5523 }; 5524 5525 $.fn.collapse.Constructor = Collapse; 5526 5527 5528 // COLLAPSE NO CONFLICT 5529 // ==================== 5530 5531 $.fn.collapse.noConflict = function () { 5532 $.fn.collapse = old; 5533 return this; 5534 }; 5535 5536 5537 // COLLAPSE DATA-API 5538 // ================= 5539 5540 $(document).on('click.bs.collapse.data-api', '[data-toggle=collapse]', function (e) { 5541 var $this = $(this), href; 5542 var target = $this.attr('data-target') 5543 || e.preventDefault() 5544 || (href = $this.attr('href')) && href.replace(/.*(?=#[^\s]+$)/, ''); //strip for ie7 5545 var $target = $(target); 5546 var data = $target.data('bs.collapse'); 5547 var option = data ? 'toggle' : $this.data(); 5548 var parent = $this.attr('data-parent'); 5549 var $parent = parent && $(parent); 5550 5551 if (!data || !data.transitioning) { 5552 if ($parent) $parent.find('[data-toggle=collapse][data-parent="' + parent + '"]').not($this).addClass('collapsed'); 5553 $this[$target.hasClass('in') ? 'addClass' : 'removeClass']('collapsed'); 5554 } 5555 5556 $target.collapse(option); 5557 }); 5558 5559 jQuery('click.bs.collapse.data-api, [data-toggle=collapse]').each(function() { 5560 var parent = jQuery(this).attr('data-parent'); 5561 5562 if(jQuery(this).parents('.panel-group').length == 0) { 5563 var random = Math.floor((Math.random() * 10) + 1); 5564 var single_panel = jQuery(this).parents('.fusion-panel'); 5565 jQuery(this).attr('data-parent', 'accordian-' + random); 5566 jQuery(single_panel).wrap('<div class="accordian fusion-accordian fusion-single-accordian"><div class="panel-group" id="accordion-' + random + '"></div></div>'); 5567 } 5568 }); 5569 5570}(jQuery); 5571 5572 5573/* ======================================================================== 5574 * Bootstrap: modal.js v3.1.1 5575 * http://getbootstrap.com/javascript/#modals 5576 * ======================================================================== 5577 * Copyright 2011-2014 Twitter, Inc. 5578 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) 5579 * ======================================================================== */ 5580 5581 5582+function ($) { 5583 'use strict'; 5584 5585 // MODAL CLASS DEFINITION 5586 // ====================== 5587 5588 var Modal = function (element, options) { 5589 this.options = options; 5590 this.$element = $(element); 5591 this.$backdrop = ''; 5592 this.isShown = null; 5593 5594 if (this.options.remote) { 5595 this.$element
5596 .find('.modal-content') 5597 .load(this.options.remote, $.proxy(function () { 5598 this.$element.trigger('loaded.bs.modal'); 5599 }, this)); 5600 } 5601 }; 5602 5603 Modal.DEFAULTS = { 5604 backdrop: true, 5605 keyboard: true, 5606 show: true 5607 }; 5608 5609 Modal.prototype.toggle = function (_relatedTarget) { 5610 return this[!this.isShown ? 'show' : 'hide'](_relatedTarget); 5611 }; 5612 5613 Modal.prototype.show = function (_relatedTarget) { 5614 var that = this; 5615 var e = $.Event('show.bs.modal', { relatedTarget: _relatedTarget }); 5616 5617 this.$element.trigger(e); 5618 5619 if (this.isShown || e.isDefaultPrevented()) return; 5620 5621 this.isShown = true; 5622 5623 this.escape(); 5624 5625 this.$element.on('click.dismiss.bs.modal', '[data-dismiss="modal"]', $.proxy(this.hide, this)); 5626 5627 this.backdrop(function () { 5628 var transition = $.support.transition && that.$element.hasClass('fade'); 5629 5630 if (!that.$element.parent().length) { 5631 that.$element.appendTo(document.body); // don't move modals dom position 5632 } 5633 5634 that.$element 5635 .show() 5636 .scrollTop(0); 5637 5638 if (transition) { 5639 that.$element[0].offsetWidth; // force reflow 5640 } 5641 5642 that.$element 5643 .addClass('in') 5644 .attr('aria-hidden', false); 5645 5646 that.enforceFocus(); 5647 5648 var e = $.Event('shown.bs.modal', { relatedTarget: _relatedTarget }); 5649 5650 transition ? 5651 that.$element.find('.modal-dialog') // wait for modal to slide in 5652 .one($.support.transition.end, function () { 5653 that.$element.focus().trigger(e); 5654 }) 5655 .emulateTransitionEnd(300) : 5656 that.$element.focus().trigger(e); 5657 }) 5658 }; 5659 5660 Modal.prototype.hide = function (e) { 5661 if (e) e.preventDefault(); 5662 5663 e = $.Event('hide.bs.modal'); 5664 5665 this.$element.trigger(e); 5666 5667 if (!this.isShown || e.isDefaultPrevented()) return; 5668 5669 this.isShown = false; 5670 5671 this.escape(); 5672 5673 $(document).off('focusin.bs.modal'); 5674 5675 this.$element 5676 .removeClass('in') 5677 .attr('aria-hidden', true) 5678 .off('click.dismiss.bs.modal'); 5679 5680 $.support.transition && this.$element.hasClass('fade') ? 5681 this.$element 5682 .one($.support.transition.end, $.proxy(this.hideModal, this)) 5683 .emulateTransitionEnd(300) : 5684 this.hideModal(); 5685 }; 5686 5687 Modal.prototype.enforceFocus = function () { 5688 $(document) 5689 .off('focusin.bs.modal') // guard against infinite focus loop 5690 .on('focusin.bs.modal', $.proxy(function (e) { 5691 if (this.$element[0] !== e.target && !this.$element.has(e.target).length) { 5692 this.$element.focus(); 5693 } 5694 }, this)); 5695 }; 5696 5697 Modal.prototype.escape = function () { 5698 if (this.isShown && this.options.keyboard) { 5699 this.$element.on('keyup.dismiss.bs.modal', $.proxy(function (e) { 5700 e.which == 27 && this.hide(); 5701 }, this)); 5702 } else if (!this.isShown) { 5703 this.$element.off('keyup.dismiss.bs.modal'); 5704 } 5705 }; 5706 5707 Modal.prototype.hideModal = function () { 5708 var that = this; 5709 this.$element.hide(); 5710 this.backdrop(function () { 5711 that.removeBackdrop(); 5712 that.$element.trigger('hidden.bs.modal'); 5713 }); 5714 }; 5715 5716 Modal.prototype.removeBackdrop = function () { 5717 this.$backdrop && this.$backdrop.remove(); 5718 this.$backdrop = null; 5719 }; 5720 5721 Modal.prototype.backdrop = function (callback) { 5722 var animate = this.$element.hasClass('fade') ? 'fade' : ''; 5723 5724 if (this.isShown && this.options.backdrop) { 5725 var doAnimate = $.support.transition && animate; 5726 5727 this.$backdrop = $('<div class="modal-backdrop ' + animate + '" />') 5728 .appendTo(document.body); 5729 5730 this.$element.on('click.dismiss.bs.modal', $.proxy(function (e) { 5731 if (e.target !== e.currentTarget) return; 5732 this.options.backdrop == 'static' 5733 ? this.$element[0].focus.call(this.$element[0]) 5734 : this.hide.call(this); 5735 }, this)); 5736 5737 if (doAnimate) this.$backdrop[0].offsetWidth; // force reflow 5738 5739 this.$backdrop.addClass('in'); 5740 5741 if (!callback) return; 5742 5743 doAnimate ? 5744 this.$backdrop 5745 .one($.support.transition.end, callback) 5746 .emulateTransitionEnd(150) : 5747 callback(); 5748 5749 } else if (!this.isShown && this.$backdrop) { 5750 this.$backdrop.removeClass('in'); 5751 5752 $.support.transition && this.$element.hasClass('fade') ? 5753 this.$backdrop 5754 .one($.support.transition.end, callback) 5755 .emulateTransitionEnd(150) : 5756 callback(); 5757 5758 } else if (callback) { 5759 callback(); 5760 } 5761 }; 5762 5763 5764 // MODAL PLUGIN DEFINITION 5765 // ======================= 5766 5767 var old = $.fn.modal; 5768 5769 $.fn.modal = function (option, _relatedTarget) { 5770 return this.each(function () { 5771 var $this = $(this); 5772 var data = $this.data('bs.modal'); 5773 var options = $.extend({}, Modal.DEFAULTS, $this.data(), typeof option == 'object' && option); 5774 5775 if (!data) $this.data('bs.modal', (data = new Modal(this, options))); 5776 if (typeof option == 'string') data[option](_relatedTarget); 5777 else if (options.show) data.show(_relatedTarget); 5778 }); 5779 }; 5780 5781 $.fn.modal.Constructor = Modal; 5782 5783 5784 // MODAL NO CONFLICT 5785 // ================= 5786 5787 $.fn.modal.noConflict = function () { 5788 $.fn.modal = old; 5789 return this; 5790 }; 5791 5792 5793 // MODAL DATA-API 5794 // ============== 5795 5796 $(document).on('click.bs.modal.data-api', '[data-toggle="modal"]', function (e) { 5797 var $this = $(this); 5798 var href = $this.attr('href'); 5799 var $target = $($this.attr('data-target') || (href && href.replace(/.*(?=#[^\s]+$)/, ''))); //strip for ie7 5800 var option = $target.data('bs.modal') ? 'toggle' : $.extend({ remote: !/#/.test(href) && href }, $target.data(), $this.data()); 5801 5802 if ($this.is('a')) e.preventDefault(); 5803 5804 $target 5805 .modal(option, this) 5806 .one('hide', function () { 5807 $this.is(':visible') && $this.focus(); 5808 }); 5809 }); 5810 5811 $(document) 5812 .on('show.bs.modal', '.modal', function () { $(document.body).addClass('modal-open') }) 5813 .on('hidden.bs.modal', '.modal', function () { $(document.body).removeClass('modal-open') }); 5814 5815}(jQuery); 5816 5817/* ======================================================================== 5818 * Bootstrap: tab.js v3.1.1 5819 * http://getbootstrap.com/javascript/#tabs 5820 * ======================================================================== 5821 * Copyright 2011-2014 Twitter, Inc. 5822 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) 5823 * ======================================================================== */ 5824 5825 5826+function ($) { 5827 'use strict'; 5828 5829 // TAB CLASS DEFINITION 5830 // ==================== 5831 5832 var Tab = function (element) { 5833 this.element = $(element); 5834 }; 5835 5836 Tab.prototype.show = function () { 5837 var $this = this.element; 5838 var $ul = $this.closest('ul:not(.dropdown-menu)'); 5839 var selector = $this.data('target'); 5840 5841 if (!selector) { 5842 selector = $this.attr('href'); 5843 selector = selector && selector.replace(/.*(?=#[^\s]*$)/, ''); //strip for ie7 5844 } 5845 5846 if ($this.parent('li').hasClass('active')) return; 5847 5848 var previous = $ul.find('.active:last a')[0]; 5849 var e = $.Event('show.bs.tab', { 5850 relatedTarget: previous 5851 }); 5852 5853 $this.trigger(e); 5854 5855 if (e.isDefaultPrevented()) return; 5856 5857 var $target = $(selector); 5858 5859 this.activate($this.parent('li'), $ul); 5860 this.activate($target, $target.parent(), function () { 5861 $this.trigger({ 5862 type: 'shown.bs.tab', 5863 relatedTarget: previous 5864 }); 5865 }); 5866 }; 5867 5868 Tab.prototype.activate = function (element, container, callback) { 5869 var $active = container.find('> .active'); 5870 var transition = callback 5871 && $.support.transition 5872 && $active.hasClass('fade'); 5873 5874 function next() { 5875 $active 5876 .removeClass('active') 5877 .find('> .dropdown-menu > .active') 5878 .removeClass('active'); 5879 5880 element.addClass('active'); 5881 5882 if (transition) { 5883 element[0].offsetWidth; // reflow for transition 5884 element.addClass('in'); 5885 } else { 5886 element.removeClass('fade'); 5887 } 5888 5889 if (element.parent('.dropdown-menu')) { 5890 element.closest('li.dropdown').addClass('active'); 5891 } 5892 5893 callback && callback(); 5894 } 5895 5896 transition ? 5897 $active 5898 .one($.support.transition.end, next) 5899 .emulateTransitionEnd(150) : 5900 next(); 5901 5902 $active.removeClass('in'); 5903 }; 5904 5905 5906 // TAB PLUGIN DEFINITION 5907 // ===================== 5908 5909 var old = $.fn.tab; 5910 5911 $.fn.tab = function ( option ) { 5912 return this.each(function () { 5913 var $this = $(this); 5914 var data = $this.data('bs.tab'); 5915 5916 if (!data) $this.data('bs.tab', (data = new Tab(this))); 5917 if (typeof option == 'string') data[option](); 5918 }); 5919 }; 5920 5921 $.fn.tab.Constructor = Tab; 5922 5923 5924 // TAB NO CONFLICT 5925 // =============== 5926 5927 $.fn.tab.noConflict = function () { 5928 $.fn.tab = old; 5929 return this; 5930 }; 5931 5932 5933 // TAB DATA-API 5934 // ============ 5935 5936 $(document).on('click.bs.tab.data-api', '[data-toggle="tab"], [data-toggle="pill"]', function (e) { 5937 e.preventDefault(); 5938 $(this).tab('show'); 5939 }); 5940 5941}(jQuery); 5942 5943 5944/* ======================================================================== 5945 * Bootstrap: tooltip.js v3.1.1 5946 * http://getbootstrap.com/javascript/#tooltip 5947 * Inspired by the original jQuery.tipsy by Jason Frame 5948 * ======================================================================== 5949 * Copyright 2011-2014 Twitter, Inc. 5950 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) 5951 * ======================================================================== */ 5952 5953 5954+function ($) { 5955 'use strict'; 5956 5957 // TOOLTIP PUBLIC CLASS DEFINITION 5958 // =============================== 5959 5960 var Tooltip = function (element, options) { 5961 this.type = ''; 5962 this.options = ''; 5963 this.enabled = ''; 5964 this.timeout = ''; 5965 this.hoverState = ''; 5966 this.$element = null; 5967 5968 this.init('tooltip', element, options); 5969 }; 5970 5971 Tooltip.DEFAULTS = { 5972 animation: true, 5973 placement: 'top', 5974 selector: false, 5975 template: '<div class="tooltip"><div class="tooltip-arrow"></div><div class="tooltip-inner"></div></div>', 5976 trigger: 'hover focus', 5977 title: '', 5978 delay: 0, 5979 html: false, 5980 container: false 5981 }; 5982 5983 Tooltip.prototype.init = function (type, element, options) { 5984 this.enabled = true; 5985 this.type = type; 5986 this.$element = $(element); 5987 this.options = this.getOptions(options); 5988 5989 var triggers = this.options.trigger.split(' '); 5990 5991 for (var i = triggers.length; i--;) { 5992 var trigger = triggers[i]; 5993 5994 if (trigger == 'click') { 5995 this.$element.on('click.' + this.type, this.options.selector, $.proxy(this.toggle, this)); 5996 } else if (trigger != 'manual') { 5997 var eventIn = trigger == 'hover' ? 'mouseenter' : 'focusin'; 5998 var eventOut = trigger == 'hover' ? 'mouseleave' : 'focusout'; 5999 6000 this.$element.on(eventIn + '.' + this.type, this.options.selector, $.proxy(this.enter, this)); 6001 this.$element.on(eventOut + '.' + this.type, this.options.selector, $.proxy(this.leave, this)); 6002 } 6003 } 6004 6005 this.options.selector ? 6006 (this._options = $.extend({}, this.options, { trigger: 'manual', selector: '' })) : 6007 this.fixTitle(); 6008 }; 6009 6010 Tooltip.prototype.getDefaults = function () { 6011 return Tooltip.DEFAULTS; 6012 }; 6013 6014 Tooltip.prototype.getOptions = function (options) { 6015 options = $.extend({}, this.getDefaults(), this.$element.data(), options); 6016 6017 if (options.delay && typeof options.delay == 'number') { 6018 options.delay = { 6019 show: options.delay, 6020 hide: options.delay 6021 }; 6022 } 6023 6024 return options; 6025 }; 6026 6027 Tooltip.prototype.getDelegateOptions = function () { 6028 var options = {}; 6029 var defaults = this.getDefaults(); 6030 6031 this._options && $.each(this._options, function (key, value) { 6032 if (defaults[key] != value) options[key] = value; 6033 }); 6034 6035 return options; 6036 }; 6037 6038 Tooltip.prototype.enter = function (obj) { 6039 var self = obj instanceof this.constructor ? 6040 obj : $(obj.currentTarget)[this.type](this.getDelegateOptions()).data('bs.' + this.type); 6041 6042 clearTimeout(self.timeout); 6043 6044 self.hoverState = 'in'; 6045 6046 if (!self.options.delay || !self.options.delay.show) return self.show(); 6047 6048 self.timeout = setTimeout(function () { 6049 if (self.hoverState == 'in') self.show(); 6050 }, self.options.delay.show); 6051 }; 6052 6053 Tooltip.prototype.leave = function (obj) { 6054 var self = obj instanceof this.constructor ? 6055 obj : $(obj.currentTarget)[this.type](this.getDelegateOptions()).data('bs.' + this.type); 6056 6057 clearTimeout(self.timeout); 6058 6059 self.hoverState = 'out'; 6060 6061 if (!self.options.delay || !self.options.delay.hide) return self.hide(); 6062 6063 self.timeout = setTimeout(function () { 6064 if (self.hoverState == 'out') self.hide(); 6065 }, self.options.delay.hide); 6066 }; 6067 6068 Tooltip.prototype.show = function () { 6069 var e = $.Event('show.bs.' + this.type); 6070 6071 if (this.hasContent() && this.enabled) { 6072 this.$element.trigger(e); 6073 6074 if (e.isDefaultPrevented()) return; 6075 var that = this; 6076 6077 var $tip = this.tip(); 6078 6079 this.setContent(); 6080 6081 if (this.options.animation) $tip.addClass('fade'); 6082 6083 var placement = typeof this.options.placement == 'function' ? 6084 this.options.placement.call(this, $tip[0], this.$element[0]) : 6085 this.options.placement; 6086 6087 var autoToken = /\s?auto?\s?/i; 6088 var autoPlace = autoToken.test(placement);
6089 if (autoPlace) placement = placement.replace(autoToken, '') || 'top'; 6090 6091 $tip 6092 .detach() 6093 .css({ top: 0, left: 0, display: 'block' }) 6094 .addClass(placement) 6095 .addClass(this.$element.data('class')); // Avada Edit 6096 6097 this.options.container ? $tip.appendTo(this.options.container) : $tip.insertAfter(this.$element); 6098 6099 var pos = this.getPosition(); 6100 var actualWidth = $tip[0].offsetWidth; 6101 var actualHeight = $tip[0].offsetHeight; 6102 6103 if (autoPlace) { 6104 var $parent = this.$element.parent(); 6105 6106 var orgPlacement = placement; 6107 var docScroll = document.documentElement.scrollTop || document.body.scrollTop; 6108 var parentWidth = this.options.container == 'body' ? window.innerWidth : $parent.outerWidth(); 6109 var parentHeight = this.options.container == 'body' ? window.innerHeight : $parent.outerHeight(); 6110 var parentLeft = this.options.container == 'body' ? 0 : $parent.offset().left; 6111 6112 placement = placement == 'bottom' && pos.top + pos.height + actualHeight - docScroll > parentHeight ? 'top' : 6113 placement == 'top' && pos.top - docScroll - actualHeight < 0 ? 'bottom' : 6114 placement == 'right' && pos.right + actualWidth > parentWidth ? 'left' : 6115 placement == 'left' && pos.left - actualWidth < parentLeft ? 'right' : 6116 placement; 6117 6118 $tip 6119 .removeClass(orgPlacement) 6120 .addClass(placement); 6121 } 6122 6123 var calculatedOffset = this.getCalculatedOffset(placement, pos, actualWidth, actualHeight); 6124 6125 this.applyPlacement(calculatedOffset, placement); 6126 this.hoverState = null; 6127 6128 var complete = function() { 6129 that.$element.trigger('shown.bs.' + that.type); 6130 }; 6131 6132 $.support.transition && this.$tip.hasClass('fade') ? 6133 $tip 6134 .one($.support.transition.end, complete) 6135 .emulateTransitionEnd(150) : 6136 complete(); 6137 } 6138 }; 6139 6140 Tooltip.prototype.applyPlacement = function (offset, placement) { 6141 var replace; 6142 var $tip = this.tip(); 6143 var width = $tip[0].offsetWidth; 6144 var height = $tip[0].offsetHeight; 6145 6146 // manually read margins because getBoundingClientRect includes difference 6147 var marginTop = parseInt($tip.css('margin-top'), 10); 6148 var marginLeft = parseInt($tip.css('margin-left'), 10); 6149 6150 // we must check for NaN for ie 8/9 6151 if (isNaN(marginTop)) marginTop = 0; 6152 if (isNaN(marginLeft)) marginLeft = 0; 6153 6154 offset.top = offset.top + marginTop; 6155 offset.left = offset.left + marginLeft; 6156 6157 // $.fn.offset doesn't round pixel values 6158 // so we use setOffset directly with our own function B-0 6159 $.offset.setOffset($tip[0], $.extend({ 6160 using: function (props) { 6161 $tip.css({ 6162 top: Math.round(props.top), 6163 left: Math.round(props.left) 6164 }); 6165 } 6166 }, offset), 0); 6167 6168 $tip.addClass('in'); 6169 6170 // check to see if placing tip in new offset caused the tip to resize itself 6171 var actualWidth = $tip[0].offsetWidth; 6172 var actualHeight = $tip[0].offsetHeight; 6173 6174 if (placement == 'top' && actualHeight != height) { 6175 replace = true; 6176 offset.top = offset.top + height - actualHeight; 6177 } 6178 6179 if (/bottom|top/.test(placement)) { 6180 var delta = 0; 6181 6182 if (offset.left < 0) { 6183 delta = offset.left * -2; 6184 offset.left = 0; 6185 6186 $tip.offset(offset); 6187 6188 actualWidth = $tip[0].offsetWidth; 6189 actualHeight = $tip[0].offsetHeight; 6190 } 6191 6192 this.replaceArrow(delta - width + actualWidth, actualWidth, 'left'); 6193 } else { 6194 this.replaceArrow(actualHeight - height, actualHeight, 'top'); 6195 } 6196 6197 if (replace) $tip.offset(offset); 6198 }; 6199 6200 Tooltip.prototype.replaceArrow = function (delta, dimension, position) { 6201 this.arrow().css(position, delta ? (50 * (1 - delta / dimension) + '%') : ''); 6202 }; 6203 6204 Tooltip.prototype.setContent = function () { 6205 var $tip = this.tip(); 6206 var title = this.getTitle(); 6207 6208 $tip.find('.tooltip-inner')[this.options.html ? 'html' : 'text'](title); 6209 $tip.removeClass('fade in top bottom left right'); 6210 }; 6211 6212 Tooltip.prototype.hide = function () { 6213 var that = this; 6214 var $tip = this.tip(); 6215 var e = $.Event('hide.bs.' + this.type); 6216 6217 function complete() { 6218 if (that.hoverState != 'in') $tip.detach(); 6219 that.$element.trigger('hidden.bs.' + that.type); 6220 }; 6221 6222 this.$element.trigger(e); 6223 6224 if (e.isDefaultPrevented()) return; 6225 6226 $tip.removeClass('in'); 6227 6228 $.support.transition && this.$tip.hasClass('fade') ? 6229 $tip 6230 .one($.support.transition.end, complete) 6231 .emulateTransitionEnd(150) : 6232 complete(); 6233 6234 this.hoverState = null; 6235 6236 return this; 6237 }; 6238 6239 Tooltip.prototype.fixTitle = function () { 6240 var $e = this.$element; 6241 if ($e.attr('title') || typeof($e.attr('data-original-title')) != 'string') { 6242 //$e.attr('data-original-title', $e.attr('title') || '').attr('title', ''); 6243 $e.attr('data-original-title', $e.attr('title') || ''); // Avada Edit 6244 } 6245 }; 6246 6247 Tooltip.prototype.hasContent = function () { 6248 return this.getTitle(); 6249 }; 6250 6251 Tooltip.prototype.getPosition = function () { 6252 var el = this.$element[0]; 6253 return $.extend({}, (typeof el.getBoundingClientRect == 'function') ? el.getBoundingClientRect() : { 6254 width: el.offsetWidth, 6255 height: el.offsetHeight 6256 }, this.$element.offset()); 6257 }; 6258 6259 Tooltip.prototype.getCalculatedOffset = function (placement, pos, actualWidth, actualHeight) { 6260 return placement == 'bottom' ? { top: pos.top + pos.height, left: pos.left + pos.width / 2 - actualWidth / 2 } : 6261 placement == 'top' ? { top: pos.top - actualHeight, left: pos.left + pos.width / 2 - actualWidth / 2 } : 6262 placement == 'left' ? { top: pos.top + pos.height / 2 - actualHeight / 2, left: pos.left - actualWidth } : 6263 /* placement == 'right' */ { top: pos.top + pos.height / 2 - actualHeight / 2, left: pos.left + pos.width }; 6264 }; 6265 6266 Tooltip.prototype.getTitle = function () { 6267 var title; 6268 var $e = this.$element; 6269 var o = this.options; 6270 6271 title = $e.attr('data-original-title') 6272 || (typeof o.title == 'function' ? o.title.call($e[0]) : o.title); 6273 6274 return title; 6275 }; 6276 6277 Tooltip.prototype.tip = function () { 6278 return this.$tip = this.$tip || $(this.options.template); 6279 }; 6280 6281 Tooltip.prototype.arrow = function () { 6282 return this.$arrow = this.$arrow || this.tip().find('.tooltip-arrow'); 6283 }; 6284 6285 Tooltip.prototype.validate = function () { 6286 if (!this.$element[0].parentNode) { 6287 this.hide(); 6288 this.$element = null; 6289 this.options = null; 6290 } 6291 }; 6292 6293 Tooltip.prototype.enable = function () { 6294 this.enabled = true; 6295 }; 6296 6297 Tooltip.prototype.disable = function () { 6298 this.enabled = false;
6299 }; 6300 6301 Tooltip.prototype.toggleEnabled = function () { 6302 this.enabled = !this.enabled; 6303 }; 6304 6305 Tooltip.prototype.toggle = function (e) { 6306 var self = e ? $(e.currentTarget)[this.type](this.getDelegateOptions()).data('bs.' + this.type) : this; 6307 self.tip().hasClass('in') ? self.leave(self) : self.enter(self); 6308 }; 6309 6310 Tooltip.prototype.destroy = function () { 6311 clearTimeout(this.timeout); 6312 this.hide().$element.off('.' + this.type).removeData('bs.' + this.type); 6313 }; 6314 6315 6316 // TOOLTIP PLUGIN DEFINITION 6317 // ========================= 6318 6319 var old = $.fn.tooltip; 6320 6321 $.fn.tooltip = function (option) { 6322 return this.each(function () { 6323 var $this = $(this); 6324 var data = $this.data('bs.tooltip'); 6325 var options = typeof option == 'object' && option; 6326 6327 if (!data && option == 'destroy') return; 6328 if (!data) $this.data('bs.tooltip', (data = new Tooltip(this, options))); 6329 if (typeof option == 'string') data[option](); 6330 }); 6331 }; 6332 6333 $.fn.tooltip.Constructor = Tooltip; 6334 6335 6336 // TOOLTIP NO CONFLICT 6337 // =================== 6338 6339 $.fn.tooltip.noConflict = function () { 6340 $.fn.tooltip = old; 6341 return this; 6342 }; 6343 6344}(jQuery); 6345 6346/* ======================================================================== 6347 * Bootstrap: popover.js v3.1.1 6348 * http://getbootstrap.com/javascript/#popovers 6349 * ======================================================================== 6350 * Copyright 2011-2014 Twitter, Inc. 6351 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) 6352 * ======================================================================== */ 6353 6354 6355+function ($) { 6356 'use strict'; 6357 6358 // POPOVER PUBLIC CLASS DEFINITION 6359 // =============================== 6360 6361 var Popover = function (element, options) { 6362 this.init('popover', element, options); 6363 }; 6364 6365 if (!$.fn.tooltip) throw new Error('Popover requires tooltip.js'); 6366 6367 Popover.DEFAULTS = $.extend({}, $.fn.tooltip.Constructor.DEFAULTS, { 6368 placement: 'right', 6369 trigger: 'click', 6370 content: '', 6371 template: '<div class="popover"><div class="arrow"></div><h3 class="popover-title"></h3><div class="popover-content"></div></div>' 6372 }); 6373 6374 6375 // NOTE: POPOVER EXTENDS tooltip.js 6376 // ================================ 6377 6378 Popover.prototype = $.extend({}, $.fn.tooltip.Constructor.prototype); 6379 6380 Popover.prototype.constructor = Popover; 6381 6382 Popover.prototype.getDefaults = function () { 6383 return Popover.DEFAULTS; 6384 }; 6385 6386 Popover.prototype.setContent = function () { 6387 var $tip = this.tip(); 6388 var title = this.getTitle(); 6389 var content = this.getContent(); 6390 6391 $tip.find('.popover-title')[this.options.html ? 'html' : 'text'](title); 6392 $tip.find('.popover-content')[ // we use append for html objects to maintain js events 6393 this.options.html ? (typeof content == 'string' ? 'html' : 'append') : 'text' 6394 ](content); 6395 6396 $tip.removeClass('fade top bottom left right in'); 6397 6398 // IE8 doesn't accept hiding via the `:empty` pseudo selector, we have to do 6399 // this manually by checking the contents. 6400 if (!$tip.find('.popover-title').html()) $tip.find('.popover-title').hide(); 6401 }; 6402 6403 Popover.prototype.hasContent = function () { 6404 return this.getTitle() || this.getContent(); 6405 }; 6406 6407 Popover.prototype.getContent = function () { 6408 var $e = this.$element; 6409 var o = this.options; 6410 6411 return $e.attr('data-content') 6412 || (typeof o.content == 'function' ? 6413 o.content.call($e[0]) : 6414 o.content); 6415 }; 6416 6417 Popover.prototype.arrow = function () { 6418 return this.$arrow = this.$arrow || this.tip().find('.arrow'); 6419 }; 6420 6421 Popover.prototype.tip = function () { 6422 if (!this.$tip) this.$tip = $(this.options.template); 6423 return this.$tip; 6424 }; 6425 6426 6427 // POPOVER PLUGIN DEFINITION 6428 // ========================= 6429 6430 var old = $.fn.popover; 6431 6432 $.fn.popover = function (option) { 6433 return this.each(function () { 6434 var $this = $(this); 6435 var data = $this.data('bs.popover'); 6436 var options = typeof option == 'object' && option; 6437 6438 if (!data && option == 'destroy') return; 6439 if (!data) $this.data('bs.popover', (data = new Popover(this, options))); 6440 if (typeof option == 'string') data[option](); 6441 }); 6442 }; 6443 6444 $.fn.popover.Constructor = Popover; 6445 6446 6447 // POPOVER NO CONFLICT 6448 // =================== 6449 6450 $.fn.popover.noConflict = function () { 6451 $.fn.popover = old; 6452 return this; 6453 }; 6454 6455}(jQuery); 6456 6457 6458/* 6459 * jQuery Easing v1.3 - http://gsgd.co.uk/sandbox/jquery/easing/ 6460 * 6461 * Uses the built in easing capabilities added In jQuery 1.1 6462 * to offer multiple easing options 6463 * 6464 * TERMS OF USE - jQuery Easing 6465 * 6466 * Open source under the BSD License. 6467 * 6468 * Copyright © 2008 George McGinley Smith 6469 * All rights reserved. 6470 * 6471 * Redistribution and use in source and binary forms, with or without modification, 6472 * are permitted provided that the following conditions are met: 6473 * 6474 * Redistributions of source code must retain the above copyright notice, this list of 6475 * conditions and the following disclaimer. 6476 * Redistributions in binary form must reproduce the above copyright notice, this list 6477 * of conditions and the following disclaimer in the documentation and/or other materials 6478 * provided with the distribution. 6479 * 6480 * Neither the name of the author nor the names of contributors may be used to endorse 6481 * or promote products derived from this software without specific prior written permission. 6482 * 6483 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY 6484 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 6485 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 6486 * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
6487 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE 6488 * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED 6489 * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 6490 * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED 6491 * OF THE POSSIBILITY OF SUCH DAMAGE. 6492 * 6493*/ 6494 6495// t: current time, b: begInnIng value, c: change In value, d: duration 6496jQuery.easing['jswing'] = jQuery.easing['swing']; 6497 6498jQuery.extend( jQuery.easing, 6499{ 6500 def: 'easeOutQuad', 6501 swing: function (x, t, b, c, d) { 6502 //alert(jQuery.easing.default); 6503 return jQuery.easing[jQuery.easing.def](x, t, b, c, d); 6504 }, 6505 easeInQuad: function (x, t, b, c, d) { 6506 return c*(t/=d)*t + b; 6507 }, 6508 easeOutQuad: function (x, t, b, c, d) { 6509 return -c *(t/=d)*(t-2) + b; 6510 }, 6511 easeInOutQuad: function (x, t, b, c, d) { 6512 if ((t/=d/2) < 1) return c/2*t*t + b; 6513 return -c/2 * ((--t)*(t-2) - 1) + b; 6514 }, 6515 easeInCubic: function (x, t, b, c, d) { 6516 return c*(t/=d)*t*t + b; 6517 }, 6518 easeOutCubic: function (x, t, b, c, d) { 6519 return c*((t=t/d-1)*t*t + 1) + b; 6520 }, 6521 easeInOutCubic: function (x, t, b, c, d) { 6522 if ((t/=d/2) < 1) return c/2*t*t*t + b; 6523 return c/2*((t-=2)*t*t + 2) + b; 6524 }, 6525 easeInQuart: function (x, t, b, c, d) { 6526 return c*(t/=d)*t*t*t + b; 6527 }, 6528 easeOutQuart: function (x, t, b, c, d) { 6529 return -c * ((t=t/d-1)*t*t*t - 1) + b; 6530 }, 6531 easeInOutQuart: function (x, t, b, c, d) { 6532 if ((t/=d/2) < 1) return c/2*t*t*t*t + b; 6533 return -c/2 * ((t-=2)*t*t*t - 2) + b; 6534 }, 6535 easeInQuint: function (x, t, b, c, d) { 6536 return c*(t/=d)*t*t*t*t + b; 6537 }, 6538 easeOutQuint: function (x, t, b, c, d) { 6539 return c*((t=t/d-1)*t*t*t*t + 1) + b; 6540 }, 6541 easeInOutQuint: function (x, t, b, c, d) { 6542 if ((t/=d/2) < 1) return c/2*t*t*t*t*t + b; 6543 return c/2*((t-=2)*t*t*t*t + 2) + b; 6544 }, 6545 easeInSine: function (x, t, b, c, d) { 6546 return -c * Math.cos(t/d * (Math.PI/2)) + c + b; 6547 }, 6548 easeOutSine: function (x, t, b, c, d) { 6549 return c * Math.sin(t/d * (Math.PI/2)) + b; 6550 }, 6551 easeInOutSine: function (x, t, b, c, d) { 6552 return -c/2 * (Math.cos(Math.PI*t/d) - 1) + b; 6553 }, 6554 easeInExpo: function (x, t, b, c, d) { 6555 return (t==0) ? b : c * Math.pow(2, 10 * (t/d - 1)) + b; 6556 }, 6557 easeOutExpo: function (x, t, b, c, d) { 6558 return (t==d) ? b+c : c * (-Math.pow(2, -10 * t/d) + 1) + b; 6559 }, 6560 easeInOutExpo: function (x, t, b, c, d) { 6561 if (t==0) return b; 6562 if (t==d) return b+c; 6563 if ((t/=d/2) < 1) return c/2 * Math.pow(2, 10 * (t - 1)) + b; 6564 return c/2 * (-Math.pow(2, -10 * --t) + 2) + b; 6565 }, 6566 easeInCirc: function (x, t, b, c, d) { 6567 return -c * (Math.sqrt(1 - (t/=d)*t) - 1) + b; 6568 }, 6569 easeOutCirc: function (x, t, b, c, d) { 6570 return c * Math.sqrt(1 - (t=t/d-1)*t) + b; 6571 }, 6572 easeInOutCirc: function (x, t, b, c, d) { 6573 if ((t/=d/2) < 1) return -c/2 * (Math.sqrt(1 - t*t) - 1) + b; 6574 return c/2 * (Math.sqrt(1 - (t-=2)*t) + 1) + b; 6575 }, 6576 easeInElastic: function (x, t, b, c, d) { 6577 var s=1.70158;var p=0;var a=c; 6578 if (t==0) return b; if ((t/=d)==1) return b+c; if (!p) p=d*.3; 6579 if (a < Math.abs(c)) { a=c; var s=p/4; } 6580 else var s = p/(2*Math.PI) * Math.asin (c/a); 6581 return -(a*Math.pow(2,10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )) + b; 6582 }, 6583 easeOutElastic: function (x, t, b, c, d) { 6584 var s=1.70158;var p=0;var a=c; 6585 if (t==0) return b; if ((t/=d)==1) return b+c; if (!p) p=d*.3; 6586 if (a < Math.abs(c)) { a=c; var s=p/4; } 6587 else var s = p/(2*Math.PI) * Math.asin (c/a); 6588 return a*Math.pow(2,-10*t) * Math.sin( (t*d-s)*(2*Math.PI)/p ) + c + b; 6589 }, 6590 easeInOutElastic: function (x, t, b, c, d) { 6591 var s=1.70158;var p=0;var a=c; 6592 if (t==0) return b; if ((t/=d/2)==2) return b+c; if (!p) p=d*(.3*1.5); 6593 if (a < Math.abs(c)) { a=c; var s=p/4; } 6594 else var s = p/(2*Math.PI) * Math.asin (c/a); 6595 if (t < 1) return -.5*(a*Math.pow(2,10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )) + b; 6596 return a*Math.pow(2,-10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )*.5 + c + b; 6597 }, 6598 easeInBack: function (x, t, b, c, d, s) { 6599 if (s == undefined) s = 1.70158; 6600 return c*(t/=d)*t*((s+1)*t - s) + b; 6601 }, 6602 easeOutBack: function (x, t, b, c, d, s) { 6603 if (s == undefined) s = 1.70158; 6604 return c*((t=t/d-1)*t*((s+1)*t + s) + 1) + b; 6605 }, 6606 easeInOutBack: function (x, t, b, c, d, s) { 6607 if (s == undefined) s = 1.70158; 6608 if ((t/=d/2) < 1) return c/2*(t*t*(((s*=(1.525))+1)*t - s)) + b; 6609 return c/2*((t-=2)*t*(((s*=(1.525))+1)*t + s) + 2) + b; 6610 }, 6611 easeInBounce: function (x, t, b, c, d) { 6612 return c - jQuery.easing.easeOutBounce (x, d-t, 0, c, d) + b; 6613 }, 6614 easeOutBounce: function (x, t, b, c, d) { 6615 if ((t/=d) < (1/2.75)) { 6616 return c*(7.5625*t*t) + b; 6617 } else if (t < (2/2.75)) { 6618 return c*(7.5625*(t-=(1.5/2.75))*t + .75) + b; 6619 } else if (t < (2.5/2.75)) { 6620 return c*(7.5625*(t-=(2.25/2.75))*t + .9375) + b; 6621 } else { 6622 return c*(7.5625*(t-=(2.625/2.75))*t + .984375) + b; 6623 } 6624 }, 6625 easeInOutBounce: function (x, t, b, c, d) { 6626 if (t < d/2) return jQuery.easing.easeInBounce (x, t*2, 0, c, d) * .5 + b; 6627 return jQuery.easing.easeOutBounce (x, t*2-d, 0, c, d) * .5 + c*.5 + b; 6628 } 6629}); 6630 6631 6632/* 6633 * Dynamic javascript File Port 6634 */ 6635 6636function insertParam(url, parameterName, parameterValue, atStart){ 6637 replaceDuplicates = true; 6638 6639 if(url.indexOf('#') > 0){ 6640 var cl = url.indexOf('#'); 6641 urlhash = url.substring(url.indexOf('#'),url.length); 6642 } else { 6643 urlhash = ''; 6644 cl = url.length; 6645 } 6646 sourceUrl = url.substring(0,cl); 6647 6648 var urlParts = sourceUrl.split("?"); 6649 var newQueryString = ""; 6650 6651 if (urlParts.length > 1) 6652 { 6653 var parameters = urlParts[1].split("&"); 6654 for (var i=0; (i < parameters.length); i++) 6655 { 6656 var parameterParts = parameters[i].split("="); 6657 if (!(replaceDuplicates && parameterParts[0] == parameterName)) 6658 { 6659 if (newQueryString == "") { 6660 newQueryString = "?" + parameterParts[0] + "=" + (parameterParts[1]?parameterParts[1]:''); 6661 } 6662 else { 6663 newQueryString += "&"; 6664 newQueryString += parameterParts[0] + "=" + (parameterParts[1]?parameterParts[1]:''); 6665 } 6666 } 6667 } 6668 } 6669 if (newQueryString == "") 6670 newQueryString = "?"; 6671 6672 if(atStart){ 6673 newQueryString = '?'+ parameterName + "=" + parameterValue + (newQueryString.length>1?'&'+newQueryString.substring(1):''); 6674 } else { 6675 if (newQueryString !== "" && newQueryString != '?') 6676 newQueryString += "&"; 6677 newQueryString += parameterName + "=" + (parameterValue?parameterValue:''); 6678 } 6679 return urlParts[0] + newQueryString + urlhash; 6680} 6681 6682function ytVidId(url) { 6683 var p = /^(?:https?:)?(\/\/)?(?:www\.)?(?:youtu\.be\/|youtube\.com\/(?:embed\/|v\/|watch\?v=|watch\?.+&v=))((\w|-){11}
6683)(?:\S+)?$/; 6684 return (url.match(p)) ? RegExp.$1 : false; 6685 //return (url.match(p)) ? true : false; 6686} 6687 6688jQuery(document).ready(function() { 6689 jQuery('.portfolio-wrapper').hide(); 6690 jQuery('.portfolio-tabs ').hide(); 6691 if(jQuery('.portfolio').length >= 1) { 6692 jQuery('#content').append('<div class="loading-container"><div class="loading-spinner"><div class="spinner-1"></div><div class="spinner-2"></div><div class="spinner-3"></div></div><div class="loading-msg">'+js_local_vars.portfolio_loading_text+'</div>'); 6693 } 6694 6695 var iframes = jQuery('iframe'); 6696 jQuery.each(iframes, function(i, v) { 6697 var src = jQuery(this).attr('src'); 6698 if(src) { 6699 if(!Number(js_local_vars.status_vimeo) && src.indexOf('vimeo') >= 1) { 6700 jQuery(this).attr('id', 'player_'+(i+1)); 6701 var new_src = insertParam(src, 'api', '1', false); 6702 var new_src_2 = insertParam(new_src, 'player_id', 'player_'+(i+1), false); 6703 6704 jQuery(this).attr('src', new_src_2); 6705 } 6706 6707 if(!Number(js_local_vars.status_yt) && ytVidId(src)) { 6708 jQuery(this).attr('id', 'player_'+(i+1)); 6709 jQuery(this).parent().wrap('<span class="play3" />'); 6710 6711 var new_src = insertParam(src, 'enablejsapi', '1', false); 6712 6713 jQuery(this).attr('src', new_src); 6714 6715 window.yt_vid_exists = true; 6716 } 6717 } 6718 }); 6719 6720 if(!Number(js_local_vars.status_yt) && window.yt_vid_exists == true) { 6721 var tag = document.createElement('script'); 6722 tag.src = window.location.protocol + "//www.youtube.com/iframe_api"; 6723 var firstScriptTag = document.getElementsByTagName('script')[0]; 6724 firstScriptTag.parentNode.insertBefore(tag, firstScriptTag); 6725 } 6726}); 6727 6728 6729// Define YT_ready function. 6730var YT_ready = (function() { 6731 var onReady_funcs = [], api_isReady = false; 6732 /* @param func function Function to execute on ready 6733 * @param func Boolean If true, all qeued functions are executed 6734 * @param b_before Boolean If true, the func will added to the first 6735 position in the queue*/ 6736 return function(func, b_before) { 6737 if (func === true) { 6738 api_isReady = true; 6739 while (onReady_funcs.length) { 6740 // Removes the first func from the array, and execute func 6741 onReady_funcs.shift()(); 6742 } 6743 } else if (typeof func == "function") { 6744 if (api_isReady) func(); 6745 else onReady_funcs[b_before?"unshift":"push"](func); 6746 } 6747 } 6748})(); 6749 6750// This function will be called when the API is fully loaded 6751function onYouTubePlayerAPIReady() {YT_ready(true);} 6752 6753// Control header-v1 and sticky on tfs parallax pages 6754 6755// Setting some global vars. Those are also needed for the correct header resizing on none parallax slider pages 6756var orig_logo_height = jQuery('.header-wrapper' ).find( '.logo' ).height(); 6757var orig_logo_container_margin_top = String( jQuery('.header-wrapper' ).find( '.logo' ).data( 'margin-top' ) ); 6758var orig_logo_container_margin_bottom = String( jQuery('.header-wrapper' ).find( '.logo' ).data( 'margin-bottom' ) ); 6759var orig_menu_height = jQuery( '.header-wrapper .fusion-navbar-nav > li > a' ).outerHeight(); 6760if( jQuery( '#wrapper' ).length >= 1 ) { 6761 var wrapper_position = jQuery( '#wrapper' ).position().left; 6762} else { 6763 var wrapper_position; 6764} 6765var is_parallax_tfs_slider = false;
6766 6767if ( ! orig_logo_container_margin_top ) { 6768 orig_logo_container_margin_top = '0px'; 6769} 6770 6771if ( ! orig_logo_container_margin_bottom ) { 6772 orig_logo_container_margin_bottom = '0px'; 6773} 6774 6775// Make sure that the modern sticky header animation is only used for the parallax special case with header above slider and on none transparent header 6776if( js_local_vars.header_sticky == '1' && jQuery( '.header-v1' ).length && jQuery( '.header-wrapper' ).css( 'position' ) != 'absolute' && jQuery( '.header-wrapper' ).prev().attr( 'id' ) != 'sliders-container' ) { 6777 6778 jQuery( '#sliders-container .tfs-slider' ).each( function() { 6779 if( jQuery( this ).data( 'parallax' ) == 1 ) { 6780 is_parallax_tfs_slider = true; 6781 6782 jQuery( window ).scroll( animate_scrolled_header_v1 ); 6783 6784 if( ! Modernizr.mq('only screen and (max-width: 1000px)') ) { 6785 jQuery( '#header-sticky' ).addClass( 'tfs_parallax' ); 6786 } 6787 } 6788 }); 6789 6790 // Only use modern sticky when parallax slider in sliders container is used 6791 if( is_parallax_tfs_slider ) { 6792 6793 if( orig_logo_height + parseInt(orig_logo_container_margin_top.replace( 'px', '' ) ) + parseInt( orig_logo_container_margin_bottom.replace( 'px', '' ) ) > orig_menu_height ) { 6794 var orig_header_height = orig_logo_height + parseInt(orig_logo_container_margin_top.replace( 'px', '' ) ) + parseInt( orig_logo_container_margin_bottom.replace( 'px', '' ) ); 6795 } else { 6796 var orig_header_height = orig_menu_height; 6797 } 6798 6799 var is_scrolled = false; 6800 var scrolled_header_height = 65; 6801 6802 if( jQuery( '.header-wrapper' ).find( '.logo .logo_normal:visible' ) ) { 6803 var scrolled_logo_height = jQuery( '.header-v1' ).find( '.logo .normal_logo' ).height(); 6804 if( scrolled_logo_height < scrolled_header_height - 10 ) { 6805 var scrolled_logo_container_margin = ( scrolled_header_height - scrolled_logo_height ) / 2; 6806 } else { 6807 scrolled_logo_height = scrolled_header_height - 10; 6808 var scrolled_logo_container_margin = 5; 6809 } 6810 } 6811 6812 jQuery(window).on('resize', function() { 6813 if( jQuery( '#wrapper' ).length >= 1 ) { 6814 wrapper_position = jQuery( '#wrapper' ).position().left; 6815 } else { 6816 wrapper_position; 6817 } 6818 6819 if( Modernizr.mq('only screen and (max-width: 800px)') ) { 6820 jQuery( '.header-v1' ).css( { 6821 'height': '', 6822 'position': '' 6823 }); 6824 6825 jQuery( '#header-sticky' ).removeClass( 'tfs_parallax' ); 6826 } 6827 6828 if( ! Modernizr.mq('only screen and (max-width: 800px)') ) { 6829 if( is_scrolled ) { 6830 setTimeout( function() { 6831 jQuery( '.header-wrapper' ).css({ 6832 'margin-left': -wrapper_position + 'px', 6833 'height': scrolled_header_height 6834 }); 6835 }, 5 ); 6836 6837 if( js_local_vars.layout_mode == 'boxed' ) { 6838 jQuery( '.header-v1' ).css({ 6839 'width': jQuery( '#wrapper' ).width(), 6840 'left': '0', 6841 'right': '0', 6842 'margin': ' 0 auto' 6843 }); 6844 } else { 6845 jQuery( '.header-v1' ).css({ 6846 'width': '100%', 6847 }); 6848 } 6849 6850 jQuery( '.header-v1' ).css({ 6851 'position': 'fixed', 6852 'height': 'auto', 6853 '-webkit-box-shadow': '0 1px 3px rgba(0, 0, 0, 0.12)', 6854 '-moz-box-shadow': '0 1px 3px rgba(0, 0, 0, 0.12)', 6855 'box-shadow': '0 1px 3px rgba(0, 0, 0, 0.12)', 6856 '-webkit-backface-visibility': 'hidden' 6857 }); 6858 6859 jQuery( '.header-wrapper' ).find( '.avada-row' ).css({ 6860 'padding-top': '0', 6861 'padding-bottom': '0' 6862 }); 6863 6864 if( jQuery( '.header-wrapper' ).find( '.logo .logo_normal:visible' ) ) { 6865 jQuery( '.header-wrapper' ).find( '.logo .logo_normal' ).css({ 6866 'height': scrolled_logo_height 6867 }); 6868 } 6869 6870 jQuery( '.header-wrapper' ).find( '.logo' ).css({ 6871 'margin-top': scrolled_logo_container_margin, 6872 'margin-bottom': scrolled_logo_container_margin 6873 }); 6874 6875 jQuery( '.header-wrapper' ).find( '.fusion-navbar-nav > li > a' ).css({ 6876 'height': scrolled_header_height - 3 + 'px', 6877 'line-height': scrolled_header_height - 3 + 'px' 6878 }); 6879 } 6880 6881 if( ! is_scrolled ) { 6882 jQuery( '.header-wrapper, .header-v1' ).css( 'height', orig_header_height ); 6883 jQuery( '.header-wrapper' ).find( '.logo' ).css({ 6884 'margin-top': orig_logo_container_margin_top, 6885 'margin-bottom': orig_logo_container_margin_top, 6886 'height': '' 6887 }); 6888 6889 jQuery( '.header-wrapper' ).find( '.fusion-navbar-nav > li > a' ).css({ 6890 'height': orig_menu_height + 'px', 6891 'line-height': orig_menu_height + 'px' 6892 }); 6893 } 6894 6895 jQuery( '#header-sticky' ).addClass( 'tfs_parallax' ); 6896 } 6897 }); 6898 } 6899} 6900 6901function animate_scrolled_header_v1() { 6902 if( jQuery( '#wrapper' ).length >= 1 ) { 6903 wrapper_position = jQuery( '#wrapper' ).position().left; 6904 } else { 6905 wrapper_position; 6906 } 6907 6908 if( ! Modernizr.mq('only screen and (max-width: 800px)') ) { 6909 if( jQuery(window).scrollTop() > 0 ) { 6910 if( ! is_scrolled ) { 6911 jQuery( '.header-wrapper' ).css({ 6912 'z-index': '5', 6913 'position': 'static', 6914 'margin-left': -wrapper_position + 'px', 6915 'height': orig_header_height, 6916 }); 6917 6918 if( js_local_vars.layout_mode == 'boxed' ) { 6919 jQuery( '.header-v1' ).css({ 6920 'width': jQuery( '#wrapper' ).width(), 6921 'left': '0', 6922 'right': '0', 6923 'margin': ' 0 auto' 6924 }); 6925 } else { 6926 jQuery( '.header-v1' ).css({ 6927 'width': '100%', 6928 }); 6929 } 6930 6931 jQuery( '.header-v1' ).css( { 6932 'z-index': '5', 6933 'position': 'fixed', 6934 'height': orig_header_height, 6935 '-webkit-box-shadow': '0 1px 3px rgba(0, 0, 0, 0.12)', 6936 '-moz-box-shadow': '0 1px 3px rgba(0, 0, 0, 0.12)', 6937 'box-shadow': '0 1px 3px rgba(0, 0, 0, 0.12)', 6938 '-webkit-backface-visibility': 'hidden' 6939 }); 6940 6941 jQuery( '.header-wrapper' ).find( '.fusion-navbar-nav > li > a' ).css( 'height', orig_menu_height ); 6942 6943 jQuery( '.header-wrapper, .header-v1' ).stop(true, true).animate({ 6944 height: scrolled_header_height 6945 }, { queue:false, duration:350, easing: 'easeOutCubic' }); 6946 6947 jQuery( '.header-wrapper' ).find( '.avada-row' ).stop(true, true).animate({ 6948 'padding-top': '0', 6949 'padding-bottom': '0' 6950 }, { queue:false, duration:350, easing: 'easeOutCubic' }); 6951 6952 if( jQuery( '.header-wrapper' ).find( '.logo .logo_normal:visible' ) ) { 6953 var scrolled_logo_height = jQuery( '.header-v1' ).find( '.logo .normal_logo' ).height(); 6954 if( scrolled_logo_height < scrolled_header_height - 10 ) { 6955 var scrolled_logo_container_margin = ( scrolled_header_height - scrolled_logo_height ) / 2; 6956 } else { 6957 scrolled_logo_height = scrolled_header_height - 10; 6958 var scrolled_logo_container_margin = 5; 6959 } 6960 6961 jQuery( '.header-wrapper' ).find( '.logo .logo_normal' ).stop(true, true).animate({ 6962 'height': scrolled_logo_height 6963 }, { queue:false, duration:350, easing: 'easeOutCubic' }); 6964 } 6965 6966 jQuery( '.header-wrapper' ).find( '.logo' ).stop(true, true).animate({ 6967 'margin-top': scrolled_logo_container_margin, 6968 'margin-bottom': scrolled_logo_container_margin 6969 }, { queue:false, duration:350, easing: 'easeOutCubic' }); 6970 6971 jQuery( '.header-wrapper' ).find( '.fusion-navbar-nav > li > a' ).stop(true, true).animate({ 6972 height: scrolled_header_height - 3, 6973 'line-height': scrolled_header_height - 3 6974 }, { queue:false, duration:350, easing: 'easeOutCubic', complete: function() { 6975 if( ! jQuery( '.header-v1 .nav-holder style' ).length ) { 6976 jQuery( '.header-v1 .nav-holder' ).prepend( '<style type="text/css">.header-v1 #nav.nav-holder .navigation > .cart > a { height:' + scrolled_header_height + ';line-height:' + scrolled_header_height + '; }</style>' ); 6977 } 6978 } 6979 }); 6980 } 6981 } else { 6982 if( is_scrolled ) { 6983 6984 jQuery( '.header-v1' ).css( { 6985 '-webkit-box-shadow': '', 6986 '-moz-box-shadow': '', 6987 'box-shadow': '', 6988 '-webkit-backface-visibility': '' 6989 }); 6990 6991 jQuery( '.header-wrapper, .header-v1' ).stop(true, true).animate({ 6992 'height': orig_header_height 6993 }, { queue:false, duration:350, easing: 'easeOutCubic', complete: function() { 6994 jQuery( '.header-wrapper' ).css( 'margin-left', '' ); 6995 6996 jQuery( this ).css({ 6997 'position': 'relative', 6998 'width': '' 6999 }); 7000 } 7001 }); 7002 7003 jQuery( '.header-wrapper' ).find( '.avada-row' ).stop(true, true).animate({ 7004 'padding-top': '0', 7005 'padding-bottom': '0' 7006 }, { queue:false, duration:350, easing: 'easeOutCubic' }); 7007 7008 if( jQuery( '.header-wrapper' ).find( '.logo .logo_normal:visible' ) ) { 7009 jQuery( '.header-wrapper' ).find( '.logo .logo_normal' ).stop(true, true).animate({ 7010 'height': orig_logo_height 7011 }, { queue:false, duration:350, easing: 'easeOutCubic' }); 7012 } 7013 7014 jQuery( '.header-wrapper' ).find( '.logo' ).stop(true, true).animate({ 7015 'margin-top': orig_logo_container_margin_top, 7016 'margin-bottom': orig_logo_container_margin_bottom 7017 }, { queue:false, duration:350, easing: 'easeOutCubic' }); 7018 7019 jQuery( '.header-wrapper' ).find( '.fusion-navbar-nav > li > a' ).stop(true, true).animate({ 7020 'height': orig_menu_height, 7021 'line-height': orig_menu_height 7022 }, { queue:false, duration:350, easing: 'easeOutCubic', complete: function() { 7023 if( jQuery( '.header-wrapper .nav-holder style' ).length ) { 7024 jQuery( '.header-wrapper .nav-holder style' ).remove(); 7025 } 7026 } 7027 }); 7028 } 7029 } 7030 } 7031 7032 if( jQuery(window).scrollTop() > 0 ) { 7033 is_scrolled = true; 7034 } else { 7035 is_scrolled = false;
7036 } 7037} 7038 7039jQuery(window).load(function() { 7040 var headerHeight = jQuery('.header-wrapper').height(); 7041 7042 if( jQuery( '.header-v1' ).length ) { 7043 if( orig_logo_height + parseInt(orig_logo_container_margin_top.replace( 'px', '' ) ) + parseInt( orig_logo_container_margin_bottom.replace( 'px', '' ) ) > orig_menu_height ) { 7044 headerHeight = orig_logo_height + parseInt(orig_logo_container_margin_top.replace( 'px', '' ) ) + parseInt( orig_logo_container_margin_bottom.replace( 'px', '' ) ); 7045 } else { 7046 headerHeight = orig_menu_height; 7047 } 7048 } 7049 7050 if(jQuery('.sidebar').is(':visible')) { 7051 jQuery('.post-content div.portfolio').each(function() { 7052 var columns = jQuery(this).data('columns'); 7053 jQuery(this).addClass('portfolio-'+columns+'-sidebar'); 7054 }); 7055 } 7056 7057 if(jQuery().isotope) { 7058 imagesLoaded(jQuery('.portfolio-one .portfolio-wrapper'), function() { 7059 jQuery('.portfolio-wrapper').fadeIn(); 7060 jQuery('.portfolio-tabs').fadeIn(); 7061 jQuery('.loading-container').remove(); 7062 jQuery('.portfolio-one .portfolio-wrapper').isotope({ 7063 // options 7064 itemSelector: '.portfolio-item', 7065 layoutMode: 'vertical', 7066 transformsEnabled: false, 7067 isOriginLeft: jQuery( 'body.rtl' ).length ? false : true 7068 }); 7069 jQuery('[data-spy="scroll"]').each(function () { 7070 var $spy = jQuery(this).scrollspy('refresh'); 7071 }); 7072 }); 7073 7074 imagesLoaded(jQuery('.portfolio-masonry .portfolio-wrapper, .portfolio-two .portfolio-wrapper, .portfolio-three .portfolio-wrapper, .portfolio-four .portfolio-wrapper, .portfolio-five .portfolio-wrapper, .portfolio-six .portfolio-wrapper'),function() { 7075 jQuery('.portfolio-wrapper').fadeIn(); 7076 jQuery('.portfolio-tabs').fadeIn(); 7077 jQuery('.loading-container').remove(); 7078 jQuery('.portfolio-masonry .portfolio-wrapper, .portfolio-two .portfolio-wrapper, .portfolio-three .portfolio-wrapper, .portfolio-four .portfolio-wrapper, .portfolio-five .portfolio-wrapper, .portfolio-six .portfolio-wrapper').isotope({ 7079 // options 7080 itemSelector: '.portfolio-item', 7081 resizable: true, 7082 layoutMode: js_local_vars.isotope_type, 7083 transformsEnabled: false, 7084 isOriginLeft: jQuery( 'body.rtl' ).length ? false : true 7085 }); 7086 jQuery('[data-spy="scroll"]').each(function () { 7087 var $spy = jQuery(this).scrollspy('refresh'); 7088 }); 7089 }); 7090 7091 jQuery(window).resize(function() { 7092 jQuery('.portfolio-wrapper').isotope(); 7093 }); 7094 } 7095 7096 if(jQuery().flexslider) { 7097 var avada_ytplayer; 7098 7099 if(!Number(js_local_vars.status_vimeo)) { 7100 function ready(player_id) { 7101 var froogaloop = $f(player_id); 7102 7103 var slide = jQuery('#' + player_id).parents('li'); 7104 7105 froogaloop.addEvent('play', function (data) { 7106 jQuery('#' + player_id).parents('li').parent().parent().flexslider("pause"); 7107 }); 7108 7109 froogaloop.addEvent('pause', function (data) { 7110 if(jQuery(slide).attr('data-loop') == 'yes') { 7111 jQuery('#' + player_id).parents('li').parent().parent().flexslider("pause"); 7112 } else { 7113 jQuery('#' + player_id).parents('li').parent().parent().flexslider("play"); 7114 } 7115 }); 7116 } 7117 7118 var vimeoPlayers = jQuery('.flexslider').find('iframe'), player; 7119 7120 jQuery('.flexslider').find('iframe').each(function () { 7121 var id = jQuery(this).attr('id'); 7122 7123 if(id) { 7124 $f(id).addEvent('ready', ready); 7125 } 7126 }); 7127 7128 function addEvent(element, eventName, callback) { 7129 if (element.addEventListener) { 7130 element.addEventListener(eventName, callback, false) 7131 } else { 7132 element.attachEvent(eventName, callback, false); 7133 } 7134 } 7135 } 7136 7137 jQuery('.full-video, .video-shortcode, .wooslider .slide-content').not('#bbpress-forums full-video, #bbpress-forums .video-shortcode, #bbpress-forums .wooslider .slide-content').fitVids(); 7138 jQuery('#bbpress-forums').fitVids(); 7139 7140 jQuery('.tfs-slider').each(function() { 7141 var this_tfslider = this; 7142 7143 var first_slide = jQuery(this_tfslider).find('li').get(0); 7144 7145 if(jQuery(this_tfslider).parents('.post-content').length >= 1) { 7146 jQuery(this_tfslider).data('parallax', 0); 7147 jQuery(this_tfslider).data('full_screen', 0); 7148 } 7149 7150 if(cssua.ua.tablet_pc) { 7151 jQuery(this_tfslider).data('parallax', 0); 7152 } 7153 7154 if(cssua.ua.mobile || Modernizr.mq('only screen and (max-width: 1000px)')) { 7155 jQuery(this_tfslider).data('parallax', 0); 7156 } 7157 7158 wpadminbarHeight = 0; 7159 if(jQuery('#wpadminbar').length >= 1) { 7160 var wpadminbarHeight = jQuery('#wpadminbar').height(); 7161 } 7162 7163 if(jQuery(this_tfslider).data('full_screen') == 1) { 7164 var sliderHeight = jQuery(window).height(); 7165 7166 if(jQuery(this_tfslider).parents('#sliders-container').next().hasClass('header-wrapper')) { 7167 sliderHeight = sliderHeight + (headerHeight - wpadminbarHeight); 7168 } 7169 7170 if(jQuery(this_tfslider).data('parallax') == 0) { 7171 sliderHeight = jQuery(window).height() - (headerHeight + wpadminbarHeight); 7172 } 7173 7174 if(Modernizr.mq('only screen and (max-width: 1000px)')) { 7175 var sliderHeight = jQuery(window).height() - (headerHeight + wpadminbarHeight); 7176 } 7177 7178 jQuery(this_tfslider).find('video').each(function() { 7179 var aspect_ratio = jQuery(this).width() / jQuery(this).height(); 7180 var arc_sliderWidth = aspect_ratio * sliderHeight; 7181 var arc_sliderLeft = '-' + ((arc_sliderWidth - jQuery(this_tfslider).width()) / 2) + 'px'; 7182 var compare_width = jQuery(this_tfslider).parent().parent().parent().width(); 7183 if(jQuery(this_tfslider).parents('.post-content').length >= 1) { 7184 compare_width = jQuery(this_tfslider).width(); 7185 } 7186 if(compare_width > arc_sliderWidth) { 7187 arc_sliderWidth = '100%'; 7188 arc_sliderLeft = 0; 7189 } 7190 jQuery(this).width(arc_sliderWidth); 7191 jQuery(this).css('left', arc_sliderLeft); 7192 }); 7193 } else { 7194 var sliderWidth = jQuery(this_tfslider).data('slider_width'); 7195 7196 if(sliderWidth.indexOf('%') != -1) { 7197 sliderWidth = jQuery(first_slide).find('.background-image').data('imgwidth'); 7198 if( ! sliderWidth && ! cssua.ua.mobile ) { 7199 sliderWidth = jQuery(first_slide).find('video').width(); 7200 } 7201 7202 if( ! sliderWidth ) { 7203 sliderWidth = 940; 7204 } 7205 7206 jQuery(this_tfslider).data('first_slide_width', sliderWidth); 7207 7208 if(sliderWidth < jQuery(this_tfslider).data('slider_width')) { 7209 sliderWidth = jQuery(this_tfslider).data('slider_width'); 7210 } 7211 7212 var percentage_width = true; 7213 } else {
7214 sliderWidth = parseInt(jQuery(this_tfslider).data('slider_width')); 7215 } 7216 7217 var sliderHeight = parseInt(jQuery(this_tfslider).data('slider_height')); 7218 var aspect_ratio = sliderHeight / sliderWidth; 7219 7220 if(aspect_ratio < 0.5) { 7221 aspect_ratio = 0.5; 7222 } 7223 7224 var compare_width = jQuery(this_tfslider).parent().parent().parent().width(); 7225 if(jQuery(this_tfslider).parents('.post-content').length >= 1) { 7226 compare_width = jQuery(this_tfslider).width(); 7227 } 7228 var sliderHeight = aspect_ratio * compare_width; 7229 7230 if(sliderHeight > parseInt(jQuery(this_tfslider).data('slider_height'))) { 7231 sliderHeight = parseInt(jQuery(this_tfslider).data('slider_height')); 7232 } 7233 7234 if(sliderHeight < 200) { 7235 sliderHeight = 300; 7236 } 7237 } 7238 7239 if(jQuery(this_tfslider).data('full_screen') == 1) { 7240 jQuery(this_tfslider).css('max-width', '100%'); 7241 jQuery(this_tfslider).find('.slides, .background').css('width', '100%'); 7242 } 7243 7244 if((js_local_vars.header_position == 'Left' || js_local_vars.header_position == 'Right') && ! jQuery(this_tfslider).hasClass('fixed-width-slider') && jQuery(this_tfslider).data('parallax') == 1) { 7245 jQuery(this_tfslider).css('max-width', jQuery('#wrapper').width()); 7246 if(jQuery('body').hasClass('side-header-left')) { 7247 jQuery(this_tfslider).css('left', jQuery('#side-header').width() + 1) 7248 } else if(jQuery('body').hasClass('side-header-right')) { 7249 jQuery(this_tfslider).css('right', jQuery('#side-header').width() + 1) 7250 } 7251 } 7252 7253 jQuery(this_tfslider).parents('.fusion-slider-container').css('height', sliderHeight); 7254 jQuery(this_tfslider).css('height', sliderHeight); 7255 jQuery(this_tfslider).find('.background, .mobile_video_image').css('height', sliderHeight); 7256 7257 if(jQuery('.layout-boxed-mode').length >= 1) { 7258 var boxed_mode_width = jQuery('.layout-boxed-mode #wrapper').width(); 7259 jQuery(this_tfslider).css('width', boxed_mode_width); 7260 jQuery(this_tfslider).css('margin-left', 'auto'); 7261 jQuery(this_tfslider).css('margin-right', 'auto'); 7262 7263 if(jQuery(this_tfslider).data('parallax') == 1 && ! Modernizr.mq('only screen and (max-width: 1000px)')) { 7264 jQuery(this_tfslider).css('left', '50%'); 7265 if( js_local_vars.header_position == 'Left' || js_local_vars.header_position == 'Right' ) { 7266 boxed_mode_width = jQuery('.layout-boxed-mode #wrapper').width() - jQuery('.layout-boxed-mode #side-header').width(); 7267 if( js_local_vars.header_position == 'Right' ) { 7268 boxed_mode_width = jQuery('.layout-boxed-mode #wrapper').width() + jQuery('.layout-boxed-mode #side-header').width(); 7269 } 7270 jQuery(this_tfslider).css('margin-left', '-' + Math.floor( boxed_mode_width / 2 ) + 'px'); 7271 } else { 7272 jQuery(this_tfslider).css('margin-left', '-' + (boxed_mode_width / 2) + 'px'); 7273 } 7274 } 7275 jQuery(this_tfslider).find('.slides, .background').css('width', '100%'); 7276 } 7277 7278 if(cssua.ua.mobile) { 7279 jQuery(this_tfslider).find('a.button').each(function() { 7280 jQuery(this).removeClass('xlarge large medium button-xlarge button-large button-medium'); 7281 jQuery(this).addClass('small button-small'); 7282 }); 7283 jQuery(this_tfslider).find('li').each(function() { 7284 jQuery(this).attr('data-autoplay', 'no'); 7285 jQuery(this).data('autoplay', 'no'); 7286 }); 7287 } 7288 7289 jQuery(this_tfslider).find('a.button').each(function() { 7290 jQuery(this).data('old', jQuery(this).attr('class')); 7291 }); 7292 7293 if(Modernizr.mq('only screen and (max-width: 800px)')) { 7294 jQuery(this_tfslider).find('a.button').each(function() { 7295 jQuery(this).data('old', jQuery(this).attr('class')); 7296 jQuery(this).removeClass('xlarge large medium button-xlarge button-large button-medium'); 7297 jQuery(this).addClass('small button-small'); 7298 }); 7299 } else { 7300 jQuery(this_tfslider).find('a.button').each(function() { 7301 jQuery(this).attr('class', jQuery(this).data('old')); 7302 }); 7303 } 7304 7305 if(jQuery(this_tfslider).data('parallax') == 1) { 7306 jQuery(window).scroll(function () { 7307 if(jQuery(window).scrollTop() >= jQuery(this_tfslider).parents('#sliders-container').position().top + jQuery(this_tfslider).parents('#sliders-container').height()) { 7308 jQuery(this_tfslider).css('display', 'none'); 7309 } else { 7310 jQuery(this_tfslider).css('display', 'block'); 7311 } 7312 }); 7313 } 7314 7315 var resize_width = jQuery(window).width(); 7316 var resize_height = jQuery(window).height(); 7317 7318 jQuery(window).on('resize', function() { // start_tfslider_resize 7319 if( jQuery(window).width() != resize_width || jQuery(window).height() != resize_height ) { 7320 var wpadminbarHeight = 0; 7321 var oldHeaderHeight = jQuery('.header-wrapper').height(); 7322 jQuery('.header-wrapper').css( 'height', '' ); 7323 var headerHeight = jQuery('.header-wrapper').height(); 7324 jQuery('.header-wrapper').css( 'height', oldHeaderHeight ); 7325 7326 if( jQuery( '.header-v1' ).length ) { 7327 if( orig_logo_height + parseInt(orig_logo_container_margin_top.replace( 'px', '' ) ) + parseInt( orig_logo_container_margin_bottom.replace( 'px', '' ) ) > orig_menu_height ) { 7328 headerHeight = orig_logo_height + parseInt(orig_logo_container_margin_top.replace( 'px', '' ) ) + parseInt( orig_logo_container_margin_bottom.replace( 'px', '' ) ); 7329 } else { 7330 headerHeight = orig_menu_height; 7331 } 7332 } 7333 7334 if(jQuery('#wpadminbar').length >= 1) { 7335 var wpadminbarHeight = jQuery('#wpadminbar').height(); 7336 } 7337 7338 7339 if(jQuery(this_tfslider).data('full_screen') == 1) { 7340 var sliderHeight = jQuery(window).height(); 7341 7342 if(jQuery(this_tfslider).parents('#sliders-container').next().hasClass('header-wrapper')) { 7343 sliderHeight = sliderHeight + (headerHeight - wpadminbarHeight); 7344 } 7345 7346 if(jQuery(this_tfslider).data('parallax') == 0) { 7347 sliderHeight = jQuery(window).height() - (headerHeight + wpadminbarHeight); 7348 } 7349 7350 if(Modernizr.mq('only screen and (max-width: 800px)')) { 7351 var sliderHeight = jQuery(window).height() - (headerHeight + wpadminbarHeight); 7352 } 7353 7354 jQuery(this_tfslider).find('video').each(function() { 7355 var aspect_ratio = jQuery(this).width() / jQuery(this).height(); 7356 var arc_sliderWidth = aspect_ratio * jQuery(window).height(); 7357 var arc_sliderLeft = '-' + ((arc_sliderWidth - jQuery(this_tfslider).width()) / 2) + 'px'; 7358 var compare_width = jQuery(this_tfslider).parent().parent().parent().width(); 7359 if(jQuery(this_tfslider).parents('.post-content').length >= 1) { 7360 compare_width = jQuery(this_tfslider).width(); 7361 } 7362 if(compare_width > arc_sliderWidth) { 7363 arc_sliderWidth = '100%'; 7364 arc_sliderLeft = 0; 7365 } 7366 jQuery(this).width(arc_sliderWidth); 7367 jQuery(this).css('left', arc_sliderLeft); 7368 }); 7369 } else { 7370 var sliderWidth = jQuery(this_tfslider).data('slider_width'); 7371 7372 if(sliderWidth.indexOf('%') != -1) { 7373 sliderWidth = jQuery(this_tfslider).data('first_slide_width'); 7374 7375 if( sliderWidth < jQuery(this_tfslider).data('slider_width') ) { 7376 sliderWidth = jQuery(this_tfslider).data('slider_width'); 7377 } 7378 7379 var percentage_width = true; 7380 } else {
7381 sliderWidth = parseInt(jQuery(this_tfslider).data('slider_width')); 7382 } 7383 7384 var sliderHeight = parseInt(jQuery(this_tfslider).data('slider_height')); 7385 var aspect_ratio = sliderHeight / sliderWidth; 7386 7387 if(aspect_ratio < 0.5) { 7388 aspect_ratio = 0.5; 7389 } 7390 7391 var compare_width = jQuery(this_tfslider).parent().parent().parent().width(); 7392 if(jQuery(this_tfslider).parents('.post-content').length >= 1) { 7393 compare_width = jQuery(this_tfslider).width(); 7394 } 7395 var sliderHeight = aspect_ratio * compare_width; 7396 7397 if(sliderHeight > parseInt(jQuery(this_tfslider).data('slider_height'))) { 7398 sliderHeight = parseInt(jQuery(this_tfslider).data('slider_height')); 7399 } 7400 7401 if(sliderHeight < 200) { 7402 sliderHeight = 300; 7403 } 7404 7405 jQuery(this_tfslider).find('video').each(function() { 7406 var aspect_ratio = jQuery(this).width() / jQuery(this).height(); 7407 var arc_sliderWidth = aspect_ratio * sliderHeight; 7408 7409 if(arc_sliderWidth < sliderWidth && !jQuery(this_tfslider).hasClass('full-width-slider')) { 7410 arc_sliderWidth = sliderWidth; 7411 } 7412 7413 var arc_sliderLeft = '-' + ((arc_sliderWidth - jQuery(this_tfslider).width()) / 2) + 'px'; 7414 var compare_width = jQuery(this_tfslider).parent().parent().parent().width(); 7415 if(jQuery(this_tfslider).parents('.post-content').length >= 1) { 7416 compare_width = jQuery(this_tfslider).width(); 7417 } 7418 if(compare_width > arc_sliderWidth && percentage_width == true && jQuery(this_tfslider).data('full_screen') != 1) { 7419 arc_sliderWidth = '100%'; 7420 arc_sliderLeft = 0; 7421 } 7422 jQuery(this).width(arc_sliderWidth); 7423 jQuery(this).css('left', arc_sliderLeft); 7424 }); 7425 7426 if(Modernizr.mq('only screen and (max-width: 800px)')) { 7427 jQuery(this_tfslider).find('a.button').each(function() { 7428 jQuery(this).removeClass('xlarge large medium button-xlarge button-large button-medium'); 7429 jQuery(this).addClass('small button-small'); 7430 }); 7431 } else { 7432 jQuery(this_tfslider).find('a.button').each(function() { 7433 jQuery(this).attr('class', jQuery(this).data('old')); 7434 }); 7435 } 7436 } 7437 7438 if(jQuery(this_tfslider).data('full_screen') == 1 && jQuery(this_tfslider).data('animation') == "fade" ) { 7439 jQuery(this_tfslider).css('max-width', '100%'); 7440 jQuery(this_tfslider).find('.slides, .background').css('width', '100%'); 7441 } 7442 7443 if((js_local_vars.header_position == 'Left' || js_local_vars.header_position == 'Right') && ! jQuery(this_tfslider).hasClass('fixed-width-slider') && jQuery(this_tfslider).data('parallax') == 1) { 7444 jQuery(this_tfslider).css('max-width', jQuery('#wrapper').width()); 7445 if(jQuery('body').hasClass('side-header-left')) { 7446 jQuery(this_tfslider).css('left', jQuery('#side-header').width() + 1) 7447 } else if(jQuery('body').hasClass('side-header-right')) { 7448 jQuery(this_tfslider).css('right', jQuery('#side-header').width() + 1) 7449 } 7450 } 7451 7452 jQuery(this_tfslider).parents('.fusion-slider-container').css('height', sliderHeight); 7453 jQuery(this_tfslider).parents('.fusion-slider-container').css('max-height', sliderHeight ); 7454 jQuery(this_tfslider).css('height', sliderHeight); 7455 jQuery(this_tfslider).find('.background, .mobile_video_image').css('height', sliderHeight); 7456 7457 if(jQuery('.layout-boxed-mode').length >= 1 && jQuery(this_tfslider).parents('.post-content').length == 0) { 7458 var boxed_mode_width = jQuery('.layout-boxed-mode #wrapper').width(); 7459 jQuery(this_tfslider).css('width', boxed_mode_width); 7460 jQuery(this_tfslider).css('margin-left', 'auto'); 7461 jQuery(this_tfslider).css('margin-right', 'auto'); 7462 7463 if(jQuery(this_tfslider).data('parallax') == 1 && ! Modernizr.mq('only screen and (max-width: 1000px)')) { 7464 jQuery(this_tfslider).css('left', '50%'); 7465 if( js_local_vars.header_position == 'Left' || js_local_vars.header_position == 'Right' ) { 7466 boxed_mode_width = jQuery('.layout-boxed-mode #wrapper').width() - jQuery('.layout-boxed-mode #side-header').width(); 7467 if( js_local_vars.header_position == 'Right' ) { 7468 boxed_mode_width = jQuery('.layout-boxed-mode #wrapper').width() + jQuery('.layout-boxed-mode #side-header').width(); 7469 } 7470 jQuery(this_tfslider).css('margin-left', '-' + Math.floor( boxed_mode_width / 2 ) + 'px'); 7471 } else { 7472 jQuery(this_tfslider).css('margin-left', '-' + (boxed_mode_width / 2) + 'px'); 7473 } 7474 } 7475 7476 if(jQuery(this_tfslider).data('animation') != 'slide') { 7477 jQuery(this_tfslider).find('.slides').css('width', '100%'); 7478 } 7479 jQuery(this_tfslider).find('.background').css('width', '100%'); 7480 } 7481 7482 if(jQuery(this_tfslider).data('parallax') == 1 && ! Modernizr.mq('only screen and (max-width: 1000px)')) { 7483 jQuery(this_tfslider).css('position', 'fixed'); 7484 if( jQuery( '.header-wrapper' ).css( 'position' ) != 'absolute' ) { 7485 jQuery('.header-wrapper').css('position', 'relative'); 7486 jQuery(this_tfslider).parents('.fusion-slider-container').css('margin-top', '-' + headerHeight + 'px'); 7487 } 7488 jQuery('#main, .footer-area, #footer, .page-title-container').css('position', 'relative'); 7489 jQuery('#main, .footer-area, #footer, .page-title-container').css('z-index', '3'); 7490 jQuery('.header-wrapper').css('z-index', '5'); 7491 jQuery('.header-wrapper').css('height', headerHeight); 7492 7493 jQuery(this_tfslider).find('.flex-direction-nav li a').css('-webkit-transform', 'translate(0, ' + (headerHeight / 2) + 'px)'); 7494 jQuery(this_tfslider).find('.flex-direction-nav li a').css('-ms-transform', 'translate(0, ' + (headerHeight / 2) + 'px)'); 7495 jQuery(this_tfslider).find('.flex-direction-nav li a').css('-o-transform', 'translate(0, ' + (headerHeight / 2) + 'px)'); 7496 jQuery(this_tfslider).find('.flex-direction-nav li a').css('-moz-transform', 'translate(0, ' + (headerHeight / 2) + 'px)'); 7497 jQuery(this_tfslider).find('.flex-direction-nav li a').css('transform', 'translate(0, ' + (headerHeight / 2) + 'px)'); 7498 7499 if(jQuery(this_tfslider).hasClass('fixed-width-slider')) { 7500 if( js_local_vars.header_position == 'Left' || js_local_vars.header_position == 'Right' ) { 7501 if( jQuery(this_tfslider).parents( '#sliders-container' ).length ) { 7502 var wrapping_container = jQuery( '#sliders-container' ); 7503 } else { 7504 var wrapping_container = jQuery( '#main' ); 7505 } 7506 7507 if( wrapping_container.width() < parseFloat( jQuery(this_tfslider).parent().css( 'max-width' ) ) ) { 7508 jQuery(this_tfslider).css( 'max-width', wrapping_container.width() ); 7509 } else { 7510 jQuery(this_tfslider).css( 'max-width', jQuery(this_tfslider).parent().css( 'max-width' ) ); 7511 } 7512 7513 if( wrapping_container.width() < parseFloat( jQuery(this_tfslider).parent().css( 'max-width' ) ) ) { 7514 jQuery(this_tfslider).css( 'max-width', wrapping_container.width() ); 7515 } else { 7516 jQuery(this_tfslider).css( 'max-width', jQuery(this_tfslider).parent().css( 'max-width' ) ); 7517 } 7518 7519 if( js_local_vars.header_position == 'Left' ) { 7520 var fixed_width_center = '-' + ((jQuery(this_tfslider).width() - jQuery( '#side-header' ).width() ) / 2) + 'px'; 7521 } else { 7522 var fixed_width_center = '-' + ((jQuery(this_tfslider).width() + jQuery( '#side-header' ).width() ) / 2) + 'px'; 7523 } 7524 7525 if( ( -1 ) * fixed_width_center > jQuery(this_tfslider).width() ) { 7526 fixed_width_center = ( -1 ) * jQuery(this_tfslider).width(); 7527 } 7528 } else { 7529 var fixed_width_center = '-' + (jQuery(this_tfslider).width() / 2) + 'px'; 7530 } 7531 jQuery(this_tfslider).css('left', '50%'); 7532 jQuery(this_tfslider).css('margin-left', fixed_width_center); 7533 } 7534 7535 jQuery(this_tfslider).find('.flex-control-nav').css('bottom', (headerHeight / 2)); 7536 } else if(jQuery(this_tfslider).data('parallax') == 1 && Modernizr.mq('only screen and (max-width: 1000px)')) { 7537 jQuery(this_tfslider).css('position', 'relative'); 7538 jQuery(this_tfslider).css('left', '0'); 7539 jQuery(this_tfslider).css('margin-left', '0'); 7540 if( jQuery( '.header-wrapper' ).css( 'position' ) != 'absolute' ) { 7541 jQuery('.header-wrapper').css('position', 'relative'); 7542 } 7543 jQuery('#main, .footer-area, #footer, .page-title-container').css('position', 'relative'); 7544 jQuery('#main, .footer-area, #footer, .page-title-container').css('z-index', '3'); 7545 jQuery('.header-wrapper').css('z-index', '5'); 7546 jQuery('.header-wrapper').css('height', 'auto'); 7547 jQuery(this_tfslider).parents('.fusion-slider-container').css('margin-top', ''); 7548 jQuery(this_tfslider).find('.flex-direction-nav li a').css('-webkit-transform', 'translate(0, 0)'); 7549 jQuery(this_tfslider).find('.flex-direction-nav li a').css('-ms-transform', 'translate(0, 0)'); 7550 jQuery(this_tfslider).find('.flex-direction-nav li a').css('-o-transform', 'translate(0, 0)'); 7551 jQuery(this_tfslider).find('.flex-direction-nav li a').css('-moz-transform', 'translate(0, 0)'); 7552 jQuery(this_tfslider).find('.flex-direction-nav li a').css('transform', 'translate(0, 0)'); 7553 7554 jQuery(this_tfslider).find('.flex-control-nav').css('bottom', 0); 7555 } 7556 7557 if(Modernizr.mq('only screen and (max-width: 640px)')) { 7558 jQuery(this_tfslider).parents('.fusion-slider-container').css('height', sliderHeight); 7559 jQuery(this_tfslider).css('height', sliderHeight); 7560 jQuery(this_tfslider).find('.background, .mobile_video_image').css('height', sliderHeight); 7561 7562 var slideContent = jQuery(this_tfslider).find('.slide-content-container'); 7563 jQuery(slideContent).each(function() { 7564 var contentHeight = '-' + (jQuery(this).find('.slide-content').height() / 2) + 'px'; 7565 var contentPadding = '0px'; 7566 7567 jQuery(this).css('margin-top', contentHeight); 7568 jQuery(this).css('padding-top', contentPadding); 7569 }); 7570 } else if(Modernizr.mq('only screen and (max-width: 1000px)')) { 7571 jQuery(this_tfslider).parents('.fusion-slider-container').css('height', sliderHeight); 7572 jQuery(this_tfslider).css('height', sliderHeight); 7573 jQuery(this_tfslider).find('.background, .mobile_video_image').css('height', sliderHeight); 7574 7575 var slideContent = jQuery(this_tfslider).find('.slide-content-container'); 7576 jQuery(slideContent).each(function() { 7577 var contentHeight = '-' + (jQuery(this).find('.slide-content').height() / 2) + 'px'; 7578 var contentPadding = '0px'; 7579 7580 jQuery(this).css('margin-top', contentHeight); 7581 jQuery(this).css('padding-top', contentPadding); 7582 }); 7583 } else { 7584 jQuery(this_tfslider).parents('.fusion-slider-container').css('height', sliderHeight); 7585 jQuery(this_tfslider).css('height', sliderHeight); 7586 jQuery(this_tfslider).find('.background, .mobile_video_image').css('height', sliderHeight); 7587 7588 var slideContent = jQuery(this_tfslider).find('.slide-content-container'); 7589 jQuery(slideContent).each(function() { 7590 jQuery(this).css('-webkit-transform', ''); 7591 jQuery(this).css('-ms-transform', ''); 7592 jQuery(this).css('-o-transform', ''); 7593 jQuery(this).css('-moz-transform', ''); 7594 jQuery(this).css('transform', ''); 7595 7596 var contentHeight = '-' + (jQuery(this).find('.slide-content').height() / 2) + 'px'; 7597 if(jQuery(this_tfslider).data('parallax') == '1' && jQuery(this_tfslider).parents('.post-content').length == 0) { 7598 var contentPadding = headerHeight / 2; 7599 } 7600 7601 jQuery(this).css('margin-top', contentHeight); 7602 jQuery(this).css('padding-top', contentPadding); 7603 }); 7604 } 7605 7606 if(jQuery(this_tfslider).parents('.post-content').length >= 1) { 7607 jQuery(this_tfslider).parents('.fusion-slider-container').css('height', 'auto'); 7608 jQuery(this_tfslider).css('height', 'auto'); 7609 jQuery(this_tfslider).parents('.fusion-slider-container').css('max-height', 'none'); 7610 jQuery(this_tfslider).find('.mobile_video_image').each(function() { 7611 var img_url = jQuery('.mobile_video_image').css('background-image').replace('url(', '').replace(')', ''); 7612 if(img_url) { 7613 var preview_image = new Image(); 7614 preview_image.name = img_url; 7615 preview_image.src = img_url; 7616 preview_image.onload = function() { 7617 var ar = this.height / this.width; 7618 var compare_width = jQuery(this_tfslider).parent().parent().parent().width(); 7619 if(jQuery(this_tfslider).parents('.post-content').length >= 1) { 7620 compare_width = jQuery(this_tfslider).width(); 7621 } 7622 var mobile_preview_height = ar * compare_width; 7623 if(mobile_preview_height < sliderHeight) { 7624 jQuery(this_tfslider).find('.mobile_video_image').css('height', mobile_preview_height); 7625 jQuery(this_tfslider).css('height', mobile_preview_height); 7626 } 7627 } 7628 } 7629 }); 7630 } 7631 7632 if(Modernizr.mq('only screen and (max-width: 1000px)')) { 7633 jQuery('.header-wrapper').css('height', '' ); 7634 } 7635 7636 resize_width = jQuery(window).width(); 7637 resize_height = jQuery(window).height(); 7638 } 7639 }); // // end_tfslider_resize 7640 7641 if(jQuery(this_tfslider).parents('.post-content').length >= 1) { 7642 jQuery(this_tfslider).css('max-width', '100%'); 7643 if(jQuery(this_tfslider).data('animation') != 'slide') { 7644 jQuery(this_tfslider).find('.slides').css('max-width', '100%'); 7645 } 7646 } 7647 7648 jQuery(this_tfslider).find('video').each(function() { 7649 if( typeof jQuery(this)[0].pause === "function" ) { 7650 jQuery(this)[0].pause(); 7651 } 7652 }); 7653 7654 jQuery(this_tfslider).flexslider({ 7655 animation: jQuery(this_tfslider).data('animation'), 7656 slideshow: jQuery(this_tfslider).data('autoplay'), 7657 slideshowSpeed: jQuery(this_tfslider).data('slideshow_speed'), 7658 animationSpeed: jQuery(this_tfslider).data('animation_speed'), 7659 controlNav: Boolean(Number(jQuery(this_tfslider).data('pagination_circles'))), 7660 directionNav: Boolean(Number(jQuery(this_tfslider).data('nav_arrows'))), 7661 animationLoop: Boolean(Number(jQuery(this_tfslider).data('loop'))), 7662 smoothHeight: true, 7663 pauseOnHover: false, 7664 useCSS: true, 7665 video: true, 7666 touch: true, 7667 prevText: '', 7668 nextText: '', 7669 start: function(slider) { 7670 wpadminbarHeight = 0; 7671 if(jQuery('#wpadminbar').length >= 1) { 7672 var wpadminbarHeight = jQuery('#wpadminbar').height(); 7673 } 7674 7675 jQuery(slider.slides.eq(slider.currentSlide)).find('.slide-content-container').show(); 7676 7677 if(jQuery(this_tfslider).data('full_screen') == 1) { 7678 var sliderHeight = jQuery(window).height(); 7679 7680 if(jQuery(this_tfslider).parents('#sliders-container').next().hasClass('header-wrapper')) { 7681 sliderHeight = sliderHeight + (headerHeight - wpadminbarHeight); 7682 } 7683 7684 if(jQuery(this_tfslider).data('parallax') == 0) { 7685 sliderHeight = jQuery(window).height() - (headerHeight + wpadminbarHeight); 7686 } 7687 7688 if(Modernizr.mq('only screen and (max-width: 1000px)')) { 7689 var sliderHeight = jQuery(window).height() - (headerHeight + wpadminbarHeight); 7690 } 7691 7692 jQuery(this_tfslider).find('video').each(function() { 7693 var aspect_ratio = jQuery(this).width() / jQuery(this).height(); 7694 var arc_sliderWidth = aspect_ratio * sliderHeight; 7695 var arc_sliderLeft = '-' + ((arc_sliderWidth - jQuery(this_tfslider).width()) / 2) + 'px'; 7696 var compare_width = jQuery(this_tfslider).parent().parent().parent().width(); 7697 if(jQuery(this_tfslider).parents('.post-content').length >= 1) { 7698 compare_width = jQuery(this_tfslider).width(); 7699 } 7700 if(compare_width > arc_sliderWidth) { 7701 arc_sliderWidth = '100%'; 7702 arc_sliderLeft = 0; 7703 } 7704 jQuery(this).width(arc_sliderWidth); 7705 jQuery(this).css('left', arc_sliderLeft); 7706 }); 7707 } else { 7708 var sliderWidth = jQuery(this_tfslider).data('slider_width'); 7709 7710 if(sliderWidth.indexOf('%') != -1) { 7711 sliderWidth = jQuery(first_slide).find('.background-image').data('imgwidth'); 7712 if( ! sliderWidth && ! cssua.ua.mobile ) { 7713 sliderWidth = jQuery(first_slide).find('video').width(); 7714 } 7715 7716 if( ! sliderWidth ) { 7717 sliderWidth = 940; 7718 } 7719 7720 jQuery(this_tfslider).data('first_slide_width'
7720, sliderWidth); 7721 7722 if(sliderWidth < jQuery(this_tfslider).data('slider_width')) { 7723 sliderWidth = jQuery(this_tfslider).data('slider_width'); 7724 } 7725 7726 var percentage_width = true; 7727 } else { 7728 sliderWidth = parseInt(jQuery(this_tfslider).data('slider_width')); 7729 } 7730 7731 var sliderHeight = parseInt(jQuery(this_tfslider).data('slider_height')); 7732 var aspect_ratio = sliderHeight / sliderWidth; 7733 7734 if(aspect_ratio < 0.5) { 7735 aspect_ratio = 0.5; 7736 } 7737 7738 var compare_width = jQuery(this_tfslider).parent().parent().parent().width(); 7739 if(jQuery(this_tfslider).parents('.post-content').length >= 1) { 7740 compare_width = jQuery(this_tfslider).width(); 7741 } 7742 var sliderHeight = aspect_ratio * compare_width; 7743 7744 if(sliderHeight > parseInt(jQuery(this_tfslider).data('slider_height'))) { 7745 sliderHeight = parseInt(jQuery(this_tfslider).data('slider_height')); 7746 } 7747 7748 if(sliderHeight < 200) { 7749 sliderHeight = 300; 7750 } 7751 7752 jQuery(this_tfslider).find('video').each(function() { 7753 var aspect_ratio = jQuery(this).width() / jQuery(this).height(); 7754 var arc_sliderWidth = aspect_ratio * sliderHeight; 7755 7756 if(arc_sliderWidth < sliderWidth && !jQuery(this_tfslider).hasClass('full-width-slider')) { 7757 arc_sliderWidth = sliderWidth; 7758 } 7759 7760 var arc_sliderLeft = '-' + ((arc_sliderWidth - jQuery(this_tfslider).width()) / 2) + 'px'; 7761 var compare_width = jQuery(this_tfslider).parent().parent().parent().width(); 7762 if(jQuery(this_tfslider).parents('.post-content').length >= 1) { 7763 compare_width = jQuery(this_tfslider).width(); 7764 } 7765 if(compare_width > arc_sliderWidth && percentage_width == true && jQuery(this_tfslider).data('full_screen') != 1) { 7766 arc_sliderWidth = '100%'; 7767 arc_sliderLeft = 0; 7768 } 7769 jQuery(this).width(arc_sliderWidth); 7770 jQuery(this).css('left', arc_sliderLeft); 7771 }); 7772 } 7773 7774 jQuery(this_tfslider).parents('.fusion-slider-container').css('max-height', sliderHeight); 7775 jQuery(this_tfslider).parents('.fusion-slider-container').css('height', sliderHeight); 7776 jQuery(this_tfslider).css('height', sliderHeight); 7777 jQuery(this_tfslider).find('.background, .mobile_video_image').css('height', sliderHeight); 7778 7779 if((cssua.ua.mobile && cssua.ua.mobile != 'ipad') || jQuery(this_tfslider).parents('.post-content').length >= 1) { 7780 jQuery(this_tfslider).parents('.fusion-slider-container').css('height', 'auto'); 7781 jQuery(this_tfslider).find('.mobile_video_image').each(function() { 7782 var img_url = jQuery('.mobile_video_image').css('background-image').replace('url(', '').replace(')', ''); 7783 if(img_url) { 7784 var preview_image = new Image(); 7785 preview_image.name = img_url; 7786 preview_image.src = img_url; 7787 preview_image.onload = function() { 7788 var ar = this.height / this.width; 7789 var compare_width = jQuery(this_tfslider).parent().parent().parent().width(); 7790 if(jQuery(this_tfslider).parents('.post-content').length >= 1) { 7791 compare_width = jQuery(this_tfslider).width(); 7792 } 7793 var mobile_preview_height = ar * compare_width; 7794 if(mobile_preview_height < sliderHeight) { 7795 jQuery(this_tfslider).find('.mobile_video_image').css('height', mobile_preview_height); 7796 jQuery(this_tfslider).find('.mobile_video_image').css('height', mobile_preview_height); 7797 } 7798 } 7799 } 7800 }); 7801 if(jQuery(slider.slides.eq(slider.currentSlide)).find('video').length >= 1 && jQuery(slider.slides.eq(slider.currentSlide)).find('.mobile_video_image').length >= 1) { 7802 var img_url = jQuery(slider.slides.eq(slider.currentSlide)).find('.mobile_video_image').css('background-image').replace('url(', '').replace(')', ''); 7803 if(img_url) { 7804 var preview_image = new Image(); 7805 preview_image.name = img_url; 7806 preview_image.src = img_url; 7807 preview_image.onload = function() { 7808 var ar = this.height / this.width; 7809 var compare_width = jQuery(this_tfslider).parent().parent().parent().width(); 7810 if(jQuery(this_tfslider).parents('.post-content').length >= 1) { 7811 compare_width = jQuery(this_tfslider).width(); 7812 } 7813 var mobile_preview_height = ar * compare_width; 7814 if(mobile_preview_height < sliderHeight) { 7815 jQuery(this_tfslider).find('.mobile_video_image').css('height', mobile_preview_height); 7816 jQuery(this_tfslider).css('height', mobile_preview_height); 7817 } 7818 } 7819 } 7820 } 7821 } 7822 7823 if(jQuery(this_tfslider).data('parallax') == 1 && ! Modernizr.mq('only screen and (max-width: 1000px)')) { 7824 jQuery(this_tfslider).css('position', 'fixed'); 7825 if( jQuery( '.header-wrapper' ).css( 'position' ) != 'absolute' ) { 7826 jQuery('.header-wrapper').css('position', 'relative'); 7827 jQuery(this_tfslider).parents('.fusion-slider-container').css('margin-top', '-' + headerHeight + 'px'); 7828 } 7829 jQuery('#main, .footer-area, #footer, .page-title-container').css('position', 'relative'); 7830 jQuery('#main, .footer-area, #footer, .page-title-container').css('z-index', '3'); 7831 jQuery('.header-wrapper').css('z-index', '5'); 7832 jQuery('.header-wrapper').css('height', headerHeight); 7833 7834 jQuery(this_tfslider).find('.flex-direction-nav li a').css('-webkit-transform', 'translate(0, ' + (headerHeight / 2) + 'px)'); 7835 jQuery(this_tfslider).find('.flex-direction-nav li a').css('-ms-transform', 'translate(0, ' + (headerHeight / 2) + 'px)'); 7836 jQuery(this_tfslider).find('.flex-direction-nav li a').css('-o-transform', 'translate(0, ' + (headerHeight / 2) + 'px)'); 7837 jQuery(this_tfslider).find('.flex-direction-nav li a').css('-moz-transform', 'translate(0, ' + (headerHeight / 2) + 'px)'); 7838 jQuery(this_tfslider).find('.flex-direction-nav li a').css('transform', 'translate(0, ' + (headerHeight / 2) + 'px)'); 7839 7840 if(jQuery(this_tfslider).data('full_screen') == 1) { 7841 jQuery(slider).find('.flex-control-nav').css('bottom', (headerHeight / 2)); 7842 } else { 7843 jQuery(slider).find('.flex-control-nav').css('bottom', 0); 7844 } 7845 7846 if(jQuery(this_tfslider).hasClass('fixed-width-slider')) { 7847 if( js_local_vars.header_position == 'Left' || js_local_vars.header_position == 'Right' ) { 7848 if( jQuery(this_tfslider).parents( '#sliders-container' ).length ) { 7849 var wrapping_container = jQuery( '#sliders-container' ); 7850 } else { 7851 var wrapping_container = jQuery( '#main' ); 7852 } 7853 7854 if( wrapping_container.width() < parseFloat( jQuery(this_tfslider).parent().css( 'max-width' ) ) ) { 7855 jQuery(this_tfslider).css( 'max-width', wrapping_container.width() ); 7856 } else { 7857 jQuery(this_tfslider).css( 'max-width', jQuery(this_tfslider).parent().css( 'max-width' ) ); 7858 } 7859 7860 if( js_local_vars.header_position == 'Left' ) { 7861 var fixed_width_center = '-' + ((jQuery(this_tfslider).width() - jQuery( '#side-header' ).width() ) / 2) + 'px'; 7862 } else { 7863 var fixed_width_center = '-' + ((jQuery(this_tfslider).width() + jQuery( '#side-header' ).width() ) / 2) + 'px'; 7864 } 7865 7866 if( ( -1 ) * fixed_width_center > jQuery(this_tfslider).width() ) { 7867 fixed_width_center = ( -1 ) * jQuery(this_tfslider).width(); 7868 } 7869 } else { 7870 var fixed_width_center = '-' + (jQuery(this_tfslider).width() / 2) + 'px'; 7871 } 7872 jQuery(this_tfslider).css('left', '50%'); 7873 jQuery(this_tfslider).css('margin-left', fixed_width_center); 7874 } 7875 } else if(jQuery(this_tfslider).data('parallax') == 1 && Modernizr.mq('only screen and (max-width: 1000px)')) { 7876 jQuery(slider).find('.flex-control-nav').css('bottom', 0); 7877 } 7878 7879 if(Modernizr.mq('only screen and (max-width: 640px)')) { 7880 var slideContent = jQuery(this_tfslider).find('.slide-content-container'); 7881 jQuery(slideContent).each(function() { 7882 var contentHeight = '-' + (jQuery(this).find('.slide-content').height() / 2) + 'px'; 7883 var contentPadding = '0px'; 7884 7885 jQuery(this).css('margin-top', contentHeight); 7886 jQuery(this).css('padding-top', contentPadding); 7887 }); 7888 } else if(Modernizr.mq('only screen and (max-width: 800px)')) { 7889 var slideContent = jQuery(this_tfslider).find('.slide-content-container'); 7890 jQuery(slideContent).each(function() { 7891 var contentHeight = '-' + (jQuery(this).find('.slide-content').height() / 2) + 'px'; 7892 var contentPadding = '0px'; 7893 7894 jQuery(this).css('margin-top', contentHeight); 7895 jQuery(this).css('padding-top', contentPadding); 7896 }); 7897 } else { 7898 var slideContent = jQuery(this_tfslider).find('.slide-content-container'); 7899 jQuery(slideContent).each(function() { 7900 jQuery(this).css('-webkit-transform', ''); 7901 jQuery(this).css('-ms-transform', ''); 7902 jQuery(this).css('-o-transform', ''); 7903 jQuery(this).css('-moz-transform', ''); 7904 jQuery(this).css('transform', ''); 7905 7906 var contentHeight = '-' + (jQuery(this).find('.slide-content').height() / 2) + 'px'; 7907 if(jQuery(this_tfslider).data('parallax') == '1' && jQuery(this_tfslider).parents('.post-content').length == 0) { 7908 var contentPadding = headerHeight / 2; 7909 } 7910 7911 jQuery(this).css('margin-top', contentHeight); 7912 jQuery(this).css('padding-top', contentPadding); 7913 }); 7914 } 7915 7916 jQuery(slider.slides.eq(slider.currentSlide)).find('video').each(function() { 7917 if(jQuery(this).parents('li').attr('data-autoplay') == 'yes') { 7918 if( typeof jQuery(this)[0].play === "function" ) { 7919 jQuery(this)[0].play(); 7920 } 7921 } 7922 }); 7923 7924 jQuery(slider.slides.eq(slider.currentSlide)).find('iframe').each(function() { 7925 if(jQuery(this).parents('li').attr('data-autoplay') == 'yes') { 7926 jQuery(this_tfslider).flexslider('pause'); 7927 var video = this; 7928 setTimeout(function() { 7929 video.contentWindow.postMessage('{"event":"command","func":"' + 'playVideo' + '","args":""}', '*'); 7930 }, 1000); 7931 } 7932 }); 7933 7934 if(js_local_vars.header_position == 'Left' || js_local_vars.header_position == 'Right') { 7935 if( jQuery(this_tfslider).parents('#sliders-container').length >= 1 ) { 7936 var slideContent = jQuery(this_tfslider).parents('#sliders-container').find('.slide-content-container'); 7937 jQuery(slideContent).each(function() { 7938 if(jQuery(this).hasClass('slide-content-right')) { 7939 jQuery(this).find('.slide-content').css('margin-right', '100px'); 7940 } else if(jQuery(this).hasClass('slide-content-left')) { 7941 jQuery(this).find('.slide-content').css('margin-left', '100px'); 7942 } 7943 }); 7944 } 7945 } 7946 7947 fusion_reanimate_slider( slideContent ); 7948 7949 if(typeof(slider.slides) !== 'undefined' && slider.slides.eq(slider.currentSlide).find('iframe').length !== 0) { 7950 if(!Number(js_local_vars.status_yt) && window.yt_vid_exists == true) { 7951 YT_ready(function() {
7952 new YT.Player(slider.slides.eq(slider.currentSlide).find('iframe').attr('id'), { 7953 events: { 7954 'onReady': onPlayerReady(slider.slides.eq(slider.currentSlide)), 7955 'onStateChange': onPlayerStateChange(slider.slides.eq(slider.currentSlide).find('iframe').attr('id'), slider) 7956 } 7957 }); 7958 }); 7959 } 7960 if(!Number(js_local_vars.status_vimeo)) { 7961 $f(slider.slides.eq(slider.currentSlide).find('iframe')[0]).api('pause'); 7962 7963 if(jQuery(slider.slides.eq(slider.currentSlide)).data('autoplay') == 'yes') { 7964 $f(slider.slides.eq(slider.currentSlide).find('iframe')[0]).api('play'); 7965 } 7966 if(jQuery(slider.slides.eq(slider.currentSlide)).data('mute') == 'yes') { 7967 $f(slider.slides.eq(slider.currentSlide).find('iframe')[0]).api('setVolume', 0); 7968 } 7969 } 7970 } 7971 7972 jQuery(this_tfslider).find('.overlay-link').hide(); 7973 jQuery(slider.slides.eq(slider.currentSlide)).find('.overlay-link').show(); 7974 7975 // Reinitialize waypoint 7976 jQuery.waypoints( 'viewportHeight' ); 7977 jQuery.waypoints('refresh'); 7978 7979 }, 7980 before: function(slider) { 7981 jQuery(this_tfslider).find('.slide-content-container').hide(); 7982 7983 if(slider.slides.eq(slider.currentSlide).find('iframe').length !== 0) { 7984 if(!Number(js_local_vars.status_vimeo)) { 7985 jQuery(this_tfslider).find('iframe').each(function() { 7986 $f(jQuery(this)[0]).api('pause'); 7987 }); 7988 7989 if(jQuery(slider.slides.eq(slider.currentSlide)).data('autoplay') == 'yes') { 7990 $f(slider.slides.eq(slider.currentSlide).find('iframe')[0]).api('play'); 7991 } 7992 if(jQuery(slider.slides.eq(slider.currentSlide)).data('mute') == 'yes') { 7993 $f(slider.slides.eq(slider.currentSlide).find('iframe')[0]).api('setVolume', 0); 7994 } 7995 } 7996 7997 if(!Number(js_local_vars.status_yt) && window.yt_vid_exists == true) { 7998 YT_ready(function() { 7999 new YT.Player(slider.slides.eq(slider.currentSlide).find('iframe').attr('id'), { 8000 events: { 8001 'onReady': onPlayerReady(slider.slides.eq(slider.currentSlide)), 8002 'onStateChange': onPlayerStateChange(slider.slides.eq(slider.currentSlide).find('iframe').attr('id'), slider) 8003 } 8004 }); 8005 }); 8006 } 8007 } 8008 8009 playVideoAndPauseOthers(slider); 8010 }, 8011 after: function(slider) { 8012 jQuery(slider.slides.eq(slider.currentSlide)).find('.slide-content-container').show(); 8013 8014 if(Modernizr.mq('only screen and (max-width: 640px)')) { 8015 var slideContent = jQuery(this_tfslider).find('.slide-content-container'); 8016 jQuery(slideContent).each(function() { 8017 var contentHeight = '-' + (jQuery(this).find('.slide-content').height() / 2) + 'px'; 8018 var contentPadding = '0px'; 8019 8020 jQuery(this).css('margin-top', contentHeight); 8021 jQuery(this).css('padding-top', contentPadding); 8022 }); 8023 } else if(Modernizr.mq('only screen and (max-width: 800px)')) { 8024 var slideContent = jQuery(this_tfslider).find('.slide-content-container'); 8025 jQuery(slideContent).each(function() { 8026 var contentHeight = '-' + (jQuery(this).find('.slide-content').height() / 2) + 'px'; 8027 var contentPadding = '0px'; 8028 8029 jQuery(this).css('margin-top', contentHeight); 8030 jQuery(this).css('padding-top', contentPadding); 8031 }); 8032 } else { 8033 var slideContent = jQuery(this_tfslider).find('.slide-content-container'); 8034 jQuery(slideContent).each(function() { 8035 jQuery(this).css('-webkit-transform', ''); 8036 jQuery(this).css('-ms-transform', ''); 8037 jQuery(this).css('-o-transform', ''); 8038 jQuery(this).css('-moz-transform', ''); 8039 jQuery(this).css('transform', ''); 8040 8041 var contentHeight = '-' + (jQuery(this).find('.slide-content').height() / 2) + 'px'; 8042 if(jQuery(this_tfslider).data('parallax') == '1' && jQuery(this_tfslider).parents('.post-content').length == 0) { 8043 var contentPadding = headerHeight / 2; 8044 } 8045 8046 jQuery(this).css('margin-top', contentHeight); 8047 jQuery(this).css('padding-top', contentPadding); 8048 }); 8049 } 8050 8051 fusion_reanimate_slider( slideContent ); 8052 8053 if(slider.slides.eq(slider.currentSlide).find('iframe').length !== 0) { 8054 if(!Number(js_local_vars.status_yt) && window.yt_vid_exists == true) { 8055 YT_ready(function() {
8056 new YT.Player(slider.slides.eq(slider.currentSlide).find('iframe').attr('id'), { 8057 events: { 8058 'onReady': onPlayerReady(slider.slides.eq(slider.currentSlide)), 8059 'onStateChange': onPlayerStateChange(slider.slides.eq(slider.currentSlide).find('iframe').attr('id'), slider) 8060 } 8061 }); 8062 }); 8063 } 8064 if(!Number(js_local_vars.status_vimeo)) { 8065 jQuery(this_tfslider).find('iframe').each(function() { 8066 $f(jQuery(this)[0]).api('pause'); 8067 }); 8068 8069 if(jQuery(slider.slides.eq(slider.currentSlide)).data('autoplay') == 'yes') { 8070 $f(slider.slides.eq(slider.currentSlide).find('iframe')[0]).api('play'); 8071 } 8072 if(jQuery(slider.slides.eq(slider.currentSlide)).data('mute') == 'yes') { 8073 $f(slider.slides.eq(slider.currentSlide).find('iframe')[0]).api('setVolume', 0); 8074 } 8075 } 8076 } 8077 8078 jQuery(this_tfslider).find('.overlay-link').hide(); 8079 jQuery(slider.slides.eq(slider.currentSlide)).find('.overlay-link').show(); 8080 8081 playVideoAndPauseOthers(slider); 8082 8083 jQuery('[data-spy="scroll"]').each(function () { 8084 var $spy = jQuery(this).scrollspy('refresh'); 8085 }); 8086 } 8087 }); 8088 }); 8089 8090 if(js_local_vars.page_smoothHeight === 'false') { 8091 page_smoothHeight = false; 8092 } else { 8093 page_smoothHeight = true; 8094 } 8095 8096 jQuery('.grid-layout .flexslider').flexslider({ 8097 slideshow: Boolean(Number(js_local_vars.slideshow_autoplay)), 8098 slideshowSpeed: Number(js_local_vars.slideshow_speed), 8099 video: true, 8100 smoothHeight: page_smoothHeight, 8101 pauseOnHover: false, 8102 useCSS: false, 8103 prevText: '', 8104 nextText: '', 8105 start: function(slider) { 8106 if(typeof(slider.slides) !== 'undefined' && slider.slides.eq(slider.currentSlide).find('iframe').length !== 0) { 8107 if(Number(js_local_vars.pagination_video_slide)) { 8108 jQuery(slider).find('.flex-control-nav').css('bottom', '-30px'); 8109 } else { 8110 jQuery(slider).find('.flex-control-nav').hide(); 8111 } 8112 if(!Number(js_local_vars.status_yt) && window.yt_vid_exists == true) { 8113 YT_ready(function() { 8114 new YT.Player(slider.slides.eq(slider.currentSlide).find('iframe').attr('id'), { 8115 events: { 8116 'onStateChange': onPlayerStateChange(slider.slides.eq(slider.currentSlide).find('iframe').attr('id'), slider) 8117 } 8118 }); 8119 }); 8120 } 8121 } else { 8122 if(Number(js_local_vars.pagination_video_slide)) { 8123 jQuery(slider).find('.flex-control-nav').css('bottom', '0px'); 8124 } else { 8125 jQuery(slider).find('.flex-control-nav').show(); 8126 } 8127 } 8128 8129 // Reinitialize waypoints 8130 jQuery.waypoints( 'viewportHeight' ); 8131 jQuery.waypoints('refresh'); 8132 }, 8133 before: function(slider) { 8134 if(slider.slides.eq(slider.currentSlide).find('iframe').length !== 0) { 8135 if(!Number(js_local_vars.status_vimeo)) { 8136 $f(slider.slides.eq(slider.currentSlide).find('iframe')[0] ).api('pause'); 8137 } 8138 8139 if(!Number(js_local_vars.status_yt) && window.yt_vid_exists == true) { 8140 YT_ready(function() { 8141 new YT.Player(slider.slides.eq(slider.currentSlide).find('iframe').attr('id'), { 8142 events: { 8143 'onStateChange': onPlayerStateChange(slider.slides.eq(slider.currentSlide).find('iframe').attr('id'), slider) 8144 } 8145 }); 8146 }); 8147 } 8148 8149 /* ------------------ YOUTUBE FOR AUTOSLIDER ------------------ */ 8150 playVideoAndPauseOthers(slider); 8151 } 8152 }, 8153 after: function(slider) { 8154 if(slider.slides.eq(slider.currentSlide).find('iframe').length !== 0) { 8155 if(Number(js_local_vars.pagination_video_slide)) { 8156 jQuery(slider).find('.flex-control-nav').css('bottom', '-30px'); 8157 } else { 8158 jQuery(slider).find('.flex-control-nav').hide(); 8159 } 8160 8161 if(!Number(js_local_vars.status_yt) && window.yt_vid_exists == true) { 8162 YT_ready(function() { 8163 new YT.Player(slider.slides.eq(slider.currentSlide).find('iframe').attr('id'), { 8164 events: { 8165 'onStateChange': onPlayerStateChange(slider.slides.eq(slider.currentSlide).find('iframe').attr('id'), slider) 8166 } 8167 }); 8168 }); 8169 } 8170 } else { 8171 if(Number(js_local_vars.pagination_video_slide)) { 8172 jQuery(slider).find('.flex-control-nav').css('bottom', '0px'); 8173 } else { 8174 jQuery(slider).find('.flex-control-nav').show(); 8175 } 8176 } 8177 jQuery('[data-spy="scroll"]').each(function () { 8178 var $spy = jQuery(this).scrollspy('refresh'); 8179 }); 8180 } 8181 }); 8182 8183 if(js_local_vars.flex_smoothHeight === 'false') { 8184 flex_smoothHeight = false;
8185 } else { 8186 flex_smoothHeight = true; 8187 } 8188 8189 jQuery('.fusion-flexslider').flexslider({ 8190 slideshow: Boolean(Number(js_local_vars.slideshow_autoplay)), 8191 slideshowSpeed: js_local_vars.slideshow_speed, 8192 video: true, 8193 smoothHeight: flex_smoothHeight, 8194 pauseOnHover: false, 8195 useCSS: false, 8196 prevText: '', 8197 nextText: '', 8198 start: function(slider) { 8199 if(typeof(slider.slides) !== 'undefined' && slider.slides.eq(slider.currentSlide).find('iframe').length !== 0) { 8200 if(Number(js_local_vars.pagination_video_slide)) { 8201 jQuery(slider).find('.flex-control-nav').css('bottom', '-30px'); 8202 } else { 8203 jQuery(slider).find('.flex-control-nav').hide(); 8204 } 8205 if(!Number(js_local_vars.status_yt) && window.yt_vid_exists == true) { 8206 YT_ready(function() { 8207 new YT.Player(slider.slides.eq(slider.currentSlide).find('iframe').attr('id'), { 8208 events: { 8209 'onStateChange': onPlayerStateChange(slider.slides.eq(slider.currentSlide).find('iframe').attr('id'), slider) 8210 } 8211 }); 8212 }); 8213 } 8214 } else { 8215 if(Number(js_local_vars.pagination_video_slide)) { 8216 jQuery(slider).find('.flex-control-nav').css('bottom', '0px'); 8217 } else { 8218 jQuery(slider).find('.flex-control-nav').show(); 8219 } 8220 } 8221 8222 // Reinitialize waypoint 8223 jQuery.waypoints( 'viewportHeight' ); 8224 jQuery.waypoints( 'refresh' ); 8225 }, 8226 before: function(slider) { 8227 if(slider.slides.eq(slider.currentSlide).find('iframe').length !== 0) { 8228 if(!Number(js_local_vars.status_vimeo)) { 8229 $f( slider.slides.eq(slider.currentSlide).find('iframe')[0] ).api('pause'); 8230 } 8231 8232 if(!Number(js_local_vars.status_yt) && window.yt_vid_exists == true) { 8233 YT_ready(function() { 8234 new YT.Player(slider.slides.eq(slider.currentSlide).find('iframe').attr('id'), { 8235 events: { 8236 'onStateChange': onPlayerStateChange(slider.slides.eq(slider.currentSlide).find('iframe').attr('id'), slider) 8237 } 8238 }); 8239 }); 8240 } 8241 8242 /* ------------------ YOUTUBE FOR AUTOSLIDER ------------------ */ 8243 playVideoAndPauseOthers(slider); 8244 } 8245 }, 8246 after: function(slider) { 8247 if(slider.slides.eq(slider.currentSlide).find('iframe').length !== 0) { 8248 if(Number(js_local_vars.pagination_video_slide)) { 8249 jQuery(slider).find('.flex-control-nav').css('bottom', '-30px'); 8250 } else { 8251 jQuery(slider).find('.flex-control-nav').hide(); 8252 } 8253 8254 if(!Number(js_local_vars.status_yt) && window.yt_vid_exists == true) { 8255 YT_ready(function() { 8256 new YT.Player(slider.slides.eq(slider.currentSlide).find('iframe').attr('id'), { 8257 events: { 8258 'onStateChange': onPlayerStateChange(slider.slides.eq(slider.currentSlide).find('iframe').attr('id'), slider) 8259 } 8260 }); 8261 }); 8262 } 8263 } else { 8264 if(Number(js_local_vars.pagination_video_slide)) { 8265 jQuery(slider).find('.flex-control-nav').css('bottom', '0px'); 8266 } else { 8267 jQuery(slider).find('.flex-control-nav').show(); 8268 } 8269 } 8270 jQuery('[data-spy="scroll"]').each(function () { 8271 var $spy = jQuery(this).scrollspy('refresh'); 8272 }); 8273 } 8274 }); 8275 8276 jQuery('.flexslider').flexslider({ 8277 slideshow: Boolean(Number(js_local_vars.slideshow_autoplay)), 8278 slideshowSpeed: js_local_vars.slideshow_speed, 8279 video: true, 8280 smoothHeight: flex_smoothHeight, 8281 pauseOnHover: false, 8282 useCSS: false, 8283 prevText: '', 8284 nextText: '', 8285 start: function(slider) { 8286 if(typeof(slider.slides) !== 'undefined' && slider.slides.eq(slider.currentSlide).find('iframe').length !== 0) { 8287 if(Number(js_local_vars.pagination_video_slide)) { 8288 jQuery(slider).find('.flex-control-nav').css('bottom', '-30px'); 8289 } else { 8290 jQuery(slider).find('.flex-control-nav').hide(); 8291 } 8292 if(!Number(js_local_vars.status_yt) && window.yt_vid_exists == true) { 8293 YT_ready(function() { 8294 new YT.Player(slider.slides.eq(slider.currentSlide).find('iframe').attr('id'), { 8295 events: { 8296 'onStateChange': onPlayerStateChange(slider.slides.eq(slider.currentSlide).find('iframe').attr('id'), slider) 8297 } 8298 }); 8299 }); 8300 } 8301 } else { 8302 if(Number(js_local_vars.pagination_video_slide)) { 8303 jQuery(slider).find('.flex-control-nav').css('bottom', '0px'); 8304 } else { 8305 jQuery(slider).find('.flex-control-nav').show(); 8306 } 8307 } 8308 8309 // Reinitialize waypoint
8310 jQuery.waypoints( 'viewportHeight' ); 8311 jQuery.waypoints( 'refresh' ); 8312 }, 8313 before: function(slider) { 8314 if(slider.slides.eq(slider.currentSlide).find('iframe').length !== 0) { 8315 if(!Number(js_local_vars.status_vimeo)) { 8316 $f( slider.slides.eq(slider.currentSlide).find('iframe')[0] ).api('pause'); 8317 } 8318 8319 if(!Number(js_local_vars.status_yt) && window.yt_vid_exists == true) { 8320 YT_ready(function() { 8321 new YT.Player(slider.slides.eq(slider.currentSlide).find('iframe').attr('id'), { 8322 events: { 8323 'onStateChange': onPlayerStateChange(slider.slides.eq(slider.currentSlide).find('iframe').attr('id'), slider) 8324 } 8325 }); 8326 }); 8327 } 8328 8329 /* ------------------ YOUTUBE FOR AUTOSLIDER ------------------ */ 8330 playVideoAndPauseOthers(slider); 8331 } 8332 }, 8333 after: function(slider) { 8334 if(slider.slides.eq(slider.currentSlide).find('iframe').length !== 0) { 8335 if(Number(js_local_vars.pagination_video_slide)) { 8336 jQuery(slider).find('.flex-control-nav').css('bottom', '-30px'); 8337 } else { 8338 jQuery(slider).find('.flex-control-nav').hide(); 8339 } 8340 8341 if(!Number(js_local_vars.status_yt) && window.yt_vid_exists == true) { 8342 YT_ready(function() { 8343 new YT.Player(slider.slides.eq(slider.currentSlide).find('iframe').attr('id'), { 8344 events: { 8345 'onStateChange': onPlayerStateChange(slider.slides.eq(slider.currentSlide).find('iframe').attr('id'), slider) 8346 } 8347 }); 8348 }); 8349 } 8350 } else { 8351 if(Number(js_local_vars.pagination_video_slide)) { 8352 jQuery(slider).find('.flex-control-nav').css('bottom', '0px'); 8353 } else { 8354 jQuery(slider).find('.flex-control-nav').show(); 8355 } 8356 } 8357 jQuery('[data-spy="scroll"]').each(function () { 8358 var $spy = jQuery(this).scrollspy('refresh'); 8359 }); 8360 } 8361 }); 8362 8363 function playVideoAndPauseOthers(slider) { 8364 jQuery(slider).find('iframe').each(function(i) { 8365 var func = 'stopVideo'; 8366 this.contentWindow.postMessage('{"event":"command","func":"' + func + '","args":""}', '*'); 8367 if(!jQuery(this).parents('li').hasClass('clone') && jQuery(this).parents('li').hasClass('flex-active-slide') && jQuery(this).parents('li').attr('data-autoplay') == 'yes') { 8368 jQuery(this).parents('.flexslider').flexslider('pause'); 8369 this.contentWindow.postMessage('{"event":"command","func":"' + 'playVideo' + '","args":""}', '*'); 8370 8371 if(jQuery(this).parents('li').attr('data-mute') == 'yes') { 8372 this.contentWindow.postMessage('{"event":"command","func":"' + 'mute' + '","args":""}', '*'); 8373 } 8374 } 8375 }); 8376 jQuery(slider).find('video').each(function(i) { 8377 if( typeof jQuery(this)[0].pause === "function" ) { 8378 jQuery(this)[0].pause(); 8379 } 8380 if(!jQuery(this).parents('li').hasClass('clone') && jQuery(this).parents('li').hasClass('flex-active-slide') && jQuery(this).parents('li').attr('data-autoplay') == 'yes') { 8381 if( typeof jQuery(this)[0].play === "function" ) { 8382 jQuery(this)[0].play(); 8383 } 8384 } 8385 }); 8386 } 8387 8388 /* ------------------ PREV & NEXT BUTTON FOR FLEXSLIDER (YOUTUBE) ------------------ */ 8389 jQuery('.flex-next, .flex-prev').click(function() { 8390 //playVideoAndPauseOthers(jQuery(this).parents('.flexslider')); 8391 }); 8392 } 8393 8394 if(jQuery().isotope) { 8395 8396 jQuery( '.grid-layout' ).each(function() { 8397 8398 var columns = 2; 8399 for( i = 1; i < 7; i++ ) { 8400 if( jQuery ( this ).hasClass( 'grid-layout-' + i ) ) { 8401 columns = i; 8402 } 8403 } 8404 8405 var grid_width = Math.floor( 100 / columns * 100 ) / 100 + '%'; 8406 jQuery( this ).find( '.post' ).css( 'width', grid_width ); 8407 jQuery( this ).isotope({ 8408 layoutMode: 'masonry', 8409 itemSelector: '.post', 8410 transformsEnabled: false, 8411 isOriginLeft: jQuery( 'body.rtl' ).length ? false : true, 8412 resizable: true, 8413 8414 }); 8415 8416 8417 if( ( jQuery ( this ).hasClass( 'grid-layout-4') || jQuery ( this ).hasClass( 'grid-layout-5') || jQuery ( this ).hasClass( 'grid-layout-6') ) && Modernizr.mq('only screen and (min-device-width: 768px) and (max-device-width: 1024px) and (orientation: portrait)')) { 8418 var grid_width = Math.floor( 100 / 3 * 100 ) / 100 + '%'; 8419 jQuery( this ).find( '.post' ).css( 'width', grid_width ); 8420 jQuery( this ).isotope({ 8421 layoutMode: 'masonry', 8422 itemSelector: '.post', 8423 transformsEnabled: false, 8424 isOriginLeft: jQuery( 'body.rtl' ).length ? false : true, 8425 resizable: true, 8426 8427 }); 8428 } 8429 8430 }); 8431 } 8432 8433 if(Boolean(Number(js_local_vars.avada_rev_styles))) { 8434 jQuery('.rev_slider_wrapper').each(function() { 8435 var rev_slider_wrapper = jQuery(this); 8436 8437 if(jQuery(this).length >=1 && jQuery(this).find('.tp-bannershadow').length == 0) { 8438 jQuery('<div class="shadow-left">').appendTo(this); 8439 jQuery('<div class="shadow-right">').appendTo(this); 8440 8441 jQuery(this).addClass('avada-skin-rev'); 8442 } 8443 8444 if( ! jQuery(this).find( '.tp-leftarrow' ).hasClass( 'preview1' ) && ! jQuery(this).find( '.tp-leftarrow' ).hasClass( 'preview2' ) && ! jQuery(this).find( '.tp-leftarrow' ).hasClass( 'preview3' ) && ! jQuery(this).find( '.tp-leftarrow' ).hasClass( 'preview4' ) ) { 8445 jQuery(this).addClass('avada-skin-rev-nav'); 8446 8447 if( rev_slider_wrapper.find( '.tp-leftarrow' ).height() > rev_slider_wrapper.height() / 4 && rev_slider_wrapper.find( '.tp-leftarrow' ).height() < rev_slider_wrapper.height() ) { 8448 var rev_slider_id = rev_slider_wrapper.attr('id'); 8449 var new_dimension = rev_slider_wrapper.height() / 4; 8450 if( rev_slider_wrapper.children( '.avada-rev-arrows' ).length ) { 8451 rev_slider_wrapper.children( '.avada-rev-arrows' ).empty(); 8452 rev_slider_wrapper.children( '.avada-rev-arrows' ).append( '<style type="text/css">#' + rev_slider_id + ' .tp-leftarrow, #' + rev_slider_id + ' .tp-rightarrow{margin-top:-' + new_dimension / 2 + 'px !important;width:' + new_dimension + 'px !important;height:' + new_dimension + 'px !important;}#' + rev_slider_id + ' .tp-leftarrow:before, #' + rev_slider_id + ' .tp-rightarrow:before{line-height:' + new_dimension + 'px;font-size:' + new_dimension / 2 + 'px;}</style>' ); 8453 } else { 8454 rev_slider_wrapper.prepend( '<div class="avada-rev-arrows"><style type="text/css">#' + rev_slider_id + ' .tp-leftarrow, #' + rev_slider_id + ' .tp-rightarrow{margin-top:-' + new_dimension / 2 + 'px !important;width:' + new_dimension + 'px !important;height:' + new_dimension + 'px !important;}#' + rev_slider_id + ' .tp-leftarrow:before, #' + rev_slider_id + ' .tp-rightarrow:before{line-height:' + new_dimension + 'px;font-size:' + new_dimension / 2 + 'px;}</style></div>' ); 8455 } 8456 } 8457 8458 jQuery(window).on('resize', function() { 8459 if( rev_slider_wrapper.find( '.tp-leftarrow' ).height() > rev_slider_wrapper.height() / 4 && rev_slider_wrapper.find( '.tp-leftarrow' ).height() < rev_slider_wrapper.height() ) { 8460 var rev_slider_id = rev_slider_wrapper.attr('id'); 8461 var new_dimension = rev_slider_wrapper.height() / 4; 8462 if( rev_slider_wrapper.children( '.avada-rev-arrows' ).length ) { 8463 rev_slider_wrapper.children( '.avada-rev-arrows' ).empty(); 8464 rev_slider_wrapper.children( '.avada-rev-arrows' ).append( '<style type="text/css">#' + rev_slider_id + ' .tp-leftarrow, #' + rev_slider_id + ' .tp-rightarrow{margin-top:-' + new_dimension / 2 + 'px !important;width:' + new_dimension + 'px !important;height:' + new_dimension + 'px !important;}#' + rev_slider_id + ' .tp-leftarrow:before, #' + rev_slider_id + ' .tp-rightarrow:before{line-height:' + new_dimension + 'px;font-size:' + new_dimension / 2 + 'px;}</style>' ); 8465 } else { 8466 rev_slider_wrapper.prepend( '<div class="avada-rev-arrows"><style type="text/css">#' + rev_slider_id + ' .tp-leftarrow, #' + rev_slider_id + ' .tp-rightarrow{margin-top:-' + new_dimension / 2 + 'px !important;width:' + new_dimension + 'px !important;height:' + new_dimension + 'px !important;}#' + rev_slider_id + ' .tp-leftarrow:before, #' + rev_slider_id + ' .tp-rightarrow:before{line-height:' + new_dimension + 'px;font-size:' + new_dimension / 2 + 'px;}</style></div>' ); 8467 } 8468 } else { 8469 rev_slider_wrapper.children( '.avada-rev-arrows' ).remove(); 8470 } 8471 }); 8472 } 8473 8474 }); 8475 } 8476}); 8477 8478jQuery(window).load(function($) { 8479 var header_social_height; 8480 var other_content_alignment; 8481
8482 if( ( jQuery( window ).width() >= 800 || ( js_local_vars.mobile_menu_design == 'modern' && Modernizr.mq('only screen and (min-device-width: 768px) and (max-device-width: 1024px) and (orientation: portrait)') ) ) && js_local_vars.ipad_potrait == '0' ) { 8483 header_social_height = jQuery( '.header-wrapper .header-social' ).height(); 8484 } 8485 8486 if( jQuery( '.header-social .alignleft .top-menu' ).length ) { 8487 other_content_alignment = '.alignright'; 8488 } 8489 8490 if( jQuery( '.header-social .alignright .top-menu' ).length ) { 8491 other_content_alignment = '.alignleft'; 8492 } 8493 8494 jQuery(window).on('resize', function() { 8495 if( jQuery( '.header-social' ).find( other_content_alignment ).height() > 43 ) { 8496 header_social_height = jQuery( '.header-social' ).find( other_content_alignment ).height(); 8497 } else { 8498 header_social_height = 43; 8499 } 8500 8501 jQuery( '.header-wrapper .header-social .menu > li' ).css( { 8502 'height': header_social_height, 8503 'line-height': header_social_height + 'px' 8504 }); 8505 }); 8506 8507 if( jQuery( '.header-wrapper .top-menu #snav > .cart' ).width() > 176 ) { 8508 setTimeout( function() { 8509 var cart_width = jQuery( '.header-wrapper .top-menu #snav > .cart' ).outerWidth(), 8510 cart_content = jQuery('.header-wrapper .top-menu .cart-content a'), 8511 cart_content_width = cart_content.width(), 8512 cart_content_padding = cart_content.outerWidth() - cart_content_width, 8513 new_cart_content_width = cart_width - cart_content_padding, 8514 img = jQuery( '.header-wrapper .top-menu .cart-content a > img' ), 8515 img_width = img.width(); 8516 img_margin = img.outerWidth( true ) - img_width; 8517 8518 jQuery('.header-wrapper .top-menu .cart-contents-wrapper').width( cart_width ); 8519 jQuery('.header-wrapper .top-menu .cart-content a').width( new_cart_content_width ); 8520 8521 jQuery('.header-wrapper .top-menu .cart-content a').find( '.cart-desc' ).each( function() { 8522 jQuery ( this ).width( jQuery ( this ).parent().width() - img_width - img_margin ); 8523 }); 8524 }, 750 ); 8525 }; 8526 8527 if(jQuery().prettyPhoto) { 8528 var ppArgs = { 8529 overlay_gallery: Boolean(Number(js_local_vars.lightbox_gallery)), 8530 autoplay_slideshow: Boolean(Number(js_local_vars.lightbox_autoplay)), 8531 show_title: Boolean(Number(js_local_vars.lightbox_title)), 8532 show_desc: Boolean(Number(js_local_vars.lightbox_desc)), 8533 deeplinking: Boolean(Number(js_local_vars.lightbox_deeplinking)), 8534 }; 8535 if(js_local_vars.lightbox_animation_speed) { 8536 ppArgs.animation_speed = js_local_vars.lightbox_animation_speed.toLowerCase(); 8537 } 8538 if(js_local_vars.lightbox_slideshow_speed) { 8539 ppArgs.slideshow = js_local_vars.lightbox_slideshow_speed; 8540 } 8541 if(js_local_vars.lightbox_opacity) { 8542 ppArgs.opacity = js_local_vars.lightbox_opacity; 8543 } 8544 if(!Boolean(Number(js_local_vars.lightbox_social))) { 8545 ppArgs.social_tools = ''; 8546 } 8547 8548 jQuery("a[rel^='prettyPhoto'], a[data-rel^='prettyPhoto']").prettyPhoto(ppArgs); 8549 8550 // Woocommerce lightbox 8551 var ppArgs_woo = ppArgs; 8552 ppArgs_woo.hook = 'data-rel'; 8553 jQuery("a.zoom, a[data-rel^='prettyPhoto']").prettyPhoto(ppArgs_woo); 8554 8555 if( Boolean( Number( js_local_vars.lightbox_post_images ) ) ) { // lightbox for images within the post content 8556 8557 jQuery( '.single-post .post-content a, #posts-container .post .post-content a, .fusion-blog-shortcode .post .post-content a' ).has( 'img' ).each( function() { 8558 if( String( jQuery( this ).attr( 'rel' ) ).indexOf( 'prettyPhoto' ) === -1 ) { 8559 jQuery( this ).prettyPhoto( ppArgs ); 8560 } 8561 }); 8562 8563 } 8564 8565 if( Boolean( Number( js_local_vars.status_lightbox_mobile ) ) ) { 8566 8567 var mediaQuery = 'desk'; 8568 8569 if (Modernizr.mq('only screen and (max-width: 600px)') || Modernizr.mq('only screen and (max-height: 520px)')) { 8570 8571 mediaQuery = 'mobile'; 8572 jQuery("a.zoom, a[data-rel^='prettyPhoto'], a[rel^='prettyPhoto']").unbind('click'); 8573 if( Boolean( Number( js_local_vars.lightbox_post_images ) ) ) { // lightbox for images within the post content 8574 jQuery('.single-post .post-content a, #posts-container .post .post-content a, .fusion-blog-shortcode .post .post-content a').has('img').unbind('click'); 8575 } 8576 } 8577 8578 // Disables prettyPhoto if screen small 8579 jQuery(window).on('resize', function() { 8580 if ((Modernizr.mq('only screen and (max-width: 600px)') || Modernizr.mq('only screen and (max-height: 520px)')) && mediaQuery == 'desk') { 8581 jQuery("a.zoom, a[data-rel^='prettyPhoto'], a[rel^='prettyPhoto']").unbind('click.prettyphoto'); 8582 if( Boolean( Number( js_local_vars.lightbox_post_images ) ) ) { // lightbox for images within the post content 8583 jQuery('.single-post .post-content a, #posts-container .post .post-content a, .fusion-blog-shortcode .post .post-content a').has('img').unbind('click.prettyphoto'); 8584 } 8585 mediaQuery = 'mobile'; 8586 } else if ( ! Modernizr.mq('only screen and (max-width: 600px)') && ! Modernizr.mq('only screen and (max-height: 520px)') && mediaQuery == 'mobile') { 8587 jQuery("a.zoom, a[data-rel^='prettyPhoto'], a[rel^='prettyPhoto']").prettyPhoto(ppArgs); 8588 if( Boolean( Number( js_local_vars.lightbox_post_images ) ) ) { // lightbox for images within the post content 8589 jQuery( '.single-post .post-content a, #posts-container .post .post-content a, .fusion-blog-shortcode .post .post-content a' ).has( 'img' ).each( function() { 8590 if( String( jQuery( this ).attr( 'rel' ) ).indexOf( 'prettyPhoto' ) === -1 ) { 8591 jQuery( this ).prettyPhoto( ppArgs ); 8592 } 8593 }); 8594 } 8595 mediaQuery = 'desk'; 8596 } 8597 }); 8598 } 8599 } 8600 8601 if( js_local_vars.sidenav_behavior == 'Click' ) { 8602 jQuery('.side-nav li a').on('click', function(e) { 8603 if( jQuery(this).parent('.page_item_has_children').length ) { 8604 if(jQuery(this).parent().find('> .children').length && ! jQuery(this).parent().find('> .children').is(':visible') ) { 8605 jQuery(this).parent().find('> .children').stop(true, true).slideDown('slow'); 8606 } else { 8607 jQuery(this).parent().find('>
8607 .children').stop(true, true).slideUp('slow'); 8608 } 8609 } 8610 8611 if( jQuery(this).parent('.page_item_has_children.current_page_item').length ) { 8612 return false; 8613 } 8614 }); 8615 } else { 8616 jQuery('.side-nav li').hoverIntent({ 8617 over: function() { 8618 if( jQuery(this).find('> .children').length ) { 8619 jQuery(this).find('> .children').stop(true, true).slideDown('slow'); 8620 } 8621 }, 8622 out: function() { 8623 if(jQuery(this).find('.current_page_item').length == 0 && jQuery(this).hasClass('current_page_item') == false) { 8624 jQuery(this).find('.children').stop(true, true).slideUp('slow'); 8625 } 8626 }, 8627 timeout: 500 8628 }); 8629 } 8630 8631 if(jQuery().eislideshow) { 8632 var eislideshow_args = { 8633 autoplay: Boolean(Number(js_local_vars.tfes_autoplay)) 8634 }; 8635 8636 if(js_local_vars.tfes_animation) { 8637 eislideshow_args.animation = js_local_vars.tfes_animation; 8638 } 8639 if(js_local_vars.tfes_interval) { 8640 eislideshow_args.slideshow_interval = js_local_vars.tfes_interval; 8641 } 8642 if(js_local_vars.tfes_speed) { 8643 eislideshow_args.speed = js_local_vars.tfes_speed; 8644 } 8645 if(js_local_vars.tfes_width) { 8646 eislideshow_args.thumbMaxWidth = js_local_vars.tfes_width; 8647 } 8648 8649 jQuery('#ei-slider').eislideshow(eislideshow_args); 8650 } 8651 8652 var retina = window.devicePixelRatio > 1 ? true : false; 8653 8654 if(js_local_vars.custom_icon_image_retina && retina) { 8655 jQuery('.fusion-social-networks a.custom').each(function() { 8656 jQuery(this).find('img').attr('src', js_local_vars.custom_icon_image_retina); 8657 jQuery(this).find('img').attr('width', js_local_vars.retina_icon_width); 8658 jQuery(this).find('img').attr('height', js_local_vars.retina_icon_height); 8659 }) 8660 } 8661 8662 /* wpml flag in center */ 8663 var wpml_flag = jQuery('ul#navigation > li > a > .iclflag'); 8664 var wpml_h = wpml_flag.height(); 8665 wpml_flag.css('margin-top', +wpml_h / - 2 + "px"); 8666 8667 var wpml_flag = jQuery('.top-menu > ul > li > a > .iclflag'); 8668 var wpml_h = wpml_flag.height(); 8669 wpml_flag.css('margin-top', +wpml_h / - 2 + "px"); 8670 8671 if(js_local_vars.blog_pagination_type == 'Infinite Scroll') { 8672 jQuery('#posts-container').infinitescroll({ 8673 navSelector : "div.pagination", 8674 // selector for the paged navigation (it will be hidden) 8675 nextSelector : "a.pagination-next", 8676 // selector for the NEXT link (to page 2) 8677 itemSelector : "div.post, .timeline-date", 8678 // selector for all items you'll retrieve 8679 loading : { 8680 finishedMsg: js_local_vars.infinite_finished_msg, 8681 msg: jQuery('<div class="loading-container"><div class="loading-spinner"><div class="spinner-1"></div><div class="spinner-2"></div><div class="spinner-3"></div></div><div class="loading-msg">'+js_local_vars.infinite_blog_text+'</div>') 8682 }, 8683 errorCallback: function() { 8684 if(jQuery('#posts-container').hasClass('isotope')) { 8685 jQuery('#posts-container').isotope(); 8686 } 8687 } 8688 }, function(posts) { 8689 if(jQuery().isotope) { 8690 jQuery(posts).hide(); 8691 imagesLoaded(posts, function() { 8692 jQuery(posts).fadeIn(); 8693 if(jQuery('#posts-container').hasClass('isotope')) { 8694 jQuery('#posts-container').isotope('appended', jQuery(posts)); 8695 jQuery('#posts-container').isotope(); 8696 } 8697 8698 jQuery('[data-spy="scroll"]').each(function () { 8699 var $spy = jQuery(this).scrollspy('refresh'); 8700 }); 8701 }); 8702 8703 var columns = 2; 8704 for( i = 1; i < 7; i++ ) { 8705 if( jQuery( '.grid-layout' ).hasClass( 'grid-layout-' + i ) ) { 8706 columns = i; 8707 } 8708 } 8709 8710 var grid_width = Math.floor( 100 / columns * 100 ) / 100 + '%'; 8711 jQuery( '.grid-layout' ).find( '.post' ).css( 'width', grid_width ); 8712 8713 if(jQuery('#posts-container').hasClass('isotope')) { 8714 jQuery('#posts-container').isotope(); 8715 } 8716 } 8717 8718 jQuery('.flexslider').flexslider({ 8719 slideshow: Boolean(Number(js_local_vars.slideshow_autoplay)), 8720 slideshowSpeed: js_local_vars.slideshow_speed, 8721 video: true, 8722 pauseOnHover: false, 8723 useCSS: false, 8724 prevText: '', 8725 nextText: '', 8726 start: function(slider) { 8727 if(typeof(slider.slides) !== 'undefined' && slider.slides.eq(slider.currentSlide).find('iframe').length !== 0) { 8728 if(Number(js_local_vars.pagination_video_slide)) { 8729 jQuery(slider).find('.flex-control-nav').css('bottom', '-30px'); 8730 } else { 8731 jQuery(slider).find('.flex-control-nav').hide(); 8732 } 8733 if(!Number(js_local_vars.status_yt) && window.yt_vid_exists == true) { 8734 YT_ready(function() {
8735 new YT.Player(slider.slides.eq(slider.currentSlide).find('iframe').attr('id'), { 8736 events: { 8737 'onStateChange': onPlayerStateChange(slider.slides.eq(slider.currentSlide).find('iframe').attr('id'), slider) 8738 } 8739 }); 8740 }); 8741 } 8742 } else { 8743 if(Number(js_local_vars.pagination_video_slide)) { 8744 jQuery(slider).find('.flex-control-nav').css('bottom', '0px'); 8745 } else { 8746 jQuery(slider).find('.flex-control-nav').show(); 8747 } 8748 } 8749 8750 // Reinitialize waypoints 8751 jQuery.waypoints( 'viewportHeight' ); 8752 jQuery.waypoints('refresh'); 8753 }, 8754 before: function(slider) { 8755 if(slider.slides.eq(slider.currentSlide).find('iframe').length !== 0) { 8756 if(!Number(js_local_vars.status_vimeo)) { 8757 $f( slider.slides.eq(slider.currentSlide).find('iframe')[0] ).api('pause'); 8758 } 8759 8760 if(!Number(js_local_vars.status_yt) && window.yt_vid_exists == true) { 8761 YT_ready(function() { 8762 new YT.Player(slider.slides.eq(slider.currentSlide).find('iframe').attr('id'), { 8763 events: { 8764 'onStateChange': onPlayerStateChange(slider.slides.eq(slider.currentSlide).find('iframe').attr('id'), slider) 8765 } 8766 }); 8767 }); 8768 } 8769 8770 /* ------------------ YOUTUBE FOR AUTOSLIDER ------------------ */ 8771 //playVideoAndPauseOthers(slider); 8772 } 8773 }, 8774 after: function(slider) { 8775 if(slider.slides.eq(slider.currentSlide).find('iframe').length !== 0) { 8776 if(Number(js_local_vars.pagination_video_slide)) { 8777 jQuery(slider).find('.flex-control-nav').css('bottom', '-30px'); 8778 } else { 8779 jQuery(slider).find('.flex-control-nav').hide(); 8780 } 8781 8782 if(!Number(js_local_vars.status_yt) && window.yt_vid_exists == true) { 8783 YT_ready(function() { 8784 new YT.Player(slider.slides.eq(slider.currentSlide).find('iframe').attr('id'), { 8785 events: { 8786 'onStateChange': onPlayerStateChange(slider.slides.eq(slider.currentSlide).find('iframe').attr('id'), slider) 8787 } 8788 }); 8789 }); 8790 } 8791 } else { 8792 if(Number(js_local_vars.pagination_video_slide)) { 8793 jQuery(slider).find('.flex-control-nav').css('bottom', '0px'); 8794 } else { 8795 jQuery(slider).find('.flex-control-nav').show(); 8796 } 8797 } 8798 jQuery('[data-spy="scroll"]').each(function () { 8799 var $spy = jQuery(this).scrollspy('refresh'); 8800 }); 8801 } 8802 }); 8803 8804 jQuery(posts).each(function() { 8805 jQuery(this).find('.full-video, .video-shortcode, .wooslider .slide-content').fitVids(); 8806 }); 8807 8808 if(jQuery().isotope && jQuery('#posts-container').hasClass('isotope')) { 8809 //jQuery('#posts-container').isotope(); 8810 } 8811 }); 8812 } 8813 8814 var blog_shortcode_infinite_container = '.posts-container-infinite'; 8815 if( jQuery('.posts-container-infinite').find( '.blog-timeline-layout' ).length ) { 8816 blog_shortcode_infinite_container = '.posts-container-infinite .blog-timeline-layout'; 8817 } 8818 8819 jQuery( blog_shortcode_infinite_container ).infinitescroll({ 8820 navSelector : "div.pagination", 8821 // selector for the paged navigation (it will be hidden) 8822 nextSelector : "a.pagination-next", 8823 // selector for the NEXT link (to page 2) 8824 itemSelector : "div.post, .timeline-date", 8825 // selector for all items you'll retrieve 8826 loading : { 8827 finishedMsg: js_local_vars.infinite_finished_msg, 8828 msg: jQuery('<div class="loading-container"><div class="loading-spinner"><div class="spinner-1"></div><div class="spinner-2"></div><div class="spinner-3"></div></div><div class="loading-msg">'+js_local_vars.infinite_blog_text+'</div>') 8829 }, 8830 errorCallback: function() { 8831 if(jQuery('.posts-container-infinite').hasClass('isotope')) { 8832 jQuery('.posts-container-infinite').isotope(); 8833 } 8834 } 8835 }, function(posts) { 8836 if(jQuery().isotope) { 8837 jQuery(posts).hide(); 8838 imagesLoaded(posts, function() { 8839 jQuery(posts).fadeIn(); 8840 if(jQuery('.posts-container-infinite').hasClass('isotope')) { 8841 jQuery('.posts-container-infinite').isotope('appended', jQuery(posts)); 8842 jQuery('.posts-container-infinite').isotope(); 8843 } 8844 8845 jQuery('[data-spy="scroll"]').each(function () { 8846 var $spy = jQuery(this).scrollspy('refresh'); 8847 }); 8848 }); 8849 8850 var columns = 2; 8851 for( i = 1; i < 7; i++ ) { 8852 if( jQuery( '.grid-layout' ).hasClass( 'grid-layout-' + i ) ) { 8853 columns = i; 8854 } 8855 } 8856 8857 var grid_width = Math.floor( 100 / columns * 100 ) / 100 + '%'; 8858 jQuery( '.grid-layout' ).find( '.post' ).css( 'width', grid_width ); 8859 8860 if(jQuery('.posts-container-infinite').hasClass('isotope')) { 8861 jQuery('.posts-container-infinite').isotope(); 8862 } 8863 } 8864 8865 jQuery('.flexslider').flexslider({ 8866 slideshow: Boolean(Number(js_local_vars.slideshow_autoplay)), 8867 slideshowSpeed: js_local_vars.slideshow_speed, 8868 video: true, 8869 pauseOnHover: false,
8870 useCSS: false, 8871 prevText: '', 8872 nextText: '', 8873 start: function(slider) { 8874 if(typeof(slider.slides) !== 'undefined' && slider.slides.eq(slider.currentSlide).find('iframe').length !== 0) { 8875 if(Number(js_local_vars.pagination_video_slide)) { 8876 jQuery(slider).find('.flex-control-nav').css('bottom', '-30px'); 8877 } else { 8878 jQuery(slider).find('.flex-control-nav').hide(); 8879 } 8880 if(!Number(js_local_vars.status_yt) && window.yt_vid_exists == true) { 8881 YT_ready(function() { 8882 new YT.Player(slider.slides.eq(slider.currentSlide).find('iframe').attr('id'), { 8883 events: { 8884 'onStateChange': onPlayerStateChange(slider.slides.eq(slider.currentSlide).find('iframe').attr('id'), slider) 8885 } 8886 }); 8887 }); 8888 } 8889 } else { 8890 if(Number(js_local_vars.pagination_video_slide)) { 8891 jQuery(slider).find('.flex-control-nav').css('bottom', '0px'); 8892 } else { 8893 jQuery(slider).find('.flex-control-nav').show(); 8894 } 8895 } 8896 8897 // Reinitialize waypoints 8898 jQuery.waypoints( 'viewportHeight' ); 8899 jQuery.waypoints('refresh'); 8900 }, 8901 before: function(slider) { 8902 if(slider.slides.eq(slider.currentSlide).find('iframe').length !== 0) { 8903 if(!Number(js_local_vars.status_vimeo)) { 8904 $f( slider.slides.eq(slider.currentSlide).find('iframe')[0] ).api('pause'); 8905 } 8906 8907 if(!Number(js_local_vars.status_yt) && window.yt_vid_exists == true) { 8908 YT_ready(function() { 8909 new YT.Player(slider.slides.eq(slider.currentSlide).find('iframe').attr('id'), { 8910 events: { 8911 'onStateChange': onPlayerStateChange(slider.slides.eq(slider.currentSlide).find('iframe').attr('id'), slider) 8912 } 8913 }); 8914 }); 8915 } 8916 8917 /* ------------------ YOUTUBE FOR AUTOSLIDER ------------------ */ 8918 playVideoAndPauseOthers(slider); 8919 } 8920 }, 8921 after: function(slider) { 8922 if(slider.slides.eq(slider.currentSlide).find('iframe').length !== 0) { 8923 if(Number(js_local_vars.pagination_video_slide)) { 8924 jQuery(slider).find('.flex-control-nav').css('bottom', '-30px'); 8925 } else { 8926 jQuery(slider).find('.flex-control-nav').hide(); 8927 } 8928 8929 if(!Number(js_local_vars.status_yt) && window.yt_vid_exists == true) { 8930 YT_ready(function() { 8931 new YT.Player(slider.slides.eq(slider.currentSlide).find('iframe').attr('id'), { 8932 events: { 8933 'onStateChange': onPlayerStateChange(slider.slides.eq(slider.currentSlide).find('iframe').attr('id'), slider) 8934 } 8935 }); 8936 }); 8937 } 8938 } else { 8939 if(Number(js_local_vars.pagination_video_slide)) { 8940 jQuery(slider).find('.flex-control-nav').css('bottom', '0px'); 8941 } else { 8942 jQuery(slider).find('.flex-control-nav').show(); 8943 } 8944 } 8945 jQuery('[data-spy="scroll"]').each(function () { 8946 var $spy = jQuery(this).scrollspy('refresh'); 8947 }); 8948 } 8949 }); 8950 8951 jQuery(posts).each(function() { 8952 jQuery(this).find('.full-video, .video-shortcode, .wooslider .slide-content').fitVids(); 8953 }); 8954 8955 if(jQuery().isotope && jQuery('.posts-container-infinite').hasClass('isotope')) { 8956 jQuery('.posts-container-infinite').isotope(); 8957 } 8958 }); 8959 8960 if(js_local_vars.portfolio_pagination_type == 'Infinite Scroll') { 8961 jQuery('.portfolio:not(.fusion-recent-works) .portfolio-wrapper').infinitescroll({ 8962 navSelector : "div.pagination", 8963 // selector for the paged navigation (it will be hidden) 8964 nextSelector : "a.pagination-next", 8965 // selector for the NEXT link (to page 2) 8966 itemSelector : "div.portfolio-item", 8967 // selector for all items you'll retrieve 8968 loading : { 8969 finishedMsg: js_local_vars.infinite_finished_msg, 8970 msg: jQuery('<div class="loading-container"><div class="loading-spinner"><div class="spinner-1"></div><div class="spinner-2"></div><div class="spinner-3"></div></div><div class="loading-msg">'+js_local_vars.infinite_blog_text+'</div>') 8971 }, 8972 errorCallback: function() { 8973 jQuery('.portfolio .portfolio-wrapper').isotope(); 8974 }, 8975 8976 }, function(posts) { 8977 if(jQuery().isotope) { 8978 jQuery(posts).hide(); 8979 8980 imagesLoaded(posts, function() { 8981 jQuery(posts).fadeIn(); 8982 8983 jQuery('.portfolio .portfolio-wrapper').isotope('appended', jQuery(posts)); 8984 8985 jQuery(posts).each(function() { 8986 jQuery(this).find('.full-video, .video-shortcode, .wooslider .slide-content').fitVids(); 8987 }); 8988 8989 jQuery('.portfolio .portfolio-wrapper').isotope(); 8990 8991 jQuery('[data-spy="scroll"]').each(function () { 8992 var $spy = jQuery(this).scrollspy('refresh'); 8993 }); 8994 }); 8995 } 8996 8997 8998 }); 8999 } 9000 9001 // sticky header v1 - v5 9002 if( jQuery( '.sticky-header' ).length ) { 9003 jQuery('.sticky-header').init_sticky_header(); 9004 } 9005}); 9006 9007// Reinitialize prettyPhoto after AJAX content loading 9008jQuery( document ).ajaxComplete( function() { 9009 9010 jQuery( '.header-wrapper .top-menu .cart' ).css({ 9011 'height': jQuery( '.top-menu .cart' ).prev().css( 'height' ), 9012 'line-height': jQuery( '.top-menu .cart' ).prev().css( 'line-height' ) 9013 }); 9014 9015 // prettyPhoto 9016 if( jQuery().prettyPhoto ) { 9017 var ppArgs = { 9018 overlay_gallery: Boolean(Number(js_local_vars.lightbox_gallery)), 9019 autoplay_slideshow: Boolean(Number(js_local_vars.lightbox_autoplay)), 9020 show_title: Boolean(Number(js_local_vars.lightbox_title)), 9021 show_desc: Boolean(Number(js_local_vars.lightbox_desc)) 9022 }; 9023 if(js_local_vars.lightbox_animation_speed) { 9024 ppArgs.animation_speed = js_local_vars.lightbox_animation_speed.toLowerCase(); 9025 } 9026 if(js_local_vars.lightbox_slideshow_speed) { 9027 ppArgs.slideshow = js_local_vars.lightbox_slideshow_speed; 9028 } 9029 if(js_local_vars.lightbox_opacity) { 9030 ppArgs.opacity = js_local_vars.lightbox_opacity; 9031 } 9032 if(!Boolean(Number(js_local_vars.lightbox_social))) { 9033 ppArgs.social_tools = ''; 9034 } 9035 9036 jQuery("a[rel^='prettyPhoto'], a[data-rel^='prettyPhoto']").prettyPhoto(ppArgs); 9037 } 9038}); 9039 9040 9041/** 9042 * Fusion Maps 9043 */ 9044(function(d,l,h,m){function e(a,c){this.element=a;this.settings=d.extend({},k,c);this._defaults=k;this._name="fusion_maps";this.geocoder=new google.maps.Geocoder;this.next_address=0;this.infowindow=new google.maps.InfoWindow;this.markers=[];this.init()}var k={addresses:{},address_pin:!0,animations:!0,delay:10,infobox_background_color:!1,infobox_styling:"default",infobox_text_color:!1,map_style:"default",map_type:"roadmap",marker_icon:!1,overlay_color:!1,overlay_color_hsl:{},pan_control:!0,show_address:!0, 9045scale_control:!0,scrollwheel:!0,zoom:9,zoom_control:!0};d.extend(e.prototype,{init:function(){var a={zoom:this.settings.zoom,mapTypeId:this.settings.map_type,scrollwheel:this.settings.scrollwheel,scaleControl:this.settings.scale_control,panControl:this.settings.pan_control,zoomControl:this.settings.zoom_control},c;c=640<d(h).width()?!0:!1;this.settings.scrollwheel&&(a.draggable=c);this.settings.address_pin||(this.settings.addresses=[this.settings.addresses[0]]);this.settings.addresses=this.settings.addresses.reverse(); 9046this.settings.addresses[0].coordinates&&(c=new google.maps.LatLng(this.settings.addresses[0].latitude,this.settings.addresses[0].longitude),a.center=c);this.map=new google.maps.Map(this.element,a);this.settings.overlay_color&&"custom"==this.settings.map_style&&(a=[{stylers:[{hue:this.settings.overlay_color},{lightness:2*this.settings.overlay_color_hsl.lum-100},{saturation:2*this.settings.overlay_color_hsl.sat-100}]},{featureType:"road",elementType:"geometry",stylers:[{visibility:"simplified"}]},{featureType:"road", 9047elementType:"labels"}],this.map.setOptions({styles:a}));this.next_geocode_request()},geocode_address:function(a){var c=this,b;b=!0===a.coordinates?{latLng:new google.maps.LatLng(a.latitude,a.longitude)}:{address:a.address};this.geocoder.geocode(b,function(b,d){var f,g;d==google.maps.GeocoderStatus.OK?(g=b[0].geometry.location,f=g.lat(),g=g.lng(),!0===a.coordinates&&""===a.infobox_content&&(a.geocoded_address=b[0].formatted_address),1!=c.next_address||a.coordinates||c.map.setCenter(b[0].geometry.location), 9048c.settings.address_pin&&c.create_marker(a,f,g),c.map.setCenter(b[0].geometry.location)):d==google.maps.GeocoderStatus.OVER_QUERY_LIMIT&&(c.next_address--,c.settings.delay++);c.next_geocode_request()})},create_marker:function(a,c,b){b={position:new google.maps.LatLng(c,b),map:this.map};a.infobox_content?c=a.infobox_content:(c=a.address,!0===a.coordinates&&a.geocoded_address&&(c=a.geocoded_address));this.settings.animations&&(b.animation=google.maps.Animation.DROP);"custom"==this.settings.map_style&& 9049"theme"==this.settings.marker_icon?b.icon=new google.maps.MarkerImage(a.marker,null,null,null,new google.maps.Size(37,55)):"custom"==this.settings.map_style&&a.marker&&(b.icon=a.marker);a=new google.maps.Marker(b);this.markers.push(a);this.create_infowindow(c,a)},create_infowindow:function(a,c){var b,d,e,f=this;"custom"==this.settings.infobox_styling&&"custom"==this.settings.map_style?(d=h.createElement("div"),e={content:d,disableAutoPan:!1,maxWidth:150,pixelOffset:new google.maps.Size(-125,10),zIndex:null, 9050boxStyle:{background:"none",opacity:1,width:"250px"},closeBoxMargin:"2px 2px 2px 2px",closeBoxURL:"//www.google.com/intl/en_us/mapfiles/close.gif",infoBoxClearance:new google.maps.Size(1,1)},d.className="fusion-info-box",d.style.cssText="background-color:"+this.settings.infobox_background_color+";
9050color:"+this.settings.infobox_text_color+";",d.innerHTML=a,b=new InfoBox(e),b.open(this.map,c),this.settings.show_address||b.setVisible(!1),google.maps.event.addListener(c,"click",function(){b.getVisible()? 9051b.setVisible(!1):b.setVisible(!0)})):(b=new google.maps.InfoWindow({content:a}),this.settings.show_address&&(b.show=!0,b.open(this.map,c)),google.maps.event.addListener(c,"click",function(){b.show?(b.close(f.map,this),b.show=!1):(b.open(f.map,this),b.show=!0)}))},next_geocode_request:function(){var a=this;this.next_address<this.settings.addresses.length&&setTimeout(function(){a.geocode_address(a.settings.addresses[a.next_address]);a.next_address++},this.settings.delay)}});d.fn.fusion_maps=function(a){this.each(function(){d.data(this, 9052"plugin_fusion_maps")||d.data(this,"plugin_fusion_maps",new e(this,a))});return this}})(jQuery,window,document); 9053 9054 9055/** 9056 * WooCommerce Quanity buttons add-back 9057 */ 9058jQuery( function( $ ) { 9059 if( typeof js_local_vars.woocommerce_23 !== 'undefined' ) { 9060 var $testProp = $( 'div.quantity:not(.buttons_added), td.quantity:not(.buttons_added)' ).find('qty'); 9061 if ($testProp && $testProp.prop('type') != 'date') { 9062 // Quantity buttons 9063 $( 'div.quantity:not(.buttons_added), td.quantity:not(.buttons_added)' ).addClass( 'buttons_added' ).append( '<input type="button" value="+" class="plus" />' ).prepend( '<input type="button" value="-" class="minus" />' ); 9064 9065 // Target quantity inputs on product pages 9066 $( 'input.qty:not(.product-quantity input.qty)' ).each( function() { 9067 9068 var min = parseFloat( $( this ).attr( 'min' ) ); 9069 9070 if ( min && min > 0 && parseFloat( $( this ).val() ) < min ) { 9071 $( this ).val( min ); 9072 } 9073 }); 9074 9075 $( document ).on( 'click', '.plus, .minus', function() { 9076 9077 // Get values 9078 var $qty = $( this ).closest( '.quantity' ).find( '.qty' ), 9079 currentVal = parseFloat( $qty.val() ), 9080 max = parseFloat( $qty.attr( 'max' ) ), 9081 min = parseFloat( $qty.attr( 'min' ) ), 9082 step = $qty.attr( 'step' ); 9083 9084 // Format values 9085 if ( ! currentVal || currentVal === '' || currentVal === 'NaN' ) currentVal = 0; 9086 if ( max === '' || max === 'NaN' ) max = ''; 9087 if ( min === '' || min === 'NaN' ) min = 0; 9088 if ( step === 'any' || step === '' || step === undefined || parseFloat( step ) === 'NaN' ) step = 1; 9089 9090 // Change the value 9091 if ( $( this ).is( '.plus' ) ) { 9092 9093 if ( max && ( max == currentVal || currentVal > max ) ) { 9094 $qty.val( max ); 9095 } else { 9096 $qty.val( currentVal + parseFloat( step ) ); 9097 } 9098 9099 } else { 9100 9101 if ( min && ( min == currentVal || currentVal < min ) ) { 9102 $qty.val( min ); 9103 } else if ( currentVal > 0 ) { 9104 $qty.val( currentVal - parseFloat( step ) ); 9105 } 9106 9107 } 9108 9109 // Trigger change event 9110 $qty.trigger( 'change' ); 9111 }); 9112 } 9113 } 9114});
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.