// JavaScript Document
/*var p1=new Array("-465px", "150px", "0px");
var p2=new Array("-450px", "103px", "80px");
var p3=new Array("-335px", "75px", "160px");
var p4=new Array("-160px", "0px", "320px");
var p5=new Array("175px", "75px", "160px");
var p6=new Array("350px", "103px", "80px");
var p7=new Array("465px", "150px", "0px");*/
	
var p1=new Array("-940px", "1", "240px", '70px');
var p2=new Array("-680px", "1", "240px", '70px');
var p3=new Array("-420px", "1", "240px", '70px');
var p4=new Array("-160px", "1", "320px", '0px');
var p5=new Array("180px", "1", "240px", '70px');
var p6=new Array("440px", "1", "240px", '70px');
var p7=new Array("700px", "1", "240px", '70px');

$(document).ready( function() {
	$('#carosello li:nth-child(1)').css('margin-left', p1[0]).css('top', '10px').css('opacity', p1[1]).width(p1[2]);
	$('#carosello li:nth-child(2)').css('margin-left', p2[0]).css('top', '10px').css('opacity', p1[1]).width(p2[2]);
	$('#carosello li:nth-child(3)').css('margin-left', p3[0]).css('top', '10px').css('opacity', p1[1]).width(p3[2]);
	$('#carosello li:nth-child(4)').css('margin-left', p4[0]).css('top', '10px').css('opacity', p1[1]).width(p4[2]);
	$('#carosello li:nth-child(5)').css('margin-left', p5[0]).css('top', '10px').css('opacity', p1[1]).width(p5[2]);
	$('#carosello li:nth-child(6)').css('margin-left', p6[0]).css('top', '10px').css('opacity', p1[1]).width(p6[2]);
	$('#carosello li:nth-child(7)').css('margin-left', p7[0]).css('top', '10px').css('opacity', p1[1]).width(p7[2]);
	
	$('#nomemarchio a:nth-child(6)').fadeIn('slow');
	
	$('#nomemarchio a').hide();
	$('#bullet div').removeClass('selected');
	$('#bullet div:nth-child(10)').addClass('selected');
	$('#carosello li:nth-child(1)').animate({
		marginLeft: p1[0],
		opacity:  p1[1],
		width: p1[2],
		top: p1[3]
	}, 0, function(){});	
	$('#carosello li:nth-child(2)').animate({
		marginLeft: p2[0],
		opacity:  p2[1],
		width: p2[2],
		top: p2[3]
	}, 0, function(){});	
	$('#carosello li:nth-child(3)').animate({
		marginLeft: p3[0],
		opacity:  p3[1],
		width: p3[2],
		top: p3[3]
	}, 0, function(){});	
	$('#carosello li:nth-child(4)').animate({
		marginLeft: p4[0],
		opacity:  p4[1],
		width: p4[2],
		top: p4[3]
	}, 0, function(){});	
	$('#carosello li:nth-child(5)').animate({
		marginLeft: p5[0],
		opacity:  p5[1],
		width: p5[2],
		top: p5[3]
	}, 0, function(){});	
	$('#carosello li:nth-child(6)').animate({
		marginLeft: p6[0],
		opacity:  p6[1],
		width: p6[2],
		top: p6[3]
	}, 0, function(){});	
	$('#carosello li:nth-child(7)').animate({
		marginLeft: p7[0],
		opacity:  p7[1],
		width: p7[2],
		top: p7[3]
	}, 0, function(){});	
	$('#nomemarchio a:nth-child(4)').delay(500).fadeIn('slow');
	step4();
})

function setWidthOLD(){
	for (i=1; i<12; i++){
		gap=(parseInt($('#carosello li:nth-child('+i+')').css('margin-left')));
		if(gap<=-450){
			gap=465+gap;
			gap=100/100*100/15*gap;
		} else 
			if(gap<=-335){
				gap=450+gap;
				gap=(60/100*100/115*gap)+100;
			}
			else
				if(gap<=-160){
					gap=335+gap;
					gap=(160/100*100/175*gap)+160;
				}
				else
					if(gap<=175){
						gap=gap+160;
						gap=(160/100*(100-100/335*gap))+160;;
					}
					else
						if(gap<=350){
							gap=gap-175;
							gap=(60/100*(100-100/175*gap))+100;;
						}
						else
							if(gap>350){
								gap=gap-350;
								gap=100/100*(100-100/115*gap);
							}
					
					
		$('#carosello li:nth-child('+i+')').css('width', gap+'px');	
		
	}	
}

function step1(){
	$('#nomemarchio a').hide();
	$('#bullet div').removeClass('selected');
	$('#bullet div:nth-child(1)').addClass('selected');
	$('#carosello li:nth-child(1)').animate({
		marginLeft: p4[0],
		opacity:  p4[1],
		width: p4[2],
		top: p4[3]
	}, 1000, function(){});	
	$('#carosello li:nth-child(2)').animate({
		marginLeft: p5[0],
		opacity:  p5[1],
		width: p5[2],
		top: p5[3]
	}, 1000, function(){});	
	$('#carosello li:nth-child(3)').animate({
		marginLeft: p6[0],
		opacity:  p6[1],
		width: p6[2],
		top: p6[3]
	}, 1000, function(){});	
	$('#carosello li:nth-child(4)').animate({
		marginLeft: p7[0],
		opacity:  p7[1],
		width: p7[2],
		top: p7[3]
	}, 0, function(){});	
	$('#carosello li:nth-child(5)').animate({
		marginLeft: p1[0],
		opacity:  p1[1],
		width: p1[2],
		top: p1[3]
	}, 1000, function(){});	
	$('#carosello li:nth-child(6)').animate({
		marginLeft: p2[0],
		opacity:  p2[1],
		width: p2[2],
		top: p2[3]
	}, 1000, function(){});	
	$('#carosello li:nth-child(7)').animate({
		marginLeft: p3[0],
		opacity:  p3[1],
		width: p3[2],
		top: p3[3]
	}, 1000, function(){});	
	$('#nomemarchio a:nth-child(1)').delay(500).fadeIn('slow');
	setTimeout('step2()', 4000);
}

function step2(){
	$('#nomemarchio a').hide();
	$('#bullet div').removeClass('selected');
	$('#bullet div:nth-child(4)').addClass('selected');
	$('#carosello li:nth-child(1)').animate({
		marginLeft: p3[0],
		opacity:  p3[1],
		width: p3[2],
		top: p3[3]
	}, 1000, function(){});	
	$('#carosello li:nth-child(2)').animate({
		marginLeft: p4[0],
		opacity:  p4[1],
		width: p4[2],
		top: p4[3]
	}, 1000, function(){});	
	$('#carosello li:nth-child(3)').animate({
		marginLeft: p5[0],
		opacity:  p5[1],
		width: p5[2],
		top: p5[3]
	}, 1000, function(){});	
	$('#carosello li:nth-child(4)').animate({
		marginLeft: p6[0],
		opacity:  p6[1],
		width: p6[2],
		top: p6[3]
	}, 1000, function(){});	
	$('#carosello li:nth-child(5)').animate({
		marginLeft: p7[0],
		opacity:  p7[1],
		width: p7[2],
		top: p7[3]
	}, 0, function(){});	
	$('#carosello li:nth-child(6)').animate({
		marginLeft: p1[0],
		opacity:  p1[1],
		width: p1[2],
		top: p1[3]
	}, 1000, function(){});	
	$('#carosello li:nth-child(7)').animate({
		marginLeft: p2[0],
		opacity:  p2[1],
		width: p2[2],
		top: p2[3]
	}, 1000, function(){});	
	$('#nomemarchio a:nth-child(2)').delay(500).fadeIn('slow');
	setTimeout('step3()', 4000);
}

