		//header, nav, article, footer, aside, section 
		document.createElement('header');
		document.createElement('nav');
		document.createElement('article');
		document.createElement('footer');
		document.createElement('aside');
		document.createElement('section');

$(function(){
	$(".thumb").lightBox();
	//modificare questi 2 valori in millisec.
	var animationSpeed = 1200;
	var animationInterval = 6000;
	$(".slider:not(.no-slider .slider)").configurableSlider({infiniteMode : true, speed : animationSpeed, easing : 'swing', naviContainer : '.slider-navi'});
	setInterval(function(){
		$(".forward").click();
	}, animationInterval);
	$('header nav li').hover(function(){
		$(this).addClass('hover');
	}, function(){
		$(this).removeClass('hover');
	});
	
	$("form#formCV").live('submit', function(){
		theform = $(this);
		if($('input[name=privacy]:not(:checked)', theform).length){
			alert('Per inviare la richiesta \n devi acconsentire al trattamento dei dati personali');
			return false;
		}
		var data = theform.serialize();
		var url = theform.attr("action");
		$.post(url, data, function(res){
			eval(res);
			$('.errorfield', theform).remove();
			$('textarea.errored').removeClass('errored');
			if(!res.correct){
				$.each(res.errors, function(k, v){
					$('textarea[name='+v+']', theform).addClass('errored');
					var fcont = $('input[name='+v+']', theform).parent('div');
					if(!fcont.find('.errorfield').length){
						$('br:last', fcont).before('<div class="errorfield"><span>obbligatorio</span></div>');
					}							
				});
				alert('Il form contiene degli errori, verificare di avere inserito correttamente i dati');
				window.location.hash='formData';
			}else{
				theform.attr('action', res.submitUrl)
				.unbind();
				$('input[type=submit]', theform).click();
			}
		});
		return false;
	});

});
