$(window).load(function() {
	$(".list").click(function() {		
		$(this).toggleClass("current");		
		$(".list").not(this).removeClass("current");
		
		if($.browser.msie) {
			$(".list").css("background-position-y","top");			
			
			if($(this).hasClass("current")) {
				$(this).css("background-position-y","bottom");
			} else {
				$(this).css("background-position-y","top");				
			}
		}
	});
	
	$(".worlds table td[class!=last]").each(function() {
		if($(this).attr("colspan")==undefined || $(this).attr("colspan")==1) {		
			$(this).after("<td style=\"width:20px;\"></td>");
		}
	});
	
	if($.browser.msie) {
		$(".list,.wall").hover(function() {
			$(this).css("background-position","bottom right");
		},function() {
			if(!$(this).hasClass("current")) {			
				$(this).css("background-position","top right");			
			}
		});
	}
	
	$(".tendenza").click(function() {
		location.href = $(this).find("a").attr("href");
	});
	
	$("#occasioni .occasione").click(function() {
		location.href = $(this).find("a").attr("href");
	});
	
});
