function shareValidate() {
    errors = new Array();		

    str = getElementValue('yourname');
    if (empty_string(str)) { 
        errors.push('You must enter your name');
        reportError('yourname');
    } else {
        unReportError('yourname');
    }

    str = getElementValue('youremail');
    if (empty_string(str)) { 
        errors.push('You must enter your email address');
        reportError('youremail');
    } else if (!valid_emailaddr(str)) {
        errors.push('The address you have entered as your email is not valid');
        reportError('youremail');
    } else {
        unReportError('youremail');
    }

    str = getElementValue('friendsname');
    if (empty_string(str)) { 
        errors.push("You must enter your friend's name");
        reportError('friendsname');
    } else {
        unReportError('friendsname');
    }

    str = getElementValue('friendsemail');
    if (empty_string(str)) { 
        errors.push("You must enter your friend's email address");
        reportError('friendsemail');
    } else if (!valid_emailaddr(str)) {
        errors.push("The address you have entered as your friend's email is not valid");
        reportError('friendsemail');
    } else {
        unReportError('friendsemail');
    }

		if (errors.length) { 
				txt = "One or more errors occurred when submitting your request:\n\n";
				
				for (i = 0; i < errors.length; i++) { 
						txt += "- " + errors[i] + "\n";
				}
		
				alert(txt);
		
				return false;
		}
		
		return true;
}
