
Cufon.replace('#header ul li',{fontFamily: 'ITC Avant Garde Std Bk'});
Cufon.replace('#header ul li a',{fontFamily: 'ITC Avant Garde Std Bk'});
Cufon.replace('a.current',{fontFamily: 'ITC Avant Garde Std Md'});
Cufon.replace('span.current',{fontFamily: 'ITC Avant Garde Std Md'});
Cufon.replace('#footer ul li',{fontFamily: 'ITC Avant Garde Std Bk'});
Cufon.replace('#advDescription h2',{fontFamily: 'ITC Avant Garde Std Bk'});
Cufon.replace('#advDescription h4',{fontFamily: 'ITC Avant Garde Std Bk'});
Cufon.replace('#altroADV h4',{fontFamily: 'ITC Avant Garde Std Bk'});

Cufon.replace('#barramesi ul li a',{fontFamily: 'ITC Avant Garde Std Bk'});
Cufon.replace('#barramesi ul li a.currYear',{fontFamily: 'ITC Avant Garde Std Md'});
Cufon.replace('.pressTitle h5',{fontFamily: 'ITC Avant Garde Std Bk'});

function resize(){
	var heightW=$(window).height()-143;
	$('#body').css('height',heightW+'px');
	var widthW=$(window).width()-30;
	$('#header').css('width',widthW+'px');
	$('#body').css('width',widthW+'px');
	$('#footer').css('width',widthW+'px');
	$('#header').css('margin-left','15px');
	$('#body').css('margin-left','15px');
	$('#footer').css('margin-left','15px');
	$('#contentFlow').css('width',widthW+'px');
	$('#contentFlow').css('height',heightW+'px');
	$('#flow').css('margin-bottom','0px');
}

$(window).load(function() {
  	if (jQuery.browser.safari && document.readyState != "complete"){
    	setTimeout( arguments.callee, 100 );
    	return;
  	}
	resize();
	$(window).resize(function() {
	  resize();
	});
	
	//---------------------------------------------- NEWSLETTER
	$("#newsletterBTN").click(function(){
		$("#newsletter").show();
	});
	$("#newsletterCLOSE").click(function(){
		$("#newsletter").hide();
	});
	$("#newsletterForm").submit(function(){
		var nome=$("#newsletterNome").val();
		var email=$("#newsletterEmail").val();
		var lang=$("#lang").val();
		var nerrori="0";
		if (nome=="") { $("#newsletterLabelNome").css("color","#C00"); nerrori="1"; } else { $("#newsletterLabelNome").css("color","#000"); }
		if (email=="") { $("#newsletterLabelEmail").css("color","#C00"); nerrori="1"; } else { $("#newsletterLabelEmail").css("color","#000"); }
		if ($("#newsletterCondizioni").is(":not(:checked)")) { $("#newsletterLabelCondizioni").css("color","#C00"); nerrori="1"; } else { $("#newsletterLabelCondizioni").css("color","#000"); }
		if (nerrori=="0") {
			var dataString = 'nome='+ nome + '&email=' + email + '&lang=' +lang;
			$.ajax({
				type: "POST",
				url: "ajax/newsletter.php",
				data: dataString,
				success: function(msg){
					$('#newsletterForm').fadeOut(400).hide();
					$('#newsletterResult').html(msg);
					$('#newsletterResult').fadeIn(600).show();
					return false;
			 	}
			});
		}
		return false;
	});
	$("#newsletterErroreBack").click(function(){
		alert("PIPPO");
		$('#newsletterResult').fadeOut(400).show();
		$('#newsletterForm').fadeIn(600).hide();
		return false;
	});
	//--------------------------------------------- FINE NEWSLETTER
});

$(function(){
	$("input, textarea, button").uniform();
});
