$(document).ready(function() {
    /*
	$('#main-navigation').click(function() {
		if (event.target === this){
            $(this).slideToggle('slow');
        }
	}).hide();
    */
       
        /*$('.feature').hover(function(event) {
			//$(this).toggleClass('feature-hover');
			$(this).children().slideToggle(400);
            // Only, not children
            /*if (event.target === this){
                $('.feature').slideToggle(300);
            }*/
        //});
               
        
	
	
	var width = $(window).width();
    
	if ((width>=721) && (width<=960)) {
		//alert("Tablet");
	}
	if (width<=720) {
		
        // Mobile
		$('#search').click(function(event) {
			$(this).addClass('search-expanded');
        });
		
        $('#main-navigation:first').click(function(event) {
			$(this).toggleClass('expanded');
            // Only, not children
            if (event.target === this){
                $(this).children().slideToggle(500);
            }
        }).children().hide();
		
		$('.grid-wrap-second-navigation #main-navigation:first').click(function(event) {
			$(this).toggleClass('expanded');
            // Only, not children
            if (event.target === this){
                $(this).children().slideToggle(500);
            }
        }).children().hide();
                
        $('span.hoverable-m').click(function() {
            $(this).parent().parent().children("ul").slideToggle(0);
            $(this).toggleClass("up");
            return false;
        }).parent().parent().children("ul").hide();
               
        
    }
    
    
    

    
    
    
    
    
    
    
    
});

