<!--
	// Controlla la trasparenza delle immagini .png
	function correctPNG(){
		for(var i=0; i<document.images.length; i++){
			var img = document.images[i]
			var imgName = img.src.toUpperCase()
			if(imgName.substring(imgName.length-3, imgName.length) == "PNG"){
				var imgID = (img.id) ? "id='" + img.id + "' " : ""
				var imgClass = (img.className) ? "class='" + img.className + "' " : ""
				var imgTitle = (img.title) ? "title='" + img.title + "' " : "title='" + img.alt + "' "
				var imgStyle = " display: inline-block" + img.style.cssText 
				var imgAttribs = img.attributes;
				for (var j=0; j<imgAttribs.length; j++){
					var imgAttrib = imgAttribs[j];
					if(imgAttrib.nodeName == "align"){		  
						if(imgAttrib.nodeValue == "left") imgStyle = "float: left;" + imgStyle
						if(imgAttrib.nodeValue == "right") imgStyle = "float: right;" + imgStyle
						break
					}
				}
				var strNewHTML = "<span " + imgID + imgClass + imgTitle
				strNewHTML += " style=\"" + "width: " + img.width + "px; height: " + img.height + "px;" + imgStyle + ";"
				strNewHTML += " filter:progid:DXImageTransform.Microsoft.AlphaImageLoader"
				strNewHTML += "(src='" + img.src + "', sizingMethod='image');\""
				strNewHTML += "></span>" 
				img.outerHTML = strNewHTML
				i = i-1
			}
		}
	}
	
	if(document.all)
		window.attachEvent("onload", correctPNG);
	
	window.onload = function(){
		if(navigator.appName == "Microsoft Internet Explorer"){
			var arrElements = new Array(3);
			arrElements[0] = "object";
			arrElements[1] = "embed";
			arrElements[2] = "applet";
			
			for(n = 0; n < arrElements.length; n++){
				replaceObj = document.getElementsByTagName(arrElements[n]);
				
				for(i = 0; i < replaceObj.length; i++ ){
					parentObj = replaceObj[i].parentNode;
					newHTML = parentObj.innerHTML;
					parentObj.removeChild(replaceObj[i]);
					parentObj.innerHTML = newHTML;
				}
			}
		}
	}
	
	// Cambia il contenuto principale delle sezioni
	function changeSez(content, section, testo){
		if(content != ""){
			var bgImg = "url('images/" + content + "/bg_" + section + ".gif')";
			document.getElementById('contenuto').style.backgroundImage = bgImg;
		}
		else
			document.getElementById('contenuto').style.backgroundImage = "";
		
		document.getElementById('sezione').innerHTML = testo;
	}
	
	// Controlla la compilazione della form in CONTATTI
	function checkForm(){
		var goodEmail = document.forms[0].mail.value.match(/\b(^(\S+@).+((\.com)|(\.net)|(\.edu)|(\.mil)|(\.gov)|(\.org)|(\..{2,2}))$)\b/gi);
		
		if(document.forms[0].nome.value == ""){
			alert("Attenzione!\nIl campo NOME non è stato compilato correttamente");
			document.forms[0].nome.focus();
		}
		else if(document.forms[0].cognome.value == ""){
			alert("Attenzione!\nIl campo COGNOME non è stato compilato correttamente");
			document.forms[0].cognome.focus();
		}
		else if(!goodEmail){
			alert("Attenzione!\nIl campo E-MAIL non è stato compilato correttamente");
			document.forms[0].mail.focus();
		}
		else if(document.forms[0].richiesta.value == ""){
			alert("Attenzione!\nIl campo RICHIESTA non è stato compilato correttamente");
			document.forms[0].richiesta.focus();
		}
		else if(document.forms[0].accetto.checked == false){
			alert("Attenzione!\nIl check di PRESA VISIONE della PRIVACY non è stato selezionato");
		}
		else
			document.forms[0].submit();
	}
	
	// Mostra l'alert di "Work in progess"
	function alertEng(){
		alert("Sorry: work in progress...");
	}
	
	// Mostra l'alert nell'AREA TECNICA
	function alertArea(){
		if(document.forms[0].pwd.value == ''){
			alert("Attenzione!\nNESSUNA Password è stata inserita nel campo...");
			document.forms[0].pwd.focus();
		}
		else
			document.forms[0].submit();
	}
//-->
