$(document).ready(function() {
    
    $('.informazioni_utili').each(function(){
    	
    	$(this).find('.espandi_info').css('display','block');
    	$(this).find('.informazioni_utili_content').css('display','none');
    	
    	$(this).find('.espandi_info').attr('open','false');
    	
    	$(this).find('.espandi_info').bind("mouseenter",function(){
    		if ($(this).attr('open')=='false'){
				$(this).find('img').attr('src','/commonx/img/bt_cerca_notizia_chiudi_over.gif');
			}else{
				$(this).find('img').attr('src','/commonx/img/bt_cerca_notizia_apri_over.gif')
			}
    	});
		
		$(this).find('.espandi_info').bind("mouseleave",function(){
			if ($(this).attr('open')=='false'){
				$(this).find('img').attr('src','/commonx/img/bt_cerca_notizia_chiudi.gif');
			}else{
				$(this).find('img').attr('src','/commonx/img/bt_cerca_notizia_apri.gif')
			}
		});
		 
		$(this).find('.espandi_info').bind("click",function(){ 
		
			var espandi='<a href="javascript:void();"><img src="/commonx/img/bt_cerca_notizia_chiudi.gif" alt="#" /></a>';
    		var chiudi='<a href="javascript:void();"><img src="/commonx/img/bt_cerca_notizia_chiudi_over.gif" alt="#" /></a>';
    	
			if ($(this).attr('open')=='false'){
				$(this).html(chiudi);
				$(this).attr('open','true');
			}else{
				$(this).html(espandi);
				$(this).attr('open','false');
			}
			

    		$(this).parent().parent().find(".informazioni_utili_content").slideToggle(500);
		});
    })

});