<!-- Frontpage Javascript -->
<script>
$.getScript("{{{ config.wwwroot }}}/theme/maker/plugins/flexslider/jquery.flexslider-min.js", function(){
	$('.hero-slider').flexslider({
    
        animation: "fade",
        directionNav: false, //remove the default direction-nav - https://github.com/woothemes/FlexSlider/wiki/FlexSlider-Properties
        controlNav: false, //remove the default control-nav
        slideshowSpeed: 8000,
        start: function(){
             $(this).find('.slide').css("display", "block"); //prevent flash of the images
        },

    }); 
});
$.getScript("{{{ config.wwwroot }}}/theme/maker/plugins/owlcarousel/owl.carousel.min.js", function(){
	$('.featured-carousel').owlCarousel({
	    {{#usertl}}
        rtl: true,
        {{/usertl}}
	    margin:15,
        nav:true,
        {{#hasinternet}}
        navText: ['<i class="material-icons">&#xE314;</i>', '<i class="material-icons">&#xE315;</i>'],
        {{/hasinternet}}
        {{^hasinternet}}
        navText: ['<i class="fa fa-chevron-left"></i>', '<i class="fa fa-chevron-right"></i>'],
        {{/hasinternet}}
	    responsive:{		    
		    // 0px and up
	        0:{
	            items:1,
	        },
	        576:{
	            items:2,
	        },

	        768:{
	            items:2,
	        },
	        992: {
		        items:3,
	        },
	        1200:{
	            items:4,
	        }
	        
	    }
	}); 
	
	$('.promo-carousel').owlCarousel({
		{{#usertl}}
        rtl: true,
        {{/usertl}}
        loop:true,
	    autoplay:true,
	    autoplayHoverPause:true,
	    smartSpeed: 1000,
	    autoplayTimeout: 8000,
	    
	    
        items: 1,
        dots:false,
        nav:true,
        {{#hasinternet}}
        navText: ['<i class="material-icons">&#xE314;</i>', '<i class="material-icons">&#xE315;</i>']
        {{/hasinternet}}
        {{^hasinternet}}
        navText: ['<i class="fa fa-chevron-left"></i>', '<i class="fa fa-chevron-right"></i>'],
        {{/hasinternet}}
	    
	}); 
	
	$('.testimonial-carousel').owlCarousel({
		{{#usertl}}
        rtl: true,
        {{/usertl}}
        margin:30,
        //dots:false,
        nav:true,
        {{#hasinternet}}
        navText: ['<i class="material-icons">&#xE314;</i>', '<i class="material-icons">&#xE315;</i>'],
        {{/hasinternet}}
        {{^hasinternet}}
        navText: ['<i class="fa fa-chevron-left"></i>', '<i class="fa fa-chevron-right"></i>'],
        {{/hasinternet}}
        responsive:{
	        0:{
	            items:1,
	        },
	        768:{
	            items:2,
	        },
	        992: {
		        items:3,
	        }
	    }
	    
	}); 
	
	$('.teachers-carousel').owlCarousel({
		{{#usertl}}
        rtl: true,
        {{/usertl}}
        margin:30,
        //dots:false,
        nav:true,
        {{#hasinternet}}
        navText: ['<i class="material-icons">&#xE314;</i>', '<i class="material-icons">&#xE315;</i>'],
        {{/hasinternet}}
        {{^hasinternet}}
        navText: ['<i class="fa fa-chevron-left"></i>', '<i class="fa fa-chevron-right"></i>'],
        {{/hasinternet}}
        responsive:{
	        0:{
	            items:1,
	        },
	        992: {
		        items:2,
	        }
	    }
	    
	}); 
});

$(document).ready(function(){

	/* ======= Play/Stop YouTube/Vimeo Video in Bootstrpa Modal ======= */

    $('.play-trigger').on('click', function() {
        
        var theModal = $(this).data("target");
        var theVideo = $(theModal + ' iframe').attr('src');
        var theVideoAuto = theVideo + "?autoplay=1";
        
        $(theModal).on('shown.bs.modal', function () {
            $(theModal + ' iframe').attr('src', theVideoAuto);
        });
        
        
        $(theModal).on('hide.bs.modal', function () {
            $(theModal + ' iframe').attr('src', '');
        });
        

        
        $(theModal).on('hidden.bs.modal', function () {
            $(theModal + ' iframe').attr('src', theVideo);
        });

    });
    
    /* ======= FAQ ======= */
    
    $('#faq-accordion .card-toggle').on('click', function(e){
	    $(this).find('i.fa').toggleClass('fa-plus-square fa-minus-square');
	    
    });

});

</script>



