$(document).ready(function(){

		$('.pngfix').pngFix( );
				
		//GESTIONE CAMPI REGISTRAZIONE
		$('form.example input, form.example_norm input').example(function() {
		return $(this).attr('title');
		}, {class_name: 'uppercase'});

		$('ul.last li:last-child').css('border-bottom','none');

		$("a[rel=expand]").each(function() {
		 var destinazione = $(this).attr("href");
		 $(this).css('cursor','pointer');
		 $(this).parent()
		 .click(function() {
		 window.location = destinazione;
		 })
		 .hover(function () {
		 $(this).css('background-color', $('#nav li.colored').css('background-color'));
		 }, function () {
			  $(this).css('background-color', '');
		 });
		});
		
	$("a[rel=expand_link]").each(function() {
		var destinazioneLink = $(this).attr("href");
		$(this).parents('div.home_box:eq(0), .strillo:eq(0), .strillo_bt:eq(0), .w_pos:eq(0), .list_book:eq(0), .box_prodotti:eq(0)')
			.click(function() {
				window.location = destinazioneLink;
			})
			.hover(function () {
				$(this).css({ cursor: "pointer" });
			}, function () {
				$(this).css({ cursor: "default" });
			});
	});
	$("a[rel=expand_linkli]").each(function() {
		var destinazioneLink_li = $(this).attr("href");
		$(this).parents('li:eq(0)')
			.click(function() {
				window.location = destinazioneLink_li;
			})
			.hover(function () {
				$(this).css({ cursor: "pointer" });
			}, function () {
				$(this).css({ cursor: "default" });
			});
	});
	
	$('#issue_body .calendar li .layer').css('position','absolute');
	$('.box_libro li .layer_img').css('position','absolute');
	
	
	
	$("ul.bi_last").each(function() {
			var lunghezza= $(this).children().length;
			$(this).children().eq(lunghezza-1).css('border-bottom','none');	
	        if(lunghezza%2==0) $(this).children().eq(lunghezza-2).css('border-bottom','none');
	});
	$('#footer ul li:last-child').css('margin-right','0px');
	$('.tools_fdd a:last-child').css('margin-right','0px');
	if($('.tools_profile li.active img').length>0){
		var href_active = $('.tools_profile li.active img').attr('src');
		href_active = href_active.replace('_wh','_bk');
		$('.tools_profile li.active img').attr('src',href_active );
		$('.tools_profile li.active span').css('filter',"progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+href_active+"', sizingMethod='crop')" );
	}
	 $('.right_back ul:last-child').css('margin','0 0 20px 80px');
	 $('.container_strilli li:first-child').css('padding-top','0').css('border','none');;
	$('a#confirm_form').click(function(){
			$(this).parent().submit();
									   });
	$('#club_chk').click(function(){
			$('#design_chk').attr('checked', '');
									   });	
	$('#design_chk').click(function(){
			$('#club_chk').attr('checked', '');
									   });	
	
	$('.box_result li:first-child').css('border','none');
	$('.confirm_box li div.ita_confirm_').css('border','none');
	$('li.registrazione input:eq(0)').css('margin-right','14px');
	$('#issue_body #wrapper, #contacts #wrapper ').removeClass('clearfix');
	$('#issue_body #wrapper, #contacts #wrapper').addClass('clearfix');
	var li_pod = $('#middlecol_updates .podcast_cor li').length;
	if(li_pod>0) $('#middlecol_updates .podcast_cor li:eq('+(li_pod-2)+')').css('padding','0');
	$('#middlecol_updates div.days').css('position','absolute');
	
	var conta_li_dl = 0;
	$('ul.griglia li').each(function(){
		/*if(conta_li_dl%6==0 && conta_li_dl!=0) {*/
		if(conta_li_dl%3==0 && conta_li_dl!=0) {
			$(this).css("margin-right","0");
			conta_li_dl = -1;
			}
		conta_li_dl++;
		var altezza_img=$(this).find("img").height();
		var padding_top = (125-altezza_img) /2;
		$(this).find("img").css("margin-top",padding_top);
		
									 });
	$('ul.griglia li').mouseover(function(){
		$(this).find('div').show();
		$(this).css("z-index","50");
									 });
		$('ul.griglia li').mouseout(function(){
		$(this).find('div').hide();
		$(this).css("z-index","3");
									 });
		$('.corpo_dl p:last-child').css("margin-bottom","0");
	var lunghezza_li = $('ul.tools_profile li').length;
	var border_last = 0;
	if(lunghezza_li>0){
		border_last=690-(115*(lunghezza_li-1));
		$('ul.tools_profile li.ultimo').css("border-right", border_last+"px solid #FFFFFF");
	}
});