1window.odometerOptions = { 2 auto: true, // Don't automatically initialize everything with class 'odometer' 3 selector: '.number.animated-element', // Change the selector used to automatically find things to be animated 4 format: '( ddd).dd', // Change how digit groups are formatted, and how many digits are shown after the decimal point 5 duration: 2000, // Change how long the javascript expects the CSS animation to take 6 theme: 'default', // Specify the theme (if you have more than one theme css file on the page) 7 animation: 'count' // Count is a simpler animation method which just increments the value, 8 // use it when you're looking for something more subtle. 9}; 10if(!Date.prototype.toISOString) 11{ 12 Date.prototype.toISOString = function() 13 { 14 function pad(n) {return n < 10 ? '0' + n : n} 15 return this.getUTCFullYear() + '-' 16 + pad(this.getUTCMonth() + 1) + '-' 17 + pad(this.getUTCDate()) + 'T' 18 + pad(this.getUTCHours()) + ':' 19 + pad(this.getUTCMinutes()) + ':' 20 + pad(this.getUTCSeconds()) + 'Z'; 21 }; 22} 23function getRandom(min,max) 24{ 25 return((Math.floor(Math.random()*(max-min)))+min); 26} 27var mc_id = 0; 28function mcUniqueId() 29{ 30 return mc_id++; 31} 32function onAfterSlide(obj) 33{ 34 var currentSlide = obj.items.visible; 35 var expando = jQuery(this).data("expando");//jQuery(this).get(0)[jQuery.expando]; 36 jQuery("#slider-navigation-" + expando + " .slider-control").addClass("inactive"); 37 jQuery("#" + jQuery(currentSlide).attr("id") + "-content").fadeIn(200, function(){ 38 jQuery("#slider-navigation-" + expando + " .slider-control").removeClass("inactive"); 39 }); 40} 41function onBeforeSlide(obj) 42{ 43 var prevSlide = obj.items.old; 44 var currentSlide = obj.items.visible; 45 var expando = jQuery(this).data("expando");//jQuery(this).get(0)[jQuery.expando]; 46 var elementClasses = jQuery(this).attr('class').split(' '); 47 var easing = "easeInOutQuint"; 48 var duration = 750; 49 for(var i=0; i<elementClasses.length; i++) 50 { 51 if(elementClasses[i].indexOf('easing-')!=-1) 52 easing = elementClasses[i].replace('easing-', ''); 53 if(elementClasses[i].indexOf('duration-')!=-1) 54 duration = elementClasses[i].replace('duration-', ''); 55 } 56 57 jQuery(".slider-" + expando + "-content-container .slider-content").fadeOut(200); 58 jQuery("#slider-navigation-" + expando + " .slider-control-bar").css("display", "none"); 59 var navigationWidth = jQuery("#slider-navigation-" + expando).width() ; 60 var currentNav = jQuery(jQuery("#" + jQuery(currentSlide).attr("id") + "-control")); 61 var prevNav = jQuery(jQuery("#" + jQuery(prevSlide).attr("id") + "-control")); 62 var currentMarginRight = navigationWidth - currentNav.position().left - currentNav.width(); 63 var prevMarginRight = navigationWidth - prevNav.position().left - prevNav.width(); 64 var margin_option_css, margin_option_animate; 65 if(config.is_rtl==1) { 66 margin_option_css = { 'margin-right' : prevMarginRight + "px" }; 67 margin_option_animate = { 'margin-right': currentMarginRight + "px" }; 68 } else { 69 margin_option_css = { 'margin-left' : prevNav.position().left + "px" }; 70 margin_option_animate = { 'margin-left': currentNav.position().left + "px" }; 71 } 72 73 jQuery("#slider-navigation-" + expando + " .slider-bar").css(jQuery.extend(margin_option_css,{"display": "block"})); 74 jQuery("#slider-navigation-" + expando + " .slider-bar").animate(margin_option_animate, 75 parseInt(duration), easing, function(){ 76 jQuery(this).css("display", "none"); 77 jQuery("#" + jQuery(currentSlide).attr("id") + "-control").children("#slider-navigation-" + expando + " .slider-control-bar").css("display", "block"); 78 }); 79} 80function pushState(event) 81{ 82 event.preventDefault(); 83 var History = window.History; 84 var url = jQuery(this).attr("href"); 85 if(typeof(url)!="undefined") 86 { 87 var hashSplit = url.split("#"); 88 if(event.data.action=="theme_doctors_pagination") 89 { 90 if(jQuery(this).parent().hasClass("selected")) 91 return false; 92 var container = jQuery(this).parent().parent().prev(); 93 if(typeof(container.attr("id"))=="undefined") 94 { 95 container.attr("id", "theme_doctors_pagination_" + mcUniqueId()/*container["context"][jQuery.expando]*/); 96 } 97 event.data.container_id = container.attr("id"); 98 jQuery(this).parent().parent().children(".selected").removeClass("selected"); 99 jQuery(this).parent().addClass("selected"); 100 } 101 else if(event.data.action=="theme_gallery_pagination") 102 { 103 if(jQuery(this).parent().hasClass("selected")) 104 return false;
105 var container = jQuery(this).parent().parent().prev(); 106 if(typeof(container.attr("id"))=="undefined") 107 { 108 container.attr("id", "theme_gallery_pagination_" + mcUniqueId()/*container["context"][jQuery.expando]*/); 109 } 110 event.data.container_id = container.attr("id"); 111 jQuery(this).parent().parent().children(".selected").removeClass("selected"); 112 jQuery(this).parent().addClass("selected"); 113 } 114 if(hashSplit.length==2) 115 { 116 event.data.hash = hashSplit[1]; 117 url = url.replace("#" + hashSplit[1], ""); 118 } 119 var title = ""; 120 if(history.pushState) 121 History.pushState(event.data, title, url); 122 else 123 History.pushState(event.data, title, url); 124 } 125}; 126var menu_position = null; 127var dragging = false; 128jQuery(document).ready(function($){ 129 var isSafari = !!navigator.userAgent.match(/Version\/[\d\.]+.*Safari/); 130 //mobile devices touchend fix 131 $("body").on("touchmove", function(){ 132 dragging = true; 133 }); 134 $("body").on("touchstart", function(){ 135 dragging = false; 136 }); 137 //home slider 138 $(".rev_slider, rs-module").each(function(){ 139 var self = $(this); 140 if(self.parent().parent().hasClass("mc-navigation")) 141 { 142 self.on("revolution.slide.onloaded", function(e){ 143 var sliderLength = self.revmaxslide(); 144 var parentUl = $(this).find("ul, rs-slides").first(); 145 if(parentUl.children().length>1) 146 { 147 var expando = mcUniqueId();//$(this).get(0)[jQuery.expando]; 148 self.data("expando", expando); 149 var sliderControl = $("<ul class='slider-navigation' id='slider-navigation-" + expando + "'>"); 150 sliderControl.append("<li class='slider-bar' style='width:" + (100/sliderLength) + "%;'></li>"); 151 parentUl.children().each(function(index){ 152 $(this).attr("id", "slide-" + expando + "-" + index); 153 sliderControl.append($("<li class='slider-control' style='width:" + (100/sliderLength) + "%;'><a id='" + $(this).attr("id") + "-control' href='#' title='" + (index+1) + "'><span class='top-border'></span><span class='slider-control-bar'></span>" + (index+1) + "</a></li>")); 154 }); 155 //var home_slider_widgets = $(this).parent().parent().parent().next(".for-home-slider"); 156 var closest_row = $(this).closest(".vc_row"); 157 var home_slider_widgets = closest_row.next(".vc_row").children().children().children(".for-home-slider").first(); 158 //var home_slider_widgets = $(".for-home-slider"); 159 if(home_slider_widgets.length) 160 { 161 home_slider_widgets.prepend(sliderControl); 162 } 163 else 164 { 165 closest_row.after('<div class="vc_row wpb_row vc_row-fluid"><div class="wpb_column vc_column_container vc_col-sm-12"><div class="wpb_wrapper"><div class="home-box-container-list for-home-slider no-widgets">' + sliderControl[0].outerHTML + '</div></div></div></div>'); 166 //$(this).closest(".wpb_wrapper").after(sliderControl); 167 } 168 169 $("#slider-navigation-" + expando + " .slider-control a").on("click", function(event){ 170 event.preventDefault(); 171 var self2 = $(this).parent(); 172 self.revshowslide($("#slider-navigation-" + expando + " .slider-control").index(self2)+1); 173 }); 174 } 175 }); 176 self.on("revolution.slide.onbeforeswap", function(e, data){ 177 var prevSlide = data.currentslide; 178 var currentSlide = data.nextslide; 179 var expando = self.data("expando");//$(this).get(0)[jQuery.expando]; 180 var easing = "easeInOutCubic"; 181 var duration = 750; 182 jQuery(".slider-" + expando + "-content-container .slider-content").fadeOut(200); 183 jQuery("#slider-navigation-" + expando + " .slider-control-bar").css("display", "none"); 184 var navigationWidth = jQuery("#slider-navigation-" + expando).width() ; 185 var currentNav = jQuery(jQuery("#" + jQuery(currentSlide).attr("id") + "-control")); 186 var prevNav = jQuery(jQuery("#" + jQuery(prevSlide).attr("id") + "-control")); 187 if(typeof(prevNav.position())!="undefined" && typeof(currentNav.position())!="undefined") 188 { 189 var currentMarginRight = navigationWidth - currentNav.position().left - currentNav.width(); 190 var prevMarginRight = navigationWidth - prevNav.position().left - prevNav.width(); 191 var margin_option_css, margin_option_animate; 192 if(config.is_rtl==1) 193 { 194 margin_option_css = { 'margin-right' : prevMarginRight + "px" }; 195 margin_option_animate = { 'margin-right': currentMarginRight + "px" }; 196 } 197 else 198 { 199 margin_option_css = { 'margin-left' : prevNav.position().left + "px" }; 200 margin_option_animate = { 'margin-left': currentNav.position().left + "px" }; 201 } 202 jQuery("#slider-navigation-" + expando + " .slider-bar").css(jQuery.extend(margin_option_css,{"dis
202play": "block"})); 203 jQuery("#slider-navigation-" + expando + " .slider-bar").animate(margin_option_animate, 204 parseInt(duration), easing, function(){ 205 jQuery(this).css("display", "none"); 206 jQuery("#" + jQuery(currentSlide).attr("id") + "-control").children("#slider-navigation-" + expando + " .slider-control-bar").css("display", "block"); 207 }); 208 } 209 }); 210 } 211 }); 212 //mobile menu 213 $(".mobile-menu-switch").on("click", function(event){ 214 event.preventDefault(); 215 if(!$(".mobile-menu-container nav.mobile-menu").is(":animated")) 216 { 217 $(this).toggleClass("mm-opened"); 218 if(!$(".mobile-menu").is(":visible")) 219 $(".mobile-menu-divider").css("display", "block"); 220 $(".mobile-menu-container nav.mobile-menu").slideToggle(200, function(){ 221 if(!$(".mobile-menu-container nav.mobile-menu").is(":visible")) 222 $(".mobile-menu-divider").css("display", "none"); 223 }); 224 } 225 }); 226 $(".collapsible-mobile-submenus .template-arrow-menu").on("click", function(event){ 227 event.preventDefault(); 228 $(this).next().slideToggle(300); 229 $(this).toggleClass("template-arrow-expanded"); 230 }); 231 232 //slider 233 $(".slider:not('.ui-slider,.form_field')").each(function(index){ 234 var autoplay = 0; 235 var pause_on_hover = 0; 236 var interval = 5000; 237 var effect = "scroll"; 238 var easing = "easeInOutQuint"; 239 var duration = 750; 240 var elementClasses = $(this).attr('class').split(' '); 241 for(var i=0; i<elementClasses.length; i++) 242 { 243 if(elementClasses[i].indexOf('autoplay-')!=-1) 244 autoplay = elementClasses[i].replace('autoplay-', ''); 245 if(elementClasses[i].indexOf('pause_on_hover-')!=-1) 246 pause_on_hover = elementClasses[i].replace('pause_on_hover-', ''); 247 if(elementClasses[i].indexOf('interval-')!=-1) 248 interval = elementClasses[i].replace('interval-', ''); 249 if(elementClasses[i].indexOf('effect-')!=-1) 250 effect = elementClasses[i].replace('effect-', ''); 251 if(elementClasses[i].indexOf('easing-')!=-1) 252 easing = elementClasses[i].replace('easing-', ''); 253 if(elementClasses[i].indexOf('duration-')!=-1) 254 duration = elementClasses[i].replace('duration-', ''); 255 /*if(elementClasses[i].indexOf('threshold-')!=-1) 256 var threshold = elementClasses[i].replace('threshold-', '');*/ 257 } 258 var carouselOptions = { 259 responsive: true, 260 prev: { 261 onAfter: onAfterSlide, 262 onBefore: onBeforeSlide, 263 fx: effect, 264 easing: easing, 265 duration: parseInt(duration) 266 }, 267 next: { 268 onAfter: onAfterSlide, 269 onBefore: onBeforeSlide, 270 fx: effect, 271 easing: easing, 272 duration: parseInt(duration) 273 }, 274 auto: { 275 onAfter: onAfterSlide, 276 onBefore: onBeforeSlide, 277 play: (parseInt(autoplay) ? true : false), 278 pauseDuration: parseInt(interval), 279 fx: effect, 280 easing: easing, 281 duration: parseInt(duration), 282 pauseOnHover: (parseInt(pause_on_hover) ? true : false) 283 } 284 }; 285 $(this).carouFredSel(carouselOptions, 286 { 287 wrapper: { 288 classname: "caroufredsel_wrapper caroufredsel_wrapper_slider" 289 } 290 }); 291 if($(this).children().length>1) { 292 $(this).sliderControl({ 293 appendTo: $(".slider-content-box"), 294 contentContainer: $(".slider-content-box") 295 }); 296 } 297 }); 298 /*$(".slider").carouFredSel({ 299 responsive: true, 300 prev: { 301 onAfter: onAfterSlide, 302 onBefore: onBeforeSlide, 303 easing: "easeInOutQuint", 304 duration: 750 305 }, 306 next: { 307 onAfter: onAfterSlide, 308 onBefore: onBeforeSlide, 309 easing: "easeInOutQuint", 310 duration: 750 311 }, 312 auto: { 313 play: true, 314 pauseDuration: 5000, 315 onAfter: onAfterSlide, 316 onBefore: onBeforeSlide, 317 easing: "easeInOutQuint", 318 duration: 750 319 } 320 }, 321 { 322 wrapper: { 323 classname: "caroufredsel_wrapper caroufredsel_wrapper_slider" 324 } 325 });*/ 326 327 //parallax 328 if(!navigator.userAgent.match(/(iPod|iPhone|iPad|Android)/)) 329 { 330 $(".moving-parallax").each(function(){ 331 $(this).parallax({ 332 speed: -50 333 }); 334 }); 335 } 336 else 337 $(".mc-parallax").addClass("attachment-scroll"); 338 339 //image carousel with preloader 340 var imageCarousel = function() 341 { 342 $(".image-carousel").each(function(index){ 343 $(this).addClass("mc-preloader_" + index); 344 $(".mc-preloader_" + index).before("<span class='mc-preloader'></span>"); 345 $(".mc-preloader_" + index).imagesLoaded(function(instance){ 346 $(".mc-preloader_" + index).prev(".mc-preloader").remove(); 347 $(".mc-preloader_" + index).fadeTo("slow", 1, function(){ 348 $(this).css("opacity", ""); 349 }); 350 //caroufred 351 var autoplay = 0; 352 var pause_on_hover = 0; 353 var scroll = 1; 354 var effect = "scroll"; 355 var easing = "easeInOutQuint"; 356 var duration = 750; 357 var elementClasses = $(".mc-preloader_" + index).attr('class').split(' '); 358 for(var i=0; i<elementClasses.length; i++) 359 { 360 if(elementClasses[i].indexOf('autoplay-')!=-1) 361 autoplay = elementClasses[i].replace('autoplay-', ''); 362 if(elementClasses[i].indexOf('pause_on_hover-')!=-1) 363 pause_on_hover = elementClasses[i].replace('pause_on_hover-', ''); 364 if(elementClasses[i].indexOf('scroll-')!=-1) 365 scroll = elementClasses[i].replace('scroll-', ''); 366 if(elementClasses[i].indexOf('effect-')!=-1) 367 effect = elementClasses[i].replace('effect-', ''); 368 if(elementClasses[i].indexOf('easing-')!=-1) 369 easing = elementClasses[i].replace('easing-', ''); 370 if(elementClasses[i].indexOf('duration-')!=-1) 371 duration = elementClasses[i].replace('duration-', ''); 372 /*if(elementClasses[i].indexOf('threshold-')!=-1) 373 var threshold = elementClasses[i].replace('threshold-', '');*/ 374 } 375 var carouselOptions = { 376 responsive: true, 377 prev: { 378 onAfter: onAfterSlide, 379 onBefore: onBeforeSlide, 380 items: parseInt(scroll), 381 fx: effect, 382 easing: easing, 383 duration: parseInt(duration) 384 }, 385 next: { 386 onAfter: onAfterSlide, 387 onBefore: onBeforeSlide, 388 items: parseInt(scroll), 389 fx: effect, 390 easing: easing, 391 duration: parseInt(duration) 392 }, 393 auto: { 394 onAfter: onAfterSlide, 395 onBefore: onBeforeSlide, 396 items: parseInt(scroll), 397 play: (parseInt(autoplay) ? true : false), 398 fx: effect, 399 easing: easing, 400 duration: parseInt(duration), 401 pauseOnHover: (parseInt(pause_on_hover) ? true : false) 402 } 403 }; 404 $(".mc-preloader_" + index).carouFredSel(carouselOptions); 405 /*$(".mc-preloader_" + index).carouFredSel({ 406 responsive: true, 407 prev: { 408 409 easing: "easeInOutQuint", 410 duration: 750 411 }, 412 next: { 413 414 easing: "easeInOutQuint", 415 duration: 750 416 }, 417 auto: { 418 play: false, 419 420 421 422 easing: "easeInOutQuint", 423 duration: 750 424 } 425 });*/ 426 if($(".mc-preloader_" + index).children().length>1) 427 { 428 $(".mc-preloader_" + index).sliderControl({ 429 appendTo: "", 430 contentContainer: "" 431 }); 432 } 433 $(".mc-preloader_" + index + " li img").css("display", "block"); 434 //$(".mc-preloader_" + index).trigger('configuration', ['debug', false, true]); //for width 435 $(".mc-preloader_" + index).trigger('configuration', ['debug', false, true]); //for width 436 $(window).trigger("resize"); 437 $(".mc-preloader_" + index).trigger('configuration', ['debug', false, true]); //for height 438 }); 439 }); 440 }; 441 imageCarousel(); 442 443 //preloader 444 var preloader = function() 445 { 446 $(".post-content a.post-image img, .services-list a>img, .mc-preload").each(function(){ 447 if(!$(this).data("loaded")) 448 { 449 imagesLoaded($(this)).on("progress", function(instance, image){ 450 $(image.img).data("loaded", true); 451 $(image.img).prev(".mc-preloader").remove(); 452 $(image.img).css("display", "block"); 453 $(image.img).parent().css("opacity", "0"); 454 $(image.img).parent().fadeTo("slow", 1, function(){ 455 $(this).css("opacity", ""); 456 }); 457 }); 458 } 459 }); 460 }; 461 preloader(); 462 463 464 /*$("ul.gallery-item-details-list").css({ 465 "height": 0, 466 "display": "none" 467 }); 468 $(".gallery-item-details-list li.gallery-item-details").css("display", "none");*/ 469 470 //horizontal carousel
471 $(".horizontal-carousel").each(function(index){ 472 $(this).addClass("mc-preloader-hr-carousel_" + index); 473 $(".mc-preloader-hr-carousel_" + index).before("<span class='mc-preloader'></span>"); 474 $(".mc-preloader-hr-carousel_" + index).imagesLoaded(function(instance){ 475 $(".mc-preloader-hr-carousel_" + index).prev(".mc-preloader").remove(); 476 $(".mc-preloader-hr-carousel_" + index).fadeTo("slow", 1, function(){ 477 $(this).css("opacity", ""); 478 }); 479 var elementClasses = $(".mc-preloader-hr-carousel_" + index).attr('class').split(' '); 480 for(var i=0; i<elementClasses.length; i++) 481 { 482 if(elementClasses[i].indexOf('id-')!=-1) 483 var id = elementClasses[i].replace('id-', ''); 484 if(elementClasses[i].indexOf('autoplay-')!=-1) 485 var autoplay = elementClasses[i].replace('autoplay-', ''); 486 if(elementClasses[i].indexOf('pause_on_hover-')!=-1) 487 var pause_on_hover = elementClasses[i].replace('pause_on_hover-', ''); 488 if(elementClasses[i].indexOf('scroll-')!=-1) 489 var scroll = elementClasses[i].replace('scroll-', ''); 490 if(elementClasses[i].indexOf('effect-')!=-1) 491 var effect = elementClasses[i].replace('effect-', ''); 492 if(elementClasses[i].indexOf('easing-')!=-1) 493 var easing = elementClasses[i].replace('easing-', ''); 494 if(elementClasses[i].indexOf('duration-')!=-1) 495 var duration = elementClasses[i].replace('duration-', ''); 496 /*if(elementClasses[i].indexOf('threshold-')!=-1) 497 var threshold = elementClasses[i].replace('threshold-', '');*/ 498 } 499 500 var self = $(".mc-preloader-hr-carousel_" + index); 501 var count = self.children().length; 502 503 var carouselOptions = { 504 direction: (config.is_rtl==1 ? "right" : "left"), 505 items: { 506 start: (config.is_rtl==1 ? count-($(".header").width()>750 ? (self.hasClass("testimonials") ? 2 : 4) : ($(".header").width()>462 ? (self.hasClass("testimonials") ? 2 : 3) : ($(".header").width()>300 ? (self.hasClass("testimonials") ? 1 : 2) : 1))) : 0), 507 visible: ($(".header").width()>750 ? (self.hasClass("testimonials") ? (self.hasClass("testimonials-full-width") ? 1 : 2) : (self.hasClass("gallery-3-columns") ? 3 : (self.hasClass("gallery-2-columns") ? 2: 4))) : ($(".header").width()>462 ? (self.hasClass("testimonials") || self.hasClass("gallery-2-columns") ? (self.hasClass("testimonials-full-width") ? 1 : 2) : 3) : ($(".header").width()>300 ? (self.hasClass("testimonials") ? 1 : 2) : 1))) 508 }, 509 prev: { 510 items: parseInt(scroll), 511 button: $('#' + id + '_prev'), 512 fx: effect, 513 easing: easing, 514 duration: parseInt(duration) 515 }, 516 next: { 517 items: parseInt(scroll), 518 button: $('#' + id + '_next'), 519 fx: effect, 520 easing: easing, 521 duration: parseInt(duration) 522 }, 523 auto: { 524 items: parseInt(scroll), 525 play: (parseInt(autoplay) ? true : false), 526 fx: effect, 527 easing: easing, 528 duration: parseInt(duration), 529 pauseOnHover: (parseInt(pause_on_hover) ? true : false) 530 } 531 }; 532 /*if(self.hasClass('ontouch') || self.hasClass('onmouse'))
533 carouselOptions.swipe = { 534 items: parseInt(scroll), 535 onTouch: (self.hasClass('ontouch') ? true : false), 536 onMouse: (self.hasClass('onmouse') ? true : false), 537 options: { 538 allowPageScroll: "none", 539 threshold: parseInt(threshold) 540 }, 541 fx: effect, 542 easing: easing, 543 duration: parseInt(duration) 544 };*/ 545 self.carouFredSel(carouselOptions, {wrapper: {classname: "caroufredsel_wrapper" + (self.hasClass("testimonials-full-width") ? " caroufredsel-wrapper-testimonials" : "") + (self.hasClass("grey") ? " grey" : "")}}); 546 if(self.hasClass("testimonials-bottom-controls")) 547 { 548 self.children().each(function(){ 549 $(this).css("width", self.parent().css("width")); 550 }); 551 } 552 //testimonials 553 if(self.hasClass("testimonials")) 554 { 555 setTimeout(function(){ 556 self.trigger("configuration", { 557 items: { 558 visible: (self.hasClass("testimonials-full-width") ? 1 : 2) 559 } 560 }); 561 }, 1000); 562 } 563 }); 564 }); 565 if($(".rev_slider_wrapper").length || $(".ls-wp-container").length) 566 { 567 var timer = 0; 568 if($(".rev_slider_wrapper").length) 569 timer = 100; 570 if($(".ls-wp-container").length) 571 timer = 1000; 572 var posInterval = setTimeout(function(){ 573 $(".home_box_container_list").css("position", "static"); 574 setTimeout(function(){ 575 $(".home_box_container_list").css("position", "relative"); 576 }, 100); 577 }, timer); 578 } 579 //counters 580 var counters = function() 581 { 582 $(".counters-group").each(function(){ 583 var topValue = 0, currentValue = 0; 584 var counterBoxes = $(this).find(".counter-box") 585 counterBoxes.each(function(index){ 586 var self = $(this); 587 if(self.find("[data-value]").length) 588 { 589 currentValue = parseInt(self.find("[data-value]").data("value").toString().replace(" ",""), 10); 590 if(currentValue>topValue) 591 topValue = currentValue; 592 } 593 }); 594 counterBoxes.each(function(index){ 595 var self = $(this); 596 currentValue = parseInt(self.find("[data-value]").data("value").toString().replace(" ",""), 10); 597 self.find(".counter-box-path").data("dashoffset", 415-(currentValue/topValue*415)); 598 }); 599 }); 600 $(".single-counter-box").each(function(){ 601 var value = $(this).find("[data-value]"); 602 if(value.length) 603 $(this).find(".ornament-container").css("width", "calc(" + value.data("value").toString().replace(" ","") + "%" + " - 10px)"); 604 }); 605 } 606 counters(); 607 $(".vc_label_units").each(function(){ 608 $(this).insertAfter($(this).parent().next()); 609 }); 610 611 //accordion 612 $(".accordion").each(function(){ 613 var active_tab = !isNaN(jQuery(this).data('active-tab')) && parseInt(j
613Query(this).data('active-tab')) > 0 ? parseInt(jQuery(this).data('active-tab'))-1 : false, 614 collapsible = (active_tab===false ? true : false); 615 $(this).accordion({ 616 event: 'change', 617 heightStyle: 'content', 618 icons: false, 619 active: active_tab, 620 collapsible: collapsible, 621 create: function(event, ui){ 622 $(window).trigger('resize'); 623 $(".image-carousel").trigger('configuration', ['debug', false, true]); 624 } 625 }); 626 /*if(!$(this).hasClass("accordion-active")) 627 { 628 $(this).accordion("option", "collapsible", true); 629 $(this).accordion("option", "active", false); 630 }*/ 631 }); 632 $(".accordion.scroll").on("accordionactivate", function(event, ui){ 633 if(typeof($("#"+$(ui.newHeader).attr("id")).offset())!="undefined") 634 { 635 var offsetFix = ($(".header-container.sticky").height()!=null ? $(".header-container.sticky").height()+10 : 10); 636 $("html, body").animate({scrollTop: $("#"+$(ui.newHeader).attr("id")).offset().top-offsetFix}, 400); 637 } 638 }); 639 $(".tabs.scroll").on("tabsbeforeactivate", function(event, ui){ 640 var offsetFix = ($(".header-container.sticky").height()!=null ? $(".header-container.sticky").height()+10 : 10); 641 $("html, body").animate({scrollTop: $("#"+$(ui.newTab).children("a").attr("id")).offset().top-offsetFix}, 400); 642 }); 643 $(".tabs").on("tabsactivate", function(event, ui){ 644 ui.newPanel.find(".image-carousel").trigger('configuration', ['debug', false, true]); 645 ui.newPanel.find(".image-carousel").trigger('configuration', ['debug', false, true]); 646 $(window).trigger("resize"); 647 }); 648 $(".vc_tta-tab").on("click", function(event){ 649 setTimeout(function(){ 650 $(window).trigger("resize"); 651 }, 1); 652 }); 653 $('.vc_tta-tab a, .vc_tta-panel .vc_tta-panel-title a').on('click', function(event){ 654 setTimeout(function(){ 655 $(window).trigger('resize'); 656 }, 657 1 658 ); 659 }); 660 $(".tabs").each(function(){ 661 var self = $(this); 662 self.tabs({ 663 event: 'change', 664 show: (self.hasClass("type-big") ? false : true), 665 create: function(){ 666 $("html, body").scrollTop(0); 667 if(self.hasClass("type-big")) 668 { 669 var tabsElements = self.children(":first").children(); 670 var tabsCount = tabsElements.length; 671 tabsElements.each(function(){ 672 $(this).css("width", (100/tabsCount) + "%"); 673 }); 674 } 675 } 676 }); 677 }); 678 679 //image controls 680 var imageControls = function() 681 { 682 var currentControls; 683 $(".gallery-box:not(.hover-icons-off)").on({ 684 mouseenter: function(){ 685 var width = $(this).find("img").first().width(); 686 var height = $(this).find("img").first().height(); 687 currentControls = $(this).find(".controls"); 688 if(typeof(currentControls)!="undefined") 689 { 690 var currentControlsWidth = currentControls.outerWidth(); 691 var currentControlsHeight = currentControls.outerHeight(); 692 currentControls.stop(); 693 if(config.is_rtl==1) { 694 margin_option = {"margin-right": (width/2-currentControlsWidth/2) + "px"}; 695 } else { 696 margin_option = {"margin-left": (width/2-currentControlsWidth/2) + "px"}; 697 } 698 currentControls.css(jQuery.extend(margin_option,{"display": "block","top": (height) + "px"})); 699 currentControls.animate({"top": (height/2-currentControlsHeight/2) + "px"},250,'easeInOutCubic'); 700 } 701 }, 702 mouseleave: function(){ 703 if(typeof(currentControls)!="undefined") 704 { 705 currentControls.stop(); 706 currentControls.css("display", "block"); 707 var height = $(this).find("img").first().height(); 708 currentControls.animate({"top": (height) + "px"},250,'easeInOutCubic', function(){ 709 $(this).css("display","none"); 710 }); 711 } 712 } 713 }); 714 715 $(".gallery-box.hover-icons-off").on("click touchend", function(event){ 716 if(dragging) 717 return; 718 var target = $(event.target); 719 if(target.is("[class*='social']")) 720 return; 721 var navigation = $(this).find('.slider-navigation a'); 722 var details = $(this).find('.open-details'); 723 var secondary; 724 if($(this).find('.image-carousel').length>0) { 725 secondary = $(this).find('.image-carousel>li:first-child .open-lightbox,.image-carousel>li:first-child .open-video-lightbox,.image-carousel>li:first-child .open-iframe-lightbox,.image-carousel>li:first-child .open-url-lightbox'); 726 } else { 727 secondary = $(this).find('.open-lightbox,.open-video-lightbox,.open-iframe-lightbox,.open-url-lightbox'); 728 } 729 730 if( !target.is(details) && 731 !target.is(secondary) && 732 !target.is(navigation) ) 733 { 734 if(details.attr('href')!==undefined) { 735 details[0].click(); 736 } else if(secondary.attr('href')!==undefined) { 737 secondary[0].click(); 738 } 739 } 740 }); 741 }; 742 imageControls(); 743 744 //browser history 745 $(".tabs .ui-tabs-nav a").on("click", function(){ 746 if($(this).attr("href").substr(0,4)!="http") 747 $.bbq.pushState($(this).attr("href")); 748 else 749 window.location.href = $(this).attr("href"); 750 }); 751 $(".ui-accordion .ui-accordion-header").on("click", function(){ 752 $.bbq.pushState("#" + $(this).attr("id").replace("accordion-", "")); 753 }); 754 755 //tabs box navigation 756 $(".tabs-box-navigation").mouseover(function(){ 757 $(this).find("ul").removeClass("tabs-box-navigation-hidden"); 758 }); 759 $(".tabs-box-navigation a").on("click", function(){ 760 $(".tabs-box-navigation-selected .selected").removeClass("selected"); 761 $(this).parent().addClass("selected"); 762 $(this).parent().parent().parent().children('span').text($(this).text()); 763 $(this).parent().parent().addClass("tabs-box-navigation-hidden"); 764 }); 765 $(".contact-form .tabs-box-navigation a").on("click", function(event){ 766 event.preventDefault(); 767 $(this).parent().parent().parent().children("[type='hidden']").first().val($.trim($(this).text())); 768 }); 769 770 //comments number scroll 771 $(".single .comments-number").on("click", function(event){ 772 event.preventDefault(); 773 var offset = $("#comments_list").offset(); 774 if(typeof(offset)!="undefined") 775 { 776 var offsetFix = ($(".header-container.sticky").height()!=null ? $(".header-container.sticky").height()+10 : 10); 777 $("html, body").animate({scrollTop: offset.top-offsetFix}, 400); 778 } 779 }); 780 781 //reply button scroll 782 $(".post-content .reply-button").on("click", function(event){ 783 event.preventDefault(); 784 var offset = $("#comment_form").offset(); 785 var offsetFix = ($(".header-container.sticky").height()!=null ? $(".header-container.sticky").height()+10 : 10); 786 $("html, body").animate({scrollTop: offset.top-offsetFix}, 400); 787 }); 788 789 //hashchange 790 $(window).on("hashchange", function(event){ 791 var hashSplit = $.param.fragment().split("-"); 792 var hashString = ""; 793 for(var i=0; i<hashSplit.length-1; i++)
794 hashString = hashString + hashSplit[i] + (i+1<hashSplit.length-1 ? "-" : ""); 795 if(hashSplit[0].substr(0,7)!="filter" && hashSplit[0].substr(0,4)!="page") 796 { 797 $('.ui-accordion .ui-accordion-header#accordion-' + decodeURIComponent($.param.fragment())).trigger("change"); 798 $(".tabs-box-navigation a[href='#" + decodeURIComponent($.param.fragment()) + "']").trigger("click"); 799 $('.ui-accordion .ui-accordion-header#accordion-' + decodeURIComponent(hashString)).trigger("change"); 800 } 801 $('.tabs .ui-tabs-nav [href="#' + decodeURIComponent(hashString) + '"]').trigger("change"); 802 $('.tabs .ui-tabs-nav [href="#' + decodeURIComponent($.param.fragment()) + '"]').trigger("change"); 803 if(hashSplit[0].substr(0,7)!="filter") 804 $('.tabs .ui-accordion .ui-accordion-header#accordion-' + decodeURIComponent($.param.fragment())).trigger("change"); 805 $(".isotope.mc-gallery:not('.horizontal-carousel, .no-isotope')").isotope('layout'); 806 $(".testimonials, .scrolling-list").trigger('configuration', ['debug', false, true]); 807 808 /*var maxHeight = Math.max.apply(null, $(".timetable:visible tr td:first-child").map(function () 809 { 810 return $(this).height(); 811 }).get()); 812 $(".timetable:visible tr td").css("height", maxHeight);*/ 813 //timetable height fix 814 /*$(".timetable .event").each(function(){ 815 if($(this).children(".event_container").length>1) 816 { 817 var childrenHeight = 0; 818 $(this).children(".event_container").not(":last").each(function(){ 819 childrenHeight += $(this).innerHeight(); 820 }); 821 var height = $(this).height()-childrenHeight-($(this).parent().parent().width()<=750 ? 9 : 22); 822 if(height>$(this).children(".event_container").last().height()) 823 $(this).children(".event_container").last().css("height", height + "px"); 824 } 825 });*/ 826 827 // get options object from hash 828 var hashOptions = $.deparam.fragment(); 829 if(hashSplit[0].substr(0,7)=="filter") 830 { 831 var filterClass = decodeURIComponent($.param.fragment()).substr(7, decodeURIComponent($.param.fragment()).length); 832 // apply options from hash 833 $(".isotope-filters a").removeClass("selected"); 834 if($('.isotope-filters a[href="#filter-' + filterClass + '"]').length) 835 $('.isotope-filters a[href="#filter-' + filterClass + '"]').addClass("selected"); 836 else 837 $(".isotope-filters li:first a").addClass("selected"); 838 839 $(".mc-gallery:not('.horizontal-carousel, .no-isotope')").isotope({filter: (filterClass!="*" ? "." : "") + filterClass, originLeft: (config.is_rtl===1 ? false : true)}); 840 //$(".timetable_isotope").isotope(hashOptions); 841 } 842 843 if(hashSplit[0].substr(0,7)=="comment") 844 { 845 if($(location.hash).length) 846 { 847 var offset = $(location.hash).offset(); 848 var offsetFix = ($(".header-container.sticky").height()!=null ? $(".header-container.sticky").height()+10 : 10); 849 $("html, body").animate({scrollTop: offset.top-offsetFix}, 400); 850 } 851 } 852 853 if(hashSplit[0]=="comments") 854 { 855 $(".single .comments-number").trigger("click"); 856 } 857 if(hashSplit[0]=="respond") 858 { 859 $(".post-content .reply-button").trigger("click"); 860 } 861 if(hashSplit[0].substr(0,4)=="page") 862 { 863 if(parseInt($("#comment_form [name='prevent_scroll']").val())==1) 864 { 865 $("#comment_form [name='prevent_scroll']").val(0); 866 $("#comment_form [name='paged']").val(parseInt(location.hash.substr(6))); 867 } 868 else 869 { 870 $.ajax({ 871 url: config.ajaxurl, 872 data: "action=theme_get_comments&post_id=" + $("#comment_form [name='post_id']").val() + "&post_type=" + $("#comment_form [name='post_type']").val() + "&paged="+parseInt(location.hash.substr(6)), 873 type: "get", 874 dataType: "json", 875 success: function(json){ 876 if(typeof(json.html)!="undefined") 877 $(".comments").html(json.html); 878 var hashSplit = location.hash.split("/"); 879 var offset = null; 880 if(hashSplit.length==2 && hashSplit[1]!="") 881 offset = $("#" + hashSplit[1]).offset(); 882 else 883 offset = $(".comments").offset(); 884 if(offset!=null) 885 { 886 var offsetFix = ($(".header-container.sticky").height()!=null ? $(".header-container.sticky").height()+10 : 10); 887 $("html, body").animate({scrollTop: offset.top-offsetFix}, 400); 888 } 889 $("#comment_form [name='paged']").val(parseInt(location.hash.substr(6))); 890 } 891 }); 892 return; 893 } 894 } 895 896 //open gallery details 897 if(location.hash.substr(1,21)=="gallery-details-close" || hashSplit[0].substr(0,7)=="filter") 898 { 899 $(".gallery-item-details-list").animate({height:'0'},{duration:200,easing:'easeOutQuint', complete:function(){ 900 $(this).css("display", "none") 901 $(".gallery-item-details-list .gallery-item-details").css("display", "none"); 902 } 903 }); 904 } 905 else if(location.hash.substr(1,15)=="gallery-details") 906 { 907 var detailsBlock = $('[id="' + location.hash.substr(1) + '"]'); 908 //var detailsBlock = $(location.hash); 909 $(".gallery-item-details-list .gallery-item-details").css("display", "none"); 910 detailsBlock.css("display", "block"); 911 var galleryItem = $('[id="gallery-item-' + location.hash.substr(17) + '"]'); 912 //var galleryItem = $("#gallery-item-" + location.hash.substr(17)); 913 //detailsBlock.find(".prev").attr("href", (galleryItem.prevAll(":not('.isotope-hidden')").first().length ? galleryItem.prevAll(":not('.isotope-hidden')").first().find(".open-details").attr("href") : $(".mc_gallery:not('.horizontal_carousel')").children(":not('.isotope-hidden')").last().find(".open-details").attr("href"))); 914 //detailsBlock.find(".next").attr("href", (galleryItem.nextAll(":not('.isotope-hidden')").first().length ? galleryItem.nextAll(":not('.isotope-hidden')").first().find(".open-details").attr("href") : $(".mc_gallery:not('.horizontal_carousel')").children(":not('.isotope-hidden')").first().find(".open-details").attr("href"))); 915 detailsBlock.find(".prev").attr("href", (galleryItem.prevAll(":not('.isotope-hidden')").first().length ? galleryItem.prevAll(":not('.isotope-hidden')").first().find(".open-details").attr("href") : galleryItem.parent().children(":not('.isotope-hidden')").last().find(".open-details").attr("href"))); 916 detailsBlock.find(".next").attr("href", (galleryItem.nextAll(":not('.isotope-hidden')").first().length ? galleryItem.nextAll(":not('.isotope-hidden')").first().find(".open-details").attr("href") : galleryItem.parent().children(":not('.isotope-hidden')").first().find(".open-details").attr("href"))); 917 var visible=parseInt($(".gallery-item-details-list").height())==0 ? false : true; 918 var galleryItemDetailsOffset; 919 if(!visible) 920 { 921 $(".gallery-item-details-list").css("display", "block").animate({height:detailsBlock.height()}, 500, 'easeOutQuint', function(){ 922 $(this).css("height", "100%"); 923 $(location.hash + " .image-carousel").trigger('configuration', ['debug', false, true]); 924 $(window).trigger("resize"); 925 }); 926 galleryItemDetailsOffset = $(".gallery-item-details-list").offset(); 927 if(typeof(galleryItemDetailsOffset)!="undefined") 928 { 929 var offsetFix = ($(".header-container.sticky").height()!=null ? $(".header-container.sticky").height()+10 : 10); 930 $("html, body").animate({scrollTop: galleryItemDetailsOffset.top-offsetFix}, 400); 931 } 932 } 933 else 934 {
935 /*$(".gallery-item-details-list").animate({height:'0'},{duration:200,easing:'easeOutQuint',complete:function() 936 { 937 $(this).css("display", "none")*/ 938 //$(".gallery-item-details-list").css("height", "100%"); 939 galleryItemDetailsOffset = $(".gallery-item-details-list").offset(); 940 if(typeof(galleryItemDetailsOffset)!="undefined") 941 { 942 var offsetFix = ($(".header-container.sticky").height()!=null ? $(".header-container.sticky").height()+10 : 10); 943 $("html, body").animate({scrollTop: galleryItemDetailsOffset.top-offsetFix}, 400); 944 } 945 $(location.hash + " .image-carousel").trigger('configuration', ['debug', false, true]); 946 $(window).trigger("resize"); 947 /*$(".gallery-item-details-list").css("display", "block").animate({height:detailsBlock.height()},{duration:500,easing:'easeOutQuint'}); 948 }});*/ 949 } 950 } 951 }).trigger("hashchange"); 952 953 //History 954 History.Adapter.bind(window,'statechange',function(){ 955 var state = History.getState(); 956 var stateSplit = state.url.replace(new RegExp(config.home_url, 'g'), "").split("/"); 957 stateSplit = $.grep(stateSplit,function(n){ 958 return(n); 959 }); 960 if(typeof(stateSplit)!="undefined") 961 var stateSplitLast = stateSplit[stateSplit.length-1]; 962 var data = state.data; 963 if(data.action=="theme_doctors_pagination") 964 { 965 data.paged = 1; 966 if(typeof(stateSplit)!="undefined" && parseInt(stateSplitLast)) 967 data.paged = parseInt(stateSplitLast); 968 data.atts = $("[name='theme_doctors_pagination']").val(); 969 $("#" + data.container_id).next().next(".mc-preloader").css("display", "block"); 970 } 971 else if(data.action=="theme_gallery_pagination") 972 { 973 data.paged = 1; 974 if(typeof(stateSplit)!="undefined" && parseInt(stateSplitLast)) 975 data.paged = parseInt(stateSplitLast); 976 data.atts = $("[name='theme_gallery_pagination']").val(); 977 $("#" + data.container_id).next().next(".mc-preloader").css("display", "block"); 978 } 979 $.ajax({ 980 url: config.ajaxurl, 981 type: 'get', 982 dataType: 'html', 983 data: data, 984 success: function(html){ 985 html = $.trim(html); 986 var indexStart = html.indexOf("theme_start")+11; 987 var indexEnd = html.indexOf("theme_end")-indexStart; 988 html = html.substr(indexStart, indexEnd); 989 $("#" + data.container_id).html(html); 990 $("#" + data.container_id).next().next(".mc-preloader").css("display", "none"); 991 $(".mc-gallery:not('.horizontal-carousel, .no-isotope')").each(function(){ 992 var self = $(this); 993 self.isotope({ 994 layoutMode: 'fitRows', 995 fitRows: { 996 gutter: ($(".mc-gallery:not('.horizontal-carousel, .no-isotope')").width()>462 ? 30 : 12) 997 } 998 /*masonry: { 999 //columnWidth: 225, 1000 gutter: ($(".mc-gallery:not('.horizontal-carousel, .no-isotope')").width()>462 ? 30 : 12) 1001 }, 1002 originLeft: (config.is_rtl===1 ? false : true)*/ 1003 }); 1004 // layout Isotope after each image loads 1005 self.imagesLoaded().always(function(){ 1006 setTimeout(function(){ 1007 self.isotope('layout'); 1008 }, 500); 1009 }); 1010 }); 1011 preloader(); 1012 imageControls(); 1013 imageCarousel(); 1014 var offsetFix = ($(".header-container.sticky").height()!=null ? $(".header-container.sticky").height()+10 : 10); 1015 $("html, body").animate({scrollTop: $("#" + data.container_id).offset().top-offsetFix}, 400); 1016 } 1017 }); 1018 }); 1019 //setTimeout(function(){History.Adapter.trigger(window,'statechange');},1); 1020 1021 //ajax pagination 1022 $(".pagination.ajax.theme_doctors_pagination a").on("click", {action: 'theme_doctors_pagination'}, pushState); 1023 $(".pagination.ajax.theme_gallery_pagination a").on("click", {action: 'theme_gallery_pagination'}, pushState); 1024 1025 //timeago 1026 //translation 1027 /*jQuery.timeago.settings.strings = { 1028 prefixAgo: null, 1029 prefixFromNow: null, 1030 suffixAgo: "ago", 1031 suffixFromNow: "from now", 1032 seconds: "less than a minute", 1033 minute: "about a minute", 1034 minutes: "%d minutes", 1035 hour: "about an hour", 1036 hours: "about %d hours", 1037 day: "a day", 1038 days: "%d days", 1039 month: "about a month", 1040 months: "%d months", 1041 year: "about a year", 1042 years: "%d years", 1043 wordSeparator: " ", 1044 numbers: [] 1045 };*/ 1046 //$("abbr.timeago").timeago(); 1047 1048 //footer recent posts, most commented, most viewed, scrolling list 1049 $(".latest-tweets, .footer-recent-posts, .most-commented, .most-viewed, .scrolling-list-0").carouFredSel({ 1050 direction: "up", 1051 scroll: { 1052 items: 1, 1053 easing: "swing", 1054 pauseOnHover: true, 1055 height: "variable" 1056 }, 1057 auto: { 1058 play: false 1059 }, 1060 prev: { 1061 button: function(){ 1062 return $(this).parent().parent().parent().find('.scrolling-list-control-left'); 1063 } 1064 }, 1065 next: { 1066 button: function(){ 1067 return $(this).parent().parent().parent().find('.scrolling-list-control-right'); 1068 } 1069 } 1070 }); 1071 $(".latest-tweets").trigger("configuration", { 1072 items: { 1073 visible: ($(".latest-tweets").children().length>1 ? 2 : $(".latest-tweets").children().length) 1074 } 1075 }); 1076 $(".footer-recent-posts").trigger("configuration", { 1077 items: { 1078 visible: ($(".footer-recent-posts").children().length>2 ? 3 : $(".footer-recent-posts").children().length) 1079 } 1080 }); 1081 $(".most-commented").trigger("configuration", { 1082 items: { 1083 visible: ($(".most-commented").children().length>2 ? 3 : $(".most-commented").children().length) 1084 } 1085 }); 1086 $(".most-viewed").trigger("configuration", { 1087 items: { 1088 visible: ($(".most-viewed").children().length>2 ? 3 : $(".most-viewed").children().length) 1089 } 1090 }); 1091 $(".scrolling-list-0").trigger("configuration", { 1092 items: { 1093 visible: ($(".scrolling-list-0").children().length>2 ? 3 : $(".scrolling-list-0").children().length) 1094 } 1095 }); 1096 1097 function windowResize() 1098 { 1099 if($(".mc-smart-column").length && $(".header").width()>462) 1100 { 1101 var topOfWindow = $(window).scrollTop(); 1102 $(".mc-smart-column").each(function(){ 1103 var row = $(this).parent(); 1104 var wrapper = $(this).children().first(); 1105 var childrenHeight = 0; 1106 wrapper.children().each(function(){ 1107 childrenHeight += $(this).outerHeight(true); 1108 }); 1109 if(childrenHeight<$(window).height() && row.offset().top-20<topOfWindow && row.offset().top-20+row.outerHeight()-childrenHeight>topOfWindow) 1110 { 1111 wrapper.css({"position": "fixed", "bottom": "auto", "top": "20px", "width": $(this).width() + "px"}); 1112 $(this).css({"height": childrenHeight+"px"}); 1113 } 1114 else if(childrenHeight<$(window).height() && row.offset().top-20+row.outerHeight()-childrenHeight<=topOfWindow && (row.outerHeight()-childrenHeight>0)) 1115 { 1116 wrapper.css({"position": "absolute", "bottom": "0", "top": (row.outerHeight()-childrenHeight) + "px", "width": "auto"}); 1117 $(this).css({"height": childrenHeight+"px"}); 1118 } 1119 else if(childrenHeight>=$(window).height() && row.offset().top+20+childrenHeight<topOfW
1119indow+$(window).height() && row.offset().top+20+row.outerHeight()>topOfWindow+$(window).height()) 1120 { 1121 wrapper.css({"position": "fixed", "bottom": "20px", "top": "auto", "width": $(this).width() + "px"}); 1122 $(this).css({"height": childrenHeight+"px"}); 1123 } 1124 else if(childrenHeight>=$(window).height() && row.offset().top+20+row.outerHeight()<=topOfWindow+$(window).height() && (row.outerHeight()-childrenHeight>0)) 1125 { 1126 wrapper.css({"position": "absolute", "bottom": "0", "top": (row.outerHeight()-childrenHeight) + "px", "width": "auto"}); 1127 $(this).css({"height": childrenHeight+"px"}); 1128 } 1129 else 1130 { 1131 wrapper.css({"position": "static", "bottom": "auto", "top": "auto", "width": "auto"}); 1132 $(this).css({"height": childrenHeight + "px"}); 1133 } 1134 }); 1135 } 1136 $(".horizontal-carousel").each(function(){ 1137 var self = $(this); 1138 self.trigger("configuration", { 1139 items: { 1140 visible: ($(".header").width()>750 ? (self.hasClass("testimonials") ? (self.hasClass("testimonials-full-width") ? 1 : 2) : (self.hasClass("gallery-3-columns") ? 3 : (self.hasClass("gallery-2-columns") ? 2: 4))) : ($(".header").width()>462 ? (self.hasClass("testimonials") || self.hasClass("gallery-2-columns") ? (self.hasClass("testimonials-full-width") ? 1 : 2) : 3) : ($(".header").width()>300 ? (self.hasClass("testimonials") ? 1 : 2) : 1))) 1141 } 1142 }); 1143 if(self.hasClass("testimonials-bottom-controls")) 1144 { 1145 self.children().each(function(){ 1146 $(this).css("width", self.parent().css("width")); 1147 }); 1148 } 1149 self.trigger('configuration', ['debug', false, true]); 1150 }); 1151 $(".training_classes").accordion("resize"); 1152 $(".slider:not('.ui-slider,.form_field')").trigger('configuration', ['debug', false, true]); 1153 setTimeout(function(){ 1154 $(".image-carousel").trigger('configuration', ['debug', false, true]); 1155 }, 1); 1156 $(".latest-tweets, .footer-recent-posts, .most-commented, .most-viewed, .scrolling-list-0").trigger('configuration', ['debug', false, true]); 1157 if($(".mc-gallery:not('.horizontal-carousel, .no-isotope')").length) 1158 { 1159 $(".mc-gallery:not('.horizontal-carousel, .no-isotope')").isotope({ 1160 layoutMode: 'fitRows', 1161 fitRows: { 1162 gutter: ($(".mc-gallery:not('.horizontal-carousel, .no-isotope')").width()>462 ? 30 : 12) 1163 } 1164 /*masonry: { 1165 //columnWidth: 225, 1166 gutter: ($(".mc-gallery:not('.horizontal-carousel, .no-isotope')").width()>462 ? 30 : 12) 1167 }, 1168 originLeft: (config.is_rtl===1 ? false : true)*/ 1169 }); 1170 } 1171 /*if($(".photostream").length) 1172 { 1173 $(".photostream").isotope({ 1174 masonry: { 1175 //columnWidth: 225, 1176 gutter: 10 1177 }, 1178 originLeft: (config.is_rtl===1 ? false : true) 1179 }); 1180 }*/ 1181 if($(".sticky").length) 1182 { 1183 if($(".header-container").hasClass("sticky")) 1184 menu_position = ($(".header-container.sticky").length>0 ? $(".header-container.sticky").offset().top : null ); 1185 var topOfWindow = $(window).scrollTop(); 1186 if(menu_position!=null && $(".header-container .sf-menu").is(":visible")) 1187 { 1188 if(menu_position<topOfWindow) 1189 { 1190 if(!$("#mc-sticky-clone").length) 1191 { 1192 $(".header-container").after($(".header-container").clone().attr("id", "mc-sticky-clone").addClass("move")); 1193 $(".header-container").addClass("transition"); 1194 setTimeout(function(){ 1195 $("#mc-sticky-clone").addClass("transition"); 1196 }, 1); 1197 } 1198 } 1199 else 1200 { 1201 $(".header-container").removeClass("transition"); 1202 $("#mc-sticky-clone").remove(); 1203 } 1204 } 1205 else 1206 $("#mc-sticky-clone").remove(); 1207 } 1208 /*var maxHeight = Math.max.apply(null, $(".timetable:visible tr td:first-child").map(function () 1209 { 1210 return $(this).height(); 1211 }).get()); 1212 $(".timetable:visible tr td").css("height", maxHeight);*/ 1213 //timetable height fix 1214 /*$(".timetable .event").each(function(){ 1215 if($(this).children(".event_container").length>1) 1216 { 1217 var childrenHeight = 0; 1218 $(this).children(".event_container").not(":last").each(function(){ 1219 childrenHeight += $(this).innerHeight(); 1220 }); 1221 var height = $(this).height()-childrenHeight-($(this).parent().parent().width()<=750 ? 9 : 22); 1222 if(height>
1222$(this).children(".event_container").last().height()) 1223 $(this).children(".event_container").last().css("height", height + "px"); 1224 } 1225 });*/ 1226 } 1227 //window resize 1228 $(window).resize(windowResize); 1229 window.addEventListener('orientationchange', windowResize); 1230 1231 //scroll top 1232 $("a[href='#top']").on("click", function() { 1233 $("html, body").animate({scrollTop: 0}, "slow"); 1234 return false; 1235 }); 1236 1237 //hint 1238 $(".search input[type='text'], .comment-form textarea").hint(); 1239 1240 /*var maxHeight = Math.max.apply(null, $(".timetable:visible tr td:first-child").map(function () 1241 { 1242 return $(this).height(); 1243 }).get()); 1244 $(".timetable:visible tr td").css("height", maxHeight);*/ 1245 //timetable height fix 1246 /*$(".timetable .event").each(function(){ 1247 if($(this).children(".event_container").length>1) 1248 { 1249 var childrenHeight = 0; 1250 $(this).children(".event_container").not(":last").each(function(){ 1251 childrenHeight += $(this).innerHeight(); 1252 }); 1253 var height = $(this).height()-childrenHeight-($(this).parent().parent().width()<=750 ? 9 : 22); 1254 if(height>$(this).children(".event_container").last().height()) 1255 $(this).children(".event_container").last().css("height", height + "px"); 1256 } 1257 });*/ 1258 1259 //tooltip 1260 $(".tooltip").on("mouseover click", function(){ 1261 var attachTo = $(this); 1262 if($(this).is(".event-container")) 1263 attachTo = $(this).parent(); 1264 var position = attachTo.position(); 1265 var tooltip_text = $(this).children(".tooltip-text"); 1266 tooltip_text.css("width", $(this).outerWidth() + "px"); 1267 tooltip_text.css("height", tooltip_text.height() + "px"); 1268 tooltip_text.css({"top": position.top-tooltip_text.innerHeight() + "px", "left": position.left + "px"}); 1269 }); 1270 1271 //isotope 1272 $(".mc-gallery:not('.horizontal-carousel, .no-isotope')").each(function(){ 1273 var self = $(this); 1274 self.isotope({ 1275 layoutMode: 'fitRows', 1276 fitRows: { 1277 gutter: ($(".mc-gallery:not('.horizontal-carousel, .no-isotope')").width()>462 ? 30 : 12) 1278 }, 1279 originLeft: (config.is_rtl===1 ? false : true) 1280 /*masonry: { 1281 //columnWidth: 225, 1282 gutter: ($(".mc-gallery:not('.horizontal-carousel, .no-isotope')").width()>462 ? 30 : 12) 1283 }, 1284 originLeft: (config.is_rtl===1 ? false : true)*/ 1285 }); 1286 // layout Isotope after each image loads 1287 self.imagesLoaded().always(function(){ 1288 setTimeout(function(){ 1289 self.isotope('layout'); 1290 }, 500); 1291 }); 1292 }); 1293 //photostream 1294 /*$(".photostream").isotope({ 1295 masonry: { 1296 //columnWidth: 225, 1297 gutter: 10 1298 }, 1299 originLeft: (config.is_rtl===1 ? false : true) 1300 }); 1301 //$(".timetable_isotope").isotope();*/ 1302 1303 //fancybox 1304 $(".mc-lightbox a, .fancybox, .fancybox-video, .fancybox-iframe").prettyPhoto({ 1305 slideshow: 3000, 1306 overlay_gallery: true, 1307 opacity: 0.7, 1308 social_tools: '', 1309 deeplinking: false, 1310 default_width: "800", 1311 default_height: "600" 1312 }); 1313 $(".fancybox[rel]").prettyPhoto({ 1314 show_title: false, 1315 slideshow: 3000, 1316 overlay_gallery: true, 1317 social_tools: '', 1318 deeplinking: false, 1319 }); 1320 /*$(".fancybox-video").each(function(){ 1321 var width = ($(this).attr("href").indexOf("vimeo")!=-1 ? 600 : 680); 1322 var height = ($(this).attr("href").indexOf("vimeo")!=-1 ? 338 : 495); 1323 $(this).prettyPhoto({ 1324 social_tools: '', 1325 default_width: width, 1326 default_height: height 1327 }); 1328 }); 1329 $(".fancybox-iframe").prettyPhoto({ 1330 social_tools: '', 1331 default_width: "75%", 1332 default_height: "75%" 1333 });*/ 1334 /*$(".fancybox:not(.noautoscale)").fancybox({ 1335 'titlePosition': 'inside', 1336 'speedIn': 600, 1337 'speedOut': 200, 1338 'transitionIn': 'elastic', 1339 'cyclic': 'true' 1340 }); 1341 $(".fancybox.noautoscale").fancybox({ 1342 'autoScale': false, 1343 'titlePosition': 'inside', 1344 'speedIn': 600, 1345 'speedOut': 200, 1346 'transitionIn': 'elastic', 1347 'cyclic': 'true' 1348 }); 1349 $(".fancybox-video").bind('click',function() 1350 { 1351 $.fancybox( 1352 { 1353 'autoScale':false, 1354 'titlePosition': 'inside', 1355 'title': this.title, 1356 'speedIn': 600, 1357 'speedOut': 200, 1358 'transitionIn': 'elastic', 1359 'width':(this.href.indexOf("vimeo")!=-1 ? 600 : 680), 1360 'height':(this.href.indexOf("vimeo")!=-1 ? 338 : 495), 1361 'href':(this.href.indexOf("vimeo")!=-1 ? this.href : this.href.replace(new RegExp("watch\\?v=", "i"), 'embed/')), 1362 'type':'iframe', 1363 'swf': 1364 { 1365 'wmode':'transparent', 1366 'allowfullscreen':'true' 1367 } 1368 }); 1369 return false;
1370 }); 1371 $(".fancybox-iframe").bind('click',function() 1372 { 1373 $.fancybox( 1374 { 1375 'autoScale' : false, 1376 'titlePosition': 'inside', 1377 'title': this.title, 1378 'speedIn': 600, 1379 'speedOut': 200, 1380 'transitionIn': 'elastic', 1381 'width' : '75%', 1382 'height' : '75%', 1383 'href': this.href, 1384 'type' : 'iframe' 1385 }); 1386 return false; 1387 });*/ 1388 1389 //comment form, contact form 1390 if($(".contact-form").length) 1391 $(".contact-form")[0].reset(); 1392 if($(".comment-form").length) 1393 $(".comment-form")[0].reset(); 1394 $(".comment-form:not('#commentform'), .contact-form").on("submit", function(event){ 1395 event.preventDefault(); 1396 var data = $(this).serializeArray(); 1397 var id = $(this).attr("id"); 1398 $("#"+id+" [type='checkbox']:not(:checked)").each(function(){ 1399 data.push({name: $(this).attr("name"), value: 0}); 1400 }); 1401 if(parseInt($("#"+id+" [name='first_name']").data("required"), 10)) 1402 data.push({name: 'first_name_required', value: 1}); 1403 if(parseInt($("#"+id+" [name='last_name']").data("required"), 10)) 1404 data.push({name: 'last_name_required', value: 1}); 1405 if(parseInt($("#"+id+" [name='date_of_birth']").data("required"), 10)) 1406 data.push({name: 'date_of_birth_required', value: 1}); 1407 if(parseInt($("#"+id+" [name='social_security_number']").data("required"), 10)) 1408 data.push({name: 'social_security_number_required', value: 1}); 1409 if(parseInt($("#"+id+" [name='phone_number']").data("required"), 10)) 1410 data.push({name: 'phone_number_required', value: 1}); 1411 if(parseInt($("#"+id+" [name='email']").data("required"), 10)) 1412 data.push({name: 'email_required', value: 1}); 1413 if(parseInt($("#"+id+" [name='message']").data("required"), 10)) 1414 data.push({name: 'message_required', value: 1}); 1415 $("#"+id+" .block").block({ 1416 message: false, 1417 overlayCSS: { 1418 opacity:'0.3', 1419 "backgroundColor": "#FFF" 1420 } 1421 }); 1422 $("#"+id+" [type='submit']").prop("disabled", true); 1423 $.ajax({ 1424 url: config.ajaxurl, 1425 data: data, 1426 type: "post", 1427 dataType: "json", 1428 success: function(json){ 1429 $("#"+id+" [name='submit'], #"+id+" [name='name'], #"+id+" [name='first_name'], #"+id+" [name='last_name'], #"+id+" [name='date_of_birth'], #"+id+" [name='email'], #"+id+" [name='phone_number'], #"+id+" [name='social_security_number'], #"+id+" [name='message'], #"+id+" .g-recaptcha, #"+id+"terms").qtip('destroy'); 1430 if(typeof(json.isOk)!="undefined" && json.isOk) 1431 { 1432 if(typeof(json.submit_message)!="undefined" && json.submit_message!="") 1433 { 1434 $("#"+id+" [name='submit']").qtip( 1435 { 1436 style: { 1437 classes: 'ui-tooltip-success' 1438 }, 1439 content: { 1440 text: json.submit_message 1441 }, 1442 hide: false, 1443 position: { 1444 my: "right center", 1445 at: "left center" 1446 } 1447 }).qtip('show'); 1448 //close tooltip after 5 sec 1449 /*setTimeout(function(){ 1450 $("#"+id+" [name='submit']").qtip("api").hide(); 1451 }, 5000);*/ 1452 if(id=="comment_form" && typeof(json.html)!="undefined") 1453 { 1454 $(".comments").addClass("page-margin-top").html(json.html); 1455 $("#comment_form [name='comment_parent_id']").val(0); 1456 if(typeof(json.comment_id)!="undefined") 1457 { 1458 var offset = $("#comment-" + json.comment_id).offset(); 1459 if(typeof(offset)!="undefined") 1460 { 1461 var offsetFix = ($(".header-container.sticky").height()!=null ? $(".header-container.sticky").height()+10 : 10); 1462 $("html, body").animate({scrollTop: offset.top-offsetFix}, 400); 1463 } 1464 if(typeof(json.change_url)!="undefined" && $.param.fragment()!=json.change_url.replace("#", "")) 1465 $("#comment_form [name='prevent_scroll']").val(1); 1466 } 1467 if(typeof(json.change_url)!="undefined" && $.param.fragment()!=json.change_url.replace("#", "")) 1468 $.bbq.pushState(json.change_url); 1469 //window.location.href = json.change_url; 1470 } 1471 $("#"+id)[0].reset(); 1472 if(typeof(grecaptcha)!="undefined") 1473 grecaptcha.reset(); 1474 $("#cancel_comment").css("display", "none"); 1475 $(".contact-form [name='department']").val(""); 1476 $(".contact-form .tabs-box-navigation-selected>span").text($(".contact-form #department_select_box_title").val()!="" ? $(".contact-form #department_select_box_title").val() : "Select Department"); 1477 } 1478 } 1479 else 1480 { 1481 if(typeof(json.submit_message)!="undefined" && json.submit_message!="") 1482 { 1483 $("#"+id+" [name='submit']").qtip( 1484 { 1485 style: { 1486 classes: 'ui-tooltip-error' 1487 }, 1488 content: { 1489 text: json.submit_message 1490 }, 1491 position: { 1492 my: "right center", 1493 at: "left center" 1494 } 1495 }).qtip('show'); 1496 if(typeof(grecaptcha)!="undefined" && grecaptcha.getResponse()!="") 1497 grecaptcha.reset(); 1498 } 1499 if(typeof(json.error_name)!="undefined" && json.error_name!="") 1500 { 1501 $("#"+id+" [name='name']").qtip( 1502 { 1503 style: { 1504 classes: 'ui-tooltip-error' 1505 }, 1506 content: { 1507 text: json.error_name 1508 }, 1509 position: { 1510 my: "bottom center", 1511 at: "top center" 1512 } 1513 }).qtip('show'); 1514 } 1515 if(typeof(json.error_first_name)!="undefined" && json.error_first_name!="") 1516 { 1517 $("#"+id+" [name='first_name']").qtip( 1518 { 1519 style: { 1520 classes: 'ui-tooltip-error' 1521 }, 1522 content: { 1523 text: json.error_first_name 1524 }, 1525 position: { 1526 my: "bottom center", 1527 at: "top center" 1528 } 1529 }).qtip('show'); 1530 } 1531 if(typeof(json.error_last_name)!="undefined" && json.error_last_name!="") 1532 { 1533 $("#"+id+" [name='last_name']").qtip( 1534 { 1535 style: { 1536 classes: 'ui-tooltip-error' 1537 }, 1538 content: { 1539 text: json.error_last_name 1540 }, 1541 position: { 1542 my: "bottom center", 1543 at: "top center" 1544 } 1545 }).qtip('show'); 1546 } 1547 if(typeof(json.error_date_of_birth)!="undefined" && json.error_date_of_birth!="") 1548 { 1549 $("#"+id+" [name='date_of_birth']").qtip( 1550 { 1551 style: { 1552 classes: 'ui-tooltip-error' 1553 }, 1554 content: { 1555 text: json.error_date_of_birth 1556 }, 1557 position: { 1558 my: "bottom center", 1559 at: "top center" 1560 } 1561 }).qtip('show'); 1562 } 1563 if(typeof(json.error_phone_number)!="undefined" && json.error_phone_number!="") 1564 { 1565 $("#"+id+" [name='phone_number']").qtip( 1566 { 1567 style: { 1568 classes: 'ui-tooltip-error' 1569 }, 1570 content: { 1571 text: json.error_phone_number 1572 }, 1573 position: { 1574 my: "bottom center", 1575 at: "top center" 1576 } 1577 }).qtip('show'); 1578 } 1579 if(typeof(json.error_social_security_number)!="undefined" && json.error_social_security_number!="") 1580 { 1581 $("#"+id+" [name='social_security_number']").qtip( 1582 { 1583 style: { 1584 classes: 'ui-tooltip-error' 1585 }, 1586 content: { 1587 text: json.error_social_security_number 1588 }, 1589 position: { 1590 my: "bottom center", 1591 at: "top center" 1592 } 1593 }).qtip('show'); 1594 } 1595 if(typeof(json.error_email)!="undefined" && json.error_email!="") 1596 { 1597 $("#"+id+" [name='email']").qtip( 1598 { 1599 style: { 1600 classes: 'ui-tooltip-error' 1601 }, 1602 content: { 1603 text: json.error_email 1604 }, 1605 position: { 1606 my: "bottom center", 1607 at: "top center" 1608 } 1609 }).qtip('show'); 1610 } 1611 if(typeof(json.error_message)!="undefined" && json.error_message!="") 1612 { 1613 $("#"+id+" [name='message']").qtip( 1614 { 1615 style: { 1616 classes: 'ui-tooltip-error' 1617 }, 1618 content: { 1619 text: json.error_message 1620 }, 1621 position: { 1622 my: "bottom center", 1623 at: "top center" 1624 } 1625 }).qtip('show'); 1626 } 1627 if(typeof(json.error_captcha)!="undefined" && json.error_captcha!="") 1628 { 1629 $("#"+id+" .g-recaptcha").qtip( 1630 { 1631 style: { 1632 classes: 'ui-tooltip-error' 1633 }, 1634 content: { 1635 text: json.error_captcha 1636 }, 1637 position: { 1638 my: "bottom left", 1639 at: "top left" 1640 } 1641 }).qtip('show'); 1642 } 1643 if(typeof(json.error_terms)!="undefined" && json.error_terms!="") 1644 { 1645 $("#"+id+"terms").qtip( 1646 { 1647 style: { 1648 classes: 'ui-tooltip-error' 1649 }, 1650 content: { 1651 text: json.error_terms 1652 }, 1653 position: { 1654 my: (config.is_rtl ? "bottom right" : "bottom left"), 1655 at: (config.is_rtl ? "top right" : "top left") 1656 } 1657 }).qtip('show'); 1658 } 1659 } 1660 $("#"+id+" .block").unblock(); 1661 $("#"+id+" [type='submit']").prop("disabled", false); 1662 } 1663 }); 1664 }); 1665 $(document.body).on("click", ".comments .reply-button", function(event){ 1666 event.preventDefault(); 1667 var offset = $("#comment_form").offset(); 1668 var offsetFix = ($(".header-container.sticky").height()!=null ? $(".header-container.sticky").height()+10 : 10); 1669 $("html, body").animate({scrollTop: offset.top-offsetFix}, 400); 1670 $("#comment_form [name='comment_parent_id']").val($(this).attr("href").substr(1)); 1671 $("#cancel_comment").css('display', 'block'); 1672 }); 1673 $(document.body).on("click", "#cancel_comment", function(event){ 1674 event.preventDefault(); 1675 $(this).css('display', 'none'); 1676 $("#comment_form [name='comment_parent_id']").val(0); 1677 }); 1678 var endYear = new Date().getFullYear(); 1679 var startYear = endYear-120; 1680 /*$.datepicker.regional['nl'] = {clearText: 'Effacer', clearStatus: '', 1681 closeText: 'sluiten', closeStatus: 'Onveranderd sluiten ', 1682 prevText: '<vorige', prevStatus: 'Zie de vorige maand', 1683 nextText: 'volgende>', nextStatus: 'Zie de volgende maand', 1684 currentText: 'Huidige', currentStatus: 'Bekijk de huidige maand', 1685 monthNames: ['januari','februari','maart','april','mei','juni', 1686 'juli','augustus','september','oktober','november','december'], 1687 monthNamesShort: ['jan','feb','mrt','apr','mei','jun', 1688 'jul','aug','sep','okt','nov','dec'], 1689 monthStatus: 'Bekijk een andere maand', yearStatus: 'Bekijk nog een jaar', 1690 weekHeader: 'Sm', weekStatus: '', 1691 dayNames: ['zondag','maandag','dinsdag','woensdag','donderdag','vr
1691ijdag','zaterdag'], 1692 dayNamesShort: ['zo', 'ma','di','wo','do','vr','za'], 1693 dayNamesMin: ['zo', 'ma','di','wo','do','vr','za'], 1694 dayStatus: 'Gebruik DD als de eerste dag van de week', dateStatus: 'Kies DD, MM d', 1695 dateFormat: 'dd/mm/yy', firstDay: 1, 1696 initStatus: 'Kies een datum', isRTL: false}; 1697 $.datepicker.setDefaults($.datepicker.regional['nl']);*/ 1698 $(".contact-form [name='date_of_birth']").datepicker({ 1699 dateFormat: "DD, d MM yy", 1700 nextText: "", 1701 prevText: "", 1702 changeYear: true, 1703 yearRange: startYear + ":" + endYear 1704 }); 1705 $(".closing-in").each(function(){ 1706 var self = $(this); 1707 var time = parseInt(self.children(".seconds").text()); 1708 var id = setInterval(function(){ 1709 time--; 1710 self.children(".seconds").text(time); 1711 if(time==0) 1712 { 1713 self.parent().prev(".notification-box").fadeOut(500, function(){ 1714 $(this).remove(); 1715 }); 1716 self.remove(); 1717 clearInterval(id); 1718 } 1719 }, 1000); 1720 }); 1721 $(".notification-box .nb-close").on("click", function(event){ 1722 event.preventDefault(); 1723 var self = $(this).parent(); 1724 if(self.next().hasClass("closing-in-container")) 1725 self.next().remove(); 1726 self.fadeOut(500, function(){ 1727 $(this).remove(); 1728 }); 1729 }); 1730 if($(".header-container").hasClass("sticky")) 1731 menu_position = ($(".header-container.sticky").length>0 ? $(".header-container.sticky").offset().top : null ); 1732 function animateElements() 1733 { 1734 $('.animated-element, .sticky, .mc-smart-column, .has-counter-box-path').each(function(){ 1735 var elementPos = $(this).offset().top; 1736 var topOfWindow = $(window).scrollTop(); 1737 var animationStart = (typeof($(this).data("animation-start"))!="undefined" ? parseInt($(this).data("animation-start"), 10) : 0); 1738 if($(this).hasClass("mc-smart-column")) 1739 { 1740 var row = $(this).parent(); 1741 var wrapper = $(this).children().first(); 1742 var childrenHeight = 0; 1743 wrapper.children().each(function(){ 1744 childrenHeight += $(this).outerHeight(true); 1745 }); 1746 if(childrenHeight<$(window).height() && row.offset().top-20<topOfWindow && row.offset().top-20+row.outerHeight()-childrenHeight>topOfWindow) 1747 { 1748 wrapper.css({"position": "fixed", "bottom": "auto", "top": "20px", "width": $(this).width() + "px"}); 1749 $(this).css({"height": childrenHeight+"px"}); 1750 } 1751 else if(childrenHeight<$(window).height() && row.offset().top-20+row.outerHeight()-childrenHeight<=topOfWindow && (row.outerHeight()-childrenHeight>0)) 1752 { 1753 wrapper.css({"position": "absolute", "bottom": "0", "top": (row.outerHeight()-childrenHeight) + "px", "width": "auto"}); 1754 $(this).css({"height": childrenHeight+"px"}); 1755 } 1756 else if(childrenHeight>=$(window).height() && row.offset().top+20+childrenHeight<topOfWindow+$(window).height() && row.offset().top+20+row.outerHeight()>topOfWindow+$(window).height()) 1757 { 1758 wrapper.css({"position": "fixed", "bottom": "20px", "top": "auto", "width": $(this).width() + "px"}); 1759 $(this).css({"height": childrenHeight+"px"}); 1760 } 1761 else if(childrenHeight>=$(window).height() && row.offset().top+20+row.outerHeight()<=topOfWindow+$(window).height() && (row.outerHeight()-childrenHeight>0)) 1762 { 1763 wrapper.css({"position": "absolute", "bottom": "0", "top": (row.outerHeight()-childrenHeight) + "px", "width": "auto"}); 1764 $(this).css({"height": childrenHeight+"px"}); 1765 } 1766 else 1767 { 1768 wrapper.css({"position": "static", "bottom": "auto", "top": "auto", "width": "auto"}); 1769 1770 } 1771 } 1772 else if($(this).hasClass("sticky")) 1773 { 1774 if(menu_position!=null && $(".header-container .sf-menu").is(":visible")) 1775 { 1776 if(menu_position<topOfWindow) 1777 { 1778 //$(this).addClass("move"); 1779 if(!$("#mc-sticky-clone").length) 1780 { 1781 $(this).after($(this).clone().attr("id", "mc-sticky-clone").addClass("move")); 1782 $(this).addClass("transition"); 1783 setTimeout(function(){ 1784 $("#mc-sticky-clone").addClass("transition"); 1785 }, 1); 1786 } 1787 1788 } 1789 else 1790 { 1791 //$(this).removeClass("move"); 1792 $(this).removeClass("transition"); 1793 $("#mc-sticky-clone").remove(); 1794 } 1795 } 1796 } 1797 else if(elementPos<topOfWindow+$(window).height()-20-animationStart) 1798 { 1799 if($(this).hasClass("number") && !$(this).hasClass("progress") && $(this).is(":visible")) 1800 { 1801 var self = $(this); 1802 self.addClass("progress"); 1803 if(typeof(self.data("value"))!="undefined") 1804 { 1805 var value = parseFloat(self.data("value").toString().replace(" ","")); 1806 self.text(0); 1807 self.text(value); 1808 } 1809 } 1810 else if(($(this).hasClass("counter-box-path") || (isSafari && $(this).hasClass("has-counter-box-path"))) && !$(this).hasClass("progress") && $(this).is(":visible")) 1811 { 1812 var self = (isSafari ? $(this).children("svg").children().first() : $(this)); 1813 self.addClass("progress"); 1814 var dashoffset = self.data("dashoffset"); 1815 var duration = (typeof(self.data("duration"))!="undefined" ? self.data("duration") : 2000); 1816 self.animate({ 1817 "stroke-dashoffset": dashoffset 1818 }, duration, "easeInOutQuad"); 1819 } 1820 else if(!$(this).hasClass("progress")) 1821 { 1822 var elementClasses = $(this).attr('class').split(' '); 1823 var animation = "fadeIn"; 1824 var duration = 600;
1825 var delay = 0; 1826 if($(this).hasClass("scroll-top")) 1827 { 1828 var height = ($(window).height()>$(document).height()/2 ? $(window).height()/2 : $(document).height()/2); 1829 if(topOfWindow+80<height) 1830 { 1831 if($(this).hasClass("fadeIn") || $(this).hasClass("fadeOut")) 1832 animation = "fadeOut"; 1833 else 1834 animation = ""; 1835 $(this).removeClass("fadeIn") 1836 } 1837 else 1838 $(this).removeClass("fadeOut") 1839 } 1840 for(var i=0; i<elementClasses.length; i++) 1841 { 1842 if(elementClasses[i].indexOf('animation-')!=-1) 1843 animation = elementClasses[i].replace('animation-', ''); 1844 if(elementClasses[i].indexOf('duration-')!=-1) 1845 duration = elementClasses[i].replace('duration-', ''); 1846 if(elementClasses[i].indexOf('delay-')!=-1) 1847 delay = elementClasses[i].replace('delay-', ''); 1848 } 1849 $(this).addClass(animation); 1850 $(this).css({"animation-duration": duration + "ms"}); 1851 $(this).css({"animation-delay": delay + "ms"}); 1852 $(this).css({"transition-delay": delay + "ms"}); 1853 } 1854 } 1855 }); 1856 $('.box-header.animation-slide, .woocommerce .box-header').each(function(){ 1857 var elementPos = $(this).offset().top; 1858 var topOfWindow = $(window).scrollTop(); 1859 if(elementPos<topOfWindow+$(window).height()-30) 1860 { 1861 $(this).addClass("slide"); 1862 } 1863 }); 1864 } 1865 setTimeout(animateElements, 1); 1866 $(window).scroll(animateElements); 1867 1868 function refreshGoogleMap() 1869 { 1870 if(typeof(theme_google_maps)!="undefined") 1871 { 1872 theme_google_maps.forEach(function(elem){ 1873 google.maps.event.trigger(elem.map, "resize"); 1874 elem.map.setCenter(elem.coordinate); 1875 elem.map.setZoom(elem.map.getZoom()); 1876 }); 1877 } 1878 } 1879 refreshGoogleMap(); 1880 $(".accordion").on("accordionactivate", function(event, ui){ 1881 refreshGoogleMap(); 1882 }); 1883 $(".tabs").on("tabsbeforeactivate", function(event, ui){ 1884 refreshGoogleMap(); 1885 }); 1886 if(isSafari) 1887 { 1888 var observer = new MutationObserver(function(mutations){ 1889 mutations.forEach(function(mutationRecord){ 1890 var intervalCounter = 0; 1891 var progressBarInterval = setInterval(function(){ 1892 $(mutationRecord.target).next().css("max-width", (100+intervalCounter) + "%"); 1893 intervalCounter++; 1894 if(intervalCounter>1500) 1895 { 1896 clearInterval(progressBarInterval); 1897 $(mutationRecord.target).next().css("max-width", "none"); 1898 } 1899 }, 1); 1900 }); 1901 }); 1902 $(".vc_progress_bar .vc_bar").each(function(){ 1903 var target = $(this)[0]; 1904 observer.observe(target, {attributes: true, attributeFilter: ['style']}); 1905 }); 1906 } 1907 //woocommerce 1908 $(".woocommerce .quantity .plus").on("click", function(){ 1909 var input = $(this).prev(); 1910 input.val(parseInt(input.val())+1); 1911 $("input[name='update_cart']").removeAttr("disabled"); 1912 }); 1913 $(".woocommerce .quantity .minus").on("click", function(){ 1914 var input = $(this).next(); 1915 input.val((parseInt(input.val())-1>0 ? parseInt(input.val())-1 : 0)); 1916 $("input[name='update_cart']").removeAttr("disabled"); 1917 }); 1918 $(document.body).on("updated_cart_totals", function(){ 1919 $(".woocommerce .quantity .plus").off("click"); 1920 $(".woocommerce .quantity .plus").on("click", function(){ 1921 var input = $(this).prev(); 1922 input.val(parseInt(input.val())+1); 1923 $("input[name='update_cart']").removeAttr("disabled"); 1924 }); 1925 $(".woocommerce .quantity .minus").off("click"); 1926 $(".woocommerce .quantity .minus").on("click", function(){ 1927 var input = $(this).next(); 1928 input.val((parseInt(input.val())-1>0 ? parseInt(input.val())-1 : 0)); 1929 $("input[name='update_cart']").removeAttr("disabled"); 1930 }); 1931 var sum = 0; 1932 $(".shop_table.cart .input-text.qty.text").each(function(){ 1933 sum += parseInt($(this).val()); 1934 }); 1935 if(sum>0) 1936 $(".cart-items-number").html(sum).removeClass("cart-empty"); 1937 }); 1938 $(document.body).on("added_to_cart", function(event, data){ 1939 var sum = 0; 1940 $(data["div.widget_shopping_cart_content"]).find(".quantity").each(function(){ 1941 sum += parseInt($(this).html()); 1942 }); 1943 if(sum>0) 1944 $(".cart-items-number").html(sum).removeClass("cart-empty"); 1945 }); 1946});
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.