1/* this prevents dom flickering, needs to be outside of dom.ready event: */ 2document.documentElement.className += ' js_active '; 3/*end dom flickering =) */ 4 5//global path: avia_framework_globals.installedAt 6 7jQuery.noConflict(); 8jQuery(document).ready(function(){ 9 10 //activates the prettyphoto lightbox 11 if(jQuery.fn.avia_activate_lightbox) 12 jQuery('body').avia_activate_lightbox(); 13 14 //activates the hover effect for image links 15 if(jQuery.fn.avia_activate_hover_effect) 16 jQuery('#main, #header').avia_activate_hover_effect(); 17 18 // enhances contact form with ajax capabilities 19 if(jQuery.fn.kriesi_ajax_form) 20 jQuery('.ajax_form').kriesi_ajax_form(); 21 22 //smooth scrooling 23 if(jQuery.fn.avia_smoothscroll) 24 jQuery('a[href*="#"]').avia_smoothscroll(); 25 26 //activates the shortcode content slider 27 if(jQuery.fn.avia_sc_slider) 28 jQuery(".content_slider").avia_sc_slider({appendControlls:{}}); 29 30 //activates the toggle shortcode 31 if(jQuery.fn.avia_sc_toggle) 32 jQuery('.togglecontainer').avia_sc_toggle(); 33 34 //activates the tabs shortcode 35 if(jQuery.fn.avia_sc_tabs) 36 jQuery('.tabcontainer').avia_sc_tabs(); 37 38 //activate html5 flare video player 39 if(jQuery.fn.avia_video_activation) 40 jQuery(".avia_video").avia_video_activation({ratio:'16:9'}); 41 42 //activates the mega menu javascript 43 if(jQuery.fn.avia_menu_helper) 44 jQuery(".main_menu .menu").avia_menu_helper({modify_position:true}); 45 46 avia_cufon_helper('h1, h2, h3, h4, h5, h6, .menu li a strong'); 47 48 49 50 // default fade slider 51 if(jQuery.fn.avia_fade_slider) 52 jQuery(".slideshow").avia_fade_slider(); 53 54 55 // default fade slider 56 if(jQuery.fn.avia_fullscreen_slider) 57 jQuery(".avia_fullscreen_slider").avia_fullscreen_slider(); 58 59 60 61 // improves comment forms 62 if(jQuery.fn.kriesi_empty_input) 63 jQuery('input:text').kriesi_empty_input(); 64 65 66 //activate tooltips for social icons 67 if(jQuery.fn.avia_static_tooltips) 68 { 69 jQuery(".fullscreen_thumb").avia_static_tooltips(); 70 jQuery(".attached_images .avia_embed_image").avia_static_tooltips({container:false, vertical_center: true}); 71 72 //tooltips for 3 column gallery, currently deactivated 73 //jQuery(".three_columns .avia_embed_image").avia_static_tooltips({container:false, vertical_center: true}); 74 } 75 76 77 avia_iframe_fix(); 78 avia_ie_fix(); 79 avia_item_fade({items: '.preview_image', hover: '.post-entry'}); 80}); 81 82 83 84 85function avia_item_fade(options) 86{ 87 var defaults = 88 { 89 items: "", 90 hover: "" 91 }; 92 93 var options = jQuery.extend(defaults, options); 94 95 jQuery(options.hover).hover( 96 function() 97 { 98 jQuery(this).find(options.items).stop().css({opacity:0, display:'block'}).animate({opacity:1}); 99 }, 100 function() 101 { 102 jQuery(this).find(options.items).stop().animate({opacity:0}
102, function(){ jQuery(this).css({display:'none'}) }); 103 } 104 ); 105 106 107} 108 109 110 111function avia_ie_fix() 112{ 113 if(!jQuery.support.opacity) 114 { 115 jQuery('.image_overlay_effect').css({'background-image':'none'}); 116 } 117 118 if(!jQuery.support.leadingWhitespace) 119 { 120 var menu_items = jQuery('.main_menu li'); 121 menu_items.each(function(i){ 122 123 jQuery(this).css({zIndex: (menu_items.length - i)}); 124 }); 125 126 } 127} 128 129// ------------------------------------------------------------------------------------------- 130// Tooltip plugin 131// ------------------------------------------------------------------------------------------- 132(function($) 133{ 134 $.fn.avia_static_tooltips = function(options) 135 { 136 var defaults = 137 { 138 start: -70, 139 active: 10, 140 end: -70, 141 container: 'body', 142 position: {left:"", top:""}, 143 vertical_center: false 144 }; 145 146 var options = $.extend(defaults, options); 147 148 return this.each(function() 149 { 150 var element = $(this), 151 modifier = 0, 152 tooltip = $('.exif_data_tooltip', element).css({opacity:0}), 153 position = options.position; 154 155 if(options.container != false) 156 { 157 container = element.parents(options.container +":eq(0)"); 158 tooltip.appendTo(container); 159 160 //if($('#wpadminbar').length > 0) 161 modifier = -28; 162 } 163 164 165 166 167 168 tooltip.bind('mouseleave', function() 169 { 170 tooltip.stop().animate({opacity: 0, bottom: -(position.top + options.end)}, function() 171 { 172 tooltip.css('display','none'); 173 }); 174 }); 175 176 element.hover( 177 function() 178 { 179 if(element.parents('.avia_fullscreen_slider_thumbs').filter(':animated').length){return;} 180 if(options.vertical_center == true) 181 { 182 var center = (element.height()/2) - tooltip.height()/2; 183 options.active = options.start = options.end = center * -1; 184 options.end = options.end +40; 185 } 186 187 if(options.container != false) position = element.offset(); 188 tooltip.css({display:'block', left: position.left, bottom: -(position.top + options.start) }).stop().animate({opacity: 1, bottom: -(position.top + modifier + options.active)}); 189 }, 190 function(eventObj) 191 { 192 if(eventObj.relatedTarget != tooltip.get(0)) 193 { 194 tooltip.stop().animate({opacity: 0, bottom: -(position.top + options.end)}, function() 195 { 196 tooltip.css('display','none'); 197 }); 198 } 199 } 200 ); 201 }); 202 }; 203})(jQuery); 204 205 206 207 208 209 210// ------------------------------------------------------------------------------------------- 211// input field improvements 212// ------------------------------------------------------------------------------------------- 213 214(function($) 215{ 216 $.fn.kriesi_empty_input = function(options) 217 { 218 return this.each(function() 219 { 220 var currentField = $(this); 221 currentField.methods = 222 { 223 startingValue: currentField.val(), 224 225 resetValue: function() 226 { 227 var currentValue = currentField.val(); 228 if(currentField.methods.startingValue == currentValue) currentField.val(''); 229 }, 230 231 restoreValue: function() 232 { 233 var currentValue = currentField.val(); 234 if(currentValue == '') currentField.val(currentField.methods.startingValue); 235 } 236 }; 237 238 currentField.bind('focus',currentField.methods.resetValue); 239 currentField.bind('blur',currentField.methods.restoreValue); 240 }); 241 }; 242})(jQuery); 243 244// ------------------------------------------------------------------------------------------- 245// Avia Menu 246// ------------------------------------------------------------------------------------------- 247 248 249(function($) 250{ 251 $.fn.avia_menu_helper = function(variables) 252 { 253 var defaults = 254 { 255 modify_position:true, 256 delay:300 257 }; 258 259 var options = $.extend(defaults, variables); 260 261 return this.each(function() 262 { 263 264 var menu = $(this), 265 menuItems = menu.find(">li"), 266 dropdownItems = menuItems.find(">ul").parent(), 267 parentContainerWidth = menu.parent().width(), 268 delayCheck = {}; 269 270 271 menuItems.each(function() 272 { 273 var item = $(this), 274 normalDropdown = item.find("li>ul").css({display:"none"}); 275 276 //if we got a mega menu or dropdown menu add the arrow beside the menu item 277 if(normalDropdown.length) 278 { 279 normalDropdown.parent('li').addClass('submenu_available'); 280 } 281 }); 282 283
284 // bind events for dropdown menu 285 dropdownItems.find('li').andSelf().each(function() 286 { 287 var currentItem = $(this), 288 sublist = currentItem.find('ul:first'), 289 showList = false; 290 291 if(sublist.length) 292 { 293 sublist.css({display:'block', opacity:0, visibility:'hidden'}); 294 var currentLink = currentItem.find('>a'), 295 timeout = ""; 296 297 currentLink.bind('mouseenter', function() 298 { 299 sublist.stop().css({visibility:'visible'}).animate({opacity:1}); 300 var other_lists = currentItem.siblings().find('ul'); 301 302 other_lists.each(function() 303 { 304 var list = $(this); 305 if(list.css('opacity') > 0) 306 { 307 list.stop().animate({opacity:0},100, function() 308 { 309 list.css({visibility:'hidden'}); 310 }); 311 } 312 }); 313 }); 314 315 currentItem.bind('mouseenter', function() 316 { 317 clearTimeout(timeout); 318 }); 319 320 currentItem.bind('mouseleave', function() 321 { 322 timeout = setTimeout(function() 323 { 324 sublist.stop().animate({opacity:0}
324, function() 325 { 326 sublist.css({visibility:'hidden'}); 327 }); 328 },500); 329 }); 330 331 } 332 333 }); 334 335 }); 336 }; 337})(jQuery); 338 339 340 341 342// ------------------------------------------------------------------------------------------- 343// HTML 5 // Flash self hosted video 344// ------------------------------------------------------------------------------------------- 345(function($) 346{ 347 $.fn.avia_video_activation = function(options) 348 { 349 var defaults = 350 { 351 ratio: '16:9' 352 }; 353 354 var options = $.extend(defaults, options); 355 356 return this.each(function() 357 { 358 var fv = $(this), 359 fv_parent = fv.parents('.slideshow:eq(0)'), 360 fv_height = fv_parent.height(), 361 fv_width = fv_parent.width(); 362 363 364 var id_to_apply = '#' + $(this).attr('id'), 365 posterImg = fv.attr('poster'); 366 367 fv.height(fv_height); 368 fv.width(fv_width); 369 370 371 projekktor(id_to_apply, { 372 plugins: ['Startbutton', 'Controlbar', 'Bufferingicon'], 373 debug: false, //'console', 374 controls: true, 375 playerFlashMP4: avia_framework_globals.installedAt + 'js/projekktor/jarisplayer.swf', 376 height: fv_height, 377 width: fv_width, 378 poster: posterImg 379 }); 380 381 }); 382 }; 383})(jQuery); 384//.ppfsenter, .ppfsexit 385 386 387// ------------------------------------------------------------------------------------------- 388// Tab shortcode javascript 389// ------------------------------------------------------------------------------------------- 390(function($) 391{ 392 $.fn.avia_sc_tabs= function(options) 393 { 394 var defaults = 395 { 396 heading: '.tab', 397 content:'.tab_content' 398 }; 399 400 var options = $.extend(defaults, options); 401 402 return this.each(function() 403 { 404 var container = $(this), 405 tabs = $(options.heading, container), 406 content = $(options.content, container), 407 initialOpen = 1; 408 409 // sort tabs 410 411 if(tabs.length < 2) return; 412 413 if(container.is('.tab_initial_open')) 414 { 415 var myRegexp = /tab_initial_open__(\d+)/; 416 var match = myRegexp.exec(container[0].className); 417 418 if(match != null && parseInt(match[1]) > 0) 419 { 420 initialOpen = parseInt(match[1]); 421 } 422 } 423 424 if(!initialOpen || initialOpen > tabs.length) initialOpen = 1; 425 426 tabs.prependTo(container).each(function(i) 427 { 428 var tab = $(this); 429 430 //set default tab to open 431 if(initialOpen == (i+1)) 432 { 433 tab.addClass('active_tab'); 434 content.filter(':eq('+i+')').addClass('active_tab_content'); 435 } 436 437 tab.bind('click', function() 438 { 439 if(!tab.is('.active_tab')) 440 { 441 $('.active_tab', container).removeClass('active_tab'); 442 $('.active_tab_content', container).removeClass('active_tab_content'); 443 444 tab.addClass('active_tab'); 445 content.filter(':eq('+i+')').addClass('active_tab_content'); 446 } 447 return false; 448 }); 449 }); 450 451 }); 452 }; 453})(jQuery); 454 455 456// ------------------------------------------------------------------------------------------- 457// Toggle shortcode javascript 458// ------------------------------------------------------------------------------------------- 459(function($) 460{ 461 $.fn.avia_sc_toggle = function(options) 462 { 463 var defaults = 464 { 465 heading: '.toggler', 466 content: '.toggle_wrap' 467 }; 468
469 var options = $.extend(defaults, options); 470 471 return this.each(function() 472 { 473 var container = $(this), 474 heading = $(options.heading, container), 475 allContent = $(options.content, container), 476 initialOpen = ''; 477 478 //check if the container has the class toggle initial open. 479 // if thats the case extract the number from the following class and open that toggle 480 if(container.is('.toggle_initial_open')) 481 { 482 var myRegexp = /toggle_initial_open__(\d+)/; 483 var match = myRegexp.exec(container[0].className); 484 485 if(match != null && parseInt(match[1]) > 0) 486 { 487 initialOpen = parseInt(match[1]); 488 } 489 } 490 491 heading.each(function(i) 492 { 493 var thisheading = $(this), 494 content = thisheading.next(options.content, container); 495 496 if(initialOpen == (i+1)) { content.css({display:'block'}); } 497 498 499 if(content.is(':visible')) 500 { 501 thisheading.addClass('activeTitle'); 502 } 503 504 thisheading.bind('click', function() 505 { 506 if(content.is(':visible')) 507 { 508 content.slideUp(300); 509 thisheading.removeClass('activeTitle'); 510 } 511 else 512 { 513 if(container.is('.toggle_close_all')) 514 { 515 allContent.slideUp(300); 516 heading.removeClass('activeTitle'); 517 } 518 content.slideDown(300); 519 thisheading.addClass('activeTitle'); 520 } 521 }); 522 }); 523 }); 524 }; 525})(jQuery); 526 527 528 529function avia_cufon_helper(elString) 530{ 531 var els = jQuery(elString).not('.no_cufon'); 532 533 els = els.not('.slideshow h1'); 534 535 536 537 538 if(typeof avia_cufon_size_mod == 'string' && avia_cufon_size_mod != "1") 539 { 540 avia_cufon_size_mod = parseFloat(avia_cufon_size_mod); 541 els.each(function() 542 { 543 $size = parseInt(jQuery(this).css('fontSize')); 544 jQuery(this).css('fontSize', $size * avia_cufon_size_mod) 545 }); 546 } 547 548 549 els.addClass('cufon_headings'); 550} 551 552 553 554 555// ------------------------------------------------------------------------------------------- 556// Smooth scrooling when clicking on anchor links 557// ------------------------------------------------------------------------------------------- 558 559(function($) 560{ 561 $.fn.avia_smoothscroll = function(variables) 562 { 563 return this.each(function() 564 { 565 $(this).click(function() { 566 567 var newHash=this.hash; 568 569 if(newHash != '' && newHash != '#' && !$(this).is('.comment-reply-link, #cancel-comment-reply-link, .no_scroll, .no-scroll')) 570 { 571 var container = $(this.hash); 572 573 if(container.length) 574 { 575 var target = container.offset().top, 576 oldLocation=window.location.href.replace(window.location.hash, ''), 577 newLocation=this, 578 duration=800, 579 easing='easeOutQuint'; 580 581 // make sure it's the same location 582 if(oldLocation+newHash==newLocation) 583 { 584 // animate to target and set the hash to the window.location after the animation 585 $('html:not(:animated),body:not(:animated)').animate({ scrollTop: target }, duration, easing, function() { 586 587 // add new hash to the browser location 588 window.location.href=newLocation; 589 }); 590 591 // cancel default click action 592 return false; 593 } 594 } 595 } 596 }); 597 }); 598 }; 599})(jQuery); 600 601 602// ------------------------------------------------------------------------------------------- 603// Ligthbox activation 604// ------------------------------------------------------------------------------------------- 605 606(function($) 607{ 608 $.fn.avia_activate_lightbox = function(variables) 609 { 610 var defaults = 611 { 612 autolinkElements: 'a[rel^="prettyPhoto"], a[rel^="lightbox"], a[href$=jpg], a[href$=png], a[href$=gif], a[href$=jpeg], a[href$=".mov"] , a[href$=".swf"] , a[href*="vimeo.com"] , a[href*="youtube.com"] , a[href*="screenr.com"]' 613 }; 614 615 var options = $.extend(defaults, variables); 616 617 return this.each(function() 618 { 619 var elements = $(options.autolinkElements, this).not('.noLightbox, .noLightbox a'), 620 lastParent = "", 621 counter = 0; 622 623 elements.each(function() 624 { 625 var el = $(this), 626 parentPost = el.parents('.post-entry:eq(0)'), 627 group = 'auto_group'; 628 629 if(parentPost.get(0) != lastParent) 630 { 631 lastParent = parentPost.get(0); 632 counter ++; 633 } 634 635 if((el.attr('rel') == undefined || el.attr('rel') == '') && !el.hasClass('noLightbox')) 636 { 637 el.attr('rel','lightbox['+group+counter+']'); 638 639 //manipulate the link in case we got a screenr video 640 if(el.is('a[href*="screenr.com"]')) 641 { 642 var currentlink = el.attr('href'); 643 644 if(currentlink.indexOf('embed') !== -1) 645 { 646 el.attr('href', currentlink + '?iframe=true&width=650&height=396'); 647 } 648 else 649 { 650 var append = currentlink.substring(currentlink.lastIndexOf('/') + 1,currentlink.length); 651 el.attr('href', 'http://www.screenr.com/embed/' + append + '?iframe=true&width=650&height=396'); 652 } 653 } 654 } 655 }); 656 657 if($.fn.prettyPhoto) 658 elements.prettyPhoto({ 'social_tools':'','slideshow': 5000 }); /* facebook /light_rounded / dark_rounded / light_square / dark_square */ 659 }); 660 }; 661})(jQuery); 662 663 664 665 666// ------------------------------------------------------------------------------------------- 667// Hover effect activation 668// ------------------------------------------------------------------------------------------- 669 670 671(function($) 672{ 673 $.fn.avia_activate_hover_effect = function(variables) 674 { 675 var defaults = 676 { 677 autolinkElements: 'a[rel^="prettyPhoto"], a[rel^="lightbox"], a[href$=jpg], a[href$=png], a[href$=gif], a[href$=jpeg], a[href$=".mov"] , a[href$=".swf"] , a[href*="vimeo.com"] , a[href*="youtube.com"], a.external-link' 678 }; 679
680 var options = $.extend(defaults, variables); 681 682 return this.each(function() 683 { 684 685 $(options.autolinkElements, this).contents('img').each(function() 686 { 687 var img = $(this), 688 a = img.parent(), 689 preload = img.parents('.preloading'), 690 $newclass = 'lightbox_video', 691 applied= false; 692 if(a.attr('href').match(/(jpg|gif|jpeg|png|tif)/)) 693 { 694 $newclass = 'lightbox_image'; 695 } 696 697 if(a.is('.external-link')) 698 { 699 $newclass = 'external_image'; 700 } 701 702 if(a.is('a')) 703 { 704 if(img.css('float')) {a.css({float:img.css('float')})} 705 if(!a.css('position') || a.css('position') == 'static') { a.css({position:'relative', display:'inline-block'}); } 706 if(img.is('.aligncenter')) a.css({display:'block'}); 707 } 708 709 var bg = $("<span class='image_overlay_effect'><span class='image_overlay_effect_inside'></span></span>").appendTo(a); 710 bg.css({display:'block', zIndex:5, opacity:0}); 711 712 bg.hover(function() 713 { 714 if(applied == false && img.css('opacity') > 0.5) 715 { 716 bg.addClass($newclass); 717 applied = true; 718 } 719 720 bg.stop().animate({opacity:0.6},400); 721 }, 722 function() 723 { 724 bg.stop().animate({opacity:0}
724,400); 725 }); 726 727 728 729 }); 730 }); 731 }; 732})(jQuery); 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747// ------------------------------------------------------------------------------------------- 748// content slider 749// ------------------------------------------------------------------------------------------- 750 751(function($) 752{ 753 $.fn.avia_sc_slider = function(variables, callback) 754 { 755 var defaults = 756 { 757 slidePadding: 40, 758 appendControlls: {'h1':'pos_h1', 'h2':'pos_h2', 'h3':'pos_h3', 'h4':'pos_h4', 'h5':'pos_h5', 'h6':'pos_h6'}, 759 controllContainerClass: 'contentSlideControlls', 760 transitionDuration: 800, //how fast should images crossfade 761 autorotation: true, //autorotation true or false? (this setting gets overwritten by the class autoslide_true and autoslide_false if applied to the container. easier for shortcode management) 762 autorotationInterval: 3000, //interval between transition if autorotation is active ()also gets overwritten by autoslidedelay__(number) 763 transitionEasing: 'easeOutQuint' 764 }; 765 766 var options = $.extend(defaults, variables); 767 768 return this.each(function() 769 { 770 var container = $(this), 771 slides = $('.single_slide', container), 772 slideCount = slides.length, 773 firstSlide = slides.filter(':eq(0)'), 774 followslides = $('.single_slide:not(:first)', container), 775 innerContainer = "", 776 innerContainerWidth = (container.width() * slideCount) + (options.slidePadding * slideCount), 777 i = 0, 778 interval = "", 779 controlls = $(); 780 781 container.methods = 782 { 783 preload: function() 784 { 785 followslides.css({display:"none"}); 786 787 788 if(!slideCount) 789 { 790 container.methods.init(); 791 } 792 else 793 { 794 container.aviaImagePreloader(container.methods.init); 795 } 796 }, 797 798 init: function() 799 { 800 if(slideCount > 1) 801 { 802 //set container height to match the first slide 803 container.height(firstSlide.height()); 804 805 //wrap additional container arround slides and align slides within that container 806 slides.wrapAll('<div class="inner_slide_container" />').css({float:'left', 807 width:container.width(), 808 display:'block', 809 paddingRight:options.slidePadding 810 }); 811 812 innerContainer = $('.inner_slide_container', container).width(innerContainerWidth); 813 814 //attach controll elements 815 container.methods.appenControlls(); 816 817 //start autoslide 818 container.methods.autoRotation(); 819 } 820 }, 821 822 change: function() 823 { 824 //move inner container 825 var moveTo = ((-i * container.width()) - (i * options.slidePadding)); 826 innerContainer.stop().animate({left: moveTo}, options.transitionDuration, options.transitionEasing); 827 828 //change height of outer container 829 var nextSlideHeight = slides.filter(':eq('+i+')').height(); 830 container.stop().animate({height: nextSlideHeight}, options.transitionDuration, options.transitionEasing); 831 832 //change active state of controlls 833 var controllLinks = $('a', controlls); 834 controllLinks.removeClass('activeItem'); 835 controllLinks.filter(':eq('+i+')').addClass('activeItem'); 836 }, 837 838 setSlideNumber: function(event) 839 { 840 841 var stop = false; 842 843 if(event) 844 { 845 clearInterval(interval); 846 847 if(event.data.show == 'next') i++; 848 if(event.data.show == 'prev') i--; 849 if(typeof(event.data.show) == 'number') 850 { 851 //check if next slide is the same as current slide 852 if(i != event.data.show) 853 { 854 i = event.data.show; 855 } 856 else 857 { 858 stop = true; 859 } 860 } 861 } 862 else 863 { 864 i++; 865 } 866 867 if(i+1 > slideCount) { i = 0; } else 868 if(i < 0) {i = slideCount-1; } 869 870 if(!stop) // prevents transition if the next slide and the current slide are the same 871 { 872 container.methods.change(); 873 } 874 875 876 877 return false; 878 }, 879 880 appenControlls: function() 881 { 882 //if controlls should be added by javascript and we got more than 1 slide 883 if(options.appendControlls && slideCount > 1) 884 { 885 //check where to position the controll element, depending on the first element within the slide 886 var positioningClass = ''; 887 888 for (var key in options.appendControlls) 889 { 890 if(!positioningClass) 891 { 892 if($(':first', firstSlide).is(key)) 893 { 894 positioningClass = options.appendControlls[key]; 895 } 896 897 } 898 } 899 900 901 //append the controlls 902 var firstClass = 'class="activeItem"'; 903 904 controlls = $('<div></div>').addClass(options.controllContainerClass) 905 .addClass(positioningClass) 906 .css({visibility:'hidden', opacity:0}
906); 907 908 if(positioningClass) 909 { 910 controlls.appendTo(container); 911 } 912 else 913 { 914 controlls.insertAfter(container); 915 } 916 917 slides.each(function(i) 918 { 919 var link = $('<a '+firstClass+' href="#">'+(i+1)+'</a>').appendTo(controlls); firstClass = ""; 920 link.bind('click', {show: i}, container.methods.setSlideNumber); 921 }); 922 923 controlls.css({visibility:'visible', opacity:0}).animate({opacity:1},400); 924 } 925 }, 926 927 autoRotation: function() 928 { 929 if(container.is('.autoslide_true')) 930 { 931 options.autorotation = true; 932 933 var myRegexp = /autoslidedelay__(\d+)/g; 934 var match = myRegexp.exec(container[0].className); 935 936 if(parseInt(match[1]) > 0) 937 { 938 options.autorotationInterval = parseInt(match[1]) * 1000; 939 } 940 941 942 943 } 944 else if(container.is('.autoslide_false')) 945 { 946 options.autorotation = false; 947 } 948 949 950 if(options.autorotation) 951 { 952 interval = setInterval(function() 953 { 954 container.methods.setSlideNumber(); 955 }, 956 options.autorotationInterval); 957 } 958 } 959 }; 960 961 962 container.methods.preload(); 963 }); 964 }; 965})(jQuery); 966 967 968 969 970 971 972 973// ------------------------------------------------------------------------------------------- 974// input field improvements 975// ------------------------------------------------------------------------------------------- 976 977(function($) 978{ 979 $.fn.kriesi_empty_input = function(options) 980 { 981 return this.each(function() 982 { 983 var currentField = $(this); 984 currentField.methods = 985 { 986 startingValue: currentField.val(), 987 988 resetValue: function() 989 { 990 var currentValue = currentField.val(); 991 if(currentField.methods.startingValue == currentValue) currentField.val(''); 992 }, 993 994 restoreValue: function() 995 { 996 var currentValue = currentField.val(); 997 if(currentValue == '') currentField.val(currentField.methods.startingValue); 998 } 999 }; 1000 1001 currentField.bind('focus',currentField.methods.resetValue); 1002 currentField.bind('blur',currentField.methods.restoreValue); 1003 }); 1004 }; 1005})(jQuery); 1006 1007// ------------------------------------------------------------------------------------------- 1008// contact form ajax improvements 1009// ------------------------------------------------------------------------------------------- 1010 1011(function($) 1012{ 1013 $.fn.kriesi_ajax_form = function(variables) 1014 { 1015 var defaults = 1016 { 1017 sendPath: 'send.php', 1018 responseContainer: '#ajaxresponse' 1019 }; 1020 1021 var options = $.extend(defaults, variables); 1022 1023 return this.each(function() 1024 { 1025 var form = $(this), 1026 form_sent = false, 1027 send = 1028 { 1029 formElements: form.find('textarea, select, input[type=text], input[type=hidden]'), 1030 validationError:false, 1031 button : form.find('input:submit'), 1032 dataObj : {} 1033 }; 1034 1035 responseContainer = $(options.responseContainer+":eq(0)"); 1036 1037 send.button.bind('click', checkElements); 1038 1039 function send_ajax_form() 1040 { 1041 if(form_sent){ return false; } 1042 1043 form_sent = true; 1044 send.button.fadeOut(300); 1045 1046 responseContainer.load(form.attr('action')+' '+options.responseContainer, send.dataObj, function() 1047 { 1048 responseContainer.find('.hidden').css({display:"block"}); 1049 form.slideUp(400, function(){responseContainer.slideDown(400); send.formElements.val('');}); 1050 }); 1051 1052 1053 } 1054 1055 function checkElements() 1056 { 1057 // reset validation var and send data 1058 send.validationError = false; 1059 send.datastring = 'ajax=true'; 1060 1061 send.formElements.each(function(i) 1062 { 1063 var currentElement = $(this), 1064 surroundingElement = currentElement.parent(), 1065 value = currentElement.val(), 1066 name = currentElement.attr('name'), 1067 classes = currentElement.attr('class'), 1068 nomatch = true; 1069 1070 send.dataObj[name] = encodeURIComponent(value); 1071 1072 if(classes && classes.match(/is_empty/)) 1073 { 1074 if(value == '') 1075 { 1076 surroundingElement.attr("class","").addClass("error"); 1077 send.validationError = true; 1078 } 1079 else 1080 {
vendor: 5,347 bytes, lines 1081-1258
1081 surroundingElement.attr("class","").addClass("valid"); 1082 } 1083 nomatch = false; 1084 } 1085 1086 if(classes && classes.match(/is_email/)) 1087 { 1088 if(!value.match(/^\w[\w|\.|\-]+@\w[\w|\.|\-]+\.[a-zA-Z]{2,4}$/)) 1089 { 1090 surroundingElement.attr("class","").addClass("error"); 1091 send.validationError = true; 1092 } 1093 else 1094 { 1095 surroundingElement.attr("class","").addClass("valid"); 1096 } 1097 nomatch = false; 1098 } 1099 1100 if(nomatch && value != '') 1101 { 1102 surroundingElement.attr("class","").addClass("valid"); 1103 } 1104 }); 1105 1106 if(send.validationError == false) 1107 { 1108 send_ajax_form(); 1109 } 1110 return false; 1111 } 1112 }); 1113 }; 1114})(jQuery); 1115 1116 1117 1118 1119 1120 1121jQuery.easing['jswing'] = jQuery.easing['swing']; 1122 1123jQuery.extend( jQuery.easing, 1124{ 1125 def: 'easeOutQuad', 1126 swing: function (x, t, b, c, d) { 1127 //alert(jQuery.easing.default); 1128 return jQuery.easing[jQuery.easing.def](x, t, b, c, d); 1129 }, 1130 easeInQuad: function (x, t, b, c, d) { 1131 return c*(t/=d)*t + b; 1132 }, 1133 easeOutQuad: function (x, t, b, c, d) { 1134 return -c *(t/=d)*(t-2) + b; 1135 }, 1136 easeInOutQuad: function (x, t, b, c, d) { 1137 if ((t/=d/2) < 1) return c/2*t*t + b; 1138 return -c/2 * ((--t)*(t-2) - 1) + b; 1139 }, 1140 easeInCubic: function (x, t, b, c, d) { 1141 return c*(t/=d)*t*t + b; 1142 }, 1143 easeOutCubic: function (x, t, b, c, d) { 1144 return c*((t=t/d-1)*t*t + 1) + b; 1145 }, 1146 easeInOutCubic: function (x, t, b, c, d) { 1147 if ((t/=d/2) < 1) return c/2*t*t*t + b; 1148 return c/2*((t-=2)*t*t + 2) + b; 1149 }, 1150 easeInQuart: function (x, t, b, c, d) { 1151 return c*(t/=d)*t*t*t + b; 1152 }, 1153 easeOutQuart: function (x, t, b, c, d) { 1154 return -c * ((t=t/d-1)*t*t*t - 1) + b; 1155 }, 1156 easeInOutQuart: function (x, t, b, c, d) { 1157 if ((t/=d/2) < 1) return c/2*t*t*t*t + b; 1158 return -c/2 * ((t-=2)*t*t*t - 2) + b; 1159 }, 1160 easeInQuint: function (x, t, b, c, d) { 1161 return c*(t/=d)*t*t*t*t + b; 1162 }, 1163 easeOutQuint: function (x, t, b, c, d) { 1164 return c*((t=t/d-1)*t*t*t*t + 1) + b; 1165 }, 1166 easeInOutQuint: function (x, t, b, c, d) { 1167 if ((t/=d/2) < 1) return c/2*t*t*t*t*t + b; 1168 return c/2*((t-=2)*t*t*t*t + 2) + b; 1169 }, 1170 easeInSine: function (x, t, b, c, d) { 1171 return -c * Math.cos(t/d * (Math.PI/2)) + c + b; 1172 }, 1173 easeOutSine: function (x, t, b, c, d) { 1174 return c * Math.sin(t/d * (Math.PI/2)) + b; 1175 }, 1176 easeInOutSine: function (x, t, b, c, d) { 1177 return -c/2 * (Math.cos(Math.PI*t/d) - 1) + b; 1178 }, 1179 easeInExpo: function (x, t, b, c, d) { 1180 return (t==0) ? b : c * Math.pow(2, 10 * (t/d - 1)) + b; 1181 }, 1182 easeOutExpo: function (x, t, b, c, d) { 1183 return (t==d) ? b+c : c * (-Math.pow(2, -10 * t/d) + 1) + b; 1184 }, 1185 easeInOutExpo: function (x, t, b, c, d) { 1186 if (t==0) return b; 1187 if (t==d) return b+c; 1188 if ((t/=d/2) < 1) return c/2 * Math.pow(2, 10 * (t - 1)) + b; 1189 return c/2 * (-Math.pow(2, -10 * --t) + 2) + b; 1190 }, 1191 easeInCirc: function (x, t, b, c, d) { 1192 return -c * (Math.sqrt(1 - (t/=d)*t) - 1) + b; 1193 }, 1194 easeOutCirc: function (x, t, b, c, d) { 1195 return c * Math.sqrt(1 - (t=t/d-1)*t) + b; 1196 }, 1197 easeInOutCirc: function (x, t, b, c, d) { 1198 if ((t/=d/2) < 1) return -c/2 * (Math.sqrt(1 - t*t) - 1) + b; 1199 return c/2 * (Math.sqrt(1 - (t-=2)*t) + 1) + b; 1200 }, 1201 easeInElastic: function (x, t, b, c, d) { 1202 var s=1.70158;var p=0;var a=c; 1203 if (t==0) return b; if ((t/=d)==1) return b+c; if (!p) p=d*.3; 1204 if (a < Math.abs(c)) { a=c; var s=p/4; } 1205 else var s = p/(2*Math.PI) * Math.asin (c/a); 1206 return -(a*Math.pow(2,10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )) + b; 1207 }, 1208 easeOutElastic: function (x, t, b, c, d) { 1209 var s=1.70158;var p=0;var a=c; 1210 if (t==0) return b; if ((t/=d)==1) return b+c; if (!p) p=d*.3; 1211 if (a < Math.abs(c)) { a=c; var s=p/4; } 1212 else var s = p/(2*Math.PI) * Math.asin (c/a); 1213 return a*Math.pow(2,-10*t) * Math.sin( (t*d-s)*(2*Math.PI)/p ) + c + b; 1214 }, 1215 easeInOutElastic: function (x, t, b, c, d) { 1216 var s=1.70158;var p=0;var a=c; 1217 if (t==0) return b; if ((t/=d/2)==2) return b+c; if (!p) p=d*(.3*1.5); 1218 if (a < Math.abs(c)) { a=c; var s=p/4; } 1219 else var s = p/(2*Math.PI) * Math.asin (c/a); 1220 if (t < 1) return -.5*(a*Math.pow(2,10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )) + b; 1221 return a*Math.pow(2,-10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )*.5 + c + b; 1222 }, 1223 easeInBack: function (x, t, b, c, d, s) { 1224 if (s == undefined) s = 1.70158; 1225 return c*(t/=d)*t*((s+1)*t - s) + b; 1226 }, 1227 easeOutBack: function (x, t, b, c, d, s) { 1228 if (s == undefined) s = 1.70158; 1229 return c*((t=t/d-1)*t*((s+1)*t + s) + 1) + b; 1230 }, 1231 easeInOutBack: function (x, t, b, c, d, s) { 1232 if (s == undefined) s = 0.70158; 1233 if ((t/=d/2) < 1) return c/2*(t*t*(((s*=(1.525))+1)*t - s)) + b; 1234 return c/2*((t-=2)*t*(((s*=(1.525))+1)*t + s) + 2) + b; 1235 }, 1236 easeInBounce: function (x, t, b, c, d) { 1237 return c - jQuery.easing.easeOutBounce (x, d-t, 0, c, d) + b; 1238 }, 1239 easeOutBounce: function (x, t, b, c, d) { 1240 if ((t/=d) < (1/2.75)) { 1241 return c*(7.5625*t*t) + b; 1242 } else if (t < (2/2.75)) { 1243 return c*(7.5625*(t-=(1.5/2.75))*t + .75) + b; 1244 } else if (t < (2.5/2.75)) { 1245 return c*(7.5625*(t-=(2.25/2.75))*t + .9375) + b; 1246 } else { 1247 return c*(7.5625*(t-=(2.625/2.75))*t + .984375) + b; 1248 } 1249 }, 1250 easeInOutBounce: function (x, t, b, c, d) { 1251 if (t < d/2) return jQuery.easing.easeInBounce (x, t*2, 0, c, d) * .5 + b; 1252 return jQuery.easing.easeOutBounce (x, t*2-d, 0, c, d) * .5 + c*.5 + b; 1253 } 1254}); 1255 1256 1257function avia_log(text) 1258{
1259 var ios = navigator.userAgent.toLowerCase().match(/(iphone|ipod|ipad)/); 1260 ( (window.console && console.log && !ios) || (window.opera && opera.postError && !ios) || avia_text_log).call(this, text); 1261 1262 function avia_text_log(text) 1263 { 1264 var logfield = jQuery('.avia_logfield'); 1265 if(!logfield.length) logfield = jQuery('<pre class="avia_logfield"></pre>').appendTo('body').css({ zIndex:100000, 1266 padding:"20px", 1267 backgroundColor:"#ffffff", 1268 position:"fixed", 1269 top:0, right:0, 1270 width:"300px", 1271 borderColor:"#cccccc", 1272 borderWidth:"1px", 1273 borderStyle:'solid', 1274 height:"600px", 1275 overflow:'scroll', 1276 display:'block', 1277 zoom:1 1278 }); 1279 var val = logfield.html(); 1280 var text = avia_get_object(text); 1281 logfield.html(val + "\n<br/>" + text); 1282 } 1283 1284 function avia_get_object(obj) 1285 { 1286 var sendreturn = obj; 1287 1288 if(typeof obj == 'object' || typeof obj == 'array') 1289 { 1290 for (i in obj) 1291 { 1292 sendreturn += "'"+i+"': "+obj[i] + "<br/>"; 1293 } 1294 } 1295 1296 return sendreturn; 1297 } 1298} 1299 1300// ------------------------------------------------------------------------------------------- 1301// image preloader 1302// ------------------------------------------------------------------------------------------- 1303 1304 1305(function($) 1306{ 1307 $.fn.aviaImagePreloader = function(variables, callback) 1308 { 1309 var defaults = 1310 { 1311 fadeInSpeed: 800, 1312 delay:0, 1313 maxLoops: 10, 1314 thisData: {}, 1315 data: '' 1316 }; 1317 1318 var options = $.extend(defaults, variables); 1319 1320 return this.each(function() 1321 { 1322 var container = $(this), 1323 images = $('img', this).css({opacity:0, visibility:'visible', display:'block'}), 1324 parent = images.parent().addClass('preloading'), 1325 imageCount = images.length, 1326 interval = '', 1327 allImages = images ; 1328 1329 1330 var methods = 1331 { 1332 checkImage: function() 1333 { 1334 images.each(function(i) 1335 { 1336 if(this.complete == true) images = images.not(this); 1337 }); 1338 1339 if(images.length && options.maxLoops >= 0) 1340 { 1341 options.maxLoops--; 1342 setTimeout(methods.checkImage, 500); 1343 } 1344 else 1345 { 1346 methods.showImages(); 1347 } 1348 }, 1349 1350 showImages: function() 1351 { 1352 allImages.each(function(i) 1353 { 1354 var currentImage = $(this); 1355 setTimeout(function() 1356 { 1357 methods.showSingleImage(currentImage, i); 1358 },options.delay * i); 1359 1360 1361 }); 1362 }, 1363 1364 showSingleImage: function(currentImage, i) 1365 { 1366 currentImage.animate({opacity:1}, options.fadeInSpeed, function() 1367 { 1368 currentImage.parents().removeClass('preloading'); 1369 if(allImages.length == i+1) 1370 { 1371 methods.callback(i); 1372 } 1373 }); 1374 }, 1375 1376 callback: function() 1377 { 1378 if (variables instanceof Function) { callback = variables; } 1379 if (callback instanceof Function) { callback.call(options.thisData, options.data); } 1380 } 1381 }; 1382 1383 if(!images.length) { methods.callback(); return } 1384 methods.checkImage(); 1385 1386 }); 1387 }; 1388})(jQuery); 1389 1390 1391 1392 1393 1394 1395 1396function avia_iframe_fix() 1397{ 1398 var iframe = jQuery('.slideshow iframe'), 1399 youtubeEmbed = jQuery('.slideshow object, .slideshow embed').attr('wmode','opaque'); 1400 1401 iframe.each(function() 1402 { 1403 var current = jQuery(this), 1404 src = current.attr('src'); 1405 1406 if(src) 1407 { 1408 if(src.indexOf('?') !== -1) 1409 { 1410 src += "&wmode=opaque"; 1411 } 1412 else 1413 { 1414 src += "?wmode=opaque"; 1415 } 1416 1417 current.attr('src', src); 1418 } 1419 }); 1420} 1421 1422 1423/* switch slideshow based on selected variation - compares variation image with slideshow imge srcs */ 1424jQuery(document).ready(function($) { 1425 variation_adjustment('.variations select'); 1426}); 1427 1428function variation_adjustment(select_el) 1429{ 1430 var selects = jQuery(select_el); 1431 1432 //unify select dropdowns 1433 selects.each(function() 1434 { 1435 var el = jQuery(this); 1436 1437 change_variation_image(); 1438 1439 el.on('change', function() 1440 { 1441 setTimeout(function(){ 1442 change_variation_image(); 1443 }, 100); 1444 }); 1445 1446 }); 1447} 1448 1449function change_variation_image() 1450{ 1451 var currentVariationId = jQuery('.single_variation_wrap .variations_button input[name="variation_id"]').val(), 1452 productid = jQuery('form.variations_form').data('product_id'), 1453 variationsdata = jQuery('form.variations_form').data('product_variations'); 1454 1455 if ( !productid || !currentVariationId ) return; 1456 1457 var currentvariation = variationsdata.filter(function (currentvariation) { return currentvariation.variation_id == currentVariationId }); 1458 1459 if(typeof currentvariation[0] == "undefined" || !currentvariation[0]) return; 1460 1461 var imglink = currentvariation[0].image_link; 1462 1463 if(imglink) 1464 { 1465 jQuery('.slideshow li a img').each(function() 1466 { 1467 var imgscr = jQuery(this).attr("src"); 1468 1469 if(imglink == imgscr || imglink.replace(/-\d+x\d+./, ".") == imgscr.replace(/-\d+x\d+./, ".")) 1470 { 1471 var index = jQuery(this).parents('li').index(); 1472 var container = jQuery(this).parents('.slideshow_container'); 1473 container.find('.slidecontrolls a:eq('+index+')').trigger('click'); 1474 } 1475 1476 }); 1477 } 1478}
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.