$(window).load(function() {
	//per l'overlay sulle liste
	$('.thumb_cont').live ('mouseover', function() {
		if (!$(this).hasClass('view'))
			$(this).children('.overlay').slideDown(100);
	});
	$('.thumb_cont .overlay').live ('mouseover', function() {
		$(this).show();
	});
	$('.thumb_cont').live ('mouseout', function() {
		if (!$(this).hasClass('view')) {
			$('.thumb_cont .overlay').hide();
			$('.view .overlay').show();
		}
	});
	
	
	
	//slider banner contest

	$('#rightConcorsiTop a').hide();
	var last = $('#rightConcorsiTop a:last-child');
	last.show();
	var active = last;
	var timec = 5000;
	
    slideContest = function() {
		active.slideUp('slow').hide();
		active.prev().slideDown('slow').show();
		
		if (active.prev().length){
			active = active.prev();
        }else {
			active.slideUp('slow').hide();
			active = last;
			active.slideDown('slow').show();
		}
    }

    $(function() {
        setInterval( "slideContest()", timec);
    });


});

function setOverlay(type,id){
	var idelement='#'+type+id;
	$(idelement).parent().parent().children().children('a').removeClass('selected');
	$(idelement).addClass('selected');
}

