1jQuery.noConflict(); 2jQuery(document).ready(function() { 3 jQuery(".comment-box-single").on("click", function() { 4 jQuery(".comment-main-box-single").slideToggle(); 5 }); 6 if (jQuery('.single_post_module').length) { 7 jQuery(window).on("scroll", function() { 8 var scroller_anchor = jQuery(".the-latest-post").offset().top; 9 if (jQuery(this).scrollTop() > 100) { 10 11 if (jQuery(this).scrollTop() >= scroller_anchor) 12 { 13 jQuery(".header-single-page").show(); 14 jQuery(".header-new").hide(); 15 } 16 else { 17 jQuery(".header-main").addClass("not-transparent"); 18 jQuery(".header-new").show(); 19 jQuery(".header-single-page").hide(); 20 } 21 } 22 else { 23 jQuery(".header-main").removeClass("not-transparent"); 24 jQuery(".header-new").hide(); 25 jQuery(".header-single-page").hide(); 26 } 27 }); 28 } else { 29 /** Scroll to home page **/ 30 jQuery(window).on("scroll", function() { 31 if (jQuery(this).scrollTop() > 100) { 32 jQuery(".header-main").addClass("not-transparent"); 33 jQuery(".header-new").show(); 34 } else { 35 jQuery(".header-main").removeClass("not-transparent"); 36 jQuery(".header-new").hide(); 37 } 38 }); 39 } 40 41 if (jQuery('ul.tabs').length > 0) { 42 jQuery('ul.tabs').tabs('> .tabs_content'); 43 } 44 if (jQuery('ul.tabs_framed').length > 0) { 45 jQuery('ul.tabs_framed').tabs('> .tabs_framed_content'); 46 } 47 if (jQuery('ul.tabs_button').length > 0) { 48 jQuery('ul.tabs_button').tabs('> .tabs_button_content'); 49 } 50 if (jQuery('.tabs_vertical_frame').length > 0) { 51 jQuery('.tabs_vertical_frame').tabs('> .tabs_vertical_content'); 52 jQuery('.tabs_vertical li').click(function() { 53 jQuery(this).parent().children().removeClass('current'); 54 jQuery(this).addClass('current'); 55 }); 56 } 57 if (jQuery('ul.blog_tabs').length > 0) { 58 jQuery('ul.blog_tabs').tabs('> .blog_tabs_content'); 59 jQuery('ul.blog_tabs').data('tabs').onClick(function(index) { 60 //Cufon.refresh(); 61 }); 62 } 63 64 /* signup box */ 65 jQuery(document).on("click", "#signup-dismiss", function(e) { 66 return jQuery(".signup-banner").slideUp("fast"), jQuery.cookie("signup", "false", { 67 expires: 1, 68 path: "/" 69 }) 70 }); 71 72 jQuery(function() { 73 if (jQuery.cookie("signup") !== "false") 74 return jQuery.cookie("signup", "true", { 75 expires: 30, 76 path: "/" 77 }), jQuery(".signup-banner").slideDown() 78 }); 79 80 /* 81 * Hover fade 82 */ 83 jQuery('.hover_fade_js').on('hover', function(e) { 84 if (e.type == 'mouseenter') 85 jQuery(this).stop().animate({opacity: 0.7}, 400); 86 87 if (e.type == 'mouseleave') 88 jQuery(this).stop().animate({opacity: 1}, 400); 89 }); 90 91 /* 92 * toggle functions 93 */ 94 jQuery('.toggle').toggle(function() { 95 jQuery(this).addClass('active'); 96 }, function() { 97 jQuery(this).removeClass('active'); 98 }); 99 100 jQuery('.toggle').click(function() { 101 jQuery(this).next('.toggle_content').slideToggle(); 102 }); 103 104 jQuery('.toggle_frame_set').each(function(i) { 105 var _this = jQuery(this), 106 toggle = _this.find('.toggle_accordion'); 107 108 toggle.click(function() { 109 if (jQuery(this).next().is(':hidden')) { 110 _this.find('.toggle_accordion').removeClass('active').next().slideUp(); 111 jQuery(this).toggleClass('active').next().slideDown(); 112 } 113 return false; 114 }); 115 }); 116 117 /* 118 * Testimonial functions 119 */ 120 var testimonialsEl = jQuery('.widget_testimonial_module'); 121 122 if (testimonialsEl.length > 0) { 123 testimonialsEl.each(function(i) { 124 testimonialsElChildren = jQuery(this).children(':not(span)'), 125 testimonialsCount = testimonialsElChildren.length; 126 testimonialNext = jQuery(this).find('.testimonial_next'), 127 testimonialPrev = jQuery(this).find('.testimonial_prev'), 128 nextTestimonials = '', 129 prevTestimonials = ''; 130 131 testimonialNext.click(function() { 132 testimonialsElChildren.each(function(i) { 133 if (jQuery(this).is(':visible')) { 134 nextTestimonials = jQuery(this).next(); 135 if (nextTestimonials.hasClass('testimonial_nav')) 136 nextTestimonials = testimonialsElChildren.eq(0); 137 } 138 }); 139 140 testimonialsElChildren.hide(); 141 nextTestimonials.show(); 142 }); 143 144 testimonialPrev.click(function() { 145 testimonialsElChildren.each(function(i) { 146 if (jQuery(this).is(':visible')) { 147 prevTestimonials = jQuery(this).prev(); 148 if (prevTestimonials.length == 0) 149 prevTestimonials = testimonialsElChildren.eq(testimonialsCount - 1); 150 } 151 }); 152 153 testimonialsElChildren.hide(); 154 prevTestimonials.show(); 155 }); 156 157 }); 158 } 159 160 /* 161 * image reflect functions 162 */ 163 jQuery('img.reflect').reflect({height: 0.5, opacity: 0.5}); 164 165 /* 166 * prettyPhoto 167 */ 168 jQuery("a[rel^='prettyPhoto'], a[rel^='lightbox']").prettyPhoto({ 169 overlay_gallery: false, social_tools: '', 'theme': prettyphotoTheme /* light_square / dark_rounded / light_square / dark_square / facebook */ 170 });
171 172 /* 173 * spam protction on mailto: links 174 */ 175 jQuery('a.email_link_noreplace').nospam({ 176 replaceText: false, 177 filterLevel: 'normal' 178 }); 179 180 jQuery('a.email_link_replace').nospam({ 181 replaceText: true, 182 filterLevel: 'normal' 183 }); 184 185 /* 186 * Contact form submit 187 */ 188 jQuery('.contact_form_submit').click(function() { 189 clearInterval(preLoaderSmall); 190 preLoaderCount = 0; 191 mysitePreloaderSmall('.mysite_contact_feedback'); 192 jQuery(this).next().css('display', 'inline-block'); 193 }); 194 195 /* 196 * "target_blank" links 197 */ 198 jQuery('.flickr_badge_image a').attr('target', '_blank'); 199 jQuery('.target_blank').attr('target', '_blank'); 200 201 /* Custom WSI */ 202 /* jQuery("#feedback").fancybox({ 203 'width' : 400, 204 'height' : 550, 205 'autoScale' : false, 206 'transitionIn' : 'elastic', 207 'transitionOut' : 'elastic', 208 'speedIn' : 600, 209 'speedOut' : 200, 210 'overlayShow' : true, 211 'overlayColor' : '#000', 212 'overlayOpacity': 0.7, 213 'centerOnScroll': true, 214 'type' : 'iframe' 215 }); */ 216 217 jQuery('#post-grid-full-tabbed .slides').cycle({ 218 fx: 'fade', 219 timeout: 0, 220 prev: '.prev_slide', 221 next: '.next_slide', 222 pauseOnPagerHover: 1, 223 pager: '#post-slider-pagination', 224 pagerAnchorBuilder: function(idx, slide) { 225 // return selector string for existing anchor 226 return '#post-slider-pagination li:eq(' + idx + ') a'; 227 } 228 }); 229 230 jQuery("#UserEmail, .fields_email").focus(function() { 231 jQuery('.error').hide(); 232 }); 233 234 jQuery('#content-signup form#icpsignup896 #btn-signup-submit').click(function() { 235 jQuery(".error").hide(); 236 var hasError = false; 237 var emailReg = /^([a-zA-Z0-9_\.\-\+])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/; 238 //var emailblockReg = /^([\w-\.]+@(?!gmail.com)(?!yahoo.com)(?!hotmail.com)([\w-]+\.)+[\w-]{2,4})?$/; 239 //var emailblockReg = /^([\w-\.]+@(?!gmail.com)(?!yahoo.com)(?!hotmail.com)([\w-]+\.)+[\w-]{2,4})?$/; 240 var emailaddressVal = jQuery("#content-signup #UserEmail").val(); 241 if (emailaddressVal == '') { 242 jQuery("#content-signup .content-signup-title").after('<span class="error">Please enter your email address.</span>').fadeIn(1000); 243 hasError = true; 244 } 245 else if (!emailReg.test(emailaddressVal)) { 246 jQuery("#content-signup .content-signup-title").after('<span class="error">Enter a valid email address.</span>').fadeIn(1000); 247 hasError = true; 248 } else if (!emailblockReg.test(emailaddressVal)) { 249 jQuery("#content-signup .content-signup-title").after('<span class="error">No yahoo, gmail or hotmail emails.</span>').fadeIn(1000); 250 hasError = true 251 } 252 if (hasError == true) { 253 return false; 254 } 255 }); 256 257 jQuery('#signup-banner form#icpsignup896 #btn-signup-submit').click(function() { 258 jQuery(".error").hide(); 259 var hasError = false; 260 var emailReg = /^([a-zA-Z0-9_\.\-\+])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/; 261 //var emailblockReg = /^([\w-\.]+@(?!gmail.com)(?!yahoo.com)(?!hotmail.com)([\w-]+\.)+[\w-]{2,4})?$/; 262 //var emailblockReg = /^([\w-\.]+@(?!gmail.com)(?!yahoo.com)(?!hotmail.com)([\w-]+\.)+[\w-]{2,4})?$/; 263 var emailaddressVal = jQuery("#signup-banner #UserEmail").val(); 264 if (emailaddressVal == '') { 265 jQuery("#signup-banner .content-signup-title").after('<span class="error">Please enter your email address.</span>').fadeIn(1000); 266 hasError = true; 267 } 268 else if (!emailReg.test(emailaddressVal)) { 269 jQuery("#signup-banner .content-signup-title").after('<span class="error">Enter a valid email address.</span>').fadeIn(1000); 270 hasError = true; 271 } else if (!emailblockReg.test(emailaddressVal)) { 272 jQuery("#signup-banner .content-signup-title").after('<span class="error">No yahoo, gmail or hotmail emails.</span>').fadeIn(1000); 273 hasError = true 274 } 275 if (hasError == true) { 276 return false; 277 } 278 });
279 280 /* SIDEBAR FORM */ 281 /* jQuery('#newsletter-sidebar form#icpsignup896 #btn-submit-side').click(function() { 282 jQuery(".error").hide(); 283 var hasError = false; 284 var emailReg = /^([a-zA-Z0-9_\.\-\+])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/; 285 //var emailblockReg = /^([\w-\.]+@(?!gmail.com)(?!yahoo.com)(?!hotmail.com)([\w-]+\.)+[\w-]{2,4})?$/; 286 var emailaddressVal = jQuery("#newsletter-sidebar #UserEmail").val(); 287 if(emailaddressVal == '') { 288 jQuery("#newsletter-sidebar #UserEmail").after('<span class="error">Please enter your email address.</span>'); 289 hasError = true; 290 } 291 292 else if(!emailReg.test(emailaddressVal)) { 293 jQuery("#newsletter-sidebar #UserEmail").after('<span class="error">Enter a valid email address.</span>'); 294 hasError = true; 295 } 296 297 else if(!emailblockReg.test(emailaddressVal)) { 298 299 jQuery("#newsletter-sidebar #UserEmail").after('<span class="error">No yahoo, gmail or hotmail emails.</span>'); 300 hasError = true; 301 } 302 303 if(hasError == true) { return false; } 304 }); */ 305 306 /* **NEW** SIDEBAR FORM */ 307 jQuery('#sidebar-signup form#icpsignup896 #btn-signup-submit').click(function() { 308 //alert('btn click'); 309 jQuery(".error").hide(); 310 var hasError = false; 311 var emailReg = /^([a-zA-Z0-9_\.\-\+])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/; 312 //var emailblockReg = /^([\w-\.]+@(?!gmail.com)(?!yahoo.com)(?!hotmail.com)([\w-]+\.)+[\w-]{2,4})?$/; 313 var emailaddressVal = jQuery("#sidebar-signup #UserEmail").val(); 314 if (emailaddressVal == '') { 315 jQuery("#sidebar-signup .sidebar-signup-title").after('<span class="error">Please enter your email address.</span>'); 316 //jQuery(".error").hide().fadeIn(); 317 hasError = true; 318 } 319 else if (!emailReg.test(emailaddressVal)) { 320 jQuery("#sidebar-signup .sidebar-signup-title").after('<span class="error">Enter a valid email address.</span>'); 321 hasError = true; 322 } 323 else if (!emailblockReg.test(emailaddressVal)) { 324 jQuery("#sidebar-signup .sidebar-signup-title").after('<span class="error">No yahoo, gmail or hotmail emails.</span>'); 325 hasError = true 326 } 327 if (hasError == true) { 328 return false; 329 } 330 }); 331 332 /* **NEW** LOWER SIDEBAR FORM */ 333 jQuery('form#icpsignup896x #btn-signup-submit').click(function() { 334 //alert('btn click'); 335 jQuery(".error").hide(); 336 var hasError = false; 337 var emailReg = /^([\w-]+(?:\.[\w-]+)*)@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$/i 338 //var emailblockReg = /^([\w-\.]+@(?!gmail.com)(?!yahoo.com)(?!hotmail.com)([\w-]+\.)+[\w-]{2,4})?$/; 339 var emailaddressValLower = jQuery('form#icpsignup896x #UserEmailx').val(); 340 //alert('email: ' + emailaddressValLower); 341 if (emailaddressValLower == '') { 342 jQuery('form#icpsignup896x .sidebar-signup-title').after('<span class="error">Please enter your email address.</span>'); 343 //jQuery(".error").hide().fadeIn(); 344 hasError = true; 345 } else if (emailaddressValLower == 'Your email here...') { 346 jQuery('form#icpsignup896x .sidebar-signup-title').after('<span class="error">Please enter your email address.</span>'); 347 //jQuery(".error").hide().fadeIn(); 348 hasError = true; 349 350 } else if (!emailReg.test(emailaddressValLower)) { 351 jQuery('form#icpsignup896x .sidebar-signup-title').after('<span class="error">Enter a valid email address.</span>'); 352 hasError = true; 353 } 354 355 if (hasError == true) { 356 return false; 357 } 358 }); 359 360 /* TOP FORM */ 361 jQuery('#newsletter form#icpsignup896 #btn-submit').click(function() { 362 jQuery(".error").hide(); 363 var hasError = false; 364 var emailReg = /^([a-zA-Z0-9_\.\-\+])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/; 365 //var emailReg = /^([\w-\.]+@([\w-]+\.)+[\w-]{2,4})?$/; 366 //var emailblockReg = /^([\w-\.]+@(?!gmail.com)(?!yahoo.com)(?!hotmail.com)([\w-]+\.)+[\w-]{2,4})?$/; 367 var emailaddressVal = jQuery("#newsletter .fields_email").val(); 368 if (emailaddressVal == '') { 369 jQuery("#newsletter .fields_email").after('<span class="error">Please enter your email address.</span>'); 370 hasError = true; 371 } 372 else if (!emailReg.test(emailaddressVal)) { 373 jQuery("#newsletter .fields_email").after('<span class="error">Enter a valid email address.</span>'); 374 hasError = true; 375 } 376 377 else if (!emailblockReg.test(emailaddressVal)) { 378 jQuery("#newsletter .fields_email").after('<span class="error">No yahoo, gmail or hotmail emails.</span>'); 379 hasError = true 380 } 381 382 if (hasError == true) { 383 return false; 384 } 385 386 });
387 388 /* Scroll Triggered FORM */ 389 jQuery('#stb-30316 #icpsignup896 #btn-submit').click(function() { 390 jQuery(".error").hide(); 391 var hasError = false; 392 var emailReg = /^([a-zA-Z0-9_\.\-\+])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/; 393 //var emailReg = /^([\w-\.]+@([\w-]+\.)+[\w-]{2,4})?$/; 394 //var emailblockReg = /^([\w-\.]+@(?!gmail.com)(?!yahoo.com)(?!hotmail.com)([\w-]+\.)+[\w-]{2,4})?$/; 395 var emailaddressVal = jQuery("#newsletter .fields_email").val(); 396 if (emailaddressVal == '') { 397 jQuery("#newsletter .fields_email").after('<span class="error">Please enter your email address.</span>'); 398 hasError = true; 399 } 400 else if (!emailReg.test(emailaddressVal)) { 401 jQuery("#newsletter .fields_email").after('<span class="error">Enter a valid email address.</span>'); 402 hasError = true; 403 } 404 405 else if (!emailblockReg.test(emailaddressVal)) { 406 jQuery("#newsletter .fields_email").after('<span class="error">No yahoo, gmail or hotmail emails.</span>'); 407 hasError = true 408 } 409 410 if (hasError == true) { 411 return false; 412 } 413 414 }); 415 416 // STICKY SIDEBAR - TODO: Account for Small Height Screen 417 /*function stickSidebar() { 418 var stickyWidget = jQuery('.widget_better_posts'); 419 var widgetOffset = jQuery('.widget_better_posts').offset().top; 420 421 jQuery(window).scroll(function fixHead(){ 422 var scrollTop = jQuery(window).scrollTop(); 423 var winHeight = jQuery(window).height(); 424 var winWidth = jQuery(window).width(); 425 426 if(winWidth >= 1024) { 427 if(scrollTop > widgetOffset){ 428 stickyWidget.addClass('stickySide'); 429 } 430 else { 431 stickyWidget.removeClass('stickySide'); 432 } 433 } else { 434 stickyWidget.hide(); 435 } 436 437 }) 438 } 439 440 function stickSidebarInPost() { 441 var stickyWidget = jQuery('.widget_better_posts'); 442 var widgetOffset = jQuery('.widget_better_posts').offset().top; 443 var footerOffset = jQuery('#footer').offset().top; 444 var scrollTop = jQuery(window).scrollTop(); 445 var winHeight = jQuery(window).height(); 446 var winWidth = jQuery(window).width(); 447 448 if ((scrollTop > widgetOffset) && (winWidth >=1024)) { 449 450 if ( jQuery('body').hasClass('single') ) { 451 stickyWidget.addClass('stickySideInPost'); 452 } else { 453 stickyWidget.addClass('stickySide'); 454 } 455 456 457 if(scrollTop >= footerOffset - stickyWidget.height()){ 458 stickyWidget.addClass('stickySideBottom'); 459 } 460 else { 461 stickyWidget.removeClass('stickySideBottom'); 462 } 463 464 } 465 else { 466 stickyWidget.removeClass('stickySideInPost'); 467 stickyWidget.removeClass('stickySide'); 468 } 469 470 }; 471 stickSidebar(); */ 472 // 473 474 475}); 476/* custom sticky menu */ 477/* jQuery(function(){ 478 479 var menu = jQuery('#primary_menu'), 480 481 pos = menu.offset(); 482 483 jQuery(window).scroll(function(){ 484 485 if(jQuery(this).scrollTop() > pos.top+menu.height() && menu.hasClass('default')){ 486 487 menu.fadeOut('fast', function(){ 488 489 jQuery(this).removeClass('default').addClass('fixed').fadeIn('fast'); 490 491 }); 492 493 } else if(jQuery(this).scrollTop() <= pos.top && menu.hasClass('fixed')){ 494 495 menu.fadeOut('fast', function(){ 496 497 jQuery(this).removeClass('fixed').addClass('default').fadeIn('fast'); 498 499 }); 500 501 } 502 503 }); 504 505 }); */ 506 507/* 508 * Preload image function 509 */ 510(function($) { 511 var cache = []; 512 // Arguments are image paths relative to the current page. 513 $.preLoadImages = function() { 514 var args_len = arguments.length; 515 for (var i = args_len; i--; ) { 516 var cacheImage = document.createElement('img'); 517 cacheImage.src = arguments[i]; 518 cache.push(cacheImage); 519 } 520 } 521})(jQuery) 522 523// Preload loading images 524jQuery.preLoadImages( 525 assetsUri + '/transparent.gif', 526 assetsUri + '/preloader.png' 527 ); 528 529/* 530 * Preloader image 531 */
532var preLoader = null; 533var preLoaderCount = 0; 534function mysitePreloader(img_class) { 535 var i, 536 positions; 537 i = 0; 538 539 positions = [-26, -52, -78, -104, -130, -156, -182, -208, -234, -260, -286, 0]; 540 positionsClass = 'center'; 541 542 preLoader = setInterval(function() { 543 jQuery(img_class + ' img').css('background-position', positions[i] + 'px ' + positionsClass); 544 i++; 545 preLoaderCount++; 546 if (preLoaderCount === 200) { 547 clearInterval(preLoader); 548 preLoaderCount = 0; 549 } 550 if (i === 12) { 551 i = 0; 552 } 553 }, 70); 554} 555 556var preLoaderSmall = null; 557var preLoaderSmallCount = 0; 558function mysitePreloaderSmall(img_class) { 559 var i, 560 positions; 561 i = 0; 562 563 positionsSmall = [-16, -32, -48, -64, -80, -96, -112, -128, -144, -160, -176, 0]; 564 positionsClassSmall = 'bottom'; 565 566 preLoaderSmall = setInterval(function() { 567 jQuery(img_class + ' img').css('background-position', positionsSmall[i] + 'px ' + positionsClassSmall); 568 i++; 569 preLoaderSmallCount++; 570 if (preLoaderSmallCount === 200) { 571 clearInterval(preLoaderSmall); 572 preLoaderSmallCount = 0; 573 } 574 if (i === 12) { 575 i = 0; 576 } 577 }, 70); 578} 579 580var preLoaderLarge = null; 581var preLoaderLargeCount = 0; 582function mysitePreloaderLarge(img_class) { 583 var i, 584 positions; 585 i = 0; 586 587 positionsLarge = [-35, -70, -105, -140, -175, -210, -245, -280, -315, -350, -385, 0]; 588 positionsClassLarge = 'top'; 589 590 preLoaderLarge = setInterval(function() { 591 jQuery(img_class + ' img').css('background-position', positionsLarge[i] + 'px ' + positionsClassLarge); 592 i++; 593 preLoaderLargeCount++; 594 if (preLoaderLargeCount === 200) { 595 clearInterval(preLoaderLarge); 596 preLoaderLargeCount = 0; 597 } 598 if (i === 12) { 599 i = 0; 600 } 601 }, 70); 602} 603 604mysitePreloader('.mysite_preloader'); 605mysitePreloaderLarge('.mysite_preloader_large'); 606 607/* 608 * YouTube api events 609 */ 610function onYouTubePlayerAPIReady(id) { 611 new YT.Player(id, { 612 height: '', 613 width: '', 614 videoId: '', 615 events: { 616 'onStateChange': onPlayerStateChange 617 } 618 }); 619} 620 621function onPlayerStateChange(event) { 622 if (event.data == YT.PlayerState.PLAYING) { 623 if (jQuery('#mysite_scrolling_slider').length > 0) { 624 jQuery('#mysite_scrolling_slider').data('scrollable').stop(); 625 jQuery('#slider_module_inner').mouseout(function() { 626 jQuery('#mysite_scrolling_slider').data('scrollable').stop(); 627 }); 628 } 629 if (jQuery('#fading_slides').length > 0) { 630 jQuery('.slider_nav').data('slideshow').stop(); 631 } 632 } 633} 634 635/* 636 * Vimeo api events 637 */ 638var VimeoEmbed = {}; 639 640VimeoEmbed.vimeo_player_loaded = function(player_id) { 641 VimeoEmbed.setupAPIEventListeners(player_id); 642}; 643 644VimeoEmbed.setupAPIEventListeners = function(target) { 645 iframe_player = document.getElementById(target); 646 iframe_player.addEvent('onPlay', VimeoEmbed.vimeo_on_play); 647}; 648 649VimeoEmbed.vimeo_on_play = function(player_id) { 650 if (jQuery('#mysite_scrolling_slider').length > 0) { 651 jQuery('#mysite_scrolling_slider').data('scrollable').stop(); 652 jQuery('#slider_module_inner').mouseout(function() { 653 jQuery('#mysite_scrolling_slider').data('scrollable').stop(); 654 }); 655 } 656 if (jQuery('#fading_slides').length > 0) { 657 jQuery('.slider_nav').data('slideshow').stop(); 658 } 659}; 660 661/* 662 * Contact ajaxForm 663 */ 664(function($) 665{ 666 $(function() { 667 try { 668 669 $('div.mysite_form > form').ajaxForm({ 670 data: {'_mysite_form_ajax_submit': 1}, 671 dataType: 'json', 672 success: function(data) { 673 if ($.browser.safari) { 674 bodyelem = $('body') 675 } else { 676 bodyelem = $('html') 677 } 678 679 jQuery(data.into).find(':input').each(function() { 680 jQuery(this).removeClass('required_error'); 681 }); 682 683 if (data.errors) { 684 685 if (data.errored_fields) { 686 $('.mysite_message').remove(); 687 for (var i in data.errored_fields) { 688 $('#' + data.errored_fields[i]).addClass('required_error'); 689 } 690 bodyelem.animate({scrollTop: $(data.into).offset().top - 80 691 }, 'slow', function() { 692 jQuery('.mysite_contact_feedback').css('display', 'none'); 693 }); 694 } 695 696 if (data.errored_fields == '' || !data.sidebar) { 697 if (data.errors) { 698 bodyelem.animate({ 699 scrollTop: $(data.into).offset().top - 80 700 }, 'slow', function() { 701 $('.mysite_message').remove(); 702 $(data.errors).css('display', 'none').prependTo(data.into).slideDown('slow'); 703 jQuery('.mysite_contact_feedback').css('display', 'none'); 704 }); 705 } 706 } 707 } 708 709 if (data.mail_sent) { 710 $('.mysite_message').remove(); 711 $(data.into + ' > form').remove(); 712 bodyelem.animate({ 713 scrollTop: $(data.into).offset().top - 80 714 }, 'slow', function() { 715 $(data.success).css('display', 'none').prependTo(data.into).slideDown('slow'); 716 jQuery('.mysite_contact_feedback').css('display', 'none'); 717 }); 718 } 719 } 720 721 }); 722 723 } catch (e) { 724 //suppress error 725 } 726 });
727 728})(jQuery); 729 730/* 731 * Mysitemyway image preloader 732 */ 733(function($) 734{ 735 $.fn.preloader = function(options) { 736 var defaults = { 737 selector: '', 738 imgSelector: 'img:not(.nopreload)', 739 imgAppend: 'a', 740 fade: true, 741 delay: 500, 742 fadein: 400, 743 slider: false, 744 imageResize: imageResize, 745 resizeDisabled: resizeDisabled, 746 nonce: imageNonce, 747 beforeShowAll: function() { 748 }, 749 onDone: function() { 750 }, 751 oneachload: function(image) { 752 } 753 754 }, 755 options = $.extend({}, defaults, options); 756 757 var ua = $.browser, 758 uaVersion = ua.version.substring(0, 1); 759 760 if (options.imageResize == 'wordpress') 761 options.delay = 0; 762 763 return this.each(function() { 764 765 options.beforeShowAll.call(this); 766 767 var $this = $(this), 768 images = $this.find(options.imgSelector), 769 count = images.length; 770 771 $this.load = { 772 preload: function(count) { 773 if (count > 0) { 774 $this.load.loadImage(0, count); 775 } else if (options.slider && $this.find('.video_frame').length > 0) { 776 options.onDone.call(this); 777 } else { 778 return; 779 } 780 }, 781 loadImage: function(i, count) { 782 if (i < count) { 783 var imgId = Math.floor(Math.random() * 1000) + '_img_'; 784 $this.load.append(i, imgId); 785 786 if (options.imageResize == 'timthumb' || options.resizeDisabled == 'true') 787 $this.load.loader(i, $(images[i]).attr('src'), imgId); 788 789 if ((options.imageResize == 'wordpress') && (options.resizeDisabled == false)) 790 $this.load.resize(i, imgId); 791 792 } else { 793 options.onDone.call(this); 794 } 795 }, 796 append: function(i, imgId) { 797 $('<span id="' + imgId + (i + 1) + '"></span>').each(function() { 798 if (options.imgAppend) { 799 $(this).appendTo($this.find(options.imgAppend).eq(i)); 800 } else { 801 $(this).appendTo($(options.selector)); 802 } 803 804 }); 805 }, 806 loader: function(i, image, imgId) { 807 var newImage = new Image(), 808 currImage = $('#' + imgId + (i + 1)), 809 title = ($(images[i]).attr('title')) ? $(images[i]).attr('title') : ''; 810 811 $(newImage).load(function() { 812 var currImgWidth = $(images[i]).attr('width'), 813 currImgHeight = $(images[i]).attr('height'); 814 815 $(this).attr('width', currImgWidth); 816 $(this).attr('height', currImgHeight); 817 818 if (responsiveSite == 'true' && options.fade) { 819 paddingBottom = currImgHeight * 100 / $(images[i]).attr('width'); 820 $(images[i]).parent().parent().prepend('<span class="placeholder" style="padding-bottom:' + paddingBottom + '%;display:block;padding-top:' + imagePadding + 'px;height:0;width:100%;"></span>'); 821 $(images[i]).parent().remove(); 822 823 } else { 824 $(images[i]).parent().remove() 825 } 826 827 828 if (options.fade) { 829 $(this).css('display', 'none'); 830 $(currImage).append(this); 831 832 j = i + 1; 833 834 // Remove preloader 835 $(this).parent().prev().delay(j * options.delay).queue(function() { 836 $(this).remove(); 837 838 if (responsiveSite == 'true') { 839 currImage.prev().remove(); 840 } 841 }); 842 843 // FadeIn image 844 $(this).delay(j * options.delay).fadeIn(options.fadein).queue(function() { 845 $(this).addClass($(images[i]).attr('class')); 846 if ($(this).parent().parent().is('a')) { 847 if (($(this).parent().parent().attr('rel'))) { 848 if ($(this).parent().parent().attr('rel').match('prettyPhoto')) { 849 var filename = $(this).parent().parent().attr('href'), 850 videos = ['swf', 'youtube', 'vimeo', 'mov']; 851 for (var v in videos) { 852 if (filename.match(videos[v])) { 853 var video_icon = true; 854 } else { 855 var zoom_icon = true; 856 } 857 } 858 } 859 } 860 861 //$(this).parent().prev().remove(); 862 863 } else { 864 //$(this).parent().prev().remove(); 865 } 866 867 if (video_icon) { 868 $(this).parent().parent().css('backgroundImage', 'url(' + assetsUri + '/play.png)'); 869 870 } else if (zoom_icon) { 871 $(this).parent().parent().css('backgroundImage', 'url(' + assetsUri + '/zoom.png)'); 872 } 873 874 options.oneachload.call(this, this); 875 }); 876 if ((!ua.msie) || (uaVersion >= '9' && ua.msie)) { 877 $this.load.loadImage(i + 1, count); 878 } 879 880 } else { 881 $(this).addClass($(images[i]).attr('class')); 882 $(currImage).append(this); 883 if ((!ua.msie) || (uaVersion >= '9' && ua.msie)) { 884 $this.load.loadImage(i + 1, count); 885 } 886 options.oneachload.call(this, this); 887 } 888 889 }).error(function() { 890 // try to load next item 891 $this.load.loadImage(i + 1, count); 892 }) 893 .attr('src', image) 894 .attr('title', title) 895 .attr('alt', $(images[i]).attr('alt')); 896 897 if (uaVersion <= '8' && ua.msie) { 898 $this.load.loadImage(i + 1, count); 899 } 900 901 }, 902 resize: function(i, imgId) { 903 var imgResize = $('<input>', {type: 'text', name: 'ajax_image_resize_url', val: $(images[i]).attr('src')}) 904 imgWidth = $('<input>', {type: 'text', name: 'img_width', val: $(images[i]).attr('width')}), 905 imgHeight = $('<input>', {type: 'text', name: 'img_height', val: $(images[i]).attr('height')}), 906 j5M5601 = $('<input>', {type: 'text', name: 'j5M5601', val: options.nonce}); 907 908 postData = imgResize.add(imgWidth).add(imgHeight).add(j5M5601).serialize(); 909 910 $.ajax({
911 type: 'POST', 912 dataType: 'json', 913 data: postData, 914 beforeSend: function(x) { 915 if (x && x.overrideMimeType) { 916 x.overrideMimeType('application/json;charset=UTF-8'); 917 } 918 }, 919 success: function(data) { 920 $this.load.loader(i, data.url, imgId); 921 } 922 }); 923 } 924 925 }; 926 927 $this.load.preload(count); 928 }); 929 } 930})(jQuery); 931 932 933/********************* 934 //* jQuery Multi Level CSS Menu #2- By Dynamic Drive: http://www.dynamicdrive.com/ 935 //* Last update: Nov 7th, 08': Limit # of queued animations to minmize animation stuttering 936 //* Menu avaiable at DD CSS Library: http://www.dynamicdrive.com/style/ 937 *********************/ 938 939//Update: April 12th, 10: Fixed compat issue with jquery 1.4x 940 941//Specify full URL to down and right arrow images (23 is padding-right to add to top level LIs with drop downs): 942var arrowimages = {down: ['', ''], right: ['', '']} 943 944var jqueryslidemenu = { 945 animateduration: {over: 200, out: 25}, //duration of slide in/ out animation, in milliseconds 946 947 buildmenu: function(menuid, arrowsvar) { 948 jQuery(document).ready(function($) { 949 $(" #main_navigation a").removeAttr("title"); 950 951 var $mainmenu = $("." + menuid + ">ul") 952 var $headers = $mainmenu.find("ul").parent() 953 $headers.each(function(i) { 954 var $curobj = $(this) 955 var $subul = $(this).find('ul:eq(0)') 956 this._dimensions = {w: this.offsetWidth, h: this.offsetHeight, subulw: $subul.outerWidth(), subulh: $subul.outerHeight()} 957 this.istopheader = $curobj.parents("ul").length == 1 ? true : false 958 $subul.css({top: this.istopheader ? this._dimensions.h + "px" : 0}) 959 960 /* 961 $curobj.children("a:eq(0)").css(this.istopheader? {paddingRight: arrowsvar.down[2]} : {}).append( 962 '<img src="'+ (this.istopheader? arrowsvar.down[1] : arrowsvar.right[1]) 963 +'" class="' + (this.istopheader? arrowsvar.down[0] : arrowsvar.right[0]) 964 + '" style="border:0;" />' 965 )*/ 966 967 $curobj.hover( 968 function(e) { 969 var $targetul = $(this).children("ul:eq(0)") 970 this._offsets = {left: $(this).offset().left, top: $(this).offset().top} 971 972 if (jQuery.browser.msie) { 973 var menuleft = this.istopheader ? 0 : this._dimensions.w + 2 974 menuleft = (this._offsets.left + menuleft + this._dimensions.subulw > $(window).width()) ? (this.istopheader ? -this._dimensions.subulw + this._dimensions.w : -this._dimensions.w) - 4 : menuleft 975 } 976 if (!jQuery.browser.msie) { 977 var menuleft = this.istopheader ? 0 : this._dimensions.w 978 menuleft = (this._offsets.left + menuleft + this._dimensions.subulw > $(window).width()) ? (this.istopheader ? -this._dimensions.subulw + this._dimensions.w : -this._dimensions.w) : menuleft 979 } 980 if ($targetul.queue().length <= 1) { 981 $targetul.css({left: menuleft + "px", width: this._dimensions.subulw + 'px'}).slideDown(jqueryslidemenu.animateduration.over, function() { 982 // Animation complete 983 jQuery(this).find('li a span').css('display', 'block') 984 }) 985 986 if (jQuery.browser.msie) { 987 ieVersion = jQuery.browser.version.substring(0, 1); 988 if (ieVersion == 7) { 989 var disableArrors = true; 990 } 991 } 992 if (!disableArrors) { 993 if (this.istopheader && jQuery(this).children().eq(0).find('span.menu_arrow').length < 1) { 994 $curobj.children("a:eq(0)").append( 995 '<span class="menu_arrow"></span>' 996 ) 997 } 998 } 999 } //if 1 or less queued animations 1000 1001 }, 1002 function(e) { 1003 var $targetul = $(this).children("ul:eq(0)") 1004 $targetul.slideUp(jqueryslidemenu.animateduration.out) 1005 } 1006 ) //end hover 1007 $curobj.click(function() { 1008 $(this).children("ul:eq(0)").hide() 1009 }) 1010 }) //end $headers.each() 1011 $mainmenu.find("ul").css({display: 'none', visibility: 'visible'}) 1012 }) //end document.ready 1013 } 1014}; 1015//build menu with ID="main_navigation" on page: 1016if (disableSlidemenu == 'false') { 1017 jqueryslidemenu.buildmenu("jqueryslidemenu", arrowimages); 1018} 1019 1020 1021/* 1022 reflection.js for jQuery v1.03 1023 (c) 2006-2009 Christophe Beyls <http://www.digitalia.be> 1024 MIT-style license. 1025 */ 1026(function(a) { 1027 a.fn.extend({reflect: function(b) { 1028 b = a.extend({height: 1 / 3, opacity: 0.5}, b); 1029 return this.unreflect().each(function() { 1030 var c = this; 1031 if (/^img$/i.test(c.tagName)) { 1032 function d() { 1033 var g = c.width, f = c.height, l, i, m, h, k; 1034 i = Math.floor((b.height > 1) ? Math.min(f, b.height) : f * b.height); 1035 if (a.browser.msie) { 1036 l = a("<img />").attr("src", c.src).css({width: g, height: f, marginBottom: i - f, filter: "flipv progid:DXImageTransform.Microsoft.Alpha(opacity=" + (b.opacity * 100) + ", style=1, finishOpacity=0, startx=0, start
1036y=0, finishx=0, finishy=" + (i / f * 100) + ")"})[0] 1037 } else { 1038 l = a("<canvas />")[0]; 1039 if (!l.getContext) { 1040 return 1041 } 1042 h = l.getContext("2d"); 1043 try { 1044 a(l).attr({width: g, height: i}); 1045 h.save(); 1046 h.translate(0, f - 1); 1047 h.scale(1, -1); 1048 h.drawImage(c, 0, 0, g, f); 1049 h.restore(); 1050 h.globalCompositeOperation = "destination-out"; 1051 k = h.createLinearGradient(0, 0, 0, i); 1052 k.addColorStop(0, "rgba(255, 255, 255, " + (1 - b.opacity) + ")"); 1053 k.addColorStop(1, "rgba(255, 255, 255, 1.0)"); 1054 h.fillStyle = k; 1055 h.rect(0, 0, g, i); 1056 h.fill() 1057 } catch (j) { 1058 return 1059 } 1060 } 1061 a(l).css({display: "block", border: 0}); 1062 m = a(/^a$/i.test(c.parentNode.tagName) ? "<span />" : "<div />").insertAfter(c).append([c, l])[0]; 1063 m.className = c.className; 1064 a.data(c, "reflected", m.style.cssText = c.style.cssText); 1065 a(m).css({width: g, height: f + i, overflow: "hidden"}); 1066 c.style.cssText = "display: block; border: 0px"; 1067 c.className = "reflected" 1068 } 1069 if (c.complete) { 1070 d() 1071 } else { 1072 a(c).load(d) 1073 } 1074 } 1075 }) 1076 }, unreflect: function() { 1077 return this.unbind("load").each(function() { 1078 var c = this, b = a.data(this, "reflected"), d; 1079 if (b !== undefined) { 1080 d = c.parentNode; 1081 c.className = d.className; 1082 c.style.cssText = b; 1083 a.removeData(c, "reflected"); 1084 d.parentNode.replaceChild(c, d) 1085 } 1086 }) 1087 }}) 1088})(jQuery); 1089 1090/** 1091 * hoverIntent r5 // 2007.03.27 // jQuery 1.1.2+ 1092 * <http://cherne.net/brian/resources/jquery.hoverIntent.html> 1093 * 1094 * @param f onMouseOver function || An object with configuration options 1095 * @param g onMouseOut function || Nothing (use configuration options object) 1096 * @author Brian Cherne <[email protected]> 1097 */ 1098(function($) { 1099 $.fn.hoverIntent = function(f, g) { 1100 var cfg = {sensitivity: 7, interval: 100, timeout: 0}; 1101 cfg = $.extend(cfg, g ? {over: f, out: g} : f); 1102 var cX, cY, pX, pY; 1103 var track = function(ev) { 1104 cX = ev.pageX; 1105 cY = ev.pageY; 1106 }; 1107 var compare = function(ev, ob) { 1108 ob.hoverIntent_t = clearTimeout(ob.hoverIntent_t); 1109 if ((Math.abs(pX - cX) + Math.abs(pY - cY)) < cfg.sensitivity) { 1110 $(ob).unbind("mousemove", track); 1111 ob.hoverIntent_s = 1; 1112 return cfg.over.apply(ob, [ev]); 1113 } else { 1114 pX = cX; 1115 pY = cY; 1116 ob.hoverIntent_t = setTimeout(function() { 1117 compare(ev, ob); 1118 }, cfg.interval); 1119 } 1120 }; 1121 var delay = function(ev, ob) { 1122 ob.hoverIntent_t = clearTimeout(ob.hoverIntent_t); 1123 ob.hoverIntent_s = 0; 1124 return cfg.out.apply(ob, [ev]); 1125 }; 1126 var handleHover = function(e) { 1127 var p = (e.type == "mouseover" ? e.fromElement : e.toElement) || e.relatedTarget; 1128 while (p && p != this) { 1129 try { 1130 p = p.parentNode; 1131 } catch (e) { 1132 p = this; 1133 } 1134 } 1135 if (p == this) { 1136 return false; 1137 } 1138 var ev = jQuery.extend({}, e); 1139 var ob = this; 1140 if (ob.hoverIntent_t) { 1141 ob.hoverIntent_t = clearTimeout(ob.hoverIntent_t); 1142 } 1143 if (e.type == "mouseover") { 1144 pX = ev.pageX; 1145 pY = ev.pageY; 1146 $(ob).bind("mousemove", track); 1147 if (ob.hoverIntent_s != 1) { 1148 ob.hoverIntent_t = setTimeout(function() { 1149 compare(ev, ob); 1150 }, cfg.interval); 1151 } 1152 } else { 1153 $(ob).unbind("mousemove", track); 1154 if (ob.hoverIntent_s == 1) { 1155 ob.hoverIntent_t = setTimeout(function() { 1156 delay(ev, ob); 1157 }, cfg.timeout); 1158 } 1159 } 1160 }; 1161 return this.mouseover(handleHover).mouseout(handleHover); 1162 }; 1163})(jQuery); 1164 1165/* 1166 * jQuery Easing v1.3 - http://gsgd.co.uk/sandbox/jquery/easing/ 1167 * 1168 * Uses the built in easing capabilities added In jQuery 1.1 1169 * to offer multiple easing options 1170 * 1171 * TERMS OF USE - jQuery Easing 1172 * 1173 * Open source under the BSD License. 1174 * 1175 * Copyright © 2008 George McGinley Smith 1176 * All rights reserved. 1177 * 1178 * Redistribution and use in source and binary forms, with or without modification, 1179 * are permitted provided that the following conditions are met: 1180 * 1181 * Redistributions of source code must retain the above copyright notice, this list of 1182 * conditions and the following disclaimer. 1183 * Redistributions in binary form must reproduce the above copyright notice, this list 1184 * of conditions and the following disclaimer in the documentation and/or other materials 1185 * provided with the distribution. 1186 * 1187 * Neither the name of the author nor the names of contributors may be used to endorse 1188 * or promote products derived from this software without specific prior written permission. 1189 * 1190 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY 1191 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 1192 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 1193 * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
vendor: 6,985 bytes, lines 1194-1360
1194 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE 1195 * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED 1196 * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 1197 * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED 1198 * OF THE POSSIBILITY OF SUCH DAMAGE. 1199 * 1200 */ 1201 1202jQuery.easing['jswing'] = jQuery.easing['swing']; 1203jQuery.extend(jQuery.easing, {def: 'easeOutQuad', swing: function(x, t, b, c, d) { 1204 return jQuery.easing[jQuery.easing.def](x, t, b, c, d); 1205 }, easeInQuad: function(x, t, b, c, d) { 1206 return c * (t /= d) * t + b; 1207 }, easeOutQuad: function(x, t, b, c, d) { 1208 return-c * (t /= d) * (t - 2) + b; 1209 }, easeInOutQuad: function(x, t, b, c, d) { 1210 if ((t /= d / 2) < 1) 1211 return c / 2 * t * t + b; 1212 return-c / 2 * ((--t) * (t - 2) - 1) + b; 1213 }, easeInCubic: function(x, t, b, c, d) { 1214 return c * (t /= d) * t * t + b; 1215 }, easeOutCubic: function(x, t, b, c, d) { 1216 return c * ((t = t / d - 1) * t * t + 1) + b; 1217 }, easeInOutCubic: function(x, t, b, c, d) { 1218 if ((t /= d / 2) < 1) 1219 return c / 2 * t * t * t + b; 1220 return c / 2 * ((t -= 2) * t * t + 2) + b; 1221 }, easeInQuart: function(x, t, b, c, d) { 1222 return c * (t /= d) * t * t * t + b; 1223 }, easeOutQuart: function(x, t, b, c, d) { 1224 return-c * ((t = t / d - 1) * t * t * t - 1) + b; 1225 }, easeInOutQuart: function(x, t, b, c, d) { 1226 if ((t /= d / 2) < 1) 1227 return c / 2 * t * t * t * t + b; 1228 return-c / 2 * ((t -= 2) * t * t * t - 2) + b; 1229 }, easeInQuint: function(x, t, b, c, d) { 1230 return c * (t /= d) * t * t * t * t + b; 1231 }, easeOutQuint: function(x, t, b, c, d) { 1232 return c * ((t = t / d - 1) * t * t * t * t + 1) + b; 1233 }, easeInOutQuint: function(x, t, b, c, d) { 1234 if ((t /= d / 2) < 1) 1235 return c / 2 * t * t * t * t * t + b; 1236 return c / 2 * ((t -= 2) * t * t * t * t + 2) + b; 1237 }, easeInSine: function(x, t, b, c, d) { 1238 return-c * Math.cos(t / d * (Math.PI / 2)) + c + b; 1239 }, easeOutSine: function(x, t, b, c, d) { 1240 return c * Math.sin(t / d * (Math.PI / 2)) + b; 1241 }, easeInOutSine: function(x, t, b, c, d) { 1242 return-c / 2 * (Math.cos(Math.PI * t / d) - 1) + b; 1243 }, easeInExpo: function(x, t, b, c, d) { 1244 return(t == 0) ? b : c * Math.pow(2, 10 * (t / d - 1)) + b; 1245 }, easeOutExpo: function(x, t, b, c, d) { 1246 return(t == d) ? b + c : c * (-Math.pow(2, -10 * t / d) + 1) + b; 1247 }, easeInOutExpo: function(x, t, b, c, d) { 1248 if (t == 0) 1249 return b; 1250 if (t == d) 1251 return b + c; 1252 if ((t /= d / 2) < 1) 1253 return c / 2 * Math.pow(2, 10 * (t - 1)) + b; 1254 return c / 2 * (-Math.pow(2, -10 * --t) + 2) + b; 1255 }, easeInCirc: function(x, t, b, c, d) { 1256 return-c * (Math.sqrt(1 - (t /= d) * t) - 1) + b; 1257 }, easeOutCirc: function(x, t, b, c, d) { 1258 return c * Math.sqrt(1 - (t = t / d - 1) * t) + b; 1259 }, easeInOutCirc: function(x, t, b, c, d) { 1260 if ((t /= d / 2) < 1) 1261 return-c / 2 * (Math.sqrt(1 - t * t) - 1) + b; 1262 return c / 2 * (Math.sqrt(1 - (t -= 2) * t) + 1) + b; 1263 }, easeInElastic: function(x, t, b, c, d) { 1264 var s = 1.70158; 1265 var p = 0; 1266 var a = c; 1267 if (t == 0) 1268 return b; 1269 if ((t /= d) == 1) 1270 return b + c; 1271 if (!p) 1272 p = d * .3; 1273 if (a < Math.abs(c)) { 1274 a = c; 1275 var s = p / 4; 1276 } 1277 else 1278 var s = p / (2 * Math.PI) * Math.asin(c / a); 1279 return-(a * Math.pow(2, 10 * (t -= 1)) * Math.sin((t * d - s) * (2 * Math.PI) / p)) + b; 1280 }, easeOutElastic: function(x, t, b, c, d) { 1281 var s = 1.70158; 1282 var p = 0; 1283 var a = c; 1284 if (t == 0) 1285 return b; 1286 if ((t /= d) == 1) 1287 return b + c; 1288 if (!p) 1289 p = d * .3; 1290 if (a < Math.abs(c)) { 1291 a = c; 1292 var s = p / 4; 1293 } 1294 else 1295 var s = p / (2 * Math.PI) * Math.asin(c / a); 1296 return a * Math.pow(2, -10 * t) * Math.sin((t * d - s) * (2 * Math.PI) / p) + c + b; 1297 }, easeInOutElastic: function(x, t, b, c, d) { 1298 var s = 1.70158; 1299 var p = 0; 1300 var a = c; 1301 if (t == 0) 1302 return b; 1303 if ((t /= d / 2) == 2) 1304 return b + c; 1305 if (!p) 1306 p = d * (.3 * 1.5); 1307 if (a < Math.abs(c)) { 1308 a = c; 1309 var s = p / 4; 1310 } 1311 else 1312 var s = p / (2 * Math.PI) * Math.asin(c / a); 1313 if (t < 1) 1314 return-.5 * (a * Math.pow(2, 10 * (t -= 1)) * Math.sin((t * d - s) * (2 * Math.PI) / p)) + b; 1315 return a * Math.pow(2, -10 * (t -= 1)) * Math.sin((t * d - s) * (2 * Math.PI) / p) * .5 + c + b; 1316 }, easeInBack: function(x, t, b, c, d, s) { 1317 if (s == undefined) 1318 s = 1.70158; 1319 return c * (t /= d) * t * ((s + 1) * t - s) + b; 1320 }, easeOutBack: function(x, t, b, c, d, s) { 1321 if (s == undefined) 1322 s = 1.70158; 1323 return c * ((t = t / d - 1) * t * ((s + 1) * t + s) + 1) + b; 1324 }, easeInOutBack: function(x, t, b, c, d, s) { 1325 if (s == undefined) 1326 s = 1.70158; 1327 if ((t /= d / 2) < 1) 1328 return c / 2 * (t * t * (((s *= (1.525)) + 1) * t - s)) + b; 1329 return c / 2 * ((t -= 2) * t * (((s *= (1.525)) + 1) * t + s) + 2) + b; 1330 }, easeInBounce: function(x, t, b, c, d) { 1331 return c - jQuery.easing.easeOutBounce(x, d - t, 0, c, d) + b; 1332 }, easeOutBounce: function(x, t, b, c, d) { 1333 if ((t /= d) < (1 / 2.75)) { 1334 return c * (7.5625 * t * t) + b; 1335 } else if (t < (2 / 2.75)) { 1336 return c * (7.5625 * (t -= (1.5 / 2.75)) * t + .75) + b; 1337 } else if (t < (2.5 / 2.75)) { 1338 return c * (7.5625 * (t -= (2.25 / 2.75)) * t + .9375) + b; 1339 } else { 1340 return c * (7.5625 * (t -= (2.625 / 2.75)) * t + .984375) + b; 1341 } 1342 }, easeInOutBounce: function(x, t, b, c, d) { 1343 if (t < d / 2) 1344 return jQuery.easing.easeInBounce(x, t * 2, 0, c, d) * .5 + b; 1345 return jQuery.easing.easeOutBounce(x, t * 2 - d, 0, c, d) * .5 + c * .5 + b; 1346 }}); 1347 1348/* 1349 * No Spam (1.3) 1350 * by Mike Branski (www.leftrightdesigns.com) 1351 * [email protected] 1352 * 1353 * Copyright (c) 2008 Mike Branski (www.leftrightdesigns.com) 1354 * Licensed under GPL (www.leftrightdesigns.com/library/jquery/nospam/gpl.txt) 1355 * 1356 * NOTE: This script requires jQuery to work. Download jQuery at www.jquery.com 1357 * 1358 * Thanks to Bill on the jQuery mailing list for the double slash idea! 1359 * 1360 * CHANGELOG:
1361 * v 1.3 - Added support for e-mail addresses with multiple dots (.) both before and after the at (@) sign 1362 * v 1.2.1 - Included GPL license 1363 * v 1.2 - Finalized name as No Spam (was Protect Email) 1364 * v 1.1 - Changed switch() to if() statement 1365 * v 1.0 - Initial release 1366 * 1367 */ 1368 1369jQuery.fn.nospam = function(settings) { 1370 settings = jQuery.extend({ 1371 replaceText: false, // optional, accepts true or false 1372 filterLevel: 'normal' // optional, accepts 'low' or 'normal' 1373 }, settings); 1374 1375 return this.each(function() { 1376 e = null; 1377 if (settings.filterLevel == 'low') { // Can be a switch() if more levels added 1378 if (jQuery(this).is('a[rel]')) { 1379 e = jQuery(this).attr('rel').replace('//', '@').replace(/\//g, '.'); 1380 } else { 1381 e = jQuery(this).text().replace('//', '@').replace(/\//g, '.'); 1382 } 1383 } else { // 'normal' 1384 if (jQuery(this).is('a[rel]')) { 1385 e = jQuery(this).attr('rel').split('').reverse().join('').replace('//', '@').replace(/\//g, '.'); 1386 } else { 1387 e = jQuery(this).text().split('').reverse().join('').replace('//', '@').replace(/\//g, '.'); 1388 } 1389 } 1390 if (e) { 1391 if (jQuery(this).is('a[rel]')) { 1392 jQuery(this).attr('href', 'mailto:' + e); 1393 if (settings.replaceText) { 1394 jQuery(this).text(e); 1395 } 1396 } else { 1397 jQuery(this).text(e); 1398 } 1399 } 1400 }); 1401}; 1402 1403 1404/* 1405 1406 CUSTOM FORM ELEMENTS 1407 1408 Created by Ryan Fait 1409 www.ryanfait.com 1410
1411 The only things you may need to change in this file are the following 1412 variables: checkboxHeight, radioHeight and selectWidth (lines 24, 25, 26) 1413 1414 The numbers you set for checkboxHeight and radioHeight should be one quarter 1415 of the total height of the image want to use for checkboxes and radio 1416 buttons. Both images should contain the four stages of both inputs stacked 1417 on top of each other in this order: unchecked, unchecked-clicked, checked, 1418 checked-clicked. 1419 1420 You may need to adjust your images a bit if there is a slight vertical 1421 movement during the different stages of the button activation. 1422 1423 The value of selectWidth should be the width of your select list image. 1424 1425 Visit http://ryanfait.com/ for more information. 1426 1427 */ 1428 1429var checkboxHeight = "25"; 1430var radioHeight = "25"; 1431var selectWidth = "190"; 1432 1433 1434/* No need to change anything after this */ 1435 1436 1437document.write('<style type="text/css">input.styled { display: none; } select.styled { position: relative; width: ' + selectWidth + 'px; opacity: 0; filter: alpha(opacity=0); z-index: 5; } .disabled { opacity: 0.5; filter: alpha(opacity=50); }</style>'); 1438 1439var Custom = { 1440 init: function() { 1441 var inputs = document.getElementsByTagName("input"), span = Array(), textnode, option, active; 1442 for (a = 0; a < inputs.length; a++) { 1443 if ((inputs[a].type == "checkbox" || inputs[a].type == "radio") && jQuery(inputs[a]).hasClass('styled')) { 1444 span[a] = document.createElement("span"); 1445 span[a].className = inputs[a].type; 1446 1447 if (inputs[a].checked == true) { 1448 if (inputs[a].type == "checkbox") { 1449 position = "0 -" + (checkboxHeight * 2) + "px"; 1450 span[a].style.backgroundPosition = position; 1451 } else { 1452 position = "0 -" + (radioHeight * 2) + "px"; 1453 span[a].style.backgroundPosition = position; 1454 } 1455 } 1456 inputs[a].parentNode.insertBefore(span[a], inputs[a]); 1457 inputs[a].onchange = Custom.clear; 1458 if (!inputs[a].getAttribute("disabled")) { 1459 span[a].onmousedown = Custom.pushed; 1460 span[a].onmouseup = Custom.check; 1461 } else { 1462 span[a].className = span[a].className += " disabled"; 1463 } 1464 } 1465 } 1466 inputs = document.getElementsByTagName("select"); 1467 for (a = 0; a < inputs.length; a++) { 1468 if (jQuery(inputs[a]).hasClass('styled')) { 1469 option = inputs[a].getElementsByTagName("option"); 1470 active = option[0].childNodes[0].nodeValue; 1471 textnode = document.createTextNode(active); 1472 for (b = 0; b < option.length; b++) { 1473 if (option[b].selected == true) { 1474 textnode = document.createTextNode(option[b].childNodes[0].nodeValue); 1475 } 1476 } 1477 span[a] = document.createElement("span"); 1478 span[a].className = "select";
1479 span[a].id = "select" + inputs[a].name; 1480 span[a].appendChild(textnode); 1481 inputs[a].parentNode.insertBefore(span[a], inputs[a]); 1482 if (!inputs[a].getAttribute("disabled")) { 1483 inputs[a].onchange = Custom.choose; 1484 } else { 1485 inputs[a].previousSibling.className = inputs[a].previousSibling.className += " disabled"; 1486 } 1487 } 1488 } 1489 document.onmouseup = Custom.clear; 1490 }, 1491 pushed: function() { 1492 element = this.nextSibling; 1493 if (element.checked == true && element.type == "checkbox") { 1494 this.style.backgroundPosition = "0 -" + checkboxHeight * 3 + "px"; 1495 } else if (element.checked == true && element.type == "radio") { 1496 this.style.backgroundPosition = "0 -" + radioHeight * 3 + "px"; 1497 } else if (element.checked != true && element.type == "checkbox") { 1498 this.style.backgroundPosition = "0 -" + checkboxHeight + "px"; 1499 } else { 1500 this.style.backgroundPosition = "0 -" + radioHeight + "px"; 1501 } 1502 }, 1503 check: function() { 1504 element = this.nextSibling; 1505 if (element.checked == true && element.type == "checkbox") { 1506 this.style.backgroundPosition = "0 0"; 1507 element.checked = false; 1508 } else { 1509 if (element.type == "checkbox") { 1510 this.style.backgroundPosition = "0 -" + checkboxHeight * 2 + "px"; 1511 } else { 1512 this.style.backgroundPosition = "0 -" + radioHeight * 2 + "px"; 1513 group = this.nextSibling.name; 1514 inputs = document.getElementsByTagName("input"); 1515 for (a = 0; a < inputs.length; a++) { 1516 if (inputs[a].name == group && inputs[a] != this.nextSibling) { 1517 inputs[a].previousSibling.style.backgroundPosition = "0 0"; 1518 } 1519 } 1520 } 1521 element.checked = true; 1522 } 1523 }, 1524 clear: function() { 1525 inputs = document.getElementsByTagName("input"); 1526 for (var b = 0; b < inputs.length; b++) { 1527 if (inputs[b].type == "checkbox" && inputs[b].checked == true && jQuery(inputs[b]).hasClass('styled')) { 1528 inputs[b].previousSibling.style.backgroundPosition = "0 -" + checkboxHeight * 2 + "px"; 1529 } else if (inputs[b].type == "checkbox" && jQuery(inputs[b]).hasClass('styled')) { 1530 inputs[b].previousSibling.style.backgroundPosition = "0 0"; 1531 } else if (inputs[b].type == "radio" && inputs[b].checked == true && jQuery(inputs[b]).hasClass('styled')) { 1532 inputs[b].previousSibling.style.backgroundPosition = "0 -" + radioHeight * 2 + "px"; 1533 } else if (inputs[b].type == "radio" && jQuery(inputs[b]).hasClass('styled')) { 1534 inputs[b].previousSibling.style.backgroundPosition = "0 0"; 1535 } 1536 } 1537 }, 1538 choose: function() { 1539 option = this.getElementsByTagName("option"); 1540 for (d = 0; d < option.length; d++) { 1541 if (option[d].selected == true) { 1542 document.getElementById("select" + this.name).childNodes[0].nodeValue = option[d].childNodes[0].nodeValue; 1543 } 1544 } 1545 } 1546} 1547window.onload = Custom.init; 1548 1549 1550/* Copyright 2011, Ben Lin (http://dreamerslab.com/) 1551 * Licensed under the MIT License (LICENSE.txt). 1552 * 1553 * Version: 1.0.5 1554 * 1555 * Requires: jQuery 1.2.3+ 1556 */ 1557; 1558(function(a) { 1559 a.fn.extend({actual: function(b, k) { 1560 var c, d, h, g, f, j, e, i; 1561 if (!this[b]) { 1562 throw'$.actual => The jQuery method "' + b + '" you called does not exist'; 1563 } 1564 h = a.extend({absolute: false, clone: false, includeMargin: undefined}, k); 1565 d = this; 1566 if (h.clone === true) { 1567 e = function() { 1568 d = d.filter(":first").clone().css({position: "absolute", top: -1000}).appendTo("body"); 1569 }; 1570 i = function() { 1571 d.remove(); 1572 }; 1573 } else { 1574 e = function() { 1575 c = d.parents().andSelf().filter(":hidden"); 1576 g = h.absolute === true ? {position: "absolute", visibility: "hidden", display: "block"} : {visibility: "hidden", display: "block"}; 1577 f = []; 1578 c.each(function() { 1579 var m = {}, l; 1580 for (l in g) { 1581 m[l] = this.style[l]; 1582 this.style[l] = g[l]; 1583 } 1584 f.push(m); 1585 }); 1586 }; 1587 i = function() { 1588 c.each(function(m) { 1589 var n = f[m], l; 1590 for (l in g) { 1591 this.style[l] = n[l]; 1592 } 1593 }); 1594 }; 1595 } 1596 e(); 1597 j = d[b](h.includeMargin); 1598 i();
1599 return j; 1600 }}); 1601})(jQuery); 1602 1603// #################################################################################### 1604// ####### ####### 1605// ####### Plugin: jScroll ####### 1606// ####### Author: William Duffy ####### 1607// ####### Website: http://www.wduffy.co.uk/jScroll ####### 1608// ####### Version: 1.1 ####### 1609// ####### ####### 1610// ####### Copyright (c) 2011, William Duffy - www.wduffy.co.uk ####### 1611// ####### ####### 1612// ####### Permission is hereby granted, free of charge, to any person ####### 1613// ####### obtaining a copy of this software and associated documentation ####### 1614// ####### files (the "Software"), to deal in the Software without ####### 1615// ####### restriction, including without limitation the rights to use, ####### 1616// ####### copy, modify, merge, publish, distribute, sublicense, and/or sell ####### 1617// ####### copies of the Software, and to permit persons to whom the ####### 1618// ####### Software is furnished to do so, subject to the following ####### 1619// ####### conditions: ####### 1620// ####### ####### 1621// ####### The above copyright notice and this permission notice shall be ####### 1622// ####### included in all copies or substantial portions of the Software. ####### 1623// ####### ####### 1624// ####### THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, ####### 1625// ####### EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES ####### 1626// ####### OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND ####### 1627// ####### NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT ####### 1628// ####### HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, ####### 1629// ####### WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING ####### 1630// ####### FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR ####### 1631// ####### OTHER DEALINGS IN THE SOFTWARE. ####### 1632// ####### ####### 1633// #################################################################################### 1634 1635(function($) { 1636 $.fn.jScroll = function(e) { 1637 var f = $.extend({}, $.fn.jScroll.defaults, e); 1638 return this.each(function() { 1639 var a = $(this); 1640 var b = $(window); 1641 var c = new location(a); 1642 b.scroll(function() { 1643 a.stop().animate(c.getMargin(b), f.speed) 1644 }) 1645 }); 1646 function location(d) { 1647 this.min = d.offset().top; 1648 this.originalMargin = parseInt(d.css("margin-top"), 10) || 0; 1649 this.getMargin = function(a) { 1650 var b = d.parent().height() - d.outerHeight(); 1651 var c = this.originalMargin; 1652 if (a.scrollTop() >= this.min) 1653 c = c + f.top + a.scrollTop() - this.min; 1654 if (c > b) 1655 c = b; 1656 return({"marginTop": c + 'px'}) 1657 } 1658 }} 1659 ; 1660 $.fn.jScroll.defaults = {speed: "slow", top: 10} 1661})(jQuery); 1662 1663/*! 1664 * jQuery Cookie Plugin v1.4.0 1665 * https://github.com/carhartl/jquery-cookie 1666 * 1667 * Copyright 2013 Klaus Hartl 1668 * Released under the MIT license 1669 */ 1670(function(factory) { 1671 if (typeof define === 'function' && define.amd) { 1672 // AMD. Register as anonymous module. 1673 define(['jquery'], factory); 1674 } else { 1675 // Browser globals. 1676 factory(jQuery); 1677 } 1678}(function($) { 1679 1680 var pluses = /\+/g; 1681 1682 function encode(s) { 1683 return config.raw ? s : encodeURIComponent(s); 1684 } 1685 1686 function decode(s) { 1687 return config.raw ? s : decodeURIComponent(s); 1688 } 1689 1690 function stringifyCookieValue(value) { 1691 return encode(config.json ? JSON.stringify(value) : String(value)); 1692 } 1693 1694 function parseCookieValue(s) { 1695 if (s.indexOf('"') === 0) { 1696 // This is a quoted cookie as according to RFC2068, unescape... 1697 s = s.slice(1, -1).replace(/\\"/g, '"').replace(/\\\\/g, '\\'); 1698 } 1699 1700 try { 1701 // Replace server-side written pluses with spaces. 1702 // If we can't decode the cookie, ignore it, it's unusable. 1703 // If we can't parse the cookie, ignore it, it's unusable. 1704 s = decodeURIComponent(s.replace(pluses, ' ')); 1705 return config.json ? JSON.parse(s) : s; 1706 } catch (e) { 1707 } 1708 } 1709 1710 function read(s, converter) { 1711 var value = config.raw ? s : parseCookieValue(s); 1712 return $.isFunction(converter) ? converter(value) : value; 1713 } 1714 1715 var config = $.cookie = function(key, value, options) { 1716 1717 // Write 1718 1719 if (value !== undefined && !$.isFunction(value)) { 1720 options = $.extend({}, config.defaults, options); 1721 1722 if (typeof options.expires === 'number') { 1723 var days = options.expires, t = options.expires = new Date(); 1724 t.setTime(+t + days * 864e+5); 1725 } 1726 1727 return (document.cookie = [ 1728 encode(key), '=', stringifyCookieValue(value), 1729 options.expires ? '; expires=' + options.expires.toUTCString() : '', // use expires attribute, max-age is not supported by IE 1730 options.path ? '; path=' + options.path : '', 1731 options.domain ? '; domain=' + options.domain : '', 1732 options.secure ? '; secure' : '' 1733 ].join(''));
1734 } 1735 1736 // Read 1737 1738 var result = key ? undefined : {}; 1739 1740 // To prevent the for loop in the first place assign an empty array 1741 // in case there are no cookies at all. Also prevents odd result when 1742 // calling $.cookie(). 1743 var cookies = document.cookie ? document.cookie.split('; ') : []; 1744 1745 for (var i = 0, l = cookies.length; i < l; i++) { 1746 var parts = cookies[i].split('='); 1747 var name = decode(parts.shift()); 1748 var cookie = parts.join('='); 1749 1750 if (key && key === name) { 1751 // If second argument (value) is a function it's a converter... 1752 result = read(cookie, value); 1753 break; 1754 } 1755 1756 // Prevent storing a cookie that we couldn't decode. 1757 if (!key && (cookie = read(cookie)) !== undefined) { 1758 result[name] = cookie; 1759 } 1760 } 1761 1762 return result; 1763 }; 1764 1765 config.defaults = {}; 1766 1767 $.removeCookie = function(key, options) { 1768 if ($.cookie(key) === undefined) { 1769 return false; 1770 } 1771 1772 // Must not alter options, thus extending a fresh object... 1773 $.cookie(key, '', $.extend({}, options, {expires: -1})); 1774 return !$.cookie(key); 1775 }; 1776 1777})); 1778 1779/*! 1780 * FitVids 1.0 1781 * 1782 * Copyright 2011, Chris Coyier - http://css-tricks.com + Dave Rupert - http://daverupert.com 1783 * Credit to Thierry Koblentz - http://www.alistapart.com/articles/creating-intrinsic-ratios-for-video/ 1784 * Released under the WTFPL license - http://sam.zoy.org/wtfpl/ 1785 * 1786 * Date: Thu Sept 01 18:00:00 2011 -0500 1787 */ 1788(function(a) { 1789 a.fn.fitVids = function(b) { 1790 var c = {customSelector: null}; 1791 var e = document.createElement("div"), d = document.getElementsByTagName("base")[0] || document.getElementsByTagName("script")[0]; 1792 e.className = "fit-vids-style"; 1793 e.innerHTML = "­<style>.fluid-width-video-wrapper{width:100%;position: relative;padding:0;}.fluid-width-video-wrapper iframe,.fluid-width-video-wrapper object,.fluid-width-video-wrapper embed {position:absolute;top: 0;left: 0;width:100%!important;height:100%!important;}</style>"; 1794 d.parentNode.insertBefore(e, d); 1795 if (b) { 1796 a.extend(c, b) 1797 } 1798 return this.each(function() { 1799 var f = ["iframe[src*='player.vimeo.com']", "iframe[src*='www.youtube.com']", "iframe[src*='www.kickstarter.com']", "object", "embed"]; 1800 if (c.customSelector) { 1801 f.push(c.customSelector) 1802 } 1803 var g = a(this).find(f.join(",")); 1804 g.each(function() { 1805 var k = a(this); 1806 if (this.tagName.toLowerCase() == "embed" && k.parent("object").length || k.parent(".fluid-width-video-wrapper").length) { 1807 return 1808 } 1809 var h = this.tagName.toLowerCase() == "object" ? k.attr("height") : k.height(), i = h / k.width(); 1810 if (!k.attr("id")) { 1811 var j = "fitvid" + Math.floor(Math.random() * 999999); 1812 k.attr("id", j) 1813 } 1814 k.wrap('<div class="fluid-width-video-wrapper"></div>').parent(".fluid-width-video-wrapper").css("padding-top", (i * 100) + "%"); 1815 k.removeAttr("height").removeAttr("width") 1816 }) 1817 }) 1818 } 1819})(jQuery); 1820 1821 1822/** 1823 * Vimeo Api 1824 * http://github.com/vimeo/froogaloop/raw/master/froogaloop.min.js 1825 */ 1826var Froogaloop = function() { 1827 var e = {hasWindowEvent: false, PLAYER_DOMAIN: "", eventCallbacks: {}, iframe_pattern: /player\.(([a-zA-Z0-9_\.]+)\.)?vimeo(ws)?\.com\/video\/([0-9]+)/i}, j = function(b) { 1828 b || (b = document.getElementsByTagName("iframe")); 1829 for (var a, c = 0, f = b.length, g; c < f; c++) { 1830 a = b[c]; 1831 if (g = e.iframe_pattern.test(a.getAttribute("src"))) { 1832 a.api = h.api; 1833 a.get = h.get; 1834 a.addEvent = h.addEvent 1835 } 1836 } 1837 }, h = {api: function(b, a) { 1838 i(b, a, this) 1839 }, get: function(b, a) { 1840 k(b, a, this.id != "" ? this.id : null); 1841 i(b, null, this) 1842 }, addEvent: function(b, a) { 1843 k(b, 1844 a, this.id != "" ? this.id : null); 1845 b != "onLoad" && i("api_addEventListener", [b, a.name], this); 1846 if (e.hasWindowEvent) 1847 return false; 1848 e.PLAYER_DOMAIN = d.getDomainFromUrl(this.getAttribute("src")); 1849 window.addEventListener ? window.addEventListener("message", l, false) : window.attachEvent("onmessage", l, false); 1850 e.hasWindowEvent = true 1851 }}, i = function(b, a, c) { 1852 if (!c.contentWindow.postMessage) 1853 return false; 1854 if (a === undefined || a === null) 1855 a = ""; 1856 var f = c.getAttribute("src").split("?")[0]; 1857 b = d.serialize({method: b, params: a, id: c.getAttribute("id")}); 1858 c.contentWindow.postMessage(b, f) 1859 }, k = function(b, a, c) { 1860 if (c) { 1861 e.eventCallbacks[c] || (e.eventCallbacks[c] = {}); 1862 e.eventCallbacks[c][b] = a 1863 } else 1864 e.eventCallbacks[b] = a 1865 }, l = function(b) { 1866 if (b.origin != e.PLAYER_DOMAIN) 1867 return false; 1868 var a = d.unserialize(b.data); 1869 b = a.params ? a.params.split('"').join("").split(",") : ""; 1870 a = a.method; 1871 var c = b[b.length - 1]; 1872 if (c == "") 1873 c = null; 1874 if (a = c ? e.eventCallbacks[c][a] : e.eventCallbacks[a]) 1875 b.length > 0 ? a.apply(null, b) : a.call() 1876 }, d = {r20: /%20/g, isArray: function(b) { 1877 return Object.prototype.toString.call(b) === 1878 "[object Array]" 1879 }, isFunction: function(b) { 1880 return Object.prototype.toString.call(b) === "[object Function]" 1881 }, unserialize: function(b) { 1882 if (!b) 1883 return false; 1884 var a = {}; 1885 b = b.split("&"); 1886 for (var c, f, g = 0; g < b.length; g++) { 1887 c = unescape(b[g].split("=")[0]); 1888 f = unescape(b[g].split("=")[1]); 1889 if (f.indexOf("=") > -1) 1890 f = d.unserialize(f); 1891 a[c] = f 1892 } 1893 return a 1894 }, s: false, serialize: function(b) { 1895 d.s = []; 1896 for (var a in b) 1897 d.buildParams(a, b[a]); 1898 return d.s.join("&").replace(d.r20, "+") 1899 }, buildParams: function(b, a) { 1900 var c = 0; 1901 if (d.isArray(a)) { 1902 for (; c < a.length; c++) 1903 a[c] = 1904 encodeURIComponent(a[c]); 1905 d.addToParam(encodeURIComponent(b), a.join(",")) 1906 } else 1907 d.addToParam(encodeURIComponent(b), encodeURIComponent(a)) 1908 }, addToParam: function(b, a) { 1909 a = d.isFunction(a) ? a() : a; 1910 d.s[d.s.length] = b + "=" + a 1911 }, getDomainFromUrl: function(b) { 1912 b = b.split("/"); 1913 for (var a = "", c = 0; c < b.length; c++) { 1914 if (c < 3) 1915 a += b[c]; 1916 else 1917 break; 1918 if (c < 2) 1919 a += "/" 1920 } 1921 return a 1922 }}; 1923 j(); 1924 return{init: j} 1925}(); 1926 1927 1928/** 1929 * YouTube Api 1930 */ 1931(function() { 1932 var f = void 0, g = null, i = !1, j, l = this, m = function(a) { 1933 for (var a = a.split("."), c = l, b; b = a.shift(); ) 1934 if (c[b] != g) 1935 c = c[b]; 1936 else 1937 return g; 1938 return c 1939 }, n = function(a) { 1940 return"string" == typeof a 1941 }, q = "closure_uid_" + Math.floor(2147483648 * Math.random()).toString(36), aa = 0, ba = function(a, c, b) { 1942 return a.call.apply(a.bind, arguments) 1943 }, ca = function(a, c, b) { 1944 if (!a) 1945 throw Error(); 1946 if (2 < arguments.length) { 1947 var d = Array.prototype.slice.call(arguments, 2); 1948 return function() { 1949 var b = Array.prototype.slice.call(arguments); 1950 Array.prototype.unshift.apply(b, 1951 d); 1952 return a.apply(c, b) 1953 } 1954 } 1955 return function() { 1956 return a.apply(c, arguments) 1957 } 1958 }, s = function(a, c, b) { 1959 s = Function.prototype.bind && -1 != Function.prototype.bind.toString().indexOf("native code") ? ba : ca; 1960 return s.apply(g, arguments) 1961 }, t = function(a, c) { 1962 var b = a.split("."), d = l; 1963 !(b[0]in d) && d.execScript && d.execScript("var " + b[0]); 1964 for (var e; b.length && (e = b.shift()); )
1965 !b.length && c !== f ? d[e] = c : d = d[e] ? d[e] : d[e] = {} 1966 }, u = function(a, c) { 1967 function b() { 1968 } 1969 b.prototype = c.prototype; 1970 a.s = c.prototype; 1971 a.prototype = new b 1972 }; 1973 Function.prototype.bind = Function.prototype.bind || function(a, c) { 1974 if (1 < arguments.length) { 1975 var b = Array.prototype.slice.call(arguments, 1); 1976 b.unshift(this, a); 1977 return s.apply(g, b) 1978 } 1979 return s(this, a) 1980 }; 1981 var v = function(a) { 1982 this.stack = Error().stack || ""; 1983 a && (this.message = "" + a) 1984 }; 1985 u(v, Error); 1986 v.prototype.name = "CustomError"; 1987 var da = function(a, c) { 1988 for (var b = 1; b < arguments.length; b++) 1989 var d = ("" + arguments[b]).replace(/\$/g, "$$$$"), a = a.replace(/\%s/, d); 1990 return a 1991 }; 1992 var w = function(a, c) { 1993 c.unshift(a); 1994 v.call(this, da.apply(g, c)); 1995 c.shift() 1996 }; 1997 u(w, v); 1998 w.prototype.name = "AssertionError"; 1999 var x = function(a, c, b) { 2000 if (!a) { 2001 var d = Array.prototype.slice.call(arguments, 2), e = "Assertion failed"; 2002 if (c) 2003 var e = e + (": " + c), h = d; 2004 throw new w("" + e, h || []); 2005 } 2006 }; 2007 var y = Array.prototype, ea = y.indexOf ? function(a, c, b) { 2008 x(a.length != g); 2009 return y.indexOf.call(a, c, b) 2010 } : function(a, c, b) { 2011 b = b == g ? 0 : 0 > b ? Math.max(0, a.length + b) : b; 2012 if (n(a)) 2013 return!n(c) || 1 != c.length ? -1 : a.indexOf(c, b); 2014 for (; b < a.length; b++) 2015 if (b in a && a[b] === c) 2016 return b; 2017 return-1 2018 }, fa = y.forEach ? function(a, c, b) { 2019 x(a.length != g); 2020 y.forEach.call(a, c, b) 2021 } : function(a, c, b) { 2022 for (var d = a.length, e = n(a) ? a.split("") : a, h = 0; h < d; h++) 2023 h in e && c.call(b, e[h], h, a) 2024 }, ga = function(a, c, b) { 2025 x(a.length != g); 2026 return 2 >= arguments.length ? y.slice.call(a, c) : 2027 y.slice.call(a, c, b) 2028 }; 2029 var ha = function(a) { 2030 var c = z, b; 2031 for (b in c) 2032 if (a.call(f, c[b], b, c)) 2033 return b 2034 }; 2035 var A, B, C, D, ia = function() { 2036 return l.navigator ? l.navigator.userAgent : g 2037 }; 2038 D = C = B = A = i; 2039 var E; 2040 if (E = ia()) { 2041 var ja = l.navigator; 2042 A = 0 == E.indexOf("Opera"); 2043 B = !A && -1 != E.indexOf("MSIE"); 2044 C = !A && -1 != E.indexOf("WebKit"); 2045 D = !A && !C && "Gecko" == ja.product 2046 } 2047 var F = B, G = D, H = C, I; 2048 a:{ 2049 var J = "", K; 2050 if (A && l.opera) 2051 var L = l.opera.version, J = "function" == typeof L ? L() : L; 2052 else if (G ? K = /rv\:([^\);]+)(\)|;)/ : F ? K = /MSIE\s+([^\);]+)(\)|;)/ : H && (K = /WebKit\/(\S+)/), K) 2053 var ka = K.exec(ia()), J = ka ? ka[1] : ""; 2054 if (F) { 2055 var M, la = l.document; 2056 M = la ? la.documentMode : f; 2057 if (M > parseFloat(J)) { 2058 I = "" + M; 2059 break a 2060 } 2061 } 2062 I = J 2063 } 2064 var ma = I, na = {}, N = function(a) { 2065 var c; 2066 if (!(c = na[a])) { 2067 c = 0; 2068 for (var b = ("" + ma).replace(/^[\s\xa0]+|[\s\xa0]+$/g, "").split("."), d = ("" + a).replace(/^[\s\xa0]+|[\s\xa0]+$/g, "").split("."), e = Math.max(b.length, d.length), h = 0; 0 == c && h < e; h++) { 2069 var k = b[h] || "", r = d[h] || "", xa = RegExp("(\\d*)(\\D*)", "g"), ya = RegExp("(\\d*)(\\D*)", "g"); 2070 do { 2071 var o = xa.exec(k) || ["", "", ""], p = ya.exec(r) || ["", "", ""]; 2072 if (0 == o[0].length && 0 == p[0].length) 2073 break; 2074 c = ((0 == o[1].length ? 0 : parseInt(o[1], 10)) < (0 == p[1].length ? 0 : parseInt(p[1], 10)) ? -1 : (0 == o[1].length ? 2075 0 : parseInt(o[1], 10)) > (0 == p[1].length ? 0 : parseInt(p[1], 10)) ? 1 : 0) || ((0 == o[2].length) < (0 == p[2].length) ? -1 : (0 == o[2].length) > (0 == p[2].length) ? 1 : 0) || (o[2] < p[2] ? -1 : o[2] > p[2] ? 1 : 0) 2076 } while (0 == c) 2077 } 2078 c = na[a] = 0 <= c 2079 } 2080 return c 2081 }, oa = {}, pa = function() {
2082 return oa[9] || (oa[9] = F && !!document.documentMode && 9 <= document.documentMode) 2083 }; 2084 !F || pa(); 2085 !G && !F || F && pa() || G && N("1.9.1"); 2086 F && N("9"); 2087 var qa = function() { 2088 }; 2089 var O = function() { 2090 this.d = []; 2091 this.f = {} 2092 }; 2093 u(O, qa); 2094 O.prototype.l = 1; 2095 O.prototype.h = 0; 2096 var ra = function(a, c, b) { 2097 var d = a.f[c]; 2098 d || (d = a.f[c] = []); 2099 var e = a.l; 2100 a.d[e] = c; 2101 a.d[e + 1] = b; 2102 a.d[e + 2] = f; 2103 a.l = e + 3; 2104 d.push(e) 2105 }; 2106 O.prototype.r = function(a, c) { 2107 var b = this.f[a]; 2108 if (b) { 2109 this.h++; 2110 for (var d = ga(arguments, 1), e = 0, h = b.length; e < h; e++) { 2111 var k = b[e]; 2112 this.d[k + 1].apply(this.d[k + 2], d) 2113 } 2114 this.h--; 2115 if (this.g && 0 == this.h) 2116 for (; b = this.g.pop(); ) 2117 if (0 != this.h) 2118 this.g || (this.g = []), this.g.push(b); 2119 else if (d = this.d[b]) { 2120 if (d = this.f[d]) 2121 e = d, d = ea(e, b), 0 <= d && (x(e.length != g), y.splice.call(e, d, 1)); 2122 delete this.d[b]; 2123 delete this.d[b + 1]; 2124 delete this.d[b + 2] 2125 } 2126 } 2127 }; 2128 var sa = RegExp("^(?:([^:/?#.]+):)?(?://(?:([^/?#]*)@)?([\\w\\d\\-\\u0100-\\uffff.%]*)(?::([0-9]+))?)?([^?#]+)?(?:\\?([^#]*))?(?:#(.*))?$"), ta = function(a) { 2129 if (P) { 2130 P = i; 2131 var c = l.location; 2132 if (c) { 2133 var b = c.href; 2134 if (b && (b = (b = ta(b)[3] || g) && decodeURIComponent(b)) && b != c.hostname) 2135 throw P = !0, Error(); 2136 } 2137 } 2138 return a.match(sa) 2139 }, P = H; 2140 var Q = m("yt.dom.getNextId_"); 2141 if (!Q) { 2142 Q = function() { 2143 return++ua 2144 }; 2145 t("yt.dom.getNextId_", Q); 2146 var ua = 0 2147 } 2148 ; 2149 var va = function(a) { 2150 if (a = a || m("window.event")) { 2151 this.type = a.type; 2152 var c = a.target || a.srcElement; 2153 c && 3 == c.nodeType && (c = c.parentNode); 2154 this.target = c; 2155 if (c = a.relatedTarget) 2156 try { 2157 c = c.nodeName && c 2158 } catch (b) { 2159 c = g 2160 } 2161 else 2162 "mouseover" == this.type ? c = a.fromElement : "mouseout" == this.type && (c = a.toElement); 2163 this.relatedTarget = c; 2164 this.data = a.data; 2165 this.source = a.source; 2166 this.origin = a.origin; 2167 this.state = a.state; 2168 this.clientX = a.clientX !== f ? a.clientX : a.pageX; 2169 this.clientY = a.clientY !== f ? a.clientY : a.pageY; 2170 if (a.pageX || a.pageY) 2171 this.pageX = a.pageX, 2172 this.pageY = a.pageY; 2173 else if ((a.clientX || a.clientY) && document.body && document.documentElement) 2174 this.pageX = a.clientX + document.body.scrollLeft + document.documentElement.scrollLeft, this.pageY = a.clientY + document.body.scrollTop + document.documentElement.scrollTop; 2175 this.keyCode = a.keyCode ? a.keyCode : a.which; 2176 this.charCode = a.charCode || ("keypress" == this.type ? this.keyCode : 0); 2177 this.altKey = a.altKey; 2178 this.ctrlKey = a.ctrlKey; 2179 this.shiftKey = a.shiftKey; 2180 0 == this.type.indexOf("touch") && (this.touches = a.touches, this.changedTouches = 2181 a.changedTouches); 2182 0 == this.type.indexOf("gesture") && (this.scale = a.scale, this.rotation = a.rotation) 2183 } 2184 }; 2185 j = va.prototype; 2186 j.type = ""; 2187 j.target = g; 2188 j.relatedTarget = g; 2189 j.currentTarget = g; 2190 j.data = g; 2191 j.source = g; 2192 j.origin = g; 2193 j.state = g; 2194 j.keyCode = 0;
2195 j.charCode = 0; 2196 j.altKey = i; 2197 j.ctrlKey = i; 2198 j.shiftKey = i; 2199 j.clientX = 0; 2200 j.clientY = 0; 2201 j.pageX = 0; 2202 j.pageY = 0; 2203 j.touches = g; 2204 j.changedTouches = g; 2205 var z = m("yt.events.listeners_") || {}; 2206 t("yt.events.listeners_", z); 2207 var wa = m("yt.events.counter_") || {count: 0}; 2208 t("yt.events.counter_", wa); 2209 var za = function(a, c) { 2210 return ha(function(b) { 2211 return b[0] == a && "message" == b[1] && b[2] == c && b[4] == i 2212 }) 2213 }, Aa = function(a, c) { 2214 if (a && (a.addEventListener || a.attachEvent)) { 2215 var b = za(a, c); 2216 if (!b) { 2217 var b = ++wa.count + "", d = function(b) { 2218 b = new va(b); 2219 b.currentTarget = a; 2220 return c.call(a, b) 2221 }; 2222 z[b] = [a, "message", c, d, i]; 2223 a.addEventListener ? a.addEventListener("message", d, i) : a.attachEvent("onmessage", d) 2224 } 2225 } 2226 }; 2227 t("yt.config_", window.yt && window.yt.config_ || {}); 2228 t("yt.globals_", window.yt && window.yt.globals_ || {}); 2229 t("yt.msgs_", window.yt && window.yt.msgs_ || {}); 2230 t("yt.timeouts_", window.yt && window.yt.timeouts_ || []); 2231 var Ba = window.yt && window.yt.intervals_ || []; 2232 t("yt.intervals_", Ba); 2233 eval("/*@cc_on!@*/false"); 2234 var Ca = window.YTConfig || {}, R = function(a) { 2235 this.p = a || {}; 2236 this.c = {}; 2237 this.c.width = 640; 2238 this.c.height = 390; 2239 this.c.title = ""; 2240 this.c.host = ("https:" == document.location.protocol ? "https:" : "http:") + "//www.youtube.com" 2241 }, S = g, T = function(a, c) { 2242 return a.p[c] || Ca[c] || a.c[c] 2243 }; 2244 R.prototype.o = function(a) { 2245 a.origin == T(this, "host") && (a = JSON.parse(a.data), S[a.id].m(a)) 2246 }; 2247 var U = function(a, c) { 2248 this.b = c; 2249 this.j = this.a = g; 2250 this.i = this.id = 0; 2251 this.pubsub = g; 2252 var b = n(a) ? document.getElementById(a) : a; 2253 if (b) { 2254 if ("iframe" != b.tagName.toLowerCase()) { 2255 var d = document.createElement("div"); 2256 d.innerHTML += m("YT.embed_template"); 2257 d = d || document; 2258 d = d.querySelectorAll && d.querySelector && (!H || "CSS1Compat" == document.compatMode || N("528")) ? d.querySelectorAll("IFRAME") : d.getElementsByTagName("IFRAME"); 2259 for (var d = d.length ? d[0] : g, e = 0, h = b.attributes.length; e < h; e++) 2260 d.setAttribute(b.attributes[e].name, b.attributes[e].value); 2261 d.removeAttribute("width"); 2262 d.removeAttribute("height"); 2263 d.removeAttribute("src"); 2264 d.setAttribute("title", "YouTube " + T(this.b, "title")); 2265 d.height = T(this.b, "height"); 2266 d.width = T(this.b, "width"); 2267 d.src = this.k(); 2268 this.j = b; 2269 (e = b.parentNode) && e.replaceChild(d, b); 2270 b = d 2271 } 2272 this.a = b; 2273 this.id = this[q] || (this[q] = ++aa); 2274 if (window.JSON && window.postMessage) { 2275 this.pubsub = new O; 2276 b = this.b; 2277 d = this.id; 2278 S || (S = {}, Aa(window, s(b.o, b))); 2279 S[d] = this; 2280 b = s(this.n, this); 2281 b = window.setInterval(b, 250); 2282 Ba.push(b); 2283 this.i = b; 2284 var b = T(this.b, "events"), k; 2285 for (k in b) 2286 b.hasOwnProperty(k) && 2287 this.addEventListener(k, b[k]) 2288 } 2289 } 2290 }; 2291 U.prototype.destroy = function() { 2292 if (this.j) { 2293 var a = this.a, c = a.parentNode; 2294 c && c.replaceChild(this.j, a) 2295 } else 2296 (a = this.a) && a.parentNode && a.parentNode.removeChild(a) 2297 }; 2298 U.prototype.n = function() { 2299 this.a && this.a.contentWindow ? Da(this, {event: "listening"}) : window.clearInterval(this.i) 2300 }; 2301 U.prototype.addEventListener = function(a, c) { 2302 var b = c; 2303 "string" == typeof c && (b = function() { 2304 window[c].apply(window, arguments) 2305 }); 2306 ra(this.pubsub, a, b); 2307 return this 2308 }; 2309 var V = function(a, c, b) { 2310 a.pubsub.r(c, {target: a, data: b}) 2311 }, Ea = function(a, c, b) { 2312 b = b || []; 2313 b = Array.prototype.slice.call(b); 2314 Da(a, {event: "command", func: c, args: b}) 2315 }, Da = function(a, c) { 2316 c.id = a.id; 2317 var b = JSON.stringify(c), d = ta(a.a.src), e = d[1], h = d[2], k = d[3], d = d[4], r = []; 2318 e && r.push(e, ":"); 2319 k && (r.push("//"), h && r.push(h, "@"), r.push(k), d && r.push(":", d)); 2320 a.a.contentWindow.postMessage(b, r.join("")) 2321 }; 2322 U.prototype.setSize = function(a, c) { 2323 this.a.width = a; 2324 this.a.height = c; 2325 return this 2326 }; 2327 U.prototype.q = function() { 2328 return this.a 2329 }; 2330 var Fa = {"0": "onEnded", 1: "onPlaying", 2: "onPaused", 3: "onBuffering", 5: "onVideoCued"}, W = function(a) { 2331 R.call(this, a); 2332 this.c.title = "video player"; 2333 this.c.apiReady = "onYouTubePlayerAPIReady"; 2334 this.c.videoId = "" 2335 }; 2336 u(W, R); 2337 var X = function(a, c) { 2338 U.call(this, a, new W(c)); 2339 this.e = {} 2340 }; 2341 u(X, U); 2342 X.prototype.k = function() { 2343 var a = T(this.b, "playerVars") || []; 2344 a.enablejsapi = 1; 2345 window.location.host && (a.origin = window.location.protocol + "//" + window.location.host); 2346 var c = [], b; 2347 for (b in a) 2348 a.hasOwnProperty(b) && c.push(b + "=" + a[b]); 2349 return T(this.b, "host") + "/embed/" + T(this.b, "videoId") + "?" + c.join("&") 2350 }; 2351 X.prototype.m = function(a) { 2352 switch (a.event) { 2353 case "onReady": 2354 window.clearInterval(this.i); 2355 V(this, "onReady"); 2356 break; 2357 case "onStateChange": 2358 var c = a.info.playerState; 2359 Y(this, a); 2360 V(this, "onStateChange", c); 2361 -1 != c && V(this, Fa[c]); 2362 break; 2363 case "onPlaybackQualityChange": 2364 Y(this, a); 2365 V(this, "onPlaybackQualityChange", this.e.playbackQuality); 2366 break; 2367 case "onError": 2368 V(this, "onError", a.error); 2369 break; 2370 case "infoDelivery": 2371 Y(this, a); 2372 break; 2373 case "initialDelivery": 2374 Ga(this, a.apiInterface), Y(this, a) 2375 } 2376 }; 2377 var Y = function(a, c) { 2378 var b = c.info || {}, d; 2379 for (d in b) 2380 a.e[d] = b[d] 2381 }, Ga = function(a, c) { 2382 fa(c, function(a) { 2383 this[a] || (this[a] = 0 == a.search("cue") || 0 == a.search("load") ? function() { 2384 this.e = {}; 2385 Ea(this, a, arguments); 2386 return this 2387 } : 0 == a.search("get") || 0 == a.search("is") ? function() { 2388 var c = this.e, e = 0; 2389 0 == a.search("get") ? e = 3 : 0 == a.search("is") && (e = 2); 2390 return c[a.charAt(e).toLowerCase() + a.substr(e + 1)] 2391 } : function() { 2392 Ea(this, a, arguments); 2393 return this 2394 }) 2395 }, a) 2396 }; 2397 X.prototype.getVideoEmbedCode = function() { 2398 var a = this.a.cloneNode(i), c = this.e.videoData, b = T(this.b, "host"); 2399 a.src = c && c.video_id ? b + "/embed/" + c.video_id : a.src; 2400 c = document.createElement("div"); 2401 c.appendChild(a); 2402 return c.innerHTML 2403 }; 2404 var Z = function(a) { 2405 R.call(this, a); 2406 this.c.title = "upload widget"; 2407 this.c.apiReady = "onYouTubeUploadWidgetReady" 2408 }; 2409 u(Z, R); 2410 var $ = function(a, c) { 2411 U.call(this, a, new Z(c)) 2412 }; 2413 u($, U); 2414 $.prototype.k = function() { 2415 return T(this.b, "host") + "/upload_embed?action_widget=1" 2416 }; 2417 $.prototype.m = function(a) { 2418 switch (a.event) { 2419 case "onUploadSuccess": 2420 V(this, "onUploadSuccess", a.videoId) 2421 } 2422 }; 2423 t("YT.PlayerState.ENDED", 0); 2424 t("YT.PlayerState.PLAYING", 1); 2425 t("YT.PlayerState.PAUSED", 2); 2426 t("YT.PlayerState.BUFFERING", 3); 2427 t("YT.PlayerState.CUED", 5); 2428 t("YT.Player", X); 2429 t("YT.UploadWidget", $); 2430 X.prototype.destroy = X.prototype.destroy; 2431 X.prototype.setSize = X.prototype.setSize; 2432 X.prototype.getVideoEmbedCode = X.prototype.getVideoEmbedCode; 2433 X.prototype.getIframe = X.prototype.q; 2434 X.prototype.addEventListener = X.prototype.addEventListener; 2435 var Ha = function(a) { 2436 (a = m(T(a, "apiReady"))) && a() 2437 }; 2438 Ha(new W); 2439 Ha(new Z); 2440})(); 2441 2442if (jQuery) { 2443 window.stickyWidgetIDs = window.stickyWidgetIDs || []; 2444 jQuery(document).ready(function($) { 2445 2446 var allowStickyWidgets = true, // We can put in conditional statements here in the future if needed 2447 isSticky = false, // Whether or not the elements are currently sticky 2448 isContentBound = false, 2449 $stickyDiv = $("<div class=\"sticky-sidebar-widgets\" style=\"width:300px;\"></div>"), 2450 $sidebar = $("#sidebar"), 2451 $body = $("body"), 2452 $content = $("#main"), 2453 $lastChild = $content.children(":last"), 2454 $window = $(window), 2455 stickyWidgets = []; 2456 2457 if (!window.stickyWidgetIDs || window.stickyWidgetIDs.length === 0) { 2458 // No point in operating further if we don't have any sticky widgets. 2459 //alert("NO WIDGETS"); 2460 return; 2461 2462 } 2463 2464 // Get a list of the last three children in order from top to bottom 2465 for (var widgetID in window.stickyWidgetIDs) { 2466 var $stickyWidget = $("#" + window.stickyWidgetIDs[widgetID]); 2467 if ($stickyWidget.length > 0) { 2468 stickyWidgets.push($stickyWidget); 2469 } 2470 } 2471 2472 if (stickyWidgets.length === 0) { 2473 // We didn't find any matching IDs, so no point in going further. 2474 return; 2475 } 2476 2477 $sidebar.append($stickyDiv); 2478 for (var i in stickyWidgets) { 2479 $stickyDiv.append(stickyWidgets[i]); 2480 } 2481 2482 $window.on("scroll", function() { 2483 //alert("SCROLLING"); 2484 var transitionPoint, 2485 toggleState = false, 2486 toggleContentBottomBinding = false, 2487 sidebarPosition = $sidebar.position(), 2488 sidebarHeight = $sidebar.outerHeight(), 2489 bodyScrollTop = $(document).scrollTop(), 2490 bodyPosition = $body.position(), 2491 stickyDivOffset = $stickyDiv.offset(), 2492 stickyDivHeight = $stickyDiv.outerHeight(), 2493 stickyDivPosition = $stickyDiv.position(), 2494 stickyDivScrollTop = $stickyDiv.scrollTop(), 2495 contentPosition = $content.position(), 2496 contentHeight = $content.outerHeight(), 2497 contentScrollTop = $content.scrollTop(), 2498 lastChildPosition = $lastChild.position(), 2499 lastChildHeight = $lastChild.outerHeight(); 2500 2501 if (isSticky) { 2502 // The time to toggle state will be when the bottom of the sidebar is in view. 2503 if (sidebarPosition.top + sidebarHeight >= bodyScrollTop) { 2504 toggleState = true; 2505 } 2506 else { 2507 // Double-check whether we need to change position information based on the footer scroll position. 2508 if (isContentBound) { 2509 if (stickyDivOffset.top > (bodyScrollTop + bodyPosition.top)) { 2510 toggleContentBottomBinding = true; 2511 } 2512 } 2513 else { 2514 if ((stickyDivOffset.top + stickyDivHeight) >= (contentPosition.top + contentHeight)) { 2515 toggleContentBottomBinding = !(stickyDivOffset.top > (bodyScrollTop + bodyPosition.top)); 2516 } 2517 } 2518 } 2519 } 2520 else { 2521 // The time to toggle state will be when the top of the div is equal to or higher than the top of the body. 2522 if (stickyDivPosition.top <= bodyScrollTop) { 2523 toggleState = true; 2524 } 2525 2526 // In this specific state, we actually don't want to make it sticky, because it's already fitting exactly where it can 2527 if ((stickyDivScrollTop + stickyDivHeight) >= (contentScrollTop + contentHeight)) { 2528 toggleState = false; 2529 } 2530 } 2531 2532 if (toggleState) { 2533 if (isSticky) { 2534 // We need to make it not sticky. 2535 $stickyDiv.css({"position": "", "top": ""}).removeClass('is-sticky'); 2536 isContentBound = false; 2537 } 2538 else { 2539 // We need to make it sticky 2540 $stickyDiv.css({ 2541 "position": "fixed", 2542 "top": bodyPosition.top + "px" 2543 }).addClass('is-sticky'); 2544 } 2545 isSticky = !isSticky; 2546 } 2547 2548 if (isSticky && toggleContentBottomBinding) { 2549 if (isContentBound) { 2550 // We need to make it not bound to the bottom. 2551 $stickyDiv.css({ 2552 "position": "fixed", 2553 "top": bodyPosition.top + "px" 2554 }); 2555 } 2556 else { 2557 // We need to bind to the bottom point of the content instead. 2558 $stickyDiv.css({ 2559 "position": "absolute",
2560 "top": (lastChildPosition.top + lastChildHeight + parseInt($lastChild.css("marginTop").replace("px"), 10) - stickyDivHeight) + "px" 2561 }); 2562 } 2563 isContentBound = !isContentBound; 2564 } 2565 }); 2566 }); 2567} 2568;
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.