function image(cheminVignette,cheminMaxi) {
	document.write('<A HREF="javascript:afficheMaxi(\''+cheminMaxi+'\')"><IMG SRC="'+cheminVignette+'"class="imm_news" ALT="Clicca qui per ingrandire la foto" onmouseout="this.className=\'imm_news\';" onmouseover="this.className=\'imm_newsover\';"></A>');
}

function image2(cheminVignette,cheminMaxi) {
	document.write('<A HREF="javascript:afficheMaxi(\''+cheminMaxi+'\')"><IMG SRC="'+cheminVignette+'"ALT="Clicca qui per ingrandire la foto" width="20" height="17" align="absmiddle"></A>');
}

function afficheMaxi(chemin) {
	i1 = new Image;
	i1.src = chemin;
	html = '<HTML>\n<HEAD>\n<title>Bertele</title>\n</HEAD>\n<BODY LEFTMARGIN=0 MARGINWIDTH=0 TOPMARGIN=0 MARGINHEIGHT=0>\n<CENTER><IMG SRC="'+chemin+'" BORDER=0 NAME=imageTest onLoad="window.resizeTo(document.imageTest.width+50,document.imageTest.height+50)"></CENTER>\n</BODY>\n</HTML>';
	popupImage = window.open('','foto','toolbar=0,location=0,directories=0,menuBar=0,scrollbars=0,width=10,height=10,resizable=0');
	popupImage.document.open();
	popupImage.document.write(html);
	popupImage.document.close()
};

function NewWindow(mypage, myname, w, h) {
var winl = (screen.width - w) / 2;
var wint = (screen.height - h) / 2;
winprops = 'height='+h+',width='+w+',top='+wint+',left='+winl;
win = window.open(mypage, myname, winprops)
if (parseInt(navigator.appVersion) >= 4) { win.window.focus(); }
}

function control () {
		obj=document.forms[0];
		var num=0;
		for (var i=0; i<obj.elements.length; i++) {
			if(obj.elements[i].value>0){
				num++;
			}
		}
		if(num>0){
			obj.submit();
			return true;
		} else {
			alert(err_ricerca);
			return false;
		}
	}

function CheckTextArea() {
	obj=document.getElementById( 'controllo' );
	mess="";
	document.getElementById('nome').style.backgroundColor="#FFFFFF";
	document.getElementById('citta').style.backgroundColor="#FFFFFF";
	document.getElementById('nazione').style.backgroundColor="#FFFFFF";
	document.getElementById('company').style.backgroundColor="#FFFFFF";
	document.getElementById('subject').style.backgroundColor="#FFFFFF";
	document.getElementById('mail').style.backgroundColor="#FFFFFF";
	document.getElementById('messaggio').style.backgroundColor="#FFFFFF";
	if (obj.nome.value == "") {
		mess+=err_nome;
		document.getElementById('nome').style.backgroundColor="#F2CEDC";
	}
	if (obj.citta.value == "") {
		if(mess==""){
			mess+=err_citta;
		} else {
			mess+=", "+err_citta;
		}
		document.getElementById('citta').style.backgroundColor="#F2CEDC";
	}
	if (obj.nazione.value == "") {
		if(mess==""){
			mess+=err_nazione;
		} else {
			mess+=", "+err_nazione;
		}
		document.getElementById('nazione').style.backgroundColor="#F2CEDC";
	}
	if (obj.subject.value == "") {
		if(mess==""){
			mess+=err_subject;
		} else {
			mess+=", "+err_subject;
		}
		document.getElementById('subject').style.backgroundColor="#F2CEDC";
	}
	if (obj.mail.value == "") {
		if(mess==""){
			mess+=err_mail1;
		} else {
			mess+=", "+err_mail1;
		}
		document.getElementById('mail').style.backgroundColor="#F2CEDC";
	}
	if (obj.mail.value != "" && (obj.mail.value.indexOf("@") == -1 || obj.mail.value.indexOf(".") == -1 || obj.mail.value.length<6)) {
		if(mess==""){
			mess+=err_mail2;
		} else {
			mess+=", "+err_mail2;
		}
		document.getElementById('mail').style.backgroundColor="#F2CEDC";
	}
	if (obj.messaggio.value == "") {
		if(mess==""){
			mess+=err_messaggio;
		} else {
			mess+=", "+err_messaggio;
		}
		document.getElementById('messaggio').style.backgroundColor="#F2CEDC";
	}
	if (mess!="") {
		alert(err_invia+mess+".");
		return false;
		void(0);
	} else {
		obj.submit();
	}
	//return true
}
function veri() {
	obj=document.getElementById( 'domanda' );
	mess="";
	document.getElementById('testo').style.backgroundColor="#FFFFFF";
	if (obj.testo.value == "") {
		mess+=err_testo;
		document.getElementById('testo').style.backgroundColor="#F2CEDC";
	}
	if (mess!="") {
		alert(err_invia+mess+".");
		return false;
		void(0);
	} else {
		obj.submit();
	}
	//return true
}
function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}