// SSL Product Selection Wizard
function none(){
	if(document.wizard.infoType[4].checked){
		document.wizard.infoType[0].checked = false;
		document.wizard.infoType[1].checked = false;
		document.wizard.infoType[2].checked = false;
		document.wizard.infoType[3].checked = false;
		
		document.wizard.infoType[0].disabled = true;
		document.wizard.infoType[1].disabled = true;
		document.wizard.infoType[2].disabled = true;
		document.wizard.infoType[3].disabled = true;
	}else{
		document.wizard.infoType[0].disabled = false;
		document.wizard.infoType[1].disabled = false;
		document.wizard.infoType[2].disabled = false;
		document.wizard.infoType[3].disabled = false;
	}
}

function init(){
	document.getElementById('ev').style.display = "none";
	document.getElementById('sgc').style.display = "none";
	document.getElementById('seal').style.display = "none";
	document.getElementById('dis').style.display = "none";
}

function validateInputs(myInputs){
	inputLength = myInputs.length;
	var isChecked = false;
	for(i=0;i<inputLength;i++){
		if (myInputs[i].checked){
			return true;
		}
	}
	return false;
}	


function frmCheck(){
	if(validateInputs(document.wizard.transact) && validateInputs(document.wizard.encrypt) && validateInputs(document.wizard.infoType) && validateInputs(document.wizard.multi)){
		return true;
	}
	else{
		alert("Todas las preguntas son necesarias.");
		return false
	}
}


function tally(){
	if(frmCheck()){
		//Check to see if any EV boxes were selected
		if(document.wizard.infoType[0].checked || document.wizard.infoType[1].checked || document.wizard.transact[0].checked){
			//Check to see which type of EV cert - Secure site pro or secure site
			if(document.wizard.infoType[0].checked || document.wizard.infoType[1].checked || document.wizard.infoType[2].checked || document.wizard.encrypt[0].checked){
				//Secure Site Pro with EV Recommendation
				document.getElementById("product-name").innerHTML = "Secure Site Pro con EV";
				document.getElementById('ev').style.display = "block";
				document.getElementById('sgc').style.display = "block";
					//Check for Enterprise account
					if(document.wizard.multi[0].checked){
						//Enterprise Account Recommendation
						document.getElementById('ent').style.display = "block";
						document.getElementById("product-btn").innerHTML = '<a href="https://ssl-certificate-center-enterprise.verisign.es/vcce/enterprise/enterprise_account_enroll?application_locale=VRSN_ES"><img src="/assets/ssl/images/dev041720.gif" alt="Comprar certificados SSL de VeriSign" /></a>&nbsp;&nbsp;&nbsp;&nbsp;|&nbsp;&nbsp;&nbsp;&nbsp;<a href="/ssl/buy-ssl-certificates/extended-validation-pro-ssl-certificates/index.html"><strong>M&aacute;s informaci&oacute;n</strong></a>';
					}else{
						//No Enterprise Account Recommendation
						document.getElementById("product-btn").innerHTML = '<a href="https://ssl-certificate-center.verisign.es/process/retail/initial?productType=HASGCServer&application_locale=VRSN_ES"><img src="/assets/ssl/images/dev041720.gif" alt="Comprar certificados SSL de VeriSign" /></a>&nbsp;&nbsp;&nbsp;&nbsp;|&nbsp;&nbsp;&nbsp;&nbsp;<a href="/ssl/buy-ssl-certificates/extended-validation-pro-ssl-certificates/index.html"><strong>M&aacute;s informaci&oacute;n</strong></a>';
					}
			}else{
				//Secure Site with EV Recommendation
				document.getElementById("product-name").innerHTML = "Secure Site con EV";
				document.getElementById('ev').style.display = "block";
				document.getElementById('sgc').style.display = "none";
					//Check for Enterprise account
					if(document.wizard.multi[0].checked){
						//Enterprise Account Recommendation
						document.getElementById('ent').style.display = "block";
						document.getElementById("product-btn").innerHTML = '<a href="https://ssl-certificate-center-enterprise.verisign.es/vcce/enterprise/enterprise_account_enroll?application_locale=VRSN_ES"><img src="/assets/ssl/images/dev041720.gif" alt="Comprar certificados SSL de VeriSign" /></a>&nbsp;&nbsp;&nbsp;&nbsp;|&nbsp;&nbsp;&nbsp;&nbsp;<a href="/ssl/buy-ssl-certificates/extended-validation-ssl-certificates/index.html"><strong>M&aacute;s informaci&oacute;n</strong></a>';
					}else{
						//No Enterprise Account Recommendation
						document.getElementById("product-btn").innerHTML = '<a href="https://ssl-certificate-center.verisign.es/process/retail/initial?productType=HAServer&application_locale=VRSN_ES"><img src="/assets/ssl/images/dev041720.gif" alt="Comprar certificados SSL de VeriSign" /></a>&nbsp;&nbsp;&nbsp;&nbsp;|&nbsp;&nbsp;&nbsp;&nbsp;<a href="/ssl/buy-ssl-certificates/extended-validation-ssl-certificates/index.html"><strong>M&aacute;s informaci&oacute;n</strong></a>';
					}
			}
		}else if(document.wizard.encrypt[0].checked){
			//Secure Site Pro without EV
			document.getElementById("product-name").innerHTML = "Secure Site Pro";
			document.getElementById('ev').style.display = "none";
			document.getElementById('sgc').style.display = "block";
					//Check for Enterprise account
					if(document.wizard.multi[0].checked){
						//Enterprise Account Recommendation
						document.getElementById('ent').style.display = "block";
						document.getElementById("product-btn").innerHTML = '<a href="https://ssl-certificate-center-enterprise.verisign.es/vcce/enterprise/enterprise_account_enroll?application_locale=VRSN_ES"><img src="/assets/ssl/images/dev041720.gif" alt="Comprar certificados SSL de VeriSign" /></a>&nbsp;&nbsp;&nbsp;&nbsp;|&nbsp;&nbsp;&nbsp;&nbsp;<a href="/ssl/buy-ssl-certificates/secure-site-pro-ssl-certificates/index.html"><strong>M&aacute;s informaci&oacute;n</strong></a>';
					}else{
						//No Enterprise Account Recommendation
						document.getElementById("product-btn").innerHTML = '<a href="https://ssl-certificate-center.verisign.es/process/retail/initial?productType=GlobalServerClass3&application_locale=VRSN_ES"><img src="/assets/ssl/images/dev041720.gif" alt="Comprar certificados SSL de VeriSign" /></a>&nbsp;&nbsp;&nbsp;&nbsp;|&nbsp;&nbsp;&nbsp;&nbsp;<a href="/ssl/buy-ssl-certificates/secure-site-pro-ssl-certificates/index.html"><strong>M&aacute;s informaci&oacute;n</strong></a>';
					}
		}else{
			//Secure Site without EV
			document.getElementById("product-name").innerHTML = "Secure Site";
			document.getElementById('ev').style.display = "none";
			document.getElementById('sgc').style.display = "none";
					//Check for Enterprise account
					if(document.wizard.multi[0].checked){
						//Enterprise Account Recommendation
						document.getElementById('ent').style.display = "block";
						document.getElementById("product-btn").innerHTML = '<a href="https://ssl-certificate-center-enterprise.verisign.es/vcce/enterprise/enterprise_account_enroll?application_locale=VRSN_ES"><img src="/assets/ssl/images/dev041720.gif" alt="Comprar certificados SSL de VeriSign" /></a>&nbsp;&nbsp;&nbsp;&nbsp;|&nbsp;&nbsp;&nbsp;&nbsp;<a href="/ssl/buy-ssl-certificates/secure-site-ssl-certificates/index.html"><strong>M&aacute;s informaci&oacute;n</strong></a>';
					}else{
						//No Enterprise Account Recommendation
						document.getElementById("product-btn").innerHTML = '<a href="https://ssl-certificate-center.verisign.es/process/retail/initial?productType=VeriSignServerClass3&application_locale=VRSN_ES"><img src="/assets/ssl/images/dev041720.gif" alt="Comprar certificados SSL de VeriSign" /></a>&nbsp;&nbsp;&nbsp;&nbsp;|&nbsp;&nbsp;&nbsp;&nbsp;<a href="/ssl/buy-ssl-certificates/secure-site-ssl-certificates/index.html"><strong>M&aacute;s informaci&oacute;n</strong></a>';
					}
		}
		//Show seal and disclaimer, along with final results
		document.getElementById('seal').style.display = "block";
		document.getElementById('dis').style.display = "block";
		document.getElementById("prod-wiz").style.display = "none";
		document.getElementById("product").style.display = "block";
	}
}

window.onload = init; 
