	function addrow()
		{
		var tb = document.getElementById('peopleform').getElementsByTagName('tbody')[0];
		var newrow = document.createElement('tr');
		var newcell1 = document.createElement('td');
		var newcell2 = document.createElement('td');
		var newinput1 = document.createElement('input');
		var newinput2 = document.createElement('input');

		newinput1.type = "text";
		newinput2.type = "text"
	
		newinput1.size = "30";
		newinput2.size = "30"
		
		newinput1.id = "names" + (tb.rows.length + 1);
		newinput2.id = "emails" + (tb.rows.length + 1);
		
		newinput1.name = "names[]";
		newinput2.name = "emails[]";

		newcell1.appendChild(newinput1);
		newcell2.appendChild(newinput2);

		newrow.appendChild(newcell1);
		newrow.appendChild(newcell2);

		tb.appendChild(newrow);
		}
	
	function checkthere()
		{
		var tb = document.getElementById('peopleform').getElementsByTagName('tbody')[0];
		var numrows = tb.rows.length - 1;
		var i=1;
		var check=0;
		var error = true;
		var people=0;
			
		for (i=1; i <= (numrows + 1); i++)
			{
			check = 0;
			if (document.getElementById('names' + i).value == "") {check++;}
			if (document.getElementById('emails' + i).value.indexOf("@") == -1) {check++;}
			if (check == 1) {error = false;}
			if (check == 0) {people++;}
			}

		if (people <= 3) {error = false;}

		if (error == false) {alert("Please check that all details are completed correctly, and there are at least 3 people in the gift pool.");}
		return error;
		}