/* nostro codice*/
	


function Controlli(){
	var nome = $('#nome').val();
	var cognome = $('#cognome').val();
	var email = $('#email').val();
	var telefono = $('#telefono').val();
	var cellulare = $('#cellulare').val();
	var messaggio = $('#messaggio').val();
	var check=false;
	
	if ((nome=="")){
		check=true;	
	}
	if ((cognome=="")){
		check=true;	
	}
	if ((email=="")){
		check=true;	
	}
	if ((telefono=="")){
		check=true;	
	}
	if ((cellulare=="")){
		check=true;	
	}
		
	if (check){
		alert("Devi compilare tutti i campi per proseguire");	
	} else {
	$('#main').load("pages/contact_2.php?step=ok&nome="+escape(nome)+"&cognome="+escape(cognome)+"&email="+escape(email)+"&cellulare="+escape(cellulare)+"&telefono="+escape(telefono)+"&messaggio="+escape(messaggio),function(){});
	}
}

function banner(name,open1,close1,close2,close3,close4){
	$('#'+close1).fadeOut('fast' );
	$('#'+close2).fadeOut('fast');
	$('#'+close3).fadeOut('fast');
	$('#'+close4).fadeOut('fast');
	$('#'+open1).fadeIn('fast');
	$('#'+name).slideDown();	

	
}
function homefade(){
	$('#main').fadeIn(2000);
}
function top1(){
	$("a[rel='gallery']").colorbox();
	$('#loader3').hide();
	homefade();
	$("#header").animate({marginTop: "+=100px"}, 500 );
	$("#box_bottom_header").delay(200).animate({marginTop: "+=44px"}, 500  );
	$("#footer").animate({marginBottom: "+=50px"}, 500 );

}
function hd(){
		$("#freccia").attr("src", "images/freccia_box_bottom_header2.png");
	 $("#box_bottom_header").stop().animate({top: 105}, 500);
	 
}
function hd1(){
	 $("#box_bottom_header").stop().animate({top: 0}, 500
	 ,  function(){ $("#freccia").attr("src", "images/freccia_box_bottom_header.png"); });

	 
}
function hovernews(img){
		$("#img_news_eventi").attr("src", "images/"+img);
	 $(this.parentNode).css("background-image", "url(images/sf_news.png)");
	 
}
function outnews(){
	 $("#box_bottom_header").stop().animate({top: 0}, 500
	 ,  function(){ $("#freccia").attr("src", "images/freccia_box_bottom_header.png"); });

	 
}
function change_page(pages,box){ /*cambio pagina*/

		$('#main').hide();
		$('#loader1').show();
		$("#pictureSlider").css("display","none");
		$('#box_sms4').fadeOut();
		$('#main').load(pages, function(){
			$('#main').waitForImages(function() {
			$('#loader1').hide();
			homefade();
			banner('box_top_footer',box, 'box_sms2', 'box_sms3' , 'box_sms' , 'box_sms5' );
			$("a[rel='gallery']").colorbox();
			});
});	
}

function numero(pref, phone){
var result;
new Ajax.Request("http://212.131.251.13/ita/mylist/add.asp", {
				method: 'post',
				asynchronous: true,
        parameters: {
            CountryCode: '+39',
			GsmCode: pref,
			PhoneNumber: phone,
			L1:'1',
			DatiPersonali:'1',
			Id:'2148',
			MyList:'23680576'
        },
        onSuccess: function(response) {
 
            alert(response.responseText);
						
						
        }
    });	
}


window.onload = function(){
top1();
};


