function validateForm()
{

// set var radio_choice to false
var radio_choice = false;

// Loop from zero to the one minus the number of radio button selections
for (counter = 0; counter < document.form1.radiobutton.length; counter++)
{
// If a radio button has been selected it will return true
// (If not it will return false)
if (document.form1.radiobutton[counter].checked)
radio_choice = true; 
}

if (!radio_choice)
{
// If there were no selections made display an alert box 
alert("Please select a Delivery Method")
return false;
}





if (document.form1.name.value =="")
		{
			alert("Please Enter Your Name");
			document.form1.name.focus();
			return false;
		}
if (document.form1.pcode.value =="")
		{
			alert("Please Enter Your Postcode");
			document.form1.pcode.focus();
			return false;
		}
if (document.form1.add.value =="")
		{
			alert("Please Enter Your Address");
			document.form1.add.focus();
			return false;
		}

//email validation start
		var str=document.form1.email.value;
		var at="@"
		var dot="."
		var lat=str.indexOf(at)
		var lstr=str.length
		var ldot=str.indexOf(dot)
		if (str.indexOf(at)==-1){
		   alert("Please Enter a Valid E-mail Address.")
		   document.form1.email.focus();
		   return false
		}

		if (str.indexOf(at)==-1 || str.indexOf(at)==0 || str.indexOf(at)==lstr){
		   alert("Please Enter a Valid E-mail Address.")
		   document.form1.email.focus();
		   return false
		}

		if (str.indexOf(dot)==-1 || str.indexOf(dot)==0 || str.indexOf(dot)==lstr){
		    alert("Please Enter a Valid E-mail Address.")
			document.form1.email.focus();
		    return false
		}

		 if (str.indexOf(at,(lat+1))!=-1){
		    alert("Please Enter a Valid E-mail Address.")
			document.form1.email.focus();
		    return false
		 }

		 if (str.substring(lat-1,lat)==dot || str.substring(lat+1,lat+2)==dot){
		    alert("Please Enter a Valid E-mail Address.")
			document.form1.email.focus();
		    return false
		 }

		 if (str.indexOf(dot,(lat+2))==-1){
		    alert("Please Enter a Valid E-mail Address.")
			document.form1.email.focus();
		    return false
		 }
		
		 if (str.indexOf(" ")!=-1){
		    alert("Please Enter a Valid E-mail Address.")
			document.form1.email.focus();
		    return false
		 }
if (document.form1.v8.value !=="volunteer123")
		{
			alert("Please Enter The Validation Code");
			document.form1.v8.focus();
			return false;
		}

	return true;

}