function step3(){
	$('#nomemarchio a').hide();
	$('#bullet div').removeClass('selected');
	$('#bullet div:nth-child(7)').addClass('selected');
	$('#carosello li:nth-child(1)').animate({
		marginLeft: p2[0],
		opacity:  p2[1],
		width: p2[2],
		top: p2[3]
	}, 1000, function(){});	
	$('#carosello li:nth-child(2)').animate({
		marginLeft: p3[0],
		opacity:  p3[1],
		width: p3[2],
		top: p3[3]
	}, 1000, function(){});	
	$('#carosello li:nth-child(3)').animate({
		marginLeft: p4[0],
		opacity:  p4[1],
		width: p4[2],
		top: p4[3]
	}, 1000, function(){});	
	$('#carosello li:nth-child(4)').animate({
		marginLeft: p5[0],
		opacity:  p5[1],
		width: p5[2],
		top: p5[3]
	}, 1000, function(){});	
	$('#carosello li:nth-child(5)').animate({
		marginLeft: p6[0],
		opacity:  p6[1],
		width: p6[2],
		top: p6[3]
	}, 1000, function(){});	
	$('#carosello li:nth-child(6)').animate({
		marginLeft: p7[0],
		opacity:  p7[1],
		width: p7[2],
		top: p7[3]
	}, 0, function(){});	
	$('#carosello li:nth-child(7)').animate({
		marginLeft: p1[0],
		opacity:  p1[1],
		width: p1[2],
		top: p1[3]
	}, 1000, function(){});	
	$('#nomemarchio a:nth-child(3)').delay(500).fadeIn('slow');
	setTimeout('step4()', 4000);
}

function step4(){
	$('#nomemarchio a').hide();
	$('#bullet div').removeClass('selected');
	$('#bullet div:nth-child(10)').addClass('selected');
	$('#carosello li:nth-child(1)').animate({
		marginLeft: p1[0],
		opacity:  p1[1],
		width: p1[2],
		top: p1[3]
	}, 1000, function(){});	
	$('#carosello li:nth-child(2)').animate({
		marginLeft: p2[0],
		opacity:  p2[1],
		width: p2[2],
		top: p2[3]
	}, 1000, function(){});	
	$('#carosello li:nth-child(3)').animate({
		marginLeft: p3[0],
		opacity:  p3[1],
		width: p3[2],
		top: p3[3]
	}, 1000, function(){});	
	$('#carosello li:nth-child(4)').animate({
		marginLeft: p4[0],
		opacity:  p4[1],
		width: p4[2],
		top: p4[3]
	}, 1000, function(){});	
	$('#carosello li:nth-child(5)').animate({
		marginLeft: p5[0],
		opacity:  p5[1],
		width: p5[2],
		top: p5[3]
	}, 1000, function(){});	
	$('#carosello li:nth-child(6)').animate({
		marginLeft: p6[0],
		opacity:  p6[1],
		width: p6[2],
		top: p6[3]
	}, 1000, function(){});	
	$('#carosello li:nth-child(7)').animate({
		marginLeft: p7[0],
		opacity:  p7[1],
		width: p7[2],
		top: p7[3]
	}, 0, function(){});	
	$('#nomemarchio a:nth-child(4)').delay(500).fadeIn('slow');
	setTimeout('step5()', 4000);
}

function step5(){
	$('#nomemarchio a').hide();
	$('#bullet div').removeClass('selected');
	$('#bullet div:nth-child(13)').addClass('selected');
	$('#carosello li:nth-child(1)').animate({
		marginLeft: p7[0],
		opacity:  p7[1],
		width: p7[2],
		top: p7[3]
	}, 0, function(){});	
	$('#carosello li:nth-child(2)').animate({
		marginLeft: p1[0],
		opacity:  p1[1],
		width: p1[2],
		top: p1[3]
	}, 1000, function(){});	
	$('#carosello li:nth-child(3)').animate({
		marginLeft: p2[0],
		opacity:  p2[1],
		width: p2[2],
		top: p2[3]
	}, 1000, function(){});	
	$('#carosello li:nth-child(4)').animate({
		marginLeft: p3[0],
		opacity:  p3[1],
		width: p3[2],
		top: p3[3]
	}, 1000, function(){});	
	$('#carosello li:nth-child(5)').animate({
		marginLeft: p4[0],
		opacity:  p4[1],
		width: p4[2],
		top: p4[3]
	}, 1000, function(){});	
	$('#carosello li:nth-child(6)').animate({
		marginLeft: p5[0],
		opacity:  p5[1],
		width: p5[2],
		top: p5[3]
	}, 1000, function(){});	
	$('#carosello li:nth-child(7)').animate({
		marginLeft: p6[0],
		opacity:  p6[1],
		width: p6[2],
		top: p6[3]
	}, 1000, function(){});	
	$('#nomemarchio a:nth-child(5)').delay(500).fadeIn('slow');
	setTimeout('step6()', 4000);
}

function step6(){
	$('#nomemarchio a').hide();
	$('#bullet div').removeClass('selected');
	$('#bullet div:nth-child(16)').addClass('selected');
	$('#carosello li:nth-child(1)').animate({
		marginLeft: p6[0],
		opacity:  p6[1],
		width: p6[2],
		top: p6[3]
	}, 1000, function(){});	
	$('#carosello li:nth-child(2)').animate({
		marginLeft: p7[0],
		opacity:  p7[1],
		width: p7[2],
		top: p7[3]
	}, 0, function(){});	
	$('#carosello li:nth-child(3)').animate({
		marginLeft: p1[0],
		opacity:  p1[1],
		width: p1[2],
		top: p1[3]
	}, 1000, function(){});	
	$('#carosello li:nth-child(4)').animate({
		marginLeft: p2[0],
		opacity:  p2[1],
		width: p2[2],
		top: p2[3]
	}, 1000, function(){});	
	$('#carosello li:nth-child(5)').animate({
		marginLeft: p3[0],
		opacity:  p3[1],
		width: p3[2],
		top: p3[3]
	}, 1000, function(){});	
	$('#carosello li:nth-child(6)').animate({
		marginLeft: p4[0],
		opacity:  p4[1],
		width: p4[2],
		top: p4[3]
	}, 1000, function(){});	
	$('#carosello li:nth-child(7)').animate({
		marginLeft: p5[0],
		opacity:  p5[1],
		width: p5[2],
		top: p5[3]
	}, 1000, function(){});	
	$('#nomemarchio a:nth-child(6)').delay(500).fadeIn('slow');
	setTimeout('step7()', 4000);
}

function step7(){
	$('#nomemarchio a').hide();
	$('#bullet div').removeClass('selected');
	$('#bullet div:nth-child(19)').addClass('selected');
	$('#carosello li:nth-child(1)').animate({
		marginLeft: p5[0],
		opacity:  p5[1],
		width: p5[2],
		top: p5[3]
	}, 1000, function(){});	
	$('#carosello li:nth-child(2)').animate({
		marginLeft: p6[0],
		opacity:  p6[1],
		width: p6[2],
		top: p6[3]
	}, 1000, function(){});	
	$('#carosello li:nth-child(3)').animate({
		marginLeft: p7[0],
		opacity:  p7[1],
		width: p7[2],
		top: p7[3]
	}, 0, function(){});	
	$('#carosello li:nth-child(4)').animate({
		marginLeft: p1[0],
		opacity:  p1[1],
		width: p1[2],
		top: p1[3]
	}, 1000, function(){});	
	$('#carosello li:nth-child(5)').animate({
		marginLeft: p2[0],
		opacity:  p2[1],
		width: p2[2],
		top: p2[3]
	}, 1000, function(){});	
	$('#carosello li:nth-child(6)').animate({
		marginLeft: p3[0],
		opacity:  p3[1],
		width: p3[2],
		top: p3[3]
	}, 1000, function(){});	
	$('#carosello li:nth-child(7)').animate({
		marginLeft: p4[0],
		opacity:  p4[1],
		width: p4[2],
		top: p4[3]
	}, 1000, function(){});	
	$('#nomemarchio a:nth-child(7)').delay(500).fadeIn('slow');
	setTimeout('step1()', 4000);
}



