﻿function toggleBox(obj) { // 1 visible, 0 hidden

	if (obj == "UK") {
		szDivIDViz = "UKClients"
		szDivIDNonViz = "NonUKClients"
	}
	else {
		szDivIDViz = "NonUKClients"
		szDivIDNonViz = "UKClients"
	}
		var objv = document.getElementById(szDivIDViz);
    objv.style.visibility =  "visible";
    
 		var objn = document.getElementById(szDivIDNonViz);
    objn.style.visibility =  "hidden";
}

function dianemail() {
	var el = document.getElementById("forma");
	if (el.MBirthDate.value=="") {
		alert("Please enter the anticipated D.O.B. of the baby");
		return(false);
	}
	if((el.MMLastName.value=="")&&(el.MFLastName.value=="")) {
		alert("Please enter at least one of the parents' full names");
		return(false);
	}
	if (el.MParentEMail.value=="") {
		alert("Please enter your email");
		return(false);
	}	 
	el.submit();
}
function dianemailen() {
	var el = document.getElementById("forma");
	if (el.MBirthDate.value=="") {
		alert("Please enter the anticipated D.O.B. of the baby");
		return(false);
	}
	if((el.MMLastName.value=="")&&(el.MFLastName.value=="")) {
		alert("Please enter at least one of the parents' full names");
		return(false);
	}
	if (el.MParentEMail.value=="") {
		alert("Please enter your email");
		return(false);
	}	 	
	if (el.MParentTel.value=="") {
		alert("Please enter your telephone number");
		return(false);
	}	 
	el.submit();
}


function dian() {
	var el = document.getElementById("forma");
	if (el.MBirthDate.value=="") {
		alert("Please enter the anticipated D.O.B. of the baby");
		return(false);
	}

	if((el.MMLastName.value=="")&&(el.MFLastName.value=="")) {
		alert("Please enter at least one of the parents' full names");
		return(false);
	}

	if (el.Country.value=="") {
		alert("Please enter your Country");
		return(false);
	}	 
	
	el.submit();
}

function diangr() {
	var el = document.getElementById("forma");
	if (el.MBirthDate.value=="") {
		alert("Παρακαλώ εισάγετε την αναμενόμενη ημερομηνία γέννησης");
		return(false);
	}

	if((el.MMLastName.value=="")&&(el.MFLastName.value=="")) {
		alert("Παρακαλώ εισάγετε την όνομα τουλάχιστον ενός γονέα");
		return(false);
	}

	el.submit();
}

function pordian() {
	var el = document.getElementById("forma");
	if (el.MBirthDate.value=="") {
		alert("Por favor insira a Data Prevista de Nascimento do Bebe");
		return(false);
	}

	if((el.MMLastName.value=="")&&(el.MFLastName.value=="")) {
		alert("Por favor insira o nome complete de pelo menos um dos Pais");
		return(false);
	}

	if (el.MParentTel.value=="") {
		alert("Por favor introduza o seu Contacto Telefonico");
		return(false);
	}	 
	
	if (el.MParentEMail.value=="") {
		alert("Por favor preencha o seu email");
		return(false);
	}	 
		

	el.submit();
}
function idian() {
	var el = document.getElementById("forma");
	if (el.MBirthDate.value=="") {
		alert("Please enter the anticipated D.O.B. of the baby");
		return(false);
	}

	if((el.MMLastName.value=="")&&(el.MFLastName.value=="")) {
		alert("Please enter at least one of the parents' full names");
		return(false);
	}
	if (el.privacy.checked==false) {
		alert("Please read Privacy Statement");
		return(false);
	}	 

	if (el.Country.value=="") {
		alert("Please enter your Country");
		return(false);
	}	 
	el.submit();
}


function sdian() {
	var el = document.getElementById("forma");
	if (el.MBirthDate.value=="") {
		alert("Molimo vas da unesete predvideni datum porodaja");
		return(false);
	}

	if((el.MMLastName.value=="")&&(el.MFLastName.value=="")) {
		alert("Molimo vas da unesete puno ime bar jednog od roditelja");
		return(false);
	}

	el.submit();
}

function pdian() {
	var el = document.getElementById("forma");
	if(el.textfield.value=="") {
		alert("Nombre y apellidos?");
		return(false);
	}

	if(el.textfield2.value=="") {
		alert("Telefono de contacto?");
		return(false);
	}

	if(el.textfield3.value=="") {
		alert("Email de contacto?");
		return(false);
	}

	if(el.textfield4.value=="") {
		alert("Provincia?");
		return(false);
	}
	
	if(el.MBirthDate.value=="") {
		alert("Fecha prevista de parto?");
		return(false);
	}
		

	if (document.all || document.getElementById) {
		for (i = 0; i < el.length; i++) {
			var tempobj = el.elements[i];
			if (tempobj.type.toLowerCase() == "submit" || tempobj.type.toLowerCase() == "reset") tempobj.disabled = true;
		}
	}	
	el.submit();
}


function paydian() {
	var el = document.getElementById("forma");
	if(el.dcode.value=="") {
		alert("Please enter the Sample Code");
		return(false);
	}
	if(el.dcode.value.length<6) {
		alert("Please enter the correct Sample Code");
		return(false);
	}
	if(el.mother.value=="") {
		alert("Please enter Mother's full name");
		return(false);
	}
	if(el.amount.value=="") {
		alert("Please enter Amount to pay");
		return(false);
	}
	if(el.curr.value=="") {
		alert("Please enter Currency");
		return(false);
	}

	if (!el.read.checked) {
		alert("Please read and agree to the terms and conditions");
		return(false);
	}		

	el.submit();
}

function paydian2() {
	var el = document.getElementById("form2");

	if (document.all || document.getElementById) {
		for (i = 0; i < el.length; i++) {
			var tempobj = el.elements[i];
			if (tempobj.type.toLowerCase() == "submit" || tempobj.type.toLowerCase() == "reset") tempobj.disabled = true;
		}
	}	
	el.submit();
}


function showother(obj) {
	var option = obj.options[obj.selectedIndex].text;
	if((option=="Other")||(option=="Otros")||(option=="Drugo")||(option=="Autre")||(option=="Altri")) {
		document.getElementById("otherdiv").style.display = "block"
		document.getElementById("mutuadiv").style.display = "none"
	} else if (option=="Mutua (especificar)")  {
		document.getElementById("otherdiv").style.display="none"
		document.getElementById("mutuadiv").style.display = "block"	
	}
	else	
	{
		document.getElementById("otherdiv").style.display="none"
		document.getElementById("mutuadiv").style.display = "none"
	}
}


function dianorder() {
	var el = document.getElementById("forma");
	if (el.MBirthDate.value=="") {
		alert("Please enter the anticipated D.O.B. of the baby");
		return(false);
	}

	if((el.MMLastName.value=="")&&(el.MFLastName.value=="")) {
		alert("Please enter at least one of the parents' full names");
		return(false);
	}

	if (el.Country.value=="") {
		alert("Please enter your Country");
		return(false);
	}	 

	if (el.name.value=="") {
		alert("Please enter the cardholder's full name");
		return(false);
	}	 

	if (el.address1.value=="") {
		alert("Please enter the Cardholder's Address");
		return(false);
	}

	if (el.postcode.value=="") {
		alert("Please enter the Cardholder's Post Code");
		return(false);
	}	 

	if(el.tel.value=="") {
		alert("Please enter the Cardholder's Telephone number");
		return(false);
	}	

	if (el.email.value=="") {
		alert("You haven't entered a Cardholder's e-mail address");
		return(false);
	}

	if (el.email.value!="") {
		var email=el.email.value;
		len1=email.length;
		ole=".";
		z1=email.search("@");
		email1=email.replace(",","a");
		email9=email.replace(".",",");
		z2=email9.search(",");
		if ((z1==-1) || (z2==-1)) {
			alert("You haven't used a valid e-mail address");
			return (false);
		}
	}

	if (document.all || document.getElementById) {
		for (i = 0; i < el.length; i++) {
			var tempobj = el.elements[i];
			if (tempobj.type.toLowerCase() == "submit" || tempobj.type.toLowerCase() == "reset") tempobj.disabled = true;
		}
	}	
	el.submit();
}

function showotherorder(obj) {
	var option = obj.options[obj.selectedIndex].text;
	if(option=="Other") {
		document.getElementById("otherdiv").style.display = "block"
	} else {
		document.getElementById("otherdiv").style.display="none"
	}
}

function comboChange(val) {
	var el = document.getElementById("forma");
	if (val=="GB") {
		el.currency.value="GBP";
		el.amount.value="200";
	} 
	else if (val=="IE") {
		el.currency.value="EUR";
		el.amount.value="695";
	}
	else if (val=="GR") {
		el.currency.value="EUR";
		el.amount.value="300";
	}	
	else 	{
		el.currency.value="EUR";
		el.amount.value="250";
	}
}

function agreementOLD() {
	var el = document.getElementById("forma");
	var countryVal = el.Country.value;
	if (countryVal =="GB") {
		window.open("uploads/en/docs/UKAgreement.pdf");
	  } 
	else {
		window.open("uploads/en/docs/NonUKAgreement.pdf");
	}
}

function agreement() {
	var el = document.getElementById("forma");
	var countryVal = el.Country.value;
	if (countryVal =="GB") {
		window.open("uploads/al/agreements/UK-AGREEMENT-EN.pdf");
	  } 
	else if (countryVal =="CY") {
		window.open("uploads/al/agreements/Cyprus-AGREEMENT-EL-EN.pdf");
	  } 
	else if (countryVal =="GR") {
		window.open("uploads/al/agreements/Greece-AGREEMENT-EL-EN.pdf");
	  } 
	else if (countryVal =="IE") {
		window.open("uploads/al/agreements/Ireland-AGREEMENT-EN.pdf");
	  } 
	else if (countryVal =="IT") {
		window.open("uploads/al/agreements/Italy-AGREEMENT-EN-IT.pdf");
	  } 
	else if (countryVal =="LB") {
		window.open("uploads/al/agreements/Lebanon-AGREEMENT-EN.pdf");
	  } 
	else if (countryVal =="JO") {
		window.open("uploads/al/agreements/Middle East-AGREEMENT-EN.pdf");
	  } 
	else if (countryVal =="SA") {
		window.open("uploads/al/agreements/Middle East-AGREEMENT-EN.pdf");
	  } 
	else if (countryVal =="AE") {
		window.open("uploads/al/agreements/Middle East-AGREEMENT-EN.pdf");
	  } 
	else if (countryVal =="PT") {
		window.open("uploads/al/agreements/Portugal-AGREEMENT-PO-EN.pdf");
	  } 
	else if (countryVal =="CH") {
		window.open("uploads/al/agreements/Switzerland-AGREEMENT-FR-EN.pdf");
	  } 
	else if (countryVal =="FR") {
		window.open("uploads/al/agreements/France-AGREEMENT-FR-EN.pdf");
	  } 
	else if (countryVal =="ES") {
		window.open("uploads/al/agreements/Spain-AGREEMENT-ES.pdf");
	  } 
	else {
		window.open("uploads/al/agreements/EU-AGREEMENT-EN.pdf");
	}
}
function agreementfr() {
	var el = document.getElementById("forma");
	var countryVal = el.Country.value;
	if (countryVal =="GB") {
		window.open("uploads/en/docs/UKAgreement.pdf");
	  } 
	else {
		window.open("uploads/fr/docs/contrat.pdf");
	}
}


function detailsCheck(obj) {
	var el = document.getElementById("forma");
	if (obj.checked==true) {
		el.email.value=el.MParentEMail.value;
		el.address1.value=el.MAdd1.value;
		el.address2.value=el.MAdd2.value;
		el.address3.value=el.MAdd3.value;
		el.tel.value=el.MParentTel.value;
		el.postcode.value=el.MPostCode.value;
	}
}

function concatenateAdd() {
	var el = document.getElementById("forma");
	var address1 = el.address1.value;
	var address2 = el.address2.value;
	var address3 = el.address3.value;
	el.address.value= address1+", "+address2+", "+address3;	
}


function dontAccept() {
	var nameVal = document.form1.name.value;
	var addressVal = document.form1.address.value;
	var countryVal = document.form1.country.value;
	var postcodeVal = document.form1.postcode.value;
	var emailVal = document.form1.email.value;
	var telVal = document.form1.tel.value;
	
	parent.location.href="stdpage.asp?Page=82&name="+nameVal+"&address="+addressVal+"&country="+countryVal+"&postcode="+postcodeVal+"&email="+emailVal+"&tel="+telVal;
}

function formaction() {
	var paysel = document.form1.paysel.value;

if (paysel=="worldpay") {
    document.form1.action= 'https://select.worldpay.com/wcc/purchase';
    document.form1.submit();
	}
else if (paysel=="paypal") {
    document.form1.action= 'https://www.paypal.com/cgi-bin/webscr';
    document.form1.submit();
	}
}

function toggle(obj) {
	var ele = document.getElementById(obj);
	if(ele.style.display == "block") {
   		ele.style.display = "none";
  	}
	else {
		ele.style.display = "block";
	}
	
} 

function telephonecheck() {
	var el = document.getElementById("forma");
	var telVal = document.forma.telephone.value;
	if(telVal.length<10) {
   		alert("Please check the telephone number");
		return(false);
  	}
el.submit();
} 

function openall() {
	document.getElementById('text1').style.display = "block";
	document.getElementById('text2').style.display = "block";
	document.getElementById('text3').style.display = "block";
	document.getElementById('text4').style.display = "block";
	document.getElementById('text5').style.display = "block";
	document.getElementById('text6').style.display = "block";
	document.getElementById('text7').style.display = "block";
	document.getElementById('text8').style.display = "block";
	document.getElementById('text9').style.display = "block";
	document.getElementById('text10').style.display = "block";
} 
function closeall() {
	document.getElementById('text1').style.display = "none";
	document.getElementById('text2').style.display = "none";
	document.getElementById('text3').style.display = "none";
	document.getElementById('text4').style.display = "none";
	document.getElementById('text5').style.display = "none";
	document.getElementById('text6').style.display = "none";
	document.getElementById('text7').style.display = "none";
	document.getElementById('text8').style.display = "none";
	document.getElementById('text9').style.display = "none";
	document.getElementById('text10').style.display = "none";
} 


