function validate() {
with(document.brochures) {

if(name.value=='') { 

alert('Sorry, please enter your name');
}

else if(email.value=='') {
alert('Sorry, please enter your email');
}

else if(checkEmail(email) == false) {
alert('Sorry, your e-mail address is invalid, please re-enter');
email.focus();
}  

else if(postcode.value=='') alert('Sorry, you have not entered your postcode');

else if (document.getElementById('brochureChoice1').checked==true) {
document.brochures.submit();
document.location.href='/pdf/brochure.pdf';
}

else if (document.getElementById('brochureChoice2').checked==true) {
document.brochures.submit();
document.location.href='/pdf/workwear.pdf';
}

else if (document.getElementById('brochureChoice3').checked==true) {
document.brochures.submit(); 
document.location.href='/pdf/cma-files.pdf';
} 

else if (document.getElementById('brochureChoice4').checked==true) {
document.brochures.submit(); 
document.location.href='/pdf/cpd4dcps.pdf';
}

else if (document.getElementById('brochureChoice5').checked==true) {
document.brochures.submit(); 
}

}

}

function checkEmail(email) {
if (/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(email.value)){
return (true)
}

return (false)
}
