// JavaScript Document

function controllaX(){
    if (document.getElementById('rott').checked == true && document.getElementById('trasf').checked == true){ 
	   document.dominio.action = "ec_step1.asp?prom=RT";
    } else if (document.getElementById('trasf').checked == true){ 
       document.dominio.action = "ec_step1.asp";
    } else {
       document.dominio.action = "topdog_whois.php";
    }
} 

function controlla2X(){
if (document.getElementById('trasf').checked==false) {
	document.getElementById('rott').checked=false;
	}
}

function controlla3X(){
	if (document.getElementById('trasf').checked == true) { 
	} else if (document.getElementById('rott').checked == true) {
	document.getElementById('trasf').checked=true;
	}
}


<!--
function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}

function nascondi(livello){
if(document.getElementById(livello).style.display=="none"){
document.getElementById(livello).style.display="";
//document.getElementById(bottone).innerHTML="Visualizza";
}else{
document.getElementById(livello).style.display="none";
//document.getElementById(bottone).innerHTML="Nascondi";
}
}

function validateForm() 
{
  if (document.richiesta.email.value.indexOf(".")==-1 | document.richiesta.email.value.indexOf("@")==-1 | document.richiesta.email.value.length <= 6) {
  alert("Inserire una e-mail valida, campo obbligatorio!");
  document.richiesta.email.focus();
  return false;
  }
  if (document.richiesta.url.value.indexOf("www")==-1 | document.richiesta.url.value.indexOf(".")==-1 | document.richiesta.url.value.length <= 6) {
  alert("Inserire l'ulr del tuo sito, campo obbligatorio!");
  document.richiesta.url.focus();
  return false;
  }  
  if (document.richiesta.nome.value == "") {
  alert("Inserire il nome, campo obbligatorio!");
  document.richiesta.nome.focus();
  return false;
  } 
  if (document.richiesta.cognome.value == "") {
  alert("Inserire il cognome, campo obbligatorio!");
  document.richiesta.cognome.focus();
  return false;
  }
  //if (document.richiesta.argomento.value == "none") {
  //alert("Scegliere il tipo di richiesta!");
  //document.richiesta.argomento.focus();
  //return false;
  //}
  //if (document.richiesta.parole.value == "") {
  //alert("Suggerisci almeno una parola/frase chiave!");
  //document.richiesta.parole.focus();
  //return false;
  //}
  if (document.richiesta.richiesta.value == "") {
  alert("Inserisci il testo della richiesta!");
  document.richiesta.richiesta.focus();
  return false;
  }
  if (document.richiesta.consenso.checked == false) {
  alert ("Bisogna dare il consenso al trattamento dei dati personali");
  document.richiesta.consenso.focus();
  return false;
  } else {
  return true;
  }
}

function validateForm2() 
{
  if (document.richiesta.email.value.indexOf(".")==-1 | document.richiesta.email.value.indexOf("@")==-1 | document.richiesta.email.value.length <= 6) {
  alert("Inserire una e-mail valida, campo obbligatorio!");
  document.richiesta.email.focus();
  return false;
  }
  //if (document.richiesta.url.value.indexOf("www")==-1 | document.richiesta.url.value.indexOf(".")==-1 | document.richiesta.url.value.length <= 6) {
  //alert("Inserire l'ulr del tuo sito, campo obbligatorio!");
  //document.richiesta.url.focus();
  //return false;
  //}  
  if (document.richiesta.nome.value == "") {
  alert("Inserire il nome, campo obbligatorio!");
  document.richiesta.nome.focus();
  return false;
  } 
  if (document.richiesta.cognome.value == "") {
  alert("Inserire il cognome, campo obbligatorio!");
  document.richiesta.cognome.focus();
  return false;
  }
  //if (document.richiesta.argomento.value == "none") {
  //alert("Scegliere il tipo di richiesta!");
  //document.richiesta.argomento.focus();
  //return false;
  //}
  //if (document.richiesta.parole.value == "") {
  //alert("Suggerisci almeno una parola/frase chiave!");
  //document.richiesta.parole.focus();
  //return false;
  //}
  if (document.richiesta.richiesta.value == "") {
  alert("Inserisci il testo della richiesta!");
  document.richiesta.richiesta.focus();
  return false;
  }
  if (document.richiesta.consenso.checked == false) {
  alert ("Bisogna dare il consenso al trattamento dei dati personali");
  document.richiesta.consenso.focus();
  return false;
  } else {
  return true;
  }
} 


function validateForm3() 
{
  if (document.segnalazione.nomecognome.value == "") {
  alert("inserisci il tuo nome e cognome!");
  document.segnalazione.nomecognome.focus();
  return false;
  }
  if (document.segnalazione.address.value == "") {
  alert("inserisci il tuo indirizzo, necessario per la fatturazione!");
  document.segnalazione.address.focus();
  return false;
  }
  if (document.segnalazione.partitaivacf.value == "" || document.segnalazione.partitaivacf.value < 11) {
  alert("inserisci il tuo codice fiscale o il CF numerico della tua azienda!");
  document.segnalazione.partitaivacf.focus();
  return false;
  }
  if (document.segnalazione.titolo.value == "") {
  alert("inserisci il titolo del tuo sito!");
  document.segnalazione.titolo.focus();
  return false;
  }
  if (document.segnalazione.url2.value.indexOf("http://")==-1 | document.segnalazione.url2.value.indexOf("www")==-1 | document.segnalazione.url2.value.indexOf(".")==-1 | document.segnalazione.url2.value.length <= 6) {
  alert("url inserito non valido o non indicato!");
  document.segnalazione.url2.focus();
  return false;
  }
  if (document.segnalazione.email2.value.indexOf(".")==-1 | document.segnalazione.email2.value.indexOf("@")==-1 | document.segnalazione.email2.value.length <= 6) {
  alert("e-mail inserita non valida o non indicata!");
  document.segnalazione.email2.focus();
  return false;
  }
  if (document.segnalazione.descrizione.value == "") {
  alert("inserisci la descrizione del tuo sito!");
  document.segnalazione.descrizione.focus();
  return false;
  }
  if (document.segnalazione.keys.value == "") {
  alert("inserisci le parole chiave per il tuo sito!");
  document.segnalazione.descrizione.focus();
  return false;
  }
  if (document.segnalazione.consenso.checked == false) {
  alert ("bisogna dare il consenso al trattamento dei dati personali");
  document.segnalazione.consenso.focus();
  return false;
  } else {
  return true;
  }
} 


function validateForm4() 
{
  if (document.pubblicazione.nomecognome2.value == "") {
  alert("inserisci il tuo nome e cognome!");
  document.pubblicazione.nomecognome2.focus();
  return false;
  }
  if (document.pubblicazione.address2.value == "") {
  alert("inserisci il tuo indirizzo, necessario per la fatturazione!");
  document.pubblicazione.address2.focus();
  return false;
  }
  if (document.pubblicazione.partitaivacf2.value == "") {
  alert("inserisci la partita iva o il tuo codice fiscale!");
  document.pubblicazione.partitaivacf2.focus();
  return false;
  }
  if (document.pubblicazione.url3.value.indexOf("http://")==-1 | document.pubblicazione.url3.value.indexOf("www")==-1 | document.pubblicazione.url3.value.indexOf(".")==-1 | document.pubblicazione.url3.value.length <= 6) {
  alert("url inserito non valido o non indicato!");
  document.pubblicazione.url3.focus();
  return false;
  }
  if (document.pubblicazione.email3.value.indexOf(".")==-1 | document.pubblicazione.email3.value.indexOf("@")==-1 | document.pubblicazione.email3.value.length <= 6) {
  alert("e-mail inserita non valida o non indicata!");
  document.pubblicazione.email3.focus();
  return false;
  }
  if (document.pubblicazione.descrizione2.value == "") {
  alert("inserisci la descrizione del tuo sito!");
  document.pubblicazione.descrizione2.focus();
  return false;
  }
  if (document.pubblicazione.comunicato.value == "") {
  alert("campo obbligatorio per definire il costo del servizio!");
  document.pubblicazione.comunicato.focus();
  return false;
  }
  if (document.pubblicazione.consenso.checked == false) {
  alert ("bisogna dare il consenso al trattamento dei dati personali");
  document.pubblicazione.consenso.focus();
  return false;
  } else {
  return true;
  }
} 

function validateForm5() 
{
  if (document.ecommerce.nomedominio.value == "") {
  alert("inserisci il nome del dominio!");
  document.ecommerce.nomedominio.focus();
  return false;
  }
  if (document.ecommerce.nomenegozio.value == "") {
  alert("inserisci il nome del negozio!");
  document.ecommerce.nomenegozio.focus();
  return false;
  }
  
var controllo = false;
var bottone = document.ecommerce.template;
for(var i=0; i<bottone.length; i++) {
  if(bottone[i].checked) {
    controllo = true;
    break;
  }
}
if(!controllo) {
  alert("Selezionare un Template di partenza.");
  return false;
}

  
  
  if (document.ecommerce.email.value.indexOf(".")==-1 | document.ecommerce.email.value.indexOf("@")==-1 | document.ecommerce.email.value.length <= 6) {
  alert("e-mail inserita non valida o non indicata!");
  document.ecommerce.email.focus();
  return false;
  }
  if (document.ecommerce.nome.value == "") {
  alert("inserisci il tuo nome e cognome!");
  document.ecommerce.nome.focus();
  return false;
  }
  if (document.ecommerce.cognome.value == "") {
  alert("inserisci il tuo cognome!");
  document.ecommerce.cognome.focus();
  return false;
  }
  if (document.ecommerce.cf.value == "" | document.ecommerce.cf.value.length <= 10) {
  alert("inserisci il tuo codice fiscale o il CF numerico della tua azienda!");
  document.ecommerce.cf.focus();
  return false;
  }
  if (document.ecommerce.indirizzo.value == "") {
  alert("inserisci il tuo indirizzo!");
  document.ecommerce.indirizzo.focus();
  return false;
  }
  if (document.ecommerce.citta.value == "" | document.ecommerce.citta.value == "Citta / Provincia") {
  alert("inserisci la citta, campo obbligatorio!");
  document.ecommerce.country.focus();
  return false;
  }
  if (document.ecommerce.cap.value == "") {
  alert("inserisci il tuo CAP!");
  document.ecommerce.cap.focus();
  return false;
  }
  if (document.ecommerce.telefono.value == "") {
  alert("inserisci un recapito telefonico!");
  document.ecommerce.telefono.focus();
  return false;
  }
  if (document.ecommerce.contratto.checked == false) {
  alert ("bisogna accettare le condizioni del contratto");
  document.ecommerce.contratto.focus();
  return false;
  }
  if (document.ecommerce.consenso.checked == false) {
  alert ("bisogna dare il consenso al trattamento dei dati personali");
  document.ecommerce.consenso.focus();
  return false;
  } else {
  return true;
  }
} 
  


function validateForm5bis() 
{
  if (document.ecommerce.nomedominio.value == "") {
  alert("inserisci il nome del dominio!");
  document.ecommerce.nomedominio.focus();
  return false;
  }
  if (document.ecommerce.nomenegozio.value == "") {
  alert("inserisci il nome del negozio!");
  document.ecommerce.nomenegozio.focus();
  return false;
  }
  
var controllo = false;
var bottone = document.ecommerce.template;
for(var i=0; i<bottone.length; i++) {
  if(bottone[i].checked) {
    controllo = true;
    break;
  }
}
if(!controllo) {
  alert("Selezionare un Template di partenza.");
  return false;
}

  
  
  if (document.ecommerce.email.value.indexOf(".")==-1 | document.ecommerce.email.value.indexOf("@")==-1 | document.ecommerce.email.value.length <= 6) {
  alert("e-mail inserita non valida o non indicata!");
  document.ecommerce.email.focus();
  return false;
  }
  if (document.ecommerce.nome.value == "") {
  alert("inserisci il tuo nome e cognome!");
  document.ecommerce.nome.focus();
  return false;
  }
  if (document.ecommerce.cognome.value == "") {
  alert("inserisci il tuo cognome!");
  document.ecommerce.cognome.focus();
  return false;
  }
  if (document.ecommerce.cf.value == "") {
  alert("inserisci la partita iva o il tuo codice fiscale!");
  document.ecommerce.cf.focus();
  return false;
  }
  if (document.ecommerce.indirizzo.value == "") {
  alert("inserisci il tuo indirizzo!");
  document.ecommerce.indirizzo.focus();
  return false;
  }
  if (document.ecommerce.citta.value == "" | document.ecommerce.citta.value == "Citta / Provincia") {
  alert("inserisci la citta, campo obbligatorio!");
  document.ecommerce.country.focus();
  return false;
  }
  if (document.ecommerce.cap.value == "") {
  alert("inserisci il tuo CAP!");
  document.ecommerce.cap.focus();
  return false;
  }
  if (document.ecommerce.telefono.value == "") {
  alert("inserisci un recapito telefonico!");
  document.ecommerce.telefono.focus();
  return false;
  }
  if (document.ecommerce.contratto.checked == false) {
  alert ("bisogna accettare le condizioni del contratto");
  document.ecommerce.contratto.focus();
  return false;
  }
  if (document.ecommerce.rottamazione.checked == false) {
  alert ("bisogna accettare le condizioni della promozione");
  document.ecommerce.rottamazione.focus();
  return false;
  }
  if (document.ecommerce.consenso.checked == false) {
  alert ("bisogna dare il consenso al trattamento dei dati personali");
  document.ecommerce.consenso.focus();
  return false;
  } else {
  return true;
  }
} 


  
function validatePagamento() 
{
  if (document.pagamento.societa.value == "") {
  alert("Inserire il nome e cognome o ragione sociale, campo obbligatorio!");
  document.pagamento.societa.focus();
  return false;
  } 
  if (document.pagamento.piva.value == "") {
  alert("Inserire la Partita Iva o C.F., campo obbligatorio!");
  document.pagamento.piva.focus();
  return false;
  } 
  if (document.pagamento.indirizzo.value == "") {
  alert("Inserire l\'indirizzo, campo obbligatorio!");
  document.pagamento.indirizzo.focus();
  return false;
  } 
  if (document.pagamento.citta.value == "") {
  alert("Inserire la cittą, campo obbligatorio!");
  document.pagamento.country.focus();
  return false;
  } 
  if (document.pagamento.cap.value == "") {
  alert("Inserire il CAP, campo obbligatorio!");
  document.pagamento.cap.focus();
  return false;
  } 
  if (document.pagamento.email.value.indexOf(".")==-1 | document.pagamento.email.value.indexOf("@")==-1 | document.pagamento.email.value.length <= 6) {
  alert("Inserire una e-mail valida, campo obbligatorio!");
  document.pagamento.email.focus();
  return false;
  }
  if (document.pagamento.amount_a.value == "") {
  alert("Inserire l'importo, campo obbligatorio!");
  document.pagamento.amount_a.focus();
  return false;
  }
  if (document.pagamento.amount_b.value == "") {
  alert("Inserire l'importo comprensivo di cifre decimali, campo obbligatorio!");
  document.pagamento.amount_b.focus();
  return false;
  }
  if (document.pagamento.item_name_a.value == "") {
  alert("Inserisci la causale per il pagamento!");
  document.pagamento.item_name_a.focus();
  return false;
  } else {
  return true;
  }
}

// JavaScript per FAQ

function mostra(id){
		if (document.getElementById(id).style.display == '') {
		document.getElementById(id).style.display = 'none';
		} else {
		document.getElementById(id).style.display = '';
		}
}


