$(document).ready(function() {
    /** effetto rollover testo sottolineato **/
    $('ul#secondNav a').hover(
	  function () {
	    $(this).find("span").css("text-decoration","underline")
	  }, 
	  function () {
	   	$(this).find("span").css("text-decoration","none")
	  }
	);
    
    $('ul#elenco a').hover(
	  function () {
	    $(this).find("span").css("text-decoration","underline")
	  }, 
	  function () {
	   	$(this).find("span").css("text-decoration","none")
	  }
	);
 });
 
 
 $(window).load(function() {
	/** centratura orizzontale lista social network **/
	var totalWidth = 0;
	$("#social li").each(function() { 
		var widthElement = $(this).width();
		totalWidth = (totalWidth + widthElement);
	}); 
	$("#social").width(totalWidth);
	$("#social").css({'margin': '0px auto'});
	
	
	/** centratura orizzontale lista paginazione **/
	var totalWidth2 = 0;
	$("#pagination li").each(function() { 
		var widthElement = $(this).width();
		totalWidth2 = (totalWidth2 + widthElement);
	}); 
	$("#pagination").width(totalWidth2);
	$("#pagination").css({'margin': '38px auto 50px'});
	
 });
