function initAll(){
	// setta voce attuale del menu
	$('#menu a').each(function(){
				if ($(this).hasClass($('body').attr('class')) && $('body').attr('class') != "") $(this).addClass('active');
							   });
	
	// setta voce attuale del sottomenu
	$('ul.menu-sezione a').each(function(){
				if ($(this).hasClass($('#conts').attr('class')) && $('#conts').attr('class') != "") $(this).addClass('active');
							   });
	// init Login
	$('#login.not-logged').css({right : '-397px'});
	$('#login .nota').hide();
	$('#login input[type="text"], #login input[type="password"]').each(function (type) {
		if($(this).val() != "") $(this).prev("label").css({'opacity' : '0.0'});
		$(this).focus(function () {
			if($(this).val() == "") {
				$(this).prev("label").css({'opacity' : '0.3'});
			}
		});

		$(this).keypress(function () {
			$(this).prev("label").css({'opacity' : '0.0'});
		});

		$(this).blur(function () {
			if($(this).val() == "") {
				$(this).prev("label").css({'opacity' : '1.0'});
			}
		});
	});
	$('#login .login-switch').click(function(){
		if($('#login').css('right') == '-397px') {
			$('#login').animate({right : '0px'});
			$('#login .nota').show('normal');
		} else {
			$('#login').animate({right : '-397px'});
			$('#login .nota').hide('normal');
		}
	});
	
	// init Fade
	$('.fade').innerfade({
		speed: 1000,
		timeout: 6000,
		containerheight: '190px'
	});

};

$(document).ready(initAll);
