function brochuresValidate() {
    errors = new Array();
		
		
		
		str = getElementValue('salutation');
    if (str == "Please Select") { 
        errors.push('You must select a Title');
        reportError('salutation');
    } else {
        unReportError('salutation');
    }

    str = getElementValue('firstname');
    if (empty_string(str)) { 
        errors.push('You must enter your first name');
        reportError('firstname');
    } else {
        unReportError('firstname');
		setClass('firstname');		
    }

    str = getElementValue('lastname');
    if (empty_string(str)) { 
        errors.push('You must enter your last name');
        reportError('lastname');
    } else {
        unReportError('lastname');
		setClass('lastname');		
    }

    str = getElementValue('address1');
    if (empty_string(str)) { 
        errors.push('You must enter your address');
        reportError('address1');
    } else {
        unReportError('address1');
		setClass('address1');		
    }

    str = getElementValue('city');
    if (empty_string(str)) { 
        errors.push('You must enter your city');
        reportError('city');
    } else {
        unReportError('city');
		setClass('city');
    }

    str = getElementValue('pcode');
    if (empty_string(str)) { 
        errors.push('You must enter your post code');
        reportError('pcode');
    } else {
        unReportError('pcode');
		setClass('pcode');		
    }

    str = getElementValue('emailaddress');
    if (empty_string(str)) { 
        errors.push('You must enter your email address');
        reportError('emailaddress');
    } else if (!valid_emailaddr(str)) {
        errors.push('The email address you have entered is not valid');
        reportError('emailaddress');
    } else {
        unReportError('emailaddress');
		setClass('emailaddress');		
    }
		
	str = getElementValue('aboutus');
    if (str == "Please Select") { 
        errors.push('You must tell us where you heard about us?');
        reportError('aboutus');
    } else {
        unReportError('aboutus');
    }

    str = getElementValue('promoref');
    if (!empty_string(str) && str.length > 15) { 
        errors.push('Promotional reference can be 15 characters long.');
        reportError('promoref');
    } else {
        unReportError('promoref');
		setClass('promoref');
    }

		if (errors.length) { 
				txt = "One or more errors occurred when submitting your brochure request:\n\n";
				
				for (i = 0; i < errors.length; i++) { 
						txt += "- " + errors[i] + "\n";
				}
		
				alert(txt);
		
				return false;
		}
		
		return true;
}
function setClass(id){
	document.getElementById(id).className = 'txt';		
}
