/*
 * Although $(document).ready is incredibly useful, it occurs during page render while objects are still downloading. 
 * If you notice your page stalling while loading, all those $(document).ready functions could be the reason why.
 */

$('document').ready(function() {
    
    var 
        forms = mjs.forms,
        layout = mjs.layout,
        preloader = mjs.preloader,
        animations = mjs.animations;
    
    layout.init();
    forms.init();
    preloader.init();
    animations.init();
    
    // activate carousel homepage
    //
    //var $carousel = $('section.carousel');
    //if($carousel.length > 0) $carousel.carousel();
    
      
});

/*
 * You can reduce CPU utilization during the page load by binding your jQuery functions to the $(window).load event, 
 * which occurs after all objects called by the HTML (including <iframe> content) have downloaded.
 *
 * Superfluous functionality such as drag and drop, binding visual effects and animations, pre-fetching hidden images, etc., 
 * are all good candidates for this technique.
 */

$(window).load(function(){
	// jQuery functions to initialize after the page has loaded.
	
	/*
	* vertical slider (eg. on contact page)
	*
	*/	
	var $vertSlider = $('.vertical-slider');
		if ($vertSlider.length) {
			mjs.animations.vertSlider($vertSlider);
		}
	
});
