/wp-content/themes/mymaxiskirt/js/avia.js

https://bitbucket.org/sanders_nick/my-maxi-skirt · JavaScript · 2573 lines · 1794 code · 590 blank · 189 comment · 324 complexity · 0c54c222124c598d180742ac97f3d974 MD5 · raw file

  1. /* this prevents dom flickering, needs to be outside of dom.ready event: */
  2. document.documentElement.className += 'js_active';
  3. /*end dom flickering =) */
  4. //global path: avia_framework_globals.installedAt
  5. jQuery.noConflict();
  6. jQuery(document).ready(function(){
  7. //browser class jquery
  8. add_browser_class();
  9. //activates the mega menu javascript
  10. if(jQuery.fn.aviaMegamenu)
  11. jQuery(".main_menu .menu").aviaMegamenu({modify_position:true});
  12. //activates the slideshow
  13. if(jQuery.fn.avia_ajax_portfolio)
  14. jQuery('.ajax_portfolio_container').avia_ajax_portfolio();
  15. // actiavte portfolio sorting
  16. if(jQuery.fn.avia_iso_sort)
  17. jQuery('.portfolio-sort-container').avia_iso_sort();
  18. // improves comment forms
  19. if(jQuery.fn.kriesi_empty_input)
  20. jQuery('#s, #search-fail input, .textwidget input, .widget_product_search input').kriesi_empty_input();
  21. // improves menu for mobile devices
  22. jQuery('.responsive .main_menu ul:eq(0)').mobileMenu({
  23. switchWidth: 768, //width (in px to switch at)
  24. topOptionText: jQuery('.main_menu').data('selectname'), //first option text
  25. indentString: '   ' //string for indenting nested items
  26. });
  27. // enhances contact form with ajax capabilities
  28. if(jQuery.fn.kriesi_ajax_form)
  29. jQuery('.ajax_form').kriesi_ajax_form();
  30. //smooth scrooling
  31. if(jQuery.fn.avia_smoothscroll)
  32. jQuery('a[href*=#]').avia_smoothscroll();
  33. //keep ratio of elements
  34. if(jQuery.fn.avia_ratio)
  35. jQuery(".avia_keep_ratio").avia_ratio();
  36. //fancy buttons
  37. if(jQuery.fn.avia_fancy_buttons)
  38. jQuery(".social_bookmarks li").avia_fancy_buttons({target:'a'});
  39. //fixed menu header
  40. if(jQuery.fn.avia_fixed_header)
  41. jQuery("body").avia_fixed_header();
  42. avia_ajax_call();
  43. avia_slideshow_caption_click();
  44. });
  45. // all functions within the avia_ajax_call function will be executed once the dynamic ajax portfolio has loaded
  46. function avia_ajax_call(container)
  47. {
  48. if(typeof container == 'undefined'){ container = 'body';};
  49. //activates the slideshow
  50. if(jQuery.fn.aviapoly)
  51. jQuery('.slideshow', container).aviapoly();
  52. jQuery('#slideshow_big .slideshow, .post-entry-type-gallery .slideshow', container).avia_base_control_hide();
  53. //activates the slideshow
  54. if(jQuery.fn.avia_external_controls)
  55. jQuery('.slide_container_big_thumbs', container).avia_external_controls();
  56. //activates the keyboard controlls
  57. if(jQuery.fn.avia_keyboard_controls)
  58. jQuery('.slideshow_container', container).avia_keyboard_controls();
  59. //activates the prettyphoto lightbox
  60. if(jQuery.fn.avia_activate_lightbox)
  61. jQuery(container).avia_activate_lightbox();
  62. //activates the hover effect for image links
  63. if(jQuery.fn.avia_activate_hover_effect)
  64. jQuery(container).avia_activate_hover_effect();
  65. //activates the shortcode content slider
  66. if(jQuery.fn.avia_sc_slider)
  67. jQuery(".content_slider", container).avia_sc_slider({appendControlls:{}});
  68. //activates the toggle shortcode
  69. if(jQuery.fn.avia_sc_toggle)
  70. jQuery('.togglecontainer', container).avia_sc_toggle();
  71. //activates the tabs shortcode
  72. if(jQuery.fn.avia_sc_tabs)
  73. {
  74. jQuery('.tabcontainer', container).avia_sc_tabs();
  75. jQuery('.sidebar_tabcontainer', container).avia_sc_tabs({heading: '.sidebar_tab', content:'.sidebar_tab_content', active:'sidebar_active_tab', sidebar:true});
  76. }
  77. if(jQuery.fn.hoverdir && jQuery('html').is('.csstransforms'))
  78. {
  79. var checkMobile = document.documentElement.ontouchstart !== undefined ? true : false;
  80. if(!checkMobile)
  81. {
  82. jQuery('.slideshow li:not(#slideshow_big .slideshow li)', container).hoverdir();
  83. }
  84. }
  85. avia_small_fixes(container);
  86. }
  87. function avia_slideshow_caption_click()
  88. {
  89. var body_tag = jQuery('body');
  90. body_tag.on('mouseenter', '.slideshow .container', function()
  91. {
  92. var container = jQuery(this),
  93. link_inner = container.prev('.slideshow_media_wrap').find('a').addClass('no_overlay');
  94. if(link_inner.length)
  95. {
  96. container.addClass('mousePointer');
  97. }
  98. });
  99. body_tag.on('click', '.slideshow .container', function(e)
  100. {
  101. if(!jQuery(e.srcElement).is('a')){
  102. jQuery(this).prev('.slideshow_media_wrap').find('a').trigger('click');
  103. }
  104. });
  105. }
  106. // -------------------------------------------------------------------------------------------
  107. // Header scroll top
  108. // -------------------------------------------------------------------------------------------
  109. (function($)
  110. {
  111. "use strict";
  112. $.fn.avia_fixed_header = function(passed_options)
  113. {
  114. var win = $(window),
  115. menu_header = $('.container_wrap_menu'),
  116. logo_header = $('.container_wrap_logo'),
  117. logo_header_height = 0,
  118. wrap_all_top = parseInt($('#wrap_all').css('margin-top'),10),
  119. top_pos = parseInt($('html').css('margin-top'),10) ,
  120. isMobile = 'ontouchstart' in document.documentElement,
  121. height_tracking = true,
  122. set_pos = function()
  123. {
  124. var st = win.scrollTop(), pos_type = menu_header.css('position');
  125. if(height_tracking || logo_header_height == 0) logo_header_height = logo_header.height();
  126. if (st < logo_header_height +wrap_all_top)
  127. {
  128. if(pos_type != 'relative') menu_header.css({position:'relative', top:0});
  129. }
  130. else
  131. {
  132. if(pos_type != 'fixed') menu_header.css({position:'fixed', top:top_pos});
  133. }
  134. };
  135. //dont apply fixed headers to mobile devices, because of small screen and poor handling of css "fixed" position
  136. if(!isMobile)
  137. {
  138. win.scroll(set_pos);
  139. set_pos();
  140. setTimeout(function(){height_tracking = false;}, 10000)
  141. }
  142. };
  143. })(jQuery);
  144. // -------------------------------------------------------------------------------------------
  145. // fancy hover effect
  146. // -------------------------------------------------------------------------------------------
  147. (function($)
  148. {
  149. "use strict";
  150. $.avia_utilities = $.avia_utilities || {};
  151. $.fn.avia_fancy_buttons = function(passed_options)
  152. {
  153. var win = $(window),
  154. defaults =
  155. {
  156. target: false,
  157. copy_img: true
  158. },
  159. options = $.extend({}, defaults, passed_options);
  160. return this.each(function()
  161. {
  162. //check if the browser supports element rotation
  163. if(!$.avia_utilities.supports('transition', ['Khtml', 'Ms','Moz','Webkit'])) { return false; }
  164. var buttons = $(this),
  165. current = false,
  166. target = false,
  167. html = "<span class='css_3_hover'></span>",
  168. effect = false;
  169. buttons.each(function()
  170. {
  171. current = $(this).addClass('css_3_hover_container');
  172. target = options.target ? current.find(options.target) : current;
  173. effect = $(html).appendTo(current);
  174. //fix the default hover color
  175. target.css('background-color', target.css('background-color'));
  176. if(options.copy_img)
  177. {
  178. effect.css('background-position', target.css('background-position'));
  179. effect.css('background-image', target.css('background-image'));
  180. }
  181. });
  182. });
  183. };
  184. })(jQuery);
  185. // -------------------------------------------------------------------------------------------
  186. // Avia AJAX Portfolio
  187. // -------------------------------------------------------------------------------------------
  188. (function($)
  189. {
  190. "use strict";
  191. $.avia_utilities = $.avia_utilities || {};
  192. $.fn.avia_ajax_portfolio = function(passed_options)
  193. {
  194. var win = $(window),
  195. isMobile = document.documentElement.ontouchstart !== undefined ? true : false,
  196. defaults =
  197. {
  198. open_wrap: '.portfolio-details',
  199. open_in: '.portfolio-details-inner',
  200. items: '.portfolio-sort-container',
  201. easing: 'easeOutQuint',
  202. timing: 800,
  203. transition: 'slide' // 'fade' or 'slide'
  204. },
  205. options = $.extend({}, defaults, passed_options);
  206. return this.each(function()
  207. {
  208. var container = $(this),
  209. target_wrap = container.find(options.open_wrap),
  210. target_container = container.find(options.open_in),
  211. item_container = container.find(options.items),
  212. items = item_container.find('.post-entry'),
  213. content_retrieved = {},
  214. is_open = false,
  215. animating = false,
  216. index_open = false,
  217. ajax_call = false,
  218. methods,
  219. controls,
  220. loader = $.avia_utilities.loading();
  221. methods =
  222. {
  223. load_item: function()
  224. {
  225. if(animating == true) return false;
  226. animating = true;
  227. var link = $(this),
  228. post_container = link.parents('.post-entry:eq(0)'),
  229. post_id = "ID_" + post_container.data('ajax-id'),
  230. clickedIndex = items.index(post_container);
  231. //check if current item is the clicked item or if we are currently animating
  232. if(post_id === is_open)
  233. {
  234. return false;
  235. }
  236. item_container.find('.active_portfolio_item').removeClass('active_portfolio_item');
  237. post_container.addClass('active_portfolio_item');
  238. loader.show();
  239. methods.ajax_get_contents(post_id, clickedIndex);
  240. return false;
  241. },
  242. scroll_top: function()
  243. {
  244. var target_offset = container.offset().top - 100,
  245. window_offset = win.scrollTop();
  246. if(window_offset > target_offset || target_offset - window_offset > 100 )
  247. {
  248. $('html:not(:animated),body:not(:animated)').animate({ scrollTop: target_offset }, options.timing, options.easing);
  249. }
  250. },
  251. attach_item: function(post_id)
  252. {
  253. content_retrieved[post_id] = $(content_retrieved[post_id]).appendTo(target_container);
  254. ajax_call = true;
  255. },
  256. remove_video: function()
  257. {
  258. var del = container.find('iframe, .avia_video').parents('.ajax_slide:not(.open_slide)');
  259. if(del.length > 0)
  260. {
  261. del.remove();
  262. content_retrieved["ID_" + del.data('slideId')] = undefined;
  263. }
  264. },
  265. show_item: function(post_id, clickedIndex)
  266. {
  267. //check if current item is the clicked item or if we are currently animating
  268. if(post_id === is_open)
  269. {
  270. return false;
  271. }
  272. animating = true;
  273. methods.scroll_top();
  274. loader.hide();
  275. if(false === is_open)
  276. {
  277. target_wrap.addClass('open_container');
  278. content_retrieved[post_id].addClass('open_slide');
  279. target_wrap.css({display:'none'}).slideDown(options.timing, options.easing, function()
  280. {
  281. if(ajax_call){ avia_ajax_call(content_retrieved[post_id]); ajax_call = false; }
  282. methods.remove_video();
  283. });
  284. index_open = clickedIndex;
  285. is_open = post_id;
  286. animating = false;
  287. }
  288. else
  289. {
  290. var initCSS = { zIndex:3 },
  291. easing = options.easing;
  292. if(index_open > clickedIndex) { initCSS.left = '-110%'; }
  293. if(options.transition === 'fade'){ initCSS.left = '0%'; initCSS.opacity = 0; easing = 'easeOutQuad'; }
  294. //fixate height for container during animation
  295. target_container.height(target_container.height()); //outerHeight = border problems?
  296. content_retrieved[post_id].css(initCSS).avia_animate({'left':"0%", opacity:1}, options.timing, easing);
  297. content_retrieved[is_open].avia_animate({opacity:0}, options.timing, easing, function()
  298. {
  299. content_retrieved[is_open].attr({'style':""}).removeClass('open_slide');
  300. content_retrieved[post_id].addClass('open_slide');
  301. target_container.avia_animate({height: content_retrieved[post_id].outerHeight()}, options.timing/2, options.easing, function()
  302. {
  303. target_container.attr({'style':""});
  304. is_open = post_id;
  305. index_open = clickedIndex;
  306. animating = false;
  307. methods.remove_video();
  308. if(ajax_call){ avia_ajax_call(content_retrieved[post_id]); ajax_call = false; }
  309. });
  310. });
  311. }
  312. },
  313. ajax_get_contents: function(post_id, clickedIndex)
  314. {
  315. if(content_retrieved[post_id] !== undefined)
  316. {
  317. methods.show_item(post_id, clickedIndex);
  318. return;
  319. }
  320. var url_params = methods.getUrlVars(), add_params = "";
  321. if(typeof url_params.style == "string") add_params = "&style=" + url_params.style
  322. $.ajax({
  323. url: avia_framework_globals.ajaxurl,
  324. type: "POST",
  325. data: "action=avia_check_portfolio&avia_ajax_request="+post_id.replace(/ID_/,"")+add_params,
  326. beforeSend: function()
  327. {
  328. },
  329. success: function(msg)
  330. {
  331. content_retrieved[post_id] = msg;
  332. methods.attach_item(post_id);
  333. setTimeout(function(){ methods.show_item(post_id, clickedIndex); },10);
  334. },
  335. error: function()
  336. {
  337. loader.hide();
  338. }
  339. });
  340. },
  341. add_controls: function()
  342. {
  343. controls = $('<div class="ajax_controlls"><a href="#prev" class="ajax_previous">-</a><a href="#next" class="ajax_next">+</a><a class="avia_close" href="#close">x</a></div>').appendTo(target_wrap);
  344. target_wrap.avia_keyboard_controls({27:'.avia_close', 37:'.ajax_previous', 39:'.ajax_next'});
  345. //target_wrap.avia_swipe_trigger({prev:'.ajax_previous', next:'.ajax_next'});
  346. items.each(function(){
  347. var current = $(this), overlay;
  348. current.addClass('no_combo').bind('click', function(event)
  349. {
  350. overlay = current.find('.slideshow_overlay');
  351. if(overlay.length)
  352. {
  353. event.stopPropagation();
  354. methods.load_item.apply(current.find('a:eq(0)'));
  355. return false;
  356. }
  357. });
  358. });
  359. },
  360. control_click: function()
  361. {
  362. var showItem,
  363. activeID = item_container.find('.active_portfolio_item').data('ajax-id'),
  364. active = item_container.find('.post-entry-'+activeID);
  365. switch(this.hash)
  366. {
  367. case '#next':
  368. showItem = active.nextAll('.post-entry:not(.isotope-hidden):eq(0)').find('a:eq(0)');
  369. if(!showItem.length) { showItem = $('.post-entry:not(.isotope-hidden):eq(0)', container).find('a:eq(0)'); }
  370. showItem.trigger('click');
  371. break;
  372. case '#prev':
  373. showItem = active.prevAll('.post-entry:not(.isotope-hidden):eq(0)').find('a:eq(0)');
  374. if(!showItem.length) { showItem = $('.post-entry:not(.isotope-hidden):last', container).find('a:eq(0)'); }
  375. showItem.trigger('click');
  376. break;
  377. case '#close':
  378. animating = true;
  379. target_wrap.slideUp( options.timing, options.easing, function()
  380. {
  381. item_container.find('.active_portfolio_item').removeClass('active_portfolio_item');
  382. content_retrieved[is_open].attr({'style':""}).removeClass('open_slide');
  383. target_wrap.removeClass('open_container');
  384. animating = is_open = index_open = false;
  385. methods.remove_video();
  386. });
  387. break;
  388. }
  389. return false;
  390. },
  391. getUrlVars: function() {
  392. var vars = {};
  393. var parts = window.location.href.replace(/[?&]+([^=&]+)=([^&]*)/gi, function(m,key,value) {
  394. vars[key] = value;
  395. });
  396. return vars;
  397. },
  398. resize_reset: function()
  399. {
  400. if(is_open === false)
  401. {
  402. target_container.html('');
  403. content_retrieved = [];
  404. }
  405. }
  406. };
  407. methods.add_controls();
  408. item_container.on("click", "a", methods.load_item);
  409. controls.on("click", "a", methods.control_click);
  410. if(jQuery.support.leadingWhitespace) { win.bind('smartresize', methods.resize_reset); }
  411. });
  412. };
  413. }(jQuery));
  414. // -------------------------------------------------------------------------------------------
  415. // Avia AJAX Sorting
  416. // -------------------------------------------------------------------------------------------
  417. (function($)
  418. {
  419. "use strict";
  420. $.fn.avia_iso_sort = function(options)
  421. {
  422. $.extend( $.Isotope.prototype, {
  423. _customModeReset : function() {
  424. this.fitRows = {
  425. x : 0,
  426. y : 0,
  427. height : 0
  428. };
  429. },
  430. _customModeLayout : function( $elems ) {
  431. var instance = this,
  432. containerWidth = this.element.width(),
  433. props = this.fitRows,
  434. margin = 0,//(containerWidth / 100) * 4, //margin based on %
  435. extraRange = 2; // adds a little range for % based calculation error in some browsers
  436. $elems.each( function() {
  437. var $this = $(this),
  438. atomW = $this.outerWidth() ,
  439. atomH = $this.outerHeight(true);
  440. if ( props.x !== 0 && atomW + props.x > containerWidth + extraRange ) {
  441. // if this element cannot fit in the current row
  442. props.x = 0;
  443. props.y = props.height;
  444. }
  445. //webkit gets blurry elements if position is a float value
  446. props.x = Math.round(props.x);
  447. props.y = Math.round(props.y);
  448. // position the atom
  449. instance._pushPosition( $this, props.x, props.y );
  450. props.height = Math.max( props.y + atomH, props.height );
  451. props.x += atomW + margin;
  452. });
  453. },
  454. _customModeGetContainerSize : function() {
  455. return { height : this.fitRows.height };
  456. },
  457. _customModeResizeChanged : function() {
  458. return true;
  459. }
  460. });
  461. return this.each(function()
  462. {
  463. var container = $(this),
  464. parentContainer = container.parents('.portfolio-wrap'),
  465. filter = parentContainer.prev('.sort_width_container').find('#js_sort_items').css({visibility:"visible", opacity:0}),
  466. links = filter.find('a'),
  467. isoActive = false,
  468. items = $('.post-entry', container);
  469. function applyIso()
  470. {
  471. container.addClass('isotope_activated').isotope({
  472. layoutMode : 'customMode', itemSelector : '.flex_column'
  473. }, function()
  474. {
  475. container.css({overflow:'visible'});
  476. });
  477. isoActive = true;
  478. setTimeout(function(){ parentContainer.addClass('avia_sortable_active'); }, 0);
  479. };
  480. links.bind('click',function()
  481. {
  482. var current = $(this),
  483. selector = current.data('filter');
  484. links.removeClass('active_sort');
  485. current.addClass('active_sort');
  486. parentContainer.find('.open_container .ajax_controlls .avia_close').trigger('click');
  487. container.css({overflow:'hidden'}).isotope({ layoutMode : 'customMode', itemSelector : '.flex_column' , filter: '.'+selector}, function()
  488. {
  489. container.css({overflow:'visible'});
  490. });
  491. return false;
  492. });
  493. // update columnWidth on window resize
  494. $(window).smartresize(function()
  495. {
  496. applyIso();
  497. });
  498. $(window).bind('avia_images_loaded', function()
  499. {
  500. setTimeout(function()
  501. {
  502. filter.animate({opacity:1}, 400);
  503. applyIso();
  504. }, 900);
  505. });
  506. ///applyIso();
  507. });
  508. };
  509. }(jQuery));
  510. // -------------------------------------------------------------------------------------------
  511. // input field improvements
  512. // -------------------------------------------------------------------------------------------
  513. (function($)
  514. {
  515. $.fn.kriesi_empty_input = function(options)
  516. {
  517. return this.each(function()
  518. {
  519. var currentField = $(this);
  520. currentField.methods =
  521. {
  522. startingValue: currentField.val(),
  523. resetValue: function()
  524. {
  525. var currentValue = currentField.val();
  526. if(currentField.methods.startingValue == currentValue) currentField.val('');
  527. },
  528. restoreValue: function()
  529. {
  530. var currentValue = currentField.val();
  531. if(currentValue == '') currentField.val(currentField.methods.startingValue);
  532. }
  533. };
  534. currentField.bind('focus',currentField.methods.resetValue);
  535. currentField.bind('blur',currentField.methods.restoreValue);
  536. });
  537. };
  538. })(jQuery);
  539. // -------------------------------------------------------------------------------------------
  540. // Ratio function
  541. // -------------------------------------------------------------------------------------------
  542. (function($)
  543. {
  544. "use strict";
  545. $.fn.avia_ratio = function()
  546. {
  547. var win = $(window);
  548. return this.each(function()
  549. {
  550. //check if the browser supports element rotation
  551. var container = $(this),
  552. height = container.height(),
  553. width = container.data('imgw'),
  554. ratio = height/width;
  555. function change_ratio()
  556. {
  557. container.height(container.outerWidth() * ratio);
  558. }
  559. change_ratio();
  560. win.bind('smartresize', change_ratio);
  561. });
  562. };
  563. })(jQuery);
  564. // -------------------------------------------------------------------------------------------
  565. // Avia Menu
  566. // -------------------------------------------------------------------------------------------
  567. (function($)
  568. {
  569. $.fn.aviaMegamenu = function(variables)
  570. {
  571. var defaults =
  572. {
  573. modify_position:true,
  574. delay:300
  575. };
  576. var options = $.extend(defaults, variables);
  577. return this.each(function()
  578. {
  579. var isMobile = 'ontouchstart' in document.documentElement,
  580. menu = $(this),
  581. menuItems = menu.find(">li"),
  582. megaItems = menuItems.find(">div").parent().css({overflow:'hidden'}),
  583. menuActive = menu.find('>.current-menu-item>a, >.current_page_item>a'),
  584. dropdownItems = menuItems.find(">ul").parent(),
  585. parentContainerWidth = menu.parent().width(),
  586. delayCheck = {},
  587. mega_open = [];
  588. if(!menuActive.length){ menu.find('.current-menu-ancestor:eq(0) a:eq(0), .current_page_ancestor:eq(0) a:eq(0)').parent().addClass('active-parent-item')}
  589. menuItems.each(function()
  590. {
  591. var item = $(this),
  592. pos = item.position(),
  593. megaDiv = item.find("div:first").css({opacity:0, display:"none"}),
  594. normalDropdown = "";
  595. //check if we got a mega menu
  596. if(!megaDiv.length)
  597. {
  598. normalDropdown = item.find(">ul").css({display:"none"});
  599. }
  600. //if we got a mega menu or dropdown menu add the arrow beside the menu item
  601. if(megaDiv.length || normalDropdown.length)
  602. {
  603. var link = item.addClass('dropdown_ul_available').find('>a');
  604. link.html("<span class='dropdown_link'>"+link.html()+"</span>").append('<span class="dropdown_available"></span>');
  605. //is a mega menu main item doesnt have a link to click use the default cursor
  606. if(typeof link.attr('href') != 'string' || link.attr('href') == "#"){ link.css('cursor','default').click(function(){return false;}); }
  607. }
  608. //correct position of mega menus
  609. if(options.modify_position && megaDiv.length)
  610. {
  611. if(megaDiv.width() > pos.left)
  612. {
  613. megaDiv.css({left: (pos.left* -1)});
  614. //megaDiv.css({left: (Math.ceil() * -1)});
  615. }
  616. else if(pos.left + megaDiv.width() > parentContainerWidth)
  617. {
  618. megaDiv.css({left: (megaDiv.width() - pos.left) * -1 });
  619. }
  620. }
  621. });
  622. function megaDivShow(i)
  623. {
  624. if(delayCheck[i] == true)
  625. {
  626. var item = megaItems.filter(':eq('+i+')').css({overflow:'visible'}).find("div:first"),
  627. link = megaItems.filter(':eq('+i+')').find("a:first");
  628. mega_open["check"+i] = true;
  629. item.stop().css('display','block').animate({opacity:1},300);
  630. if(item.length)
  631. {
  632. link.addClass('open-mega-a');
  633. }
  634. }
  635. }
  636. function megaDivHide (i)
  637. {
  638. if(delayCheck[i] == false)
  639. {
  640. megaItems.filter(':eq('+i+')').find(">a").removeClass('open-mega-a');
  641. var listItem = megaItems.filter(':eq('+i+')'),
  642. item = listItem.find("div:first");
  643. item.stop().css('display','block').animate({opacity:0},300, function()
  644. {
  645. $(this).css('display','none');
  646. listItem.css({overflow:'hidden'});
  647. mega_open["check"+i] = false;
  648. });
  649. }
  650. }
  651. if(isMobile)
  652. {
  653. megaItems.each(function(i){
  654. $(this).bind('click', function()
  655. {
  656. if(mega_open["check"+i] != true) return false;
  657. });
  658. });
  659. }
  660. //bind event for mega menu
  661. megaItems.each(function(i){
  662. $(this).hover(
  663. function()
  664. {
  665. delayCheck[i] = true;
  666. setTimeout(function(){megaDivShow(i); },options.delay);
  667. },
  668. function()
  669. {
  670. delayCheck[i] = false;
  671. setTimeout(function(){megaDivHide(i); },options.delay);
  672. }
  673. );
  674. });
  675. // bind events for dropdown menu
  676. dropdownItems.find('li').andSelf().each(function()
  677. {
  678. var currentItem = $(this),
  679. sublist = currentItem.find('ul:first'),
  680. showList = false;
  681. if(sublist.length)
  682. {
  683. sublist.css({display:'block', opacity:0, visibility:'hidden'});
  684. var currentLink = currentItem.find('>a');
  685. currentLink.bind('mouseenter', function()
  686. {
  687. sublist.stop().css({visibility:'visible'}).animate({opacity:1});
  688. });
  689. currentItem.bind('mouseleave', function()
  690. {
  691. sublist.stop().animate({opacity:0}, function()
  692. {
  693. sublist.css({visibility:'hidden'});
  694. });
  695. });
  696. }
  697. });
  698. });
  699. };
  700. })(jQuery);
  701. // -------------------------------------------------------------------------------------------
  702. // Tab shortcode javascript
  703. // -------------------------------------------------------------------------------------------
  704. (function($)
  705. {
  706. "use strict"
  707. $.fn.avia_sc_tabs= function(options)
  708. {
  709. var defaults =
  710. {
  711. heading: '.tab',
  712. content:'.tab_content',
  713. active:'active_tab',
  714. sidebar: false
  715. };
  716. var win = $(window)
  717. options = $.extend(defaults, options);
  718. return this.each(function()
  719. {
  720. var container = $(this),
  721. tabs = $(options.heading, container),
  722. content = $(options.content, container),
  723. initialOpen = 1,
  724. newtabs = false,
  725. oldtabs = false;
  726. // sort tabs
  727. if(tabs.length < 2) return;
  728. if(container.is('.tab_initial_open'))
  729. {
  730. var myRegexp = /tab_initial_open__(\d+)/;
  731. var match = myRegexp.exec(container[0].className);
  732. if(match != null && parseInt(match[1]) > 0)
  733. {
  734. initialOpen = parseInt(match[1]);
  735. }
  736. }
  737. if(!initialOpen || initialOpen > tabs.length) initialOpen = 1;
  738. if(!options.sidebar)
  739. {
  740. tabs.prependTo(container);
  741. }
  742. else
  743. {
  744. var click_container = $("<div class='sidebar_tab_wrap'></div>").prependTo(container), min_height;
  745. newtabs = tabs.clone();
  746. oldtabs = tabs;
  747. tabs = newtabs;
  748. tabs.prependTo(click_container);
  749. var sidebar_shadow = $("<span class='sidebar_tab_shadow'></span>").prependTo(click_container);
  750. set_size(click_container, sidebar_shadow);
  751. win.smartresize(function(){ set_size(click_container, sidebar_shadow); });
  752. }
  753. tabs.each(function(i)
  754. {
  755. var tab = $(this), the_oldtab = false;
  756. if(newtabs) the_oldtab = oldtabs.filter(':eq('+i+')');
  757. //set default tab to open
  758. if(initialOpen == (i+1))
  759. {
  760. open_content(tab, i, the_oldtab);
  761. }
  762. tab.addClass('tab_counter_'+i).bind('click', function()
  763. {
  764. open_content(tab, i, the_oldtab);
  765. return false;
  766. });
  767. if(newtabs)
  768. {
  769. the_oldtab.bind('click', function()
  770. {
  771. open_content(the_oldtab, i, tab);
  772. return false;
  773. });
  774. }
  775. });
  776. function set_size(click_container, sidebar_shadow)
  777. {
  778. min_height = click_container.outerHeight();
  779. content.css({'min-height': ( min_height - parseInt(content.css('padding-top'),10) - parseInt(content.css('padding-bottom'),10) - parseInt(content.css('border-top-width'),10) - parseInt(content.css('border-bottom-width'),10) ) });
  780. sidebar_shadow.height(content.filter('.'+options.active+'_content').outerHeight());
  781. }
  782. function open_content(tab, i, alternate_tab)
  783. {
  784. if(!tab.is('.'+options.active))
  785. {
  786. $('.'+options.active, container).removeClass(options.active);
  787. $('.'+options.active+'_content', container).removeClass(options.active+'_content');
  788. tab.addClass(options.active);
  789. setTimeout(function(){avia_small_fixes($('.'+options.active+'_content', container));},10);
  790. if(alternate_tab) alternate_tab.addClass(options.active);
  791. var active_c = content.filter(':eq('+i+')').addClass(options.active+'_content');
  792. if(typeof click_container != 'undefined' && click_container.length)
  793. {
  794. sidebar_shadow.height(active_c.outerHeight());
  795. }
  796. }
  797. }
  798. });
  799. };
  800. })(jQuery);
  801. // -------------------------------------------------------------------------------------------
  802. // Toggle shortcode javascript
  803. // -------------------------------------------------------------------------------------------
  804. (function($)
  805. {
  806. $.fn.avia_sc_toggle = function(options)
  807. {
  808. var defaults =
  809. {
  810. heading: '.toggler',
  811. content: '.toggle_wrap'
  812. };
  813. var options = $.extend(defaults, options);
  814. return this.each(function()
  815. {
  816. var container = $(this),
  817. heading = $(options.heading, container),
  818. allContent = $(options.content, container),
  819. initialOpen = '';
  820. //check if the container has the class toggle initial open.
  821. // if thats the case extract the number from the following class and open that toggle
  822. if(container.is('.toggle_initial_open'))
  823. {
  824. var myRegexp = /toggle_initial_open__(\d+)/;
  825. var match = myRegexp.exec(container[0].className);
  826. if(match != null && parseInt(match[1]) > 0)
  827. {
  828. initialOpen = parseInt(match[1]);
  829. }
  830. }
  831. heading.each(function(i)
  832. {
  833. var thisheading = $(this),
  834. content = thisheading.next(options.content, container);
  835. if(initialOpen == (i+1)) { content.css({display:'block'}); setTimeout(function(){avia_small_fixes(content);},10); }
  836. if(content.is(':visible'))
  837. {
  838. thisheading.addClass('activeTitle');
  839. }
  840. thisheading.bind('click', function()
  841. {
  842. if(content.is(':visible'))
  843. {
  844. content.slideUp(300);
  845. thisheading.removeClass('activeTitle');
  846. }
  847. else
  848. {
  849. if(container.is('.toggle_close_all'))
  850. {
  851. allContent.slideUp(300);
  852. heading.removeClass('activeTitle');
  853. }
  854. content.slideDown(300);
  855. thisheading.addClass('activeTitle');
  856. avia_small_fixes(content);
  857. }
  858. });
  859. });
  860. });
  861. };
  862. })(jQuery);
  863. // -------------------------------------------------------------------------------------------
  864. // Smooth scrooling when clicking on anchor links
  865. // -------------------------------------------------------------------------------------------
  866. (function($)
  867. {
  868. $.fn.avia_smoothscroll = function(variables)
  869. {
  870. return this.each(function()
  871. {
  872. $(this).click(function() {
  873. var newHash=this.hash;
  874. if(newHash != '' && newHash != '#' && !$(this).is('.comment-reply-link, #cancel-comment-reply-link, .no-scroll'))
  875. {
  876. var container = $(this.hash);
  877. if(container.length)
  878. {
  879. var target = container.offset().top,
  880. oldLocation=window.location.href.replace(window.location.hash, ''),
  881. newLocation=this,
  882. duration=800,
  883. easing='easeOutQuint';
  884. // make sure it's the same location
  885. if(oldLocation+newHash==newLocation)
  886. {
  887. // animate to target and set the hash to the window.location after the animation
  888. $('html:not(:animated),body:not(:animated)').animate({ scrollTop: target }, duration, easing, function() {
  889. // add new hash to the browser location
  890. window.location.href=newLocation;
  891. });
  892. // cancel default click action
  893. return false;
  894. }
  895. }
  896. }
  897. });
  898. });
  899. };
  900. })(jQuery);
  901. // -------------------------------------------------------------------------------------------
  902. // Ligthbox activation
  903. // -------------------------------------------------------------------------------------------
  904. (function($)
  905. {
  906. $.fn.avia_activate_lightbox = function(variables)
  907. {
  908. var defaults =
  909. {
  910. 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"]'
  911. };
  912. var options = $.extend(defaults, variables),
  913. win = $(window),
  914. ww = parseInt(win.width(),10) * 0.8, //controls the default lightbox width: 80% of the window size
  915. wh = (ww/16)*9; //controls the default lightbox height (16:9 ration for videos. images are resized by the lightbox anyway)
  916. return this.each(function()
  917. {
  918. var elements = $(options.autolinkElements, this).not('.noLightbox, .noLightbox a'),
  919. lastParent = "",
  920. counter = 0;
  921. elements.each(function()
  922. {
  923. var el = $(this),
  924. parentPost = el.parents('.post-entry:eq(0)'),
  925. group = 'auto_group';
  926. if(parentPost.get(0) != lastParent)
  927. {
  928. lastParent = parentPost.get(0);
  929. counter ++;
  930. }
  931. if((el.attr('rel') == undefined || el.attr('rel') == '') && !el.hasClass('noLightbox'))
  932. {
  933. el.attr('rel','lightbox['+group+counter+']');
  934. }
  935. });
  936. if($.fn.prettyPhoto)
  937. elements.prettyPhoto({ social_tools:'',slideshow: 5000, deeplinking: false, overlay_gallery:false, default_width: ww, default_height: wh });
  938. });
  939. };
  940. })(jQuery);
  941. // -------------------------------------------------------------------------------------------
  942. // Hover effect activation
  943. // -------------------------------------------------------------------------------------------
  944. (function($)
  945. {
  946. $.fn.avia_activate_hover_effect = function(variables)
  947. {
  948. var defaults =
  949. {
  950. 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, .avia_mega a, .dynamic_template_columns a, .slideshow a'
  951. };
  952. var options = $.extend(defaults, variables), css3 = $('html').is('.csstransforms'), opacity_val = 0.8;
  953. return this.each(function()
  954. {
  955. if(css3)
  956. {
  957. opacity_val = 1;
  958. }
  959. $(options.autolinkElements, this).not(".noLightbox a").contents('img:not(.filtered-image)').each(function()
  960. {
  961. var img = $(this),
  962. a = img.parent(),
  963. preload = img.parents('.preloading'),
  964. $newclass = 'lightbox_video',
  965. applied= false;
  966. if(a.attr('href').match(/(jpg|gif|jpeg|png|tif)/))
  967. {
  968. $newclass = 'lightbox_image';
  969. }
  970. if(a.is('.external-link') || ! a.attr('href').match(/(jpg|gif|jpeg|png|\.tif|\.mov|\.swf|vimeo\.com|youtube\.com)/))
  971. {
  972. $newclass = 'external_image';
  973. }
  974. if(a.is('a'))
  975. {
  976. if(img.is('.alignright')) {img.removeClass('alignright'); a.addClass('alignright')}
  977. if(img.is('.alignleft')) {img.removeClass('alignleft'); a.addClass('alignleft')}
  978. if(img.css('float') == 'left' || img.css('float') == 'right') {a.css({float:img.css('float')})}
  979. if(!a.css('position') || a.css('position') == 'static') { a.css({position:'relative', display:'inline-block'}); }
  980. if(img.is('.aligncenter')) a.css({display:'block'});
  981. if(img.is('.avia_mega img')) a.css({position:'relative', display:'inline-block'});
  982. if(img.css('left')) { a.css({left: img.css('left')}); img.css('left', 0); }
  983. }
  984. var bg = $("<span class='image_overlay_effect'><span class='image_overlay_effect_inside'></span></span>").appendTo(a);
  985. bg.css({display:'block', zIndex:5, opacity:0});
  986. bg.hover(function()
  987. {
  988. if(applied == false && img.css('opacity') > 0.5)
  989. {
  990. bg.addClass($newclass);
  991. applied = true;
  992. }
  993. bg.stop().animate({opacity:opacity_val},400);
  994. },
  995. function()
  996. {
  997. bg.stop().animate({opacity:0},400);
  998. });
  999. });
  1000. });
  1001. };
  1002. })(jQuery);
  1003. // -------------------------------------------------------------------------------------------
  1004. // small js fixes for pixel perfection :)
  1005. // -------------------------------------------------------------------------------------------
  1006. function avia_small_fixes(container)
  1007. {
  1008. if(!jQuery.support.opacity)
  1009. {
  1010. jQuery('.image_overlay_effect', container).css({'background-image':'none'});
  1011. }
  1012. if(jQuery('#slideshow_big').length) { jQuery('body').addClass('js-big-slider'); } else { jQuery('body').addClass('js-big-slider-false'); }
  1013. setTimeout(function()
  1014. {
  1015. jQuery('.twitter-tweet-rendered', container).attr('style',"");
  1016. }, 500);
  1017. var win = jQuery(window),
  1018. iframes = jQuery(' iframe:not(.slideshow iframe):not( iframe.no_resize)', container),
  1019. adjust_iframes = function()
  1020. {
  1021. iframes.each(function(){
  1022. var iframe = jQuery(this), frame_parent_w = iframe.parent().width(), proportions = 16/9;
  1023. if(this.width && this.height)
  1024. {
  1025. proportions = Math.round(this.width / this.height * 1000) / 1000;
  1026. iframes.css({width:frame_parent_w, height: frame_parent_w / proportions});
  1027. }
  1028. });
  1029. };
  1030. adjust_iframes();
  1031. win.smartresize(adjust_iframes);
  1032. }
  1033. // -------------------------------------------------------------------------------------------
  1034. // content slider
  1035. // -------------------------------------------------------------------------------------------
  1036. (function($)
  1037. {
  1038. $.avia_utilities = $.avia_utilities || {};
  1039. $.fn.avia_sc_slider = function(variables, callback)
  1040. {
  1041. return this.each(function()
  1042. {
  1043. var defaults =
  1044. {
  1045. slidePadding: 40,
  1046. appendControlls: {'h1':'pos_h1', 'h2':'pos_h2', 'h3':'pos_h3', 'h4':'pos_h4', 'h5':'pos_h5', 'h6':'pos_h6'},
  1047. controllContainerClass: 'contentSlideControlls',
  1048. transitionDuration: 800, //how fast should images crossfade
  1049. 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)
  1050. autorotationInterval: 3000, //interval between transition if autorotation is active ()also gets overwritten by autoslidedelay__(number)
  1051. transitionEasing: 'easeOutQuint',
  1052. slide: '.single_slide',
  1053. group: false,
  1054. arrowControll:false
  1055. };
  1056. var options = $.extend(defaults, variables);
  1057. var container = $(this).css({overflow:'hidden'}),
  1058. optionWrap = container.parent(':eq(0)'),
  1059. slides = $(options.slide, container),
  1060. isMobile = 'ontouchstart' in document.documentElement;
  1061. if(!slides.length) { return false; }
  1062. if(optionWrap.data('interval')){ options.autorotationInterval = optionWrap.data('interval') * 1000;}
  1063. if(optionWrap.data('interval') === 0) options.autorotation = false;
  1064. if(options.group)
  1065. {
  1066. var container_new = $('<div>').addClass(container.attr('class')).css({overflow:'hidden', width:'100%', position:'relative'}).insertAfter(container),
  1067. start = 0,
  1068. end = slides.index(slides.filter('.last:eq(0)'));
  1069. if(end === -1) end = slides.length;
  1070. var columns = end + 1,
  1071. elements = slides.length,
  1072. subgroup = {};
  1073. slides.appendTo(container_new);
  1074. for (i = 0; i <= elements; i += columns)
  1075. {
  1076. subgroup = slides.slice(i, i + columns);
  1077. if(subgroup.length)
  1078. {
  1079. subgroup.wrapAll('<div class="single_slide"></div>');
  1080. }
  1081. }
  1082. slides.each(function()
  1083. {
  1084. var current = $(this);
  1085. current.find('>*').wrapAll('<div class="'+current.attr('class')+'"></div>');
  1086. current.find('>div:eq(0)').insertAfter(current);
  1087. });
  1088. //reset values
  1089. slides.remove();
  1090. container.remove();
  1091. container = container_new;
  1092. options.slide = '.single_slide';
  1093. slides = $(options.slide, container);
  1094. }
  1095. var slideCount = slides.length,
  1096. firstSlide = slides.filter(':eq(0)'),
  1097. followslides = $(options.slide+':not(:first)', container),
  1098. innerContainer = "",
  1099. innerContainerWidth = (container.width() * slideCount) + (options.slidePadding * slideCount),
  1100. i = 0,
  1101. interval = "",
  1102. controlls = $(),
  1103. arrowControlls = $(),
  1104. nextArrow,
  1105. prevArrow;
  1106. container.animating = false;
  1107. container.methods =
  1108. {
  1109. resize: function()
  1110. {
  1111. if(!innerContainer) return;
  1112. innerContainerWidth = (container.width() * slideCount) + (options.slidePadding * slideCount);
  1113. innerContainer.width(innerContainerWidth);
  1114. slides.width(container.width());
  1115. container.methods.change();
  1116. },
  1117. preload: function()
  1118. {
  1119. followslides.css({display:"none"});
  1120. if(!slideCount)
  1121. {
  1122. container.methods.init();
  1123. }
  1124. else
  1125. {
  1126. $.avia_utilities.preload({container: container, single_callback: function(){ container.methods.init(); }});
  1127. }
  1128. },
  1129. init: function()
  1130. {
  1131. if(slideCount > 1)
  1132. {
  1133. $(window).resize(container.methods.resize);
  1134. //set container height to match the first slide
  1135. container.height(firstSlide.outerHeight());
  1136. //wrap additional container arround slides and align slides within that container
  1137. slides.wrapAll('<div class="inner_slide_container" />').css({float:'left',
  1138. width:container.width(),
  1139. display:'block',
  1140. paddingRight:options.slidePadding
  1141. });
  1142. innerContainer = $('.inner_slide_container', container).width(innerContainerWidth);
  1143. //attach controll elements
  1144. container.methods.appenControlls();
  1145. //start autoslide
  1146. container.methods.autoRotation();
  1147. //start autoslide
  1148. //container.methods.activate_touch_control();
  1149. }
  1150. container.addClass('not_animating_slides');
  1151. slides.filter(':eq(0)').addClass('active_slide');
  1152. },
  1153. change: function()
  1154. {
  1155. container.animating = true;
  1156. container.removeClass('not_animating_slides');
  1157. var moveTo = ((-i * container.width()) - (i * options.slidePadding)),
  1158. nextSlide = slides.removeClass('active_slide').filter(':eq('+i+')'),
  1159. nextSlideHeight = nextSlide.outerHeight();
  1160. //move inner container
  1161. innerContainer.stop().animate({left: moveTo}, options.transitionDuration, options.transitionEasing, function()
  1162. {
  1163. container.animating = false;
  1164. setTimeout(function(){
  1165. container.addClass('not_animating_slides');
  1166. },10);
  1167. nextSlide.addClass('active_slide');
  1168. });
  1169. //change height of outer container
  1170. container.stop().animate({height: nextSlideHeight}, options.transitionDuration, options.transitionEasing);
  1171. //change active state of controlls
  1172. var controllLinks = $('a', controlls);
  1173. controllLinks.removeClass('activeItem');
  1174. controllLinks.filter(':eq('+i+')').addClass('activeItem');
  1175. },
  1176. activate_touch_control:function()
  1177. {
  1178. var slider = container;
  1179. if(isMobile)
  1180. {
  1181. slider.touchPos = {};
  1182. slider.hasMoved = false;
  1183. slider.bind('touchstart', function(event)
  1184. {
  1185. slider.touchPos.X = event.originalEvent.touches[0].clientX;
  1186. slider.touchPos.Y = event.originalEvent.touches[0].clientY;
  1187. });
  1188. slider.bind('touchend', function(event)
  1189. {
  1190. slider.touchPos = {};
  1191. if(slider.hasMoved) { event.preventDefault(); }
  1192. slider.hasMoved = false;
  1193. });
  1194. slider.bind('touchmove', function(event)
  1195. {
  1196. if(!slider.touchPos.X)
  1197. {
  1198. slider.touchPos.X = event.originalEvent.touches[0].clientX;
  1199. slider.touchPos.Y = event.originalEvent.touches[0].clientY;
  1200. }
  1201. else
  1202. {
  1203. var differenceX = event.originalEvent.touches[0].clientX - slider.touchPos.X;
  1204. var differenceY = event.originalEvent.touches[0].clientY - slider.touchPos.Y;
  1205. //check if user is scrolling the window or moving the slider
  1206. if(Math.abs(differenceX) > Math.abs(differenceY))
  1207. {
  1208. event.preventDefault();
  1209. if(!slider.animating)
  1210. {
  1211. if(slider.touchPos != event.originalEvent.touches[0].clientX)
  1212. {
  1213. if(Math.abs(differenceX) > 50)
  1214. {
  1215. i = differenceX > 0 ? i - 1 : i + 1;
  1216. if(i+1 > slideCount) { i = 0; } else
  1217. if(i < 0) {i = slideCount-1; }
  1218. clearInterval(interval);
  1219. container.methods.change();
  1220. slider.touchPos = {};
  1221. slider.hasMoved = true;
  1222. return false;
  1223. }
  1224. }
  1225. }
  1226. }
  1227. }
  1228. });
  1229. }
  1230. },
  1231. setSlideNumber: function(event)
  1232. {
  1233. var stop = false;
  1234. if(event)
  1235. {
  1236. clearInterval(interval);
  1237. if(event.data.show == 'next') i++;
  1238. if(event.data.show == 'prev') i--;
  1239. if(typeof(event.data.show) == 'number')
  1240. {
  1241. //check if next slide is the same as current slide
  1242. if(i != event.data.show)
  1243. {
  1244. i = event.data.show;
  1245. }
  1246. else
  1247. {
  1248. stop = true;
  1249. }
  1250. }
  1251. }
  1252. else
  1253. {
  1254. i++;
  1255. }
  1256. if(i+1 > slideCount) { i = 0; } else
  1257. if(i < 0) {i = slideCount-1; }
  1258. if(!stop) // prevents transition if the next slide and the current slide are the same
  1259. {
  1260. container.methods.change();
  1261. }
  1262. return false;
  1263. },
  1264. appenControlls: function()
  1265. {
  1266. //if controlls should be added by javascript and we got more than 1 slide
  1267. if(options.appendControlls && slideCount > 1)
  1268. {
  1269. //check where to position the controll element, depending on the first element within the slide
  1270. var positioningClass = '';
  1271. for (var key in options.appendControlls)
  1272. {
  1273. if(!positioningClass)
  1274. {
  1275. if($(':first', firstSlide).is(key))
  1276. {
  1277. positioningClass = options.appendControlls[key];
  1278. }
  1279. }
  1280. }
  1281. //append the controlls
  1282. var firstClass = 'class="activeItem"';
  1283. controlls = $('<div></div>').addClass(options.controllContainerClass)
  1284. .addClass(positioningClass)
  1285. .css({visibility:'hidden', opacity:0});
  1286. if(positioningClass)
  1287. {
  1288. controlls.appendTo(container);
  1289. }
  1290. else
  1291. {
  1292. controlls.insertAfter(container);
  1293. }
  1294. slides.each(function(i)
  1295. {
  1296. var link = $('<a '+firstClass+' href="#">'+(i+1)+'</a>').appendTo(controlls); firstClass = "";
  1297. link.bind('click', {show: i}, container.methods.setSlideNumber);
  1298. });
  1299. controlls.css({visibility:'visible', opacity:0}).animate({opacity:0.7},400);
  1300. }
  1301. //add arrow Controlls
  1302. if(options.arrowControll && slideCount > 1)
  1303. {
  1304. arrowControlls = $('<div class="arrow_container"></div>');
  1305. nextArrow = $('<a class="arrow_controll arrow_controll_next" href="#next">+</a>').appendTo(arrowControlls).bind('click', {show: 'next'}, container.methods.setSlideNumber).css({visibility:'visible', opacity:0});
  1306. prevArrow = $('<a class="arrow_controll arrow_controll_prev" href="#prev">-</a>').appendTo(arrowControlls).bind('click', {show: 'prev'}, container.methods.setSlideNumber).css({visibility:'visible', opacity:0});
  1307. }
  1308. if(positioningClass)
  1309. {
  1310. arrowControlls.appendTo(container);
  1311. }
  1312. else
  1313. {
  1314. arrowControlls.insertAfter(container);
  1315. }
  1316. if(!isMobile)
  1317. {
  1318. arrowControlls.parent().hover(function()
  1319. {
  1320. prevArrow.stop().animate({opacity:0.7},400);
  1321. nextArrow.stop().animate({opacity:0.7},400);
  1322. },
  1323. function()
  1324. {
  1325. prevArrow.stop().animate({opacity:0},400)
  1326. nextArrow.stop().animate({opacity:0},400)
  1327. });
  1328. }
  1329. },
  1330. autoRotation: function()
  1331. {
  1332. if(container.is('.autoslide_true'))
  1333. {
  1334. options.autorotation = true;
  1335. var myRegexp = /autoslidedelay__(\d+)/g;
  1336. var match = myRegexp.exec(container[0].className);
  1337. if(parseInt(match[1]) > 0)
  1338. {
  1339. options.autorotationInterval = parseInt(match[1]) * 1000;
  1340. }
  1341. }
  1342. else if(container.is('.autoslide_false'))
  1343. {
  1344. options.autorotation = false;
  1345. }
  1346. if(options.autorotation)
  1347. {
  1348. interval = setInterval(function()
  1349. {
  1350. container.methods.setSlideNumber();
  1351. },
  1352. options.autorotationInterval);
  1353. }
  1354. }
  1355. };
  1356. container.methods.preload();
  1357. });
  1358. };
  1359. })(jQuery);
  1360. // -------------------------------------------------------------------------------------------
  1361. // contact form ajax improvements
  1362. // -------------------------------------------------------------------------------------------
  1363. (function($)
  1364. {
  1365. $.fn.kriesi_ajax_form = function(variables)
  1366. {
  1367. var defaults =
  1368. {
  1369. sendPath: 'send.php',
  1370. responseContainer: '#ajaxresponse'
  1371. };
  1372. var options = $.extend(defaults, variables);
  1373. return this.each(function()
  1374. {
  1375. var form = $(this),
  1376. form_sent = false,
  1377. send =
  1378. {
  1379. formElements: form.find('textarea, select, input[type=text], input[type=checkbox], input[type=hidden]'),
  1380. validationError:false,
  1381. button : form.find('input:submit'),
  1382. dataObj : {}
  1383. };
  1384. responseContainer = $(options.responseContainer+":eq(0)");
  1385. send.button.bind('click', checkElements);
  1386. function send_ajax_form()
  1387. {
  1388. if(form_sent){ return false; }
  1389. form_sent = true;
  1390. send.button.fadeOut(300);
  1391. responseContainer.load(form.attr('action')+' '+options.responseContainer, send.dataObj, function()
  1392. {
  1393. responseContainer.find('.hidden').css({display:"block"});
  1394. form.slideUp(400, function(){responseContainer.slideDown(400); send.formElements.val('');});
  1395. });
  1396. }
  1397. function checkElements()
  1398. {
  1399. // reset validation var and send data
  1400. send.validationError = false;
  1401. send.datastring = 'ajax=true';
  1402. send.formElements.each(function(i)
  1403. {
  1404. var currentElement = $(this),
  1405. surroundingElement = currentElement.parent(),
  1406. value = currentElement.val(),
  1407. name = currentElement.attr('name'),
  1408. classes = currentElement.attr('class'),
  1409. nomatch = true;
  1410. if(currentElement.is(':checkbox'))
  1411. {
  1412. if(currentElement.is(':checked')) { value = true } else {value = ''}
  1413. }
  1414. send.dataObj[name] = encodeURIComponent(value);
  1415. if(classes && classes.match(/is_empty/))
  1416. {
  1417. if(value == '')
  1418. {
  1419. surroundingElement.attr("class","").addClass("error");
  1420. send.validationError = true;
  1421. }
  1422. else
  1423. {
  1424. surroundingElement.attr("class","").addClass("valid");
  1425. }
  1426. nomatch = false;
  1427. }
  1428. if(classes && classes.match(/is_email/))
  1429. {
  1430. if(!value.match(/^\w[\w|\.|\-]+@\w[\w|\.|\-]+\.[a-zA-Z]{2,4}$/))
  1431. {
  1432. surroundingElement.attr("class","").addClass("error");
  1433. send.validationError = true;
  1434. }
  1435. else
  1436. {
  1437. surroundingElement.attr("class","").addClass("valid");
  1438. }
  1439. nomatch = false;
  1440. }
  1441. if(classes && classes.match(/is_phone/))
  1442. {
  1443. if(!value.match(/^(\d|\s|\-|\/|\(|\)|\[|\]|e|x|t|ension|\.|\+|\_|\,|\:|\;)*$/))
  1444. {
  1445. surroundingElement.attr("class","").addClass("error");
  1446. send.validationError = true;
  1447. }
  1448. else
  1449. {
  1450. surroundingElement.attr("class","").addClass("valid");
  1451. }
  1452. nomatch = false;
  1453. }
  1454. if(classes && classes.match(/is_number/))
  1455. {
  1456. if(!value.match(/^(\d)*$/))
  1457. {
  1458. surroundingElement.attr("class","").addClass("error");
  1459. send.validationError = true;
  1460. }
  1461. else
  1462. {
  1463. surroundingElement.attr("class","").addClass("valid");
  1464. }
  1465. nomatch = false;
  1466. }
  1467. if(classes && classes.match(/captcha/))
  1468. {
  1469. var verifier = form.find("#" + name + "_verifier").val(),
  1470. lastVer = verifier.charAt(verifier.length-1),
  1471. finalVer = verifier.charAt(lastVer);
  1472. if(value != finalVer)
  1473. {
  1474. surroundingElement.attr("class","").addClass("error");
  1475. send.validationError = true;
  1476. }
  1477. else
  1478. {
  1479. surroundingElement.attr("class","").addClass("valid");
  1480. }
  1481. nomatch = false;
  1482. }
  1483. if(nomatch && value != '')
  1484. {
  1485. surroundingElement.attr("class","").addClass("valid");
  1486. }
  1487. });
  1488. if(send.validationError == false)
  1489. {
  1490. send_ajax_form();
  1491. }
  1492. return false;
  1493. }
  1494. });
  1495. };
  1496. })(jQuery);
  1497. /**
  1498. * jQuery Cookie plugin
  1499. *
  1500. * Copyright (c) 2010 Klaus Hartl (stilbuero.de)
  1501. * Dual licensed under the MIT and GPL licenses:
  1502. * http://www.opensource.org/licenses/mit-license.php
  1503. * http://www.gnu.org/licenses/gpl.html
  1504. *
  1505. */
  1506. jQuery.cookie = function (key, value, options) {
  1507. // key and at least value given, set cookie...
  1508. if (arguments.length > 1 && String(value) !== "[object Object]") {
  1509. options = jQuery.extend({}, options);
  1510. if (value === null || value === undefined) {
  1511. options.expires = -1;
  1512. }
  1513. if (typeof options.expires === 'number') {
  1514. var days = options.expires, t = options.expires = new Date();
  1515. t.setDate(t.getDate() + days);
  1516. }
  1517. value = String(value);
  1518. return (document.cookie = [
  1519. encodeURIComponent(key), '=',
  1520. options.raw ? value : cookie_encode(value),
  1521. options.expires ? '; expires=' + options.expires.toUTCString() : '', // use expires attribute, max-age is not supported by IE
  1522. options.path ? '; path=' + options.path : '',
  1523. options.domain ? '; domain=' + options.domain : '',
  1524. options.secure ? '; secure' : ''
  1525. ].join(''));
  1526. }
  1527. // key and possibly options given, get cookie...
  1528. options = value || {};
  1529. var result, decode = options.raw ? function (s) { return s; } : decodeURIComponent;
  1530. return (result = new RegExp('(?:^|; )' + encodeURIComponent(key) + '=([^;]*)').exec(document.cookie)) ? decode(result[1]) : null;
  1531. };
  1532. function cookie_encode(string){
  1533. //full uri decode not only to encode ",; =" but to save uicode charaters
  1534. var decoded = encodeURIComponent(string);
  1535. //encod back common and allowed charaters {}:"#[] to save space and make the cookies more human readable
  1536. var ns = decoded.replace(/(%7B|%7D|%3A|%22|%23|%5B|%5D)/g,function(charater){return decodeURIComponent(charater);});
  1537. return ns;
  1538. }
  1539. /**
  1540. * Isotope v1.5.18
  1541. * An exquisite jQuery plugin for magical layouts
  1542. * http://isotope.metafizzy.co
  1543. *
  1544. * Commercial use requires one-time license fee
  1545. * http://metafizzy.co/#licenses
  1546. *
  1547. * Copyright 2012 David DeSandro / Metafizzy
  1548. */
  1549. (function(a,b,c){"use strict";var d=a.document,e=a.Modernizr,f=function(a){return a.charAt(0).toUpperCase()+a.slice(1)},g="Moz Webkit O Ms".split(" "),h=function(a){var b=d.documentElement.style,c;if(typeof b[a]=="string")return a;a=f(a);for(var e=0,h=g.length;e<h;e++){c=g[e]+a;if(typeof b[c]=="string")return c}},i=h("transform"),j=h("transitionProperty"),k={csstransforms:function(){return!!i},csstransforms3d:function(){var a=!!h("perspective");if(a){var c=" -o- -moz- -ms- -webkit- -khtml- ".split(" "),d="@media ("+c.join("transform-3d),(")+"modernizr)",e=b("<style>"+d+"{#modernizr{height:3px}}"+"</style>").appendTo("head"),f=b('<div id="modernizr" />').appendTo("html");a=f.height()===3,f.remove(),e.remove()}return a},csstransitions:function(){return!!j}},l;if(e)for(l in k)e.hasOwnProperty(l)||e.addTest(l,k[l]);else{e=a.Modernizr={_version:"1.6ish: miniModernizr for Isotope"};var m=" ",n;for(l in k)n=k[l](),e[l]=n,m+=" "+(n?"":"no-")+l;b("html").addClass(m)}if(e.csstransforms){var o=e.csstransforms3d?{translate:function(a){return"translate3d("+a[0]+"px, "+a[1]+"px, 0) "},scale:function(a){return"scale3d("+a+", "+a+", 1) "}}:{translate:function(a){return"translate("+a[0]+"px, "+a[1]+"px) "},scale:function(a){return"scale("+a+") "}},p=function(a,c,d){var e=b.data(a,"isoTransform")||{},f={},g,h={},j;f[c]=d,b.extend(e,f);for(g in e)j=e[g],h[g]=o[g](j);var k=h.translate||"",l=h.scale||"",m=k+l;b.data(a,"isoTransform",e),a.style[i]=m};b.cssNumber.scale=!0,b.cssHooks.scale={set:function(a,b){p(a,"scale",b)},get:function(a,c){var d=b.data(a,"isoTransform");return d&&d.scale?d.scale:1}},b.fx.step.scale=function(a){b.cssHooks.scale.set(a.elem,a.now+a.unit)},b.cssNumber.translate=!0,b.cssHooks.translate={set:function(a,b){p(a,"translate",b)},get:function(a,c){var d=b.data(a,"isoTransform");return d&&d.translate?d.translate:[0,0]}}}var q,r;e.csstransitions&&(q={WebkitTransitionProperty:"webkitTransitionEnd",MozTransitionProperty:"transitionend",OTransitionProperty:"oTransitionEnd",transitionProperty:"transitionEnd"}[j],r=h("transitionDuration"));var s=b.event,t;s.special.smartresize={setup:function(){b(this).bind("resize",s.special.smartresize.handler)},teardown:function(){b(this).unbind("resize",s.special.smartresize.handler)},handler:function(a,b){var c=this,d=arguments;a.type="smartresize",t&&clearTimeout(t),t=setTimeout(function(){jQuery.event.handle.apply(c,d)},b==="execAsap"?0:100)}},b.fn.smartresize=function(a){return a?this.bind("smartresize",a):this.trigger("smartresize",["execAsap"])},b.Isotope=function(a,c,d){this.element=b(c),this._create(a),this._init(d)};var u=["width","height"],v=b(a);b.Isotope.settings={resizable:!0,layoutMode:"masonry",containerClass:"isotope",itemClass:"isotope-item",hiddenClass:"isotope-hidden",hiddenStyle:{opacity:0,scale:.001},visibleStyle:{opacity:1,scale:1},containerStyle:{position:"relative",overflow:"hidden"},animationEngine:"best-available",animationOptions:{queue:!1,duration:800},sortBy:"original-order",sortAscending:!0,resizesContainer:!0,transformsEnabled:!b.browser.opera,itemPositionDataEnabled:!1},b.Isotope.prototype={_create:function(a){this.options=b.extend({},b.Isotope.settings,a),this.styleQueue=[],this.elemCount=0;var c=this.element[0].style;this.originalStyle={};var d=u.slice(0);for(var e in this.options.containerStyle)d.push(e);for(var f=0,g=d.length;f<g;f++)e=d[f],this.originalStyle[e]=c[e]||"";this.element.css(this.options.containerStyle),this._updateAnimationEngine(),this._updateUsingTransforms();var h={"original-order":function(a,b){b.elemCount++;return b.elemCount},random:function(){return Math.random()}};this.options.getSortData=b.extend(this.options.getSortData,h),this.reloadItems(),this.offset={left:parseInt(this.element.css("padding-left")||0,10),top:parseInt(this.element.css("padding-top")||0,10)};var i=this;setTimeout(function(){i.element.addClass(i.options.containerClass)},0),this.options.resizable&&v.bind("smartresize.isotope",function(){i.resize()}),this.element.delegate("."+this.options.hiddenClass,"click",function(){return!1})},_getAtoms:function(a){var b=this.options.itemSelector,c=b?a.filter(b).add(a.find(b)):a,d={position:"absolute"};this.usingTransforms&&(d.left=0,d.top=0),c.css(d).addClass(this.options.itemClass),this.updateSortData(c,!0);return c},_init:function(a){this.$filteredAtoms=this._filter(this.$allAtoms),this._sort(),this.reLayout(a)},option:function(a){if(b.isPlainObject(a)){this.options=b.extend(!0,this.options,a);var c;for(var d in a)c="_update"+f(d),this[c]&&this[c]()}},_updateAnimationEngine:function(){var a=this.options.animationEngine.toLowerCase().replace(/[ _\-]/g,""),b;switch(a){case"css":case"none":b=!1;break;case"jquery":b=!0;break;default:b=!e.csstransitions}this.isUsingJQueryAnimation=b,this._updateUsingTransforms()},_updateTransformsEnabled:function(){this._updateUsingTransforms()},_updateUsingTransforms:function(){var a=this.usingTransforms=this.options.transformsEnabled&&e.csstransforms&&e.csstransitions&&!this.isUsingJQueryAnimation;a||(delete this.options.hiddenStyle.scale,delete this.options.visibleStyle.scale),this.getPositionStyles=a?this._translate:this._positionAbs},_filter:function(a){var b=this.options.filter===""?"*":this.options.filter;if(!b)return a;var c=this.options.hiddenClass,d="."+c,e=a.filter(d),f=e;if(b!=="*"){f=e.filter(b);var g=a.not(d).not(b).addClass(c);this.styleQueue.push({$el:g,style:this.options.hiddenStyle})}this.styleQueue.push({$el:f,style:this.options.visibleStyle}),f.removeClass(c);return a.filter(b)},updateSortData:function(a,c){var d=this,e=this.options.getSortData,f,g;a.each(function(){f=b(this),g={};for(var a in e)!c&&a==="original-order"?g[a]=b.data(this,"isotope-sort-data")[a]:g[a]=e[a](f,d);b.data(this,"isotope-sort-data",g)})},_sort:function(){var a=this.options.sortBy,b=this._getSorter,c=this.options.sortAscending?1:-1,d=function(d,e){var f=b(d,a),g=b(e,a);f===g&&a!=="original-order"&&(f=b(d,"original-order"),g=b(e,"original-order"));return(f>g?1:f<g?-1:0)*c};this.$filteredAtoms.sort(d)},_getSorter:function(a,c){return b.data(a,"isotope-sort-data")[c]},_translate:function(a,b){return{translate:[a,b]}},_positionAbs:function(a,b){return{left:a,top:b}},_pushPosition:function(a,b,c){b=Math.round(b+this.offset.left),c=Math.round(c+this.offset.top);var d=this.getPositionStyles(b,c);this.styleQueue.push({$el:a,style:d}),this.options.itemPositionDataEnabled&&a.data("isotope-item-position",{x:b,y:c})},layout:function(a,b){var c=this.options.layoutMode;this["_"+c+"Layout"](a);if(this.options.resizesContainer){var d=this["_"+c+"GetContainerSize"]();this.styleQueue.push({$el:this.element,style:d})}this._processStyleQueue(a,b),this.isLaidOut=!0},_processStyleQueue:function(a,c){var d=this.isLaidOut?this.isUsingJQueryAnimation?"animate":"css":"css",f=this.options.animationOptions,g=this.options.onLayout,h,i,j,k;i=function(a,b){b.$el[d](b.style,f)};if(this._isInserting&&this.isUsingJQueryAnimation)i=function(a,b){h=b.$el.hasClass("no-transition")?"css":d,b.$el[h](b.style,f)};else if(c||g||f.complete){var l=!1,m=[c,g,f.complete],n=this;j=!0,k=function(){if(!l){var b;for(var c=0,d=m.length;c<d;c++)b=m[c],typeof b=="function"&&b.call(n.element,a,n);l=!0}};if(this.isUsingJQueryAnimation&&d==="animate")f.complete=k,j=!1;else if(e.csstransitions){var o=0,p=this.styleQueue[0],s=p&&p.$el,t;while(!s||!s.length){t=this.styleQueue[o++];if(!t)return;s=t.$el}var u=parseFloat(getComputedStyle(s[0])[r]);u>0&&(i=function(a,b){b.$el[d](b.style,f).one(q,k)},j=!1)}}b.each(this.styleQueue,i),j&&k(),this.styleQueue=[]},resize:function(){this["_"+this.options.layoutMode+"ResizeChanged"]()&&this.reLayout()},reLayout:function(a){this["_"+this.options.layoutMode+"Reset"](),this.layout(this.$filteredAtoms,a)},addItems:function(a,b){var c=this._getAtoms(a);this.$allAtoms=this.$allAtoms.add(c),b&&b(c)},insert:function(a,b){this.element.append(a);var c=this;this.addItems(a,function(a){var d=c._filter(a);c._addHideAppended(d),c._sort(),c.reLayout(),c._revealAppended(d,b)})},appended:function(a,b){var c=this;this.addItems(a,function(a){c._addHideAppended(a),c.layout(a),c._revealAppended(a,b)})},_addHideAppended:function(a){this.$filteredAtoms=this.$filteredAtoms.add(a),a.addClass("no-transition"),this._isInserting=!0,this.styleQueue.push({$el:a,style:this.options.hiddenStyle})},_revealAppended:function(a,b){var c=this;setTimeout(function(){a.removeClass("no-transition"),c.styleQueue.push({$el:a,style:c.options.visibleStyle}),c._isInserting=!1,c._processStyleQueue(a,b)},10)},reloadItems:function(){this.$allAtoms=this._getAtoms(this.element.children())},remove:function(a,b){var c=this,d=function(){c.$allAtoms=c.$allAtoms.not(a),a.remove(),b&&b.call(this.element)};a.filter(":not(."+this.options.hiddenClass+")").length?(this.styleQueue.push({$el:a,style:this.options.hiddenStyle}),this.$filteredAtoms=this.$filteredAtoms.not(a),this._sort(),this.reLayout(d)):d()},shuffle:function(a){this.updateSortData(this.$allAtoms),this.options.sortBy="random",this._sort(),this.reLayout(a)},destroy:function(){var a=this.usingTransforms,b=this.options;this.$allAtoms.removeClass(b.hiddenClass+" "+b.itemClass).each(function(){var b=this.style;b.position="",b.top="",b.left="",b.opacity="",a&&(b[i]="")});var c=this.element[0].style;for(var d in this.originalStyle)c[d]=this.originalStyle[d];this.element.unbind(".isotope").undelegate("."+b.hiddenClass,"click").removeClass(b.containerClass).removeData("isotope"),v.unbind(".isotope")},_getSegments:function(a){var b=this.options.layoutMode,c=a?"rowHeight":"columnWidth",d=a?"height":"width",e=a?"rows":"cols",g=this.element[d](),h,i=this.options[b]&&this.options[b][c]||this.$filteredAtoms["outer"+f(d)](!0)||g;h=Math.floor(g/i),h=Math.max(h,1),this[b][e]=h,this[b][c]=i},_checkIfSegmentsChanged:function(a){var b=this.options.layoutMode,c=a?"rows":"cols",d=this[b][c];this._getSegments(a);return this[b][c]!==d},_masonryReset:function(){this.masonry={},this._getSegments();var a=this.masonry.cols;this.masonry.colYs=[];while(a--)this.masonry.colYs.push(0)},_masonryLayout:function(a){var c=this,d=c.masonry;a.each(function(){var a=b(this),e=Math.ceil(a.outerWidth(!0)/d.columnWidth);e=Math.min(e,d.cols);if(e===1)c._masonryPlaceBrick(a,d.colYs);else{var f=d.cols+1-e,g=[],h,i;for(i=0;i<f;i++)h=d.colYs.slice(i,i+e),g[i]=Math.max.apply(Math,h);c._masonryPlaceBrick(a,g)}})},_masonryPlaceBrick:function(a,b){var c=Math.min.apply(Math,b),d=0;for(var e=0,f=b.length;e<f;e++)if(b[e]===c){d=e;break}var g=this.masonry.columnWidth*d,h=c;this._pushPosition(a,g,h);var i=c+a.outerHeight(!0),j=this.masonry.cols+1-f;for(e=0;e<j;e++)this.masonry.colYs[d+e]=i},_masonryGetContainerSize:function(){var a=Math.max.apply(Math,this.masonry.colYs);return{height:a}},_masonryResizeChanged:function(){return this._checkIfSegmentsChanged()},_fitRowsReset:function(){this.fitRows={x:0,y:0,height:0}},_fitRowsLayout:function(a){var c=this,d=this.element.width(),e=this.fitRows;a.each(function(){var a=b(this),f=a.outerWidth(!0),g=a.outerHeight(!0);e.x!==0&&f+e.x>d&&(e.x=0,e.y=e.height),c._pushPosition(a,e.x,e.y),e.height=Math.max(e.y+g,e.height),e.x+=f})},_fitRowsGetContainerSize:function(){return{height:this.fitRows.height}},_fitRowsResizeChanged:function(){return!0},_cellsByRowReset:function(){this.cellsByRow={index:0},this._getSegments(),this._getSegments(!0)},_cellsByRowLayout:function(a){var c=this,d=this.cellsByRow;a.each(function(){var a=b(this),e=d.index%d.cols,f=Math.floor(d.index/d.cols),g=(e+.5)*d.columnWidth-a.outerWidth(!0)/2,h=(f+.5)*d.rowHeight-a.outerHeight(!0)/2;c._pushPosition(a,g,h),d.index++})},_cellsByRowGetContainerSize:function(){return{height:Math.ceil(this.$filteredAtoms.length/this.cellsByRow.cols)*this.cellsByRow.rowHeight+this.offset.top}},_cellsByRowResizeChanged:function(){return this._checkIfSegmentsChanged()},_straightDownReset:function(){this.straightDown={y:0}},_straightDownLayout:function(a){var c=this;a.each(function(a){var d=b(this);c._pushPosition(d,0,c.straightDown.y),c.straightDown.y+=d.outerHeight(!0)})},_straightDownGetContainerSize:function(){return{height:this.straightDown.y}},_straightDownResizeChanged:function(){return!0},_masonryHorizontalReset:function(){this.masonryHorizontal={},this._getSegments(!0);var a=this.masonryHorizontal.rows;this.masonryHorizontal.rowXs=[];while(a--)this.masonryHorizontal.rowXs.push(0)},_masonryHorizontalLayout:function(a){var c=this,d=c.masonryHorizontal;a.each(function(){var a=b(this),e=Math.ceil(a.outerHeight(!0)/d.rowHeight);e=Math.min(e,d.rows);if(e===1)c._masonryHorizontalPlaceBrick(a,d.rowXs);else{var f=d.rows+1-e,g=[],h,i;for(i=0;i<f;i++)h=d.rowXs.slice(i,i+e),g[i]=Math.max.apply(Math,h);c._masonryHorizontalPlaceBrick(a,g)}})},_masonryHorizontalPlaceBrick:function(a,b){var c=Math.min.apply(Math,b),d=0;for(var e=0,f=b.length;e<f;e++)if(b[e]===c){d=e;break}var g=c,h=this.masonryHorizontal.rowHeight*d;this._pushPosition(a,g,h);var i=c+a.outerWidth(!0),j=this.masonryHorizontal.rows+1-f;for(e=0;e<j;e++)this.masonryHorizontal.rowXs[d+e]=i},_masonryHorizontalGetContainerSize:function(){var a=Math.max.apply(Math,this.masonryHorizontal.rowXs);return{width:a}},_masonryHorizontalResizeChanged:function(){return this._checkIfSegmentsChanged(!0)},_fitColumnsReset:function(){this.fitColumns={x:0,y:0,width:0}},_fitColumnsLayout:function(a){var c=this,d=this.element.height(),e=this.fitColumns;a.each(function(){var a=b(this),f=a.outerWidth(!0),g=a.outerHeight(!0);e.y!==0&&g+e.y>d&&(e.x=e.width,e.y=0),c._pushPosition(a,e.x,e.y),e.width=Math.max(e.x+f,e.width),e.y+=g})},_fitColumnsGetContainerSize:function(){return{width:this.fitColumns.width}},_fitColumnsResizeChanged:function(){return!0},_cellsByColumnReset:function(){this.cellsByColumn={index:0},this._getSegments(),this._getSegments(!0)},_cellsByColumnLayout:function(a){var c=this,d=this.cellsByColumn;a.each(function(){var a=b(this),e=Math.floor(d.index/d.rows),f=d.index%d.rows,g=(e+.5)*d.columnWidth-a.outerWidth(!0)/2,h=(f+.5)*d.rowHeight-a.outerHeight(!0)/2;c._pushPosition(a,g,h),d.index++})},_cellsByColumnGetContainerSize:function(){return{width:Math.ceil(this.$filteredAtoms.length/this.cellsByColumn.rows)*this.cellsByColumn.columnWidth}},_cellsByColumnResizeChanged:function(){return this._checkIfSegmentsChanged(!0)},_straightAcrossReset:function(){this.straightAcross={x:0}},_straightAcrossLayout:function(a){var c=this;a.each(function(a){var d=b(this);c._pushPosition(d,c.straightAcross.x,0),c.straightAcross.x+=d.outerWidth(!0)})},_straightAcrossGetContainerSize:function(){return{width:this.straightAcross.x}},_straightAcrossResizeChanged:function(){return!0}},b.fn.imagesLoaded=function(a){function i(a){var c=a.target;c.src!==f&&b.inArray(c,g)===-1&&(g.push(c),--e<=0&&(setTimeout(h),d.unbind(".imagesLoaded",i)))}function h(){a.call(c,d)}var c=this,d=c.find("img").add(c.filter("img")),e=d.length,f="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///ywAAAAAAQABAAACAUwAOw==",g=[];e||h(),d.bind("load.imagesLoaded error.imagesLoaded",i).each(function(){var a=this.src;this.src=f,this.src=a});return c};var w=function(b){a.console&&a.console.error(b)};b.fn.isotope=function(a,c){if(typeof a=="string"){var d=Array.prototype.slice.call(arguments,1);this.each(function(){var c=b.data(this,"isotope");if(!c)w("cannot call methods on isotope prior to initialization; attempted to call method '"+a+"'");else{if(!b.isFunction(c[a])||a.charAt(0)==="_"){w("no such method '"+a+"' for isotope instance");return}c[a].apply(c,d)}})}else this.each(function(){var d=b.data(this,"isotope");d?(d.option(a),d._init(c)):b.data(this,"isotope",new b.Isotope(a,this,c))});return this}})(window,jQuery);
  1550. /*
  1551. (function($,d){"use strict";$.HoverDir=function(a,b){this.$el=$(b);this._init(a)};$.HoverDir.defaults={hoverDelay:0,reverse:false,hoverItem:'image_overlay_effect_inside'};$.HoverDir.prototype={_init:function(a){this.options=$.extend(true,{},$.HoverDir.defaults,a);this._loadEvents()},_loadEvents:function(){var c=this;this.$el.on('mouseenter.hoverdir, mouseleave.hoverdir',function(a){var b=$(this),evType=a.type,$hoverElem=b.find('.'+c.options.hoverItem),direction=c._getDir(b,{x:a.pageX,y:a.pageY}),hoverClasses=c._getClasses(direction);$hoverElem.removeClass().addClass(c.options.hoverItem);if(evType==='mouseenter'){$hoverElem.hide().addClass(hoverClasses.from);clearTimeout(c.tmhover);c.tmhover=setTimeout(function(){$hoverElem.show(0,function(){$(this).addClass('da-animate').addClass(hoverClasses.to)})},c.options.hoverDelay)}else{$hoverElem.addClass('da-animate');clearTimeout(c.tmhover);$hoverElem.addClass(hoverClasses.from)}})},_getDir:function(a,b){var w=a.width(),h=a.height(),x=(b.x-a.offset().left-(w/2))*(w>h?(h/w):1),y=(b.y-a.offset().top-(h/2))*(h>w?(w/h):1),direction=Math.round((((Math.atan2(y,x)*(180/Math.PI))+180)/90)+3)%4;return direction},_getClasses:function(a){var b,toClass;switch(a){case 0:(!this.options.reverse)?b='da-slideFromTop':b='da-slideFromBottom';toClass='da-slideTop';break;case 1:(!this.options.reverse)?b='da-slideFromRight':b='da-slideFromLeft';toClass='da-slideLeft';break;case 2:(!this.options.reverse)?b='da-slideFromBottom':b='da-slideFromTop';toClass='da-slideTop';break;case 3:(!this.options.reverse)?b='da-slideFromLeft':b='da-slideFromRight';toClass='da-slideLeft';break};return{from:b,to:toClass}}};var e=function(a){if(this.console){console.error(a)}};$.fn.hoverdir=function(b){if(typeof b==='string'){var c=Array.prototype.slice.call(arguments,1);this.each(function(){var a=$.data(this,'hoverdir');if(!a){e("cannot call methods on hoverdir prior to initialization; "+"attempted to call method '"+b+"'");return}if(!$.isFunction(a[b])||b.charAt(0)==="_"){e("no such method '"+b+"' for hoverdir instance");return}a[b].apply(a,c)})}else{this.each(function(){var a=$.data(this,'hoverdir');if(!a){$.data(this,'hoverdir',new $.HoverDir(b,this))}})}return this}})(jQuery);
  1552. */
  1553. (function( $, undefined ) {
  1554. "use strict";
  1555. /*
  1556. * HoverDir object.
  1557. */
  1558. $.HoverDir = function( options, element ) {
  1559. this.$el = $( element );
  1560. this._init( options );
  1561. };
  1562. $.HoverDir.defaults = {
  1563. hoverDelay : 0,
  1564. reverse : false,
  1565. hoverItem : 'image_overlay_effect_inside'
  1566. };
  1567. $.HoverDir.prototype = {
  1568. _init : function( options ) {
  1569. this.options = $.extend( true, {}, $.HoverDir.defaults, options );
  1570. // load the events
  1571. this._loadEvents();
  1572. },
  1573. _loadEvents : function() {
  1574. var _self = this;
  1575. this.$el.on( 'mouseenter.hoverdir, mouseleave.hoverdir', function( event ) {
  1576. var $el = $(this),
  1577. evType = event.type,
  1578. $hoverElem = $el.find( '.'+ _self.options.hoverItem ),
  1579. direction = _self._getDir( $el, { x : event.pageX, y : event.pageY } ),
  1580. hoverClasses= _self._getClasses( direction );
  1581. $hoverElem.removeClass().addClass( _self.options.hoverItem);
  1582. if( evType === 'mouseenter' ) {
  1583. $hoverElem.hide().addClass( hoverClasses.from );
  1584. clearTimeout( _self.tmhover );
  1585. _self.tmhover = setTimeout( function() {
  1586. $hoverElem.show( 0, function() {
  1587. $(this).addClass( 'da-animate' ).addClass( hoverClasses.to );
  1588. } );
  1589. }, _self.options.hoverDelay );
  1590. }
  1591. else {
  1592. $hoverElem.addClass( 'da-animate' );
  1593. clearTimeout( _self.tmhover );
  1594. $hoverElem.addClass( hoverClasses.from );
  1595. }
  1596. } );
  1597. },
  1598. // credits : http://stackoverflow.com/a/3647634
  1599. _getDir : function( $el, coordinates ) {
  1600. /** the width and height of the current div **/
  1601. var w = $el.width(),
  1602. h = $el.height(),
  1603. /** calculate the x and y to get an angle to the center of the div from that x and y. **/
  1604. /** gets the x value relative to the center of the DIV and "normalize" it **/
  1605. x = ( coordinates.x - $el.offset().left - ( w/2 )) * ( w > h ? ( h/w ) : 1 ),
  1606. y = ( coordinates.y - $el.offset().top - ( h/2 )) * ( h > w ? ( w/h ) : 1 ),
  1607. /** the angle and the direction from where the mouse came in/went out clockwise (TRBL=0123);**/
  1608. /** first calculate the angle of the point,
  1609. add 180 deg to get rid of the negative values
  1610. divide by 90 to get the quadrant
  1611. add 3 and do a modulo by 4 to shift the quadrants to a proper clockwise TRBL (top/right/bottom/left) **/
  1612. direction = Math.round( ( ( ( Math.atan2(y, x) * (180 / Math.PI) ) + 180 ) / 90 ) + 3 ) % 4;
  1613. return direction;
  1614. },
  1615. _getClasses : function( direction ) {
  1616. var fromClass, toClass;
  1617. switch( direction ) {
  1618. case 0:
  1619. // from top
  1620. ( !this.options.reverse ) ? fromClass = 'da-slideFromTop' : fromClass = 'da-slideFromBottom';
  1621. toClass = 'da-slideTop';
  1622. break;
  1623. case 1:
  1624. // from right
  1625. ( !this.options.reverse ) ? fromClass = 'da-slideFromRight' : fromClass = 'da-slideFromLeft';
  1626. toClass = 'da-slideLeft';
  1627. break;
  1628. case 2:
  1629. // from bottom
  1630. ( !this.options.reverse ) ? fromClass = 'da-slideFromBottom' : fromClass = 'da-slideFromTop';
  1631. toClass = 'da-slideTop';
  1632. break;
  1633. case 3:
  1634. // from left
  1635. ( !this.options.reverse ) ? fromClass = 'da-slideFromLeft' : fromClass = 'da-slideFromRight';
  1636. toClass = 'da-slideLeft';
  1637. break;
  1638. };
  1639. return { from : fromClass, to: toClass };
  1640. }
  1641. };
  1642. var logError = function( message ) {
  1643. if ( this.console ) {
  1644. console.error( message );
  1645. }
  1646. };
  1647. $.fn.hoverdir = function( options ) {
  1648. if ( typeof options === 'string' ) {
  1649. var args = Array.prototype.slice.call( arguments, 1 );
  1650. this.each(function() {
  1651. var instance = $.data( this, 'hoverdir' );
  1652. if ( !instance ) {
  1653. logError( "cannot call methods on hoverdir prior to initialization; " +
  1654. "attempted to call method '" + options + "'" );
  1655. return;
  1656. }
  1657. if ( !$.isFunction( instance[options] ) || options.charAt(0) === "_" ) {
  1658. logError( "no such method '" + options + "' for hoverdir instance" );
  1659. return;
  1660. }
  1661. instance[ options ].apply( instance, args );
  1662. });
  1663. }
  1664. else {
  1665. this.each(function() {
  1666. var instance = $.data( this, 'hoverdir' );
  1667. if ( !instance ) {
  1668. $.data( this, 'hoverdir', new $.HoverDir( options, this ) );
  1669. }
  1670. });
  1671. }
  1672. return this;
  1673. };
  1674. })( jQuery );
  1675. //add browser class in JS instead of PHP. works better with caching plugins
  1676. function add_browser_class()
  1677. {
  1678. var html_class = "unknown", html_tag = jQuery('html'), broserObject = jQuery.browser, userAgent = navigator.userAgent.toLowerCase();
  1679. broserObject.chrome = /chrome/.test(navigator.userAgent.toLowerCase());
  1680. if(broserObject.chrome){ html_class = 'chrome'; }
  1681. else if(broserObject.firefox){ html_class = 'firefox'; }
  1682. else if(broserObject.msie){ html_class = 'msie'; }
  1683. else if(broserObject.safari){ html_class = 'safari'; }
  1684. else if(broserObject.opera){ html_class = 'opera'; }
  1685. if('ontouchstart' in document.documentElement){ html_class = html_class + " " + html_class+"_mobile browser_mobile" ; }
  1686. html_tag.addClass(html_class);
  1687. }
  1688. (function($){
  1689. //variable for storing the menu count when no ID is present
  1690. var menuCount = 0;
  1691. //plugin code
  1692. $.fn.mobileMenu = function(options){
  1693. //plugin's default options
  1694. var settings = {
  1695. switchWidth: 768,
  1696. topOptionText: 'Select a page',
  1697. indentString: '&nbsp;&nbsp;&nbsp;'
  1698. };
  1699. //function to check if selector matches a list
  1700. function isList($this){
  1701. return $this.is('ul, ol');
  1702. }
  1703. //function to decide if mobile or not
  1704. function isMobile(){
  1705. return ($(window).width() < settings.switchWidth);
  1706. }
  1707. //check if dropdown exists for the current element
  1708. function menuExists($this){
  1709. //if the list has an ID, use it to give the menu an ID
  1710. if($this.attr('id')){
  1711. return ($('#mobileMenu_'+$this.attr('id')).length > 0);
  1712. }
  1713. //otherwise, give the list and select elements a generated ID
  1714. else {
  1715. menuCount++;
  1716. $this.attr('id', 'mm'+menuCount);
  1717. return ($('#mobileMenu_mm'+menuCount).length > 0);
  1718. }
  1719. }
  1720. //change page on mobile menu selection
  1721. function goToPage($this){
  1722. if($this.val() !== null){document.location.href = $this.val()}
  1723. }
  1724. //show the mobile menu
  1725. function showMenu($this){
  1726. $this.css('display', 'none');
  1727. $('#mobileMenu_'+$this.attr('id')).show();
  1728. }
  1729. //hide the mobile menu
  1730. function hideMenu($this){
  1731. $this.css('display', '');
  1732. $('#mobileMenu_'+$this.attr('id')).hide();
  1733. }
  1734. //create the mobile menu
  1735. function createMenu($this){
  1736. if(isList($this)){
  1737. //generate select element as a string to append via jQuery
  1738. var selectString = '<select id="mobileMenu_'+$this.attr('id')+'" class="mobileMenu">';
  1739. //create first option (no value)
  1740. selectString += '<option value="">'+settings.topOptionText+'</option>';
  1741. //loop through list items
  1742. $this.find('li').each(function(){
  1743. //when sub-item, indent
  1744. var levelStr = '', disabled = '', skip = false, current = $(this);
  1745. var len = current.parents('ul, ol').length;
  1746. for(i=1;i<len;i++){levelStr += settings.indentString;}
  1747. //get url and text for option
  1748. var link = current.find('a:first-child').attr('href');
  1749. var the_clone = current.clone();
  1750. if(the_clone.find('.avia_mega_text_block').length && the_clone.find('li:not(.avia_mega_text_block)').length == 0)
  1751. {
  1752. skip = true;
  1753. }
  1754. if(!skip)
  1755. {
  1756. var element = the_clone.children('ul, ol, .avia_mega_div').remove().end();
  1757. var text = levelStr + element.text();
  1758. console.log(element.text());
  1759. if($.trim( element.text() ) == "")
  1760. {
  1761. skip = true;
  1762. }
  1763. if(element.find('.mega_menu_title').length > 0 || link == "" || link == '#')
  1764. {
  1765. disabled = 'disabled="disabled"';
  1766. }
  1767. if(element.is('.avia_mega_text_block'))
  1768. {
  1769. skip = true;
  1770. }
  1771. //add option
  1772. if(!skip) selectString += '<option '+disabled+' value="'+link+'">'+text+'</option>';
  1773. }
  1774. });
  1775. selectString += '</select>';
  1776. //append select element to ul/ol's container
  1777. $this.parent().append(selectString);
  1778. //add change event handler for mobile menu
  1779. $('#mobileMenu_'+$this.attr('id')).change(function(){
  1780. goToPage($(this));
  1781. });
  1782. //hide current menu, show mobile menu
  1783. showMenu($this);
  1784. } else {
  1785. alert('mobileMenu will only work with UL or OL elements!');
  1786. }
  1787. }
  1788. //plugin functionality
  1789. function run($this){
  1790. //menu doesn't exist
  1791. if(isMobile() && !menuExists($this)){
  1792. createMenu($this);
  1793. }
  1794. //menu already exists
  1795. else if(isMobile() && menuExists($this)){
  1796. showMenu($this);
  1797. }
  1798. //not mobile browser
  1799. else if(!isMobile() && menuExists($this)){
  1800. hideMenu($this);
  1801. }
  1802. }
  1803. //run plugin on each matched ul/ol
  1804. //maintain chainability by returning "this"
  1805. return this.each(function() {
  1806. //override the default settings if user provides some
  1807. if(options){$.extend(settings, options);}
  1808. //cache "this"
  1809. var $this = $(this);
  1810. //bind event to browser resize
  1811. $(window).resize(function(){run($this);});
  1812. //run plugin
  1813. run($this);
  1814. });
  1815. };
  1816. })(jQuery);
  1817. jQuery.easing['jswing'] = jQuery.easing['swing'];
  1818. jQuery.extend( jQuery.easing,
  1819. {
  1820. def: 'easeOutQuad',
  1821. swing: function (x, t, b, c, d) {
  1822. //alert(jQuery.easing.default);
  1823. return jQuery.easing[jQuery.easing.def](x, t, b, c, d);
  1824. },
  1825. easeInQuad: function (x, t, b, c, d) {
  1826. return c*(t/=d)*t + b;
  1827. },
  1828. easeOutQuad: function (x, t, b, c, d) {
  1829. return -c *(t/=d)*(t-2) + b;
  1830. },
  1831. easeInOutQuad: function (x, t, b, c, d) {
  1832. if ((t/=d/2) < 1) return c/2*t*t + b;
  1833. return -c/2 * ((--t)*(t-2) - 1) + b;
  1834. },
  1835. easeInCubic: function (x, t, b, c, d) {
  1836. return c*(t/=d)*t*t + b;
  1837. },
  1838. easeOutCubic: function (x, t, b, c, d) {
  1839. return c*((t=t/d-1)*t*t + 1) + b;
  1840. },
  1841. easeInOutCubic: function (x, t, b, c, d) {
  1842. if ((t/=d/2) < 1) return c/2*t*t*t + b;
  1843. return c/2*((t-=2)*t*t + 2) + b;
  1844. },
  1845. easeInQuart: function (x, t, b, c, d) {
  1846. return c*(t/=d)*t*t*t + b;
  1847. },
  1848. easeOutQuart: function (x, t, b, c, d) {
  1849. return -c * ((t=t/d-1)*t*t*t - 1) + b;
  1850. },
  1851. easeInOutQuart: function (x, t, b, c, d) {
  1852. if ((t/=d/2) < 1) return c/2*t*t*t*t + b;
  1853. return -c/2 * ((t-=2)*t*t*t - 2) + b;
  1854. },
  1855. easeInQuint: function (x, t, b, c, d) {
  1856. return c*(t/=d)*t*t*t*t + b;
  1857. },
  1858. easeOutQuint: function (x, t, b, c, d) {
  1859. return c*((t=t/d-1)*t*t*t*t + 1) + b;
  1860. },
  1861. easeInOutQuint: function (x, t, b, c, d) {
  1862. if ((t/=d/2) < 1) return c/2*t*t*t*t*t + b;
  1863. return c/2*((t-=2)*t*t*t*t + 2) + b;
  1864. },
  1865. easeInSine: function (x, t, b, c, d) {
  1866. return -c * Math.cos(t/d * (Math.PI/2)) + c + b;
  1867. },
  1868. easeOutSine: function (x, t, b, c, d) {
  1869. return c * Math.sin(t/d * (Math.PI/2)) + b;
  1870. },
  1871. easeInOutSine: function (x, t, b, c, d) {
  1872. return -c/2 * (Math.cos(Math.PI*t/d) - 1) + b;
  1873. },
  1874. easeInExpo: function (x, t, b, c, d) {
  1875. return (t==0) ? b : c * Math.pow(2, 10 * (t/d - 1)) + b;
  1876. },
  1877. easeOutExpo: function (x, t, b, c, d) {
  1878. return (t==d) ? b+c : c * (-Math.pow(2, -10 * t/d) + 1) + b;
  1879. },
  1880. easeInOutExpo: function (x, t, b, c, d) {
  1881. if (t==0) return b;
  1882. if (t==d) return b+c;
  1883. if ((t/=d/2) < 1) return c/2 * Math.pow(2, 10 * (t - 1)) + b;
  1884. return c/2 * (-Math.pow(2, -10 * --t) + 2) + b;
  1885. },
  1886. easeInCirc: function (x, t, b, c, d) {
  1887. return -c * (Math.sqrt(1 - (t/=d)*t) - 1) + b;
  1888. },
  1889. easeOutCirc: function (x, t, b, c, d) {
  1890. return c * Math.sqrt(1 - (t=t/d-1)*t) + b;
  1891. },
  1892. easeInOutCirc: function (x, t, b, c, d) {
  1893. if ((t/=d/2) < 1) return -c/2 * (Math.sqrt(1 - t*t) - 1) + b;
  1894. return c/2 * (Math.sqrt(1 - (t-=2)*t) + 1) + b;
  1895. },
  1896. easeInElastic: function (x, t, b, c, d) {
  1897. var s=1.70158;var p=0;var a=c;
  1898. if (t==0) return b; if ((t/=d)==1) return b+c; if (!p) p=d*.3;
  1899. if (a < Math.abs(c)) { a=c; var s=p/4; }
  1900. else var s = p/(2*Math.PI) * Math.asin (c/a);
  1901. return -(a*Math.pow(2,10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )) + b;
  1902. },
  1903. easeOutElastic: function (x, t, b, c, d) {
  1904. var s=1.70158;var p=0;var a=c;
  1905. if (t==0) return b; if ((t/=d)==1) return b+c; if (!p) p=d*.3;
  1906. if (a < Math.abs(c)) { a=c; var s=p/4; }
  1907. else var s = p/(2*Math.PI) * Math.asin (c/a);
  1908. return a*Math.pow(2,-10*t) * Math.sin( (t*d-s)*(2*Math.PI)/p ) + c + b;
  1909. },
  1910. easeInOutElastic: function (x, t, b, c, d) {
  1911. var s=1.70158;var p=0;var a=c;
  1912. if (t==0) return b; if ((t/=d/2)==2) return b+c; if (!p) p=d*(.3*1.5);
  1913. if (a < Math.abs(c)) { a=c; var s=p/4; }
  1914. else var s = p/(2*Math.PI) * Math.asin (c/a);
  1915. if (t < 1) return -.5*(a*Math.pow(2,10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )) + b;
  1916. return a*Math.pow(2,-10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )*.5 + c + b;
  1917. },
  1918. easeInBack: function (x, t, b, c, d, s) {
  1919. if (s == undefined) s = 1.70158;
  1920. return c*(t/=d)*t*((s+1)*t - s) + b;
  1921. },
  1922. easeOutBack: function (x, t, b, c, d, s) {
  1923. if (s == undefined) s = 1.70158;
  1924. return c*((t=t/d-1)*t*((s+1)*t + s) + 1) + b;
  1925. },
  1926. easeInOutBack: function (x, t, b, c, d, s) {
  1927. if (s == undefined) s = 1.70158;
  1928. if ((t/=d/2) < 1) return c/2*(t*t*(((s*=(1.525))+1)*t - s)) + b;
  1929. return c/2*((t-=2)*t*(((s*=(1.525))+1)*t + s) + 2) + b;
  1930. },
  1931. easeInBounce: function (x, t, b, c, d) {
  1932. return c - jQuery.easing.easeOutBounce (x, d-t, 0, c, d) + b;
  1933. },
  1934. easeOutBounce: function (x, t, b, c, d) {
  1935. if ((t/=d) < (1/2.75)) {
  1936. return c*(7.5625*t*t) + b;
  1937. } else if (t < (2/2.75)) {
  1938. return c*(7.5625*(t-=(1.5/2.75))*t + .75) + b;
  1939. } else if (t < (2.5/2.75)) {
  1940. return c*(7.5625*(t-=(2.25/2.75))*t + .9375) + b;
  1941. } else {
  1942. return c*(7.5625*(t-=(2.625/2.75))*t + .984375) + b;
  1943. }
  1944. },
  1945. easeInOutBounce: function (x, t, b, c, d) {
  1946. if (t < d/2) return jQuery.easing.easeInBounce (x, t*2, 0, c, d) * .5 + b;
  1947. return jQuery.easing.easeOutBounce (x, t*2-d, 0, c, d) * .5 + c*.5 + b;
  1948. }
  1949. });
  1950. function avia_log(text)
  1951. {
  1952. var logfield = jQuery('.avia_logfield');
  1953. if(!logfield.length) logfield = jQuery('<pre class="avia_logfield"></pre>').appendTo('body').css({ zIndex:100000,
  1954. padding:"20px",
  1955. backgroundColor:"#ffffff",
  1956. color:"#333333",
  1957. position:"fixed",
  1958. top:0, right:0,
  1959. width:"300px",
  1960. borderColor:"#cccccc",
  1961. borderWidth:"1px",
  1962. borderStyle:'solid',
  1963. height:"300px",
  1964. overflow:'scroll',
  1965. display:'block',
  1966. zoom:1
  1967. });
  1968. var val = logfield.html();
  1969. var text = avia_get_object(text);
  1970. logfield.html(text + "\n<br/>" + val );
  1971. function avia_get_object(obj)
  1972. {
  1973. var sendreturn = obj;
  1974. if(typeof obj == 'object' || typeof obj == 'array')
  1975. {
  1976. for (i in obj)
  1977. {
  1978. sendreturn += "'"+i+"': "+obj[i] + "<br/>";
  1979. }
  1980. }
  1981. return sendreturn;
  1982. }
  1983. }