// JavaScript 
$(function(){
	//pagine
	$('dl.elencoTOGGLE').each(function(){
		$(this).children('dt').css({'cursor':'pointer'});				  
		$(this).children('dt').next().hide();
		$(this).children('dd:first').show();
		$(this).children('dt:first').addClass('ON');
		
		$(this).children('dt').click(
			function(){				
				$(this).next().toggle('fast');
				if($(this).is('.ON')){
					$(this).removeClass();
				}else{
					$(this).addClass('ON');
				}
				return false;
			});		
		
	});
		
	$('ul.elencoTOGGLE').each(function(){	
		$(this).children('li').css({'cursor':'pointer'});		  
			
		$(this).children('li').click(
			function(){				
				if($(this).is('.ON')){
					$(this).removeClass();
				}else{
					$(this).addClass('ON');
				}
				return false;
			});		
	});


/*
	// JavaScript 
	$(function(){
		//pagine
		$('.toggleDiv').each(function(){
			
			var item = $(this);
			var h    = (parseInt($(item).children('.toggleContent').css('line-height'))*5);
			var h2   = h+(parseInt($(item).children('.toggleContent').css('font-size'))/2);//		
			
			$(item).children('.toggleClose').hide();//nascondo il bottone di chiusura
			$(item).children('.toggleSegue').hide();//nascondo il bottone di chiusura
			if($(item).children('.toggleContent').height() > h){
				$(item).children('.toggleContent').css({'height':h2+'px'});
				$(item).children('.toggleSegue').show();
			}
		
		
			$(this).children('.toggleSegue').click(
				function(){
					$(item).children('.toggleClose').show();
					$(this).hide();
					$(item).children('.toggleContent').hide();
					$(item).children('.toggleContent').css({'height':'auto'}).toggle('fast');
				});
			
	
			$(this).children('.toggleClose').click(
				function(){
					$(item).children('.toggleSegue').show();
					$(this).hide();
					$(item).children('.toggleContent').hide();
					$(item).children('.toggleContent').css({'height':h2+'px'}).toggle('fast');
				})
		
		});

	});
*/

});


