
$(document).ready(function(){
	
//Set default open/close settings
$('.acc_container').hide(); //Hide/close all containers
$('.acc_trigger:first').addClass('active').next().show(); //Add "active" class to first trigger, then show/open the immediate next container

//On Click
$('.acc_trigger').click(function(){
	if( $(this).next().is(':hidden') ) { //If immediate next container is closed...
		$('.acc_trigger').removeClass('active').next().slideUp(); //Remove all .acc_trigger classes and slide up the immediate next container
		$(this).toggleClass('active').next().slideDown(); //Add .acc_trigger class to clicked trigger and slide down the immediate next container
	}
	return false; //Prevent the browser jump to the link anchor
});


// toggle: else {
//		$(this).removeClass('active').next().slideUp()
//	}
//Dla menu

//Set default open/close settings
$('.acc_container_m').hide(); //Hide/close all containers


//On Click
$('.acc_trigger_m').click(function(){
	if( $(this).next().is(':hidden') ) { //If immediate next container is closed...
		
		$(this).toggleClass('active').next().slideDown(); //Add .acc_trigger class to clicked trigger and slide down the immediate next container
	}
	else {
		$(this).removeClass('active').next().slideUp()
	}
	return false; //Prevent the browser jump to the link anchor
});

//tipsy

    $('.tip_trigger').each(function() {        
        var tip = $(this).find('.tip');

        $(this).hover(
            function() { tip.appendTo('body'); },
            function() { tip.appendTo(this); }
        ).mousemove(function(e) {
            var x = e.pageX + 20,
                y = e.pageY + 20,
                w = tip.width(),
                h = tip.height(),
                dx = $(window).width() - (x + w),
                dy = $(window).height() - (y + h);

            if ( dx < 20 ) x = e.pageX - w - 20;
            if ( dy < 20 ) y = e.pageY - h - 20;

            tip.css({ left: x, top: y });
        });         
    });

//Span

	$(function() {

    $("h1")
        .wrapInner("<span>")

	});

});





