function homeSwitching(me) {
		
	var P = $(me).parent().parent();
	var classBox = $(P).attr("class");
		
	if( ! $(P).hasClass("inAnim") ) {
		$(P).addClass("inAnim");
	
		var idBox = classBox.charAt(classBox.length - 1);
		
		var classBig = $("#sloganBigContent div.sloganContent:visible").attr("id");
		var idBig = classBig.charAt(classBig.length -1);
		
		if( ! ( $.browser.msie && parseInt($.browser.version, 10) < 8 ) ) {
			if( $.browser.msie ) {
				$("div#sloganContent"+idBig+" h3").fadeOut( 400 );
				$("div#sloganContent"+idBig+" h4").fadeOut( 400 );

				$("div#sloganContent"+idBig).fadeOut( 400, function(){
					$("div#sloganContent"+idBox+" h3").fadeIn( 400 );
					$("div#sloganContent"+idBox+" h4").fadeIn( 400 );
                                        $("div#sloganContent"+idBox).fadeIn(400);
                                });
			} else {			
				$("div#sloganContent"+idBig+"").fadeOut( 400, function(){ 
					$("div#sloganContent"+idBox+"").fadeIn(400);
				});
			}
		} else {
			$("#sloganBigContent div#sloganContent"+idBig).hide();
			$("#sloganBigContent div#sloganContent"+idBox).show();
		}
		
		var htmlOut = $(me).parent().clone();
		var htmlIn = $("#sloganBox3 .sloganBoxContent").clone();
		//htmlOut.find("img,h3").click( function(){ homeSwitching(this); } );
		
		//alert( htmlOut.html() );	
		$(P).removeClass(classBox);
		$(P).addClass("slogan"+idBig);
		
		$("#sloganBox3").removeClass("slogan"+idBig);;
		$("#sloganBox3").addClass(classBox);
		
		if( ! ( $.browser.msie &&  parseInt($.browser.version, 10) < 8 ) ) {
			if( ! $.browser.msie || parseInt($.browser.version, 10) >= 9 ) {
				$(P).find(".sloganBoxContent").fadeOut( 400 );
			}

		
			$(P).css("position", "relative");
			$(P).animate({"left": '380'}, function() {
				$(me).parent().replaceWith(htmlIn);
				if( ! $.browser.msie || parseInt($.browser.version, 10) >= 9 ) {
					$(P).find(".sloganBoxContent").hide();
					$(P).find(".sloganBoxContent").fadeIn(600);
				}
				$(P).animate({"left": '0'}, function(){
					if( idBox == "2" ) {
						flowplayer("player", _urlBase+"/flowplayer-3.2.7.swf");
					} else {
						if( $f("player") != null ) {
							$f("player").stop();
							$f("player").unload();
						}
					}
					//htmlIn.find("img,h3").click( function(){ homeSwitching(this); } );
					$(P).find("img,h3").click( function(){ homeSwitching(this); } );
					$(P).removeClass("inAnim");
				});
			});
		} else {
			$(P).find(".sloganBoxContent").hide();	
			//htmlIn.find("img,h3").click( function(){ homeSwitching(this); } );
			$(me).parent().replaceWith(htmlIn);
			if( idBox == "2" ) {
				flowplayer("player", _urlBase+"/flowplayer-3.2.7.swf");
			}
			$(P).find(".sloganBoxContent").show();
			$(P).find("img,h3").click( function(){ homeSwitching(this); } );
			$(P).removeClass("inAnim");
		}
	//	$(me).parent().replaceWith(htmlIn);
		
		$("#sloganBox3 .sloganBoxContent").replaceWith(htmlOut);
	}
}

$(document).ready(function() {
	if( $.browser.msie && parseInt($.browser.version, 10) < 8 )  {
		alert("NOTA: \nabbiamo notato che il tuo programma non è aggiornato; per una miglior e sicura navigazione è sempre bene aggiornarlo :)");
	}
	$("#sloganBox1 img, #sloganBox2 img, #sloganBox3 img, #sloganBox1 h3, #sloganBox2 h3, #sloganBox3 h3").click( function() {
		homeSwitching(this);	
	});
});


