
function checkMe(admin) {
 if (!admin) {
   if (!document.getElementById("chkTandC").checked) {
     alert('You must accept the terms and conditions before submitting this form.');
     return false;
   } 
 }
 if (!document.getElementById("radSchYes").checked && !document.getElementById("radSchNo").checked) {
   alert('Please select your organisation type (school or not)');
   return false;
 }  
 if (document.getElementById("ddlRAB").selectedIndex == 0) {
  alert("Please select your Region/Arts Board");
  return false;
 }
 var vOrg = document.getElementById("txtOrg").value;
 if (vOrg == '') {
  alert("Please enter a name for your organisation");
  return false;
  } else {
    if (!cTest(vOrg.charAt(0))) {
      alert("Please begin your organisation name with a letter or a number");
      return false;   
    }
 }
 if (document.getElementById("txtLastName").value == '') {
  alert("Please give your last name");
  return false;
 } 

 var lstCounty = document.getElementById("ddlCounty");
 if (lstCounty.options[lstCounty.selectedIndex].value == 0) {
      alert("Please select a county for this organisation");
      return false;
 } else if (lstCounty.options[lstCounty.selectedIndex].value < 6000) {
      if (document.getElementById("txtAddress1").value == '') {
         alert("Please give at least the first line of the address");
         return false;
      } 
      if (document.getElementById("txtPostCode").value == '') {
         alert("Please give the post code");
         return false;
      } else {
         if (!cTest(document.getElementById("txtPostCode").value)) {
            alert("You have used an illegal character in the Post Code field\nPLease restrict your input to alphanumeric characters only");
            return false;
         }
      }
 }

 if (document.getElementById("txtTel").value == '') {
    alert("Please give a contact telephone number for your organisation");
    return false;
 } else {
    if (!testTel(document.getElementById("txtTel").value)) {
      alert("You have used an illegal character in the Telephone number field");
      return false;
    }
 }

 //if (document.getElementById("txtFax").value.length > 0) {
 //  if (!cTest(document.getElementById("txtFax").value)) {
 //   alert("You have used an illegal character in the (optional) Fax number field\nPLease restirct your input to alphanumeric characters only");
 //   return false;
 // }
 // }


 var vHow = document.getElementById("ddlHowHeard");
 var i;
 var v;
 var tHow = document.getElementById("txtHow").value;
 i = vHow.selectedIndex;
 v = vHow.options[i].value;
 if (v==0) {
   alert("Please select a numbered option from the 'How did you hear about The Big draw?' list");
   return false;
 } else {
   if (parseInt(v) > 1) {
      if ( tHow.length == 0 ) {
         alert("Please give details of 'How you heard about The Big Draw'");
         return false;
      }
   }
 }
 var vEmail = document.getElementById("txtEmail").value;
  if (vEmail.length > 0) {
   if (!testEMail(vEmail)) {
    alert("You have used an illegal character in the Email field");
    return false;
   }
   if (vEmail.indexOf("@")==-1 || vEmail.indexOf(".")==-1 || vEmail.length<6) {
    alert("Your email address appears to be invalid");
    return false;
   }  
  } else {
    alert("Please enter an email address");
    return false;   
  }
 var vEmail2 = document.getElementById("txtEmail2").value;
  if (vEmail2.length > 0) {
   if (!testEMail(vEmail2)) {
    alert("You have used an illegal character in the Email confirmation field");
    return false;
   }
   if (vEmail2.indexOf("@")==-1 || vEmail2.indexOf(".")==-1 || vEmail2.length<6) {
    alert("Your email confirmation appears to be invalid");
    return false;
   }  
  } else {
    alert("Please enter your contact email address in both email boxes");
    return false;   
  }
  
  if (vEmail != vEmail2) {
    alert("Please enter the same email address in both email boxes");
    return false;   	
  }

 return true;
}


