function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}

function checkmailing(which) {
	if(document.addentry.name.value == "") {
		alert('Please enter your name. Thank you.');
		document.addentry.name.focus();
		return false;
	}
	if(document.addentry.email.value == "") {
		alert('Please enter your email. Thank you.');
		document.addentry.email.focus();
		return false;
	}
	inemail = document.addentry.email.value;
        split1 = inemail.split("@");
	split2 = inemail.split(".");
        if (split1.length < 2) {
            	alert('There seems to be a mistake with the format of your email. Please check carefully.');
	             document.addentry.email.focus();
		return false;
      }
        if (split2.length < 2) {
            	alert('There seems to be a mistake with the format of your email. Please check carefully.');
	             document.addentry.email.focus();
	return false;
	}
return true;
}

function checkmailing2(which) {
	if(document.BuyForm.cartId.value == "") {
		alert('Please enter your email address. Thank you.');
		document.BuyForm.cartId.focus();
		return false;
	}
	if(document.BuyForm.amount.value == "") {
		alert('Please enter your donation amount. Thank you.');
		document.BuyForm.amount.focus();
		return false;
	}
return true;
}

function checkmailing3(which) {
	if(document.addentry.name.value == "") {
		alert('Please enter your first name. Thank you.');
		document.addentry.name.focus();
		return false;
	}
	if(document.addentry.surname.value == "") {
		alert('Please enter your surname. Thank you.');
		document.addentry.surname.focus();
		return false;
	}
	if(document.addentry.donation.checked){ 
		return true;
 	} else{ 
		alert("You must confirm your contribution through gift aid by ticking the box");
		return false;
		 }
return true;
}