function RefreshImage(valImageId) {
	var objImage = document.images[valImageId];
	if (objImage == undefined) {
		return;
	}
	var now = new Date();
	objImage.src = objImage.src.split('?')[0] + '?x=' + now.toUTCString();
}

function verifica_dati() {
	with(document.forms.modulo) {
	if (nome.value=="") {
		alert("Inserire il Nome");
		nome.style.backgroundColor='yellow';
		nome.focus();
		return false;
	} else { nome.style.backgroundColor='white'; }
	if (!/^[0-9]{3}\.+[0-9]{5,9}$/.test(telefono.value)) {
		alert("Inserire il vostro numero di telefono. (Es: 338.8707006)");
		telefono.style.backgroundColor='yellow';
		telefono.focus();
		return false;
	} else { telefono.style.backgroundColor='white'; }
	if (!/^[a-zA-Z0-9._%-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,4}$/.test(email.value)) {
        alert("Inserire correttament l'Email");
		email.style.backgroundColor='yellow';
		email.focus();
		return false;
	} else { email.style.backgroundColor='white'; }
	if (richiesta.value=="") {
		alert("Inserire richiesta/difetto");
		richiesta.style.backgroundColor='yellow';
		richiesta.focus();
		return false;
	} else { richiesta.style.backgroundColor='white'; }
	}
	return true;
}

function verifica_dati_ass() {
	with(document.forms.modulo) {
	if (nome.value=="") {
		alert("Inserire il Nome");
		document.modulo.nome.style.backgroundColor='yellow';
		document.modulo.nome.focus();
		return false;
	} else { document.modulo.nome.style.backgroundColor='white'; }
	if (cognome.value=="") {
		alert("Inserire il Cognome");
		document.modulo.cognome.style.backgroundColor='yellow';
		document.modulo.cognome.focus();
		return false;
	} else { document.modulo.cognome.style.backgroundColor='white'; }
	if (!/^[a-zA-Z0-9._%-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,4}$/.test(email.value)) {
        alert("Inserire correttament l'Email");
		document.modulo.email.style.backgroundColor='yellow';
		document.modulo.email.focus();
		return false;
	} else { document.modulo.email.style.backgroundColor='white'; }
	var codiceass=new Array();
	codiceass=codice.value.split("-");
	if (codice.value.length<=4 || isNaN(codiceass[1])==true)  {
		alert("Inserire il codice dell'assistenza");
		document.modulo.codice.style.backgroundColor='yellow';
		document.modulo.codice.focus();
		return false;
	} else { document.modulo.codice.style.backgroundColor='white'; }	
	}
	return true;
}

function conta(){
   var testo = document.modulo.richiestad.value;
   if (testo.length>1000) { alert("Lunghezza massima Testo superata, il testo oltre il limite non verrą inserito."); }
   document.modulo.contatore.value=testo.length+"/1000";
}

function Faq(id) {
	switch (document.getElementById("a"+id).src) 
	{
	case "http://www.global-assistance.it/immagini/piu.gif":
		document.getElementById("a"+id).src="immagini/meno.gif";
		document.getElementById(id).style.display='';
		break;
	case "http://www.global-assistance.it/immagini/meno.gif":
		document.getElementById("a"+id).src="immagini/piu.gif";
		document.getElementById(id).style.display='none';
		break;
	}
}

function mostraFaq(id) {
	document.getElementById(id).style.display='';
}

function nascondiFaq(id) {
	document.getElementById(id).style.display='none';
}

function mostra(id) {
	document.getElementById(id).style.display='inline';
}

function nascondi(id) {
	document.getElementById(id).style.display='none';
}

function MM_openBrWindow(theURL,winName,features) { window.open(theURL,winName,features); }