// JavaScript Document
document.getElementsByClassName = function(cl) {
   var retnode = [];
   var myclass = new RegExp('\\b'+cl+'\\b');
   var elem = this.getElementsByTagName('*');
   for (var i = 0; i < elem.length; i++) {
      var classes = elem[i].className;
      if (myclass.test(classes)) retnode.push(elem[i]);
   }
   return retnode;
}; 



function checkConfirmEmail() {
	var email2 = document.getElementsByClassName ("confirm");
	var email1 = document.getElementsByClassName ("email");
	 
	//alert(email2[0].value);
	
	if (email2[0].value != email1[0].value) {
		alert ("Email addresses do not match - please re-enter!");
		
		document.getElementsByClassName("confirm").value = "";
		document.getElementsByClassName("confirm").focus();
	}

}


function checkOtherAmount() {
	var otherRadio = document.getElementsByClassName ("otherRadio");
	var other = document.getElementsByClassName ("otherAmount");
	
	var is_other = otherRadio[otherRadio.length-1].checked;

 if (is_other==true) {
	
	 if (other[0].value==''){
		 alert('If other donation please state the amount');
		 return false;
		 }
	else {
		return true;
		}
		 
	 }
	 else {
		return true;
		}

}
function selectOther() {
	
	var otherRadio = document.getElementsByClassName ("otherRadio");
	
	otherRadio[otherRadio.length-1].checked = true;


}

function myPopup2() {
window.open( "/privacy.html", "Privacy", 
"status = 1, height = 600, width = 500, resizable = 1, scrollbars=1" )
}


