function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}
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];}}
}
function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}
function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
function SwapText1(id,txt){
 document.getElementById(id).innerHTML=txt;
 document.getElementById(id).style.color="#337833";
}
function SwapText2(id,txt){
 document.getElementById(id).innerHTML=txt;
 document.getElementById(id).style.color="#A0A0A0";
}
function SwapText3(id,txt){
 document.getElementById(id).innerHTML=txt;
 document.getElementById(id).style.color="#FF0000"; //rosso
}
function SwapText4(id,txt){
 document.getElementById(id).innerHTML=txt;
 document.getElementById(id).style.color="#D0AFAE"; //grigio rosso
}



// SCRIPT PER IL MODULO D'ORDINE
function enable(choose) {
	if ( choose == 1 ) { // Persona
		document.getElementById( "nomePersona" ).style.display = "block";
		document.getElementById( "nomeSocieta" ).style.display = "none";
		
		document.getElementById( "nome" ).value = "";
		document.getElementById( "cognome" ).value = "";
		
		document.getElementById( "nome" ).disabled = false;
		document.getElementById( "cognome" ).disabled = false;
		document.getElementById( "cf" ).disabled = false;
		document.getElementById( "denominazione" ).disabled = true;
		document.getElementById( "piva" ).disabled = true;
	} else { // Societa
		document.getElementById( "nomePersona" ).style.display = "none";
		document.getElementById( "nomeSocieta" ).style.display = "block";
		
		document.getElementById( "denominazione" ).value = "";
		
		document.getElementById( "nome" ).disabled = true;
		document.getElementById( "cognome" ).disabled = true;
		document.getElementById( "cf" ).disabled = true;
		document.getElementById( "denominazione" ).disabled = false;
		document.getElementById( "piva" ).disabled = false;
	}
	
	document.getElementById( "indirizzo" ).value = "";
	document.getElementById( "cap" ).value = "";
	document.getElementById( "localita" ).value = "";
	document.getElementById( "provincia" ).value = "";
	document.getElementById( "telefono" ).value = "";
	document.getElementById( "email" ).value = "";
	document.getElementById( "note" ).value = "";
	document.getElementById( "tipoPagamento" ).value = "";
	
	document.getElementById( "indirizzo" ).disabled = false;
	document.getElementById( "cap" ).disabled = false;
	document.getElementById( "localita" ).disabled = false;
	document.getElementById( "provincia" ).disabled = false;
	document.getElementById( "telefono" ).disabled = false;
	document.getElementById( "email" ).disabled = false;
	document.getElementById( "note" ).disabled = false;
	document.getElementById( "tipoPagamento" ).disabled = false;
}
/*function enableIndirizzoResoconto(choose) {
	document.getElementById( "indirizzor" ).value = "";
	document.getElementById( "capr" ).value = "";
	document.getElementById( "localitar" ).value = "";
	document.getElementById( "provinciar" ).value = "";
	document.getElementById( "emailr" ).value = "";
	
	if ( choose == 1 ) { // Uguale al precedente
		document.getElementById( "indirizzoResoconto" ).style.display = "none";
		document.getElementById( "indirizzor" ).disabled = true;
		document.getElementById( "capr" ).disabled = true;
		document.getElementById( "localitar" ).disabled = true;
		document.getElementById( "provinciar" ).disabled = true;
		document.getElementById( "emailResoconto" ).style.display = "none";
		document.getElementById( "emailr" ).disabled = true;
	} else if ( choose == 2 ) { // Diverso dal precedente
		document.getElementById( "indirizzoResoconto" ).style.display = "block";
		document.getElementById( "indirizzor" ).disabled = false;
		document.getElementById( "capr" ).disabled = false;
		document.getElementById( "localitar" ).disabled = false;
		document.getElementById( "provinciar" ).disabled = false;
		document.getElementById( "emailResoconto" ).style.display = "none";
		document.getElementById( "emailr" ).disabled = true;
	} else { // Email
		document.getElementById( "indirizzoResoconto" ).style.display = "none";
		document.getElementById( "indirizzor" ).disabled = true;
		document.getElementById( "capr" ).disabled = true;
		document.getElementById( "localitar" ).disabled = true;
		document.getElementById( "provinciar" ).disabled = true;
		document.getElementById( "emailResoconto" ).style.display = "block";
		document.getElementById( "emailr" ).disabled = false;
	}
	
	
}*/
/*function enableIndirizzoFattura(choose) {
	document.getElementById( "indirizzof" ).value = "";
	document.getElementById( "capf" ).value = "";
	document.getElementById( "localitaf" ).value = "";
	document.getElementById( "provinciaf" ).value = "";
	document.getElementById( "emailf" ).value = "";
	
	if ( choose == 1 ) { // Uguale al precedente
		document.getElementById( "indirizzoFattura" ).style.display = "none";
		document.getElementById( "indirizzof" ).disabled = true;
		document.getElementById( "capf" ).disabled = true;
		document.getElementById( "localitaf" ).disabled = true;
		document.getElementById( "provinciaf" ).disabled = true;
		document.getElementById( "emailFattura" ).style.display = "none";
		document.getElementById( "emailf" ).disabled = true;
	} else if ( choose == 2 ) { // Diverso dal precedente
		document.getElementById( "indirizzoFattura" ).style.display = "block";
		document.getElementById( "indirizzof" ).disabled = false;
		document.getElementById( "capf" ).disabled = false;
		document.getElementById( "localitaf" ).disabled = false;
		document.getElementById( "provinciaf" ).disabled = false;
		document.getElementById( "emailFattura" ).style.display = "none";
		document.getElementById( "emailf" ).disabled = true;
	} else { // Email
		document.getElementById( "indirizzoFattura" ).style.display = "none";
		document.getElementById( "indirizzof" ).disabled = true;
		document.getElementById( "capf" ).disabled = true;
		document.getElementById( "localitaf" ).disabled = true;
		document.getElementById( "provinciaf" ).disabled = true;
		document.getElementById( "emailFattura" ).style.display = "block";
		document.getElementById( "emailf" ).disabled = false;
	}
}*/
function verifyForm( form ) {
	var error = "";
	if ( form.tipologia[0].checked ) { // Società
		if ( document.getElementById( "denominazione" ).value == "" ) {
			error += "Il campo DENOMINAZIONE e' obbligatorio!\n";
		}
		if ( document.getElementById( "piva" ).value == "" ) {
			error += "Il campo P.IVA e' obligatorio!\n";
		}
	}
	if (form.tipologia[1].checked ) { // Persona Fisica
		if ( document.getElementById( "nome" ).value == "" ) {
			error += "Il campo NOME e' obbligatorio!\n";
		}
		if ( document.getElementById( "cognome" ).value == "" ) {
			error += "Il campo COGNOME e' obligatorio!\n";
		}
		if ( document.getElementById( "cf" ).value == "" ) {
			error += "Il campo CODICE FISCALE e' obligatorio!\n";
		}
	}
	if ( document.getElementById( "indirizzo" ).value == "" ) {
		error += "Il campo INDIRIZZO e' obbligatorio!\n";
	}
	if ( document.getElementById( "cap" ).value == "" ) {
		error += "Il campo CAP e' obbligatorio!\n";
	}
	if ( document.getElementById( "localita" ).value == "" ) {
		error += "Il campo LOCALITA' e' obbligatorio!\n";
	}
	if ( document.getElementById( "provincia" ).value == "" ) {
		error += "Il campo PROVINCIA e' obbligatorio!\n";
	}
	if ( document.getElementById( "telefono" ).value == "" ) {
		error += "Il campo TELEFONO e' obbligatorio!\n";
	}
	if ( document.getElementById( "email" ).value == "" ) {
		error += "Il campo EMAIL e' obbligatorio!\n";
	}
	if ( document.getElementById( "numero" ).value == "" ) {
		error += "Il campo N. KIT e' obbligatorio!\n";
	}
	
	if ( form.invioR[1].checked ) {
		if ( document.getElementById( "indirizzor" ).value == "" ) {
			error += "Il campo INDIRIZZO e' obbligatorio (Sezione Resoconto)!\n";
		}
		if ( document.getElementById( "capr" ).value == "" ) {
			error += "Il campo CAP e' obbligatorio (Sezione Resoconto)!\n";
		}
		if ( document.getElementById( "localitar" ).value == "" ) {
			error += "Il campo LOCALITA' e' obbligatorio (Sezione Resoconto)!\n";
		}
		if ( document.getElementById( "provinciar" ).value == "" ) {
			error += "Il campo PROVINCIA e' obbligatorio (Sezione Resoconto)!\n";
		}
	} else if ( form.invioR[2].checked ) {
		if ( document.getElementById( "emailr" ).value == "" ) {
			error += "Il campo EMAIL e' obbligatorio (Sezione Resoconto)!\n";
		}
	}
	
	if ( form.invioF[1].checked ) {
		if ( document.getElementById( "indirizzof" ).value == "" ) {
			error += "Il campo INDIRIZZO e' obbligatorio (Sezione Fatturazione)!\n";
		}
		if ( document.getElementById( "capf" ).value == "" ) {
			error += "Il campo CAP e' obbligatorio (Sezione Fatturazione)!\n";
		}
		if ( document.getElementById( "localitaf" ).value == "" ) {
			error += "Il campo LOCALITA' e' obbligatorio (Sezione Fatturazione)!\n";
		}
		if ( document.getElementById( "provinciaf" ).value == "" ) {
			error += "Il campo PROVINCIA e' obbligatorio (Sezione Fatturazione)!\n";
		}
	} else if ( form.invioF[2].checked ) {
		if ( document.getElementById( "emailf" ).value == "" ) {
			error += "Il campo EMAIL e' obbligatorio (Sezione Fatturazione)!\n";
		}
	}
	
	if ( !document.getElementById( "privacy" ).checked ) {
		error += "E' necessario acconsentire al trattamento dei dati personali!\n";
	}
	
	if ( error == "" ) {
		return true;
	} else {
		alert( error );
		return false;
	}
}


// ------------------------------------------------------------------- //
// ------------------------- Google Maps ----------------------------- //
// ------------------------------------------------------------------- //
var map = null;
var centro = null;
var marker = null;
	
function inizializza() {
	if (GBrowserIsCompatible()) {
		centro = new GLatLng(45.405561, 10.970629);
		map = new GMap2(document.getElementById("mappaGoogle"));
		map.addControl(new GSmallMapControl());
		map.setCenter(centro, 15);
		marker = new GMarker(centro);
		GEvent.addListener(marker, "click", apriInfoMarker);
	
		map.addOverlay(marker);
	
		//apriInfoMarker();
	}
}
function apriInfoMarker() {
	var htmlInfo	=	"<strong>TECNORAD</strong><br>";
	htmlInfo		+=	"Via Schiaparelli, 5 - 37135 Verona<br>";
	htmlInfo		+=	"Tel +39 045 8201066 Fax +39 045 8445460";
	htmlInfo        +=  "E-mail info@tecnorad.it";
	marker.openInfoWindowHtml(htmlInfo);
}

//blink

var c1='#E0E4E3'
var c2='ff6600'
function colore1(){
codice='<font color=' + c1+ '><b>RADON NELLE ABITAZIONI</b></font>'
if(document.all)
{
document.all('testo').innerHTML=codice;
}
else if(document.getElementById){
document.getElementById("testo").innerHTML = codice
}
attesa = window.setTimeout("colore2()",500);
}
function colore2(){
codice='<font color=' + c2 + '><b>RADON NELLE ABITAZIONI</b></font>'
if(document.all)
{
document.all('testo').innerHTML=codice;
}
else if(document.getElementById){
document.getElementById("testo").innerHTML =codice
}
attesa = window.setTimeout("colore1()",500)
}
function avvia()
{
attesa = window.setTimeout("colore1()",500);
}

function scomparsa(form)
{
	
}

