/*!
 * Animated Scroll helper JS
 * Copyright (c) 2014 Intense Visions, Inc.
 */
/* global jQuery, skrollr */

// Resize the animated scroll divs and apply parallax effect

function intenseLoadAnimatedScroll() {
    'use strict';

    var isMobile = (/Android|iPhone|iPad|iPod|BlackBerry|Windows Phone/i).test(navigator.userAgent || navigator.vendor || window.opera);
    var $ = jQuery;


    jQuery('.animated-scroll').each(function() {
        var $element = jQuery(this);
        var skrollrSection = null;        


        if ($element.hasClass('skrollable')) {
            if (!isMobile) {
                skrollrSection = skrollr.init({
                    forceHeight: false,
                    mobileCheck: function() {
                        //hack - forces mobile version to be off
                        return false;
                    }
                });
            }
        }
    });   
}

(function($) {
    'use stict';

    $(document).ready(function() {
        intenseLoadAnimatedScroll();

        $(window).resize(function() {
            intenseLoadAnimatedScroll();
        });
    });
})(jQuery);