// JavaScript Document 

$(document).ready(function() {

// Popup sopra al link in homepage
	$("a.LinkPaginaNews").hover(function() {
	$(this).next("em").animate({opacity: "show", top: "-75"});
		}, function() {
	  		$(this).next("em").animate({opacity: "hide", top: "-85"}, "fast");
		});
	$("img.imgSezione").animate({opacity: "show"},1500);


//modifico lo stile del footer e del comportamento del menu orizzontale per opera e safari
	if($.browser.safari || $.browser.opera) {
		$("#footer #dati").css("height","100px");
		$("#footer #dati p,#footer #dati li,#footer #dati h3,#footer #dati h4").css("padding","0px").css("margin","0px");		
		$("#menu-oriz ul li a").hover(function(){
		$(this).css("color","#aaa");
	}, function() {
		$(this).css("color","#fff")
	});			
	}

//disabilito gli effetti per ie,safari e opera
	if(!$.browser.msie && !$.browser.safari && !$.browser.opera) {
								   

	$("#colonna2 input:not(.button),#colonna2 textarea").css("opacity","0.5").css("backgroundColor","#ffe");
	$("select").css("backgroundColor","#ffe");

	$("#colonna2 input:not(.button),#colonna2 textarea").focus(function(){
		$(this).fadeTo("fast", 1).css("backgroundColor","#ffe");
	});

	$("#colonna2 select").focus(function(){
		$(this).css("backgroundColor","#fff");	
	});
	
	$("#colonna2 select").blur(function(){
		$(this).css("backgroundColor","#ffe");
	});

	$("#colonna2 input:not(.button),textarea").blur(function(){
		$(this).fadeTo("fast", 0.65).css("backgroundColor","#ffe");;
	});

	$("#menu-oriz ul li").hover(function(){
		$(this).fadeTo("fast", 0.60);
		$(this).find("a").css("color", "#ccc");
	}, function() {
		$(this).fadeTo("fast", 1);
		$(this).find("a").css("color", "#fff");
	});
	
	$("#header h1 a").hover(function(){
		$(this).fadeTo("fast", 0.60);
		$(this).find("a").css("color", "#ccc");
	}, function() {
		$(this).fadeTo("fast", 0);
		$(this).find("a").css("color", "#fff");
	});	
	}
	
// codice per aggiungere classi in base a estensione link
	$("a[href$=pdf]").addClass("file linkPdf");
	$("a[href$=doc]").addClass("file linkDoc");
	$("a[href$=xls]").addClass("file linkXls");
	$("a[href$=html]").addClass("file linkPagina");
	$("a[href$=zip]").addClass("file linkZip");


});

//curriculum
$(document).ready(function() {
	contatore1 = 1;
   $("a#sw1").click(function () {
   	 if(contatore1 > 9) alert("Imposssibile aggiungere altri moduli per l'aggiunta di dati");
      identificatore = "#el" + contatore1;
	  $(identificatore).show("slow");
	contatore1++;
    });
});

$(document).ready(function() {
	contatore2 = 1;
   $("a#sw2").click(function () {
   	  if(contatore2 > 9) alert("Imposssibile aggiungere altri moduli per l'aggiunta di dati");
      identificatore = "#fo" + contatore2;
	  $(identificatore).show("slow");
	contatore2++;	  
    });
});

$(document).ready(function() {
	contatore3 = 1;
   $("a#sw3").click(function () {
   	if(contatore3 > 9) alert("Imposssibile aggiungere altri moduli per l'aggiunta di dati");
      identificatore = "#li" + contatore3;
	  $(identificatore).show("slow");
	contatore3++;	  
    });
   $('.FAQR').hide();
   $('.FAQD').toggle(function(){
			$(this).next().slideDown();
			$(this).css("color","blue");
							  },function(){
			$(this).next().slideUp('fast');	
			$(this).css("color","black");
							  });
   
   
});

