jQuery(document).ready(function( $ ) {
	
	/***********************************/
	/********** SLIDER *****************/
	//window.dispatchEvent(new Event('resize'));
	$('.nyma-slider-1').owlCarousel({
		loop:true,
		margin:0,
		nav:true,
		navText: ["<span class='icon icon-arrow-left7'><i class='fa fa-angle-left'></i></span>","<span class='icon icon-arrow-right7'><i class='fa fa-angle-right'></i></span>"],
		responsive:{
			0:{
				items:1
			},
			600:{
				items:1
			},
			1000:{
				items:1
			}
		},
		responsiveClass:true,
		autoHeight:true,
		autoplay:true,
		autoplayTimeout:8000
	});
	
	$('.nyma-slider-2').owlCarousel({
		loop:true,
		margin:0,
		nav:true,
		navText: ["<span class='icon icon-arrow-left7'><i class='fa fa-angle-left'></i></span>","<span class='icon icon-arrow-right7'><i class='fa fa-angle-right'></i></span>"],
		responsive:{
			0:{
				items:1
			},
			600:{
				items:1
			},
			1000:{
				items:1
			}
		},
		responsiveClass:true,
		autoHeight:true
	});
	
	$('.nyma-slider-3').owlCarousel({
		loop:true,
		margin:0,
		nav:true,
		navText: ["<span class='icon icon-arrow-left7'><i class='fa fa-angle-left'></i></span>","<span class='icon icon-arrow-right7'><i class='fa fa-angle-right'></i></span>"],
		responsive:{
			0:{
				items:1
			},
			600:{
				items:3
			},
			1000:{
				items:4
			}
		},
		responsiveClass:true,
		autoHeight:true
	});
	
	
	/********** SLIDER ENDS ************/
	/***********************************/
	
	
	/***********************************/
	/********** MENU *****************/
	// top menu
	jQuery('#topmenu > .menu-item-has-children > a,#mainmenu > .page_item_has_children > a').append('<span class="sub-toggle"> <i class="fa fa-angle-down"></i> </span>');
	jQuery('#topmenu  li .menu-item-has-children> a,#mainmenu  li .page_item_has_children >  a').append('<span class="sub-toggle"> <i class="fa fa-angle-right"></i> </span>');
	
	//responsive copy main menu iteme
	$("#mainmenu ").children().clone().appendTo("#mainmenu-responsive");
	
	//main menu responsive sub menu toggle 
	jQuery('#mainmenu-responsive .menu-item-has-children,#mainmenu .page_item_has_children').append('<span class="sub-toggle"> <i class="fa fa-angle-right"></i> </span>');
    jQuery('#mainmenu-responsive .sub-toggle').click(function() {
        jQuery(this).parent('.menu-item-has-children').children('ul.sub-menu').first().slideToggle('1000');
        jQuery(this).parent('.page_item_has_children').children('ul.children').first().slideToggle('1000');
        jQuery(this).children('.fa-angle-right').first().toggleClass('fa-angle-down');
    });
	// toggle responsive menu icon
	jQuery('#nyma-mainmenu-responsive-icon').click(function() {
		jQuery('.section-main-menu-responsive').slideToggle('1000');
	});
	
	// main menu
	jQuery('#mainmenu > .menu-item-has-children > a,#mainmenu > .page_item_has_children > a').append('<span class="sub-toggle"> <i class="fa fa-angle-down"></i> </span>');
	jQuery('#mainmenu li .menu-item-has-children> a,#mainmenu  li .page_item_has_children >  a').append('<span class="sub-toggle"> <i class="fa fa-angle-right"></i> </span>');
	
	/********** MENU ENDS ************/
	/***********************************/
	
	/***********************************/
	/********** TICKER NEWS  *****************/
	$('.marquee').marquee({
		//time in milliseconds before the marquee will start animating
		delayBeforeStart: 0,
		//'left' or 'right'
		direction: 'left',
		pauseOnHover: true
	});
	/********** TICKER NEWS END ************/
	/***********************************/
	
	
	/*******************************/
	/*********SEARCH****************/
    $('.nyma-nav-search , .nyma-close-popup').on('click', function(event) {
		$('body').toggleClass('nyma-reveal-search');
		$('input.search-field').val('');
	});
	/********** SEARCH END ************/
	/***********************************/
});