$(document).ready(function(){
	/* This code is executed after the DOM has been completely loaded */

	/* Changing thedefault easing effect - will affect the slideUp/slideDown methods: */
	$.easing.def = "easeOutBounce";

	/* Binding a click event handler to the links: */
	$('li.button a').click(function(e){
	
		/* Finding the drop down list that corresponds to the current section: */
		var dropDown = $(this).parent().next();
		
		/* Closing all other drop down sections, except the current one */
		$('.dropdown').not(dropDown).slideUp('slow');
		dropDown.slideToggle('slow');
		
		/* Preventing the default event (which would be to navigate the browser to the link's address) */
		e.preventDefault();
	})


	$('.nav a,.footer a.up').click(function(e){
										  
		// If a link has been clicked, scroll the page to the link's hash target:
		
		$.scrollTo( this.hash || 0, 1500);
		e.preventDefault();
	});
});




function spr(a,risk){
		
		s = 0;
		
		c = a.elements.length;
		
		
		for (i=0; i<c; i++){
			x = a.elements[i].type;
			if (x == "checkbox" && a.elements[i].checked) s += parseFloat(a.elements[i].value);
		}
		
			if (s >= risk){
				r = "Występuje ryzyko zaburzeń.";
			}
			else{
				r = "Wynik mieści się w normie.";
			};
		
		alert(r + "\n\nDziękuję za wypełnienie ankiety. W razie pytań, proszę o kontakt.");
}



