function browserCheck() {
    var isNS=document.layers?true:false;
    var isIE=(document.all!=null)||(navigator.appName.toLowerCase().indexOf('microsoft internet explorer')!=-1);
    var isDom2=document.getElementById;
    var fVers=parseFloat(navigator.appVersion);

	if ((isNS && fVers<4)||(isIE && fVers<4)) {
	    alert('Our apologies, this page may not function correctly in your browser.');
	}
}

function validateForm(form) {
    try {
        
        var errorCount = 0;
        var errors = "";
        
        if (form.SName.value == "") {
            errorCount++;
            errors += "  - enter the Nominee's name.\r\n";
        }
        
        if (form.SAdd1.value == "" 
                && form.Email.value == "" 
                && form.ContactNo1.value == "") {
            errorCount++;
            errors += "  - enter one of the Nominee's address, email or phone number.\r\n"
        }
        
        if (form.NReason.value == "") {
            errorCount++;
            errors += "  - enter the Reason for nomination.\r\n";
        }
        
        if (!form.IncludeWWA.checked
                && !form.IncludeWWIB.checked
                && !form.IncludeWWAW.checked
                && !form.IncludeWWSA.checked
                && !form.IncludeWWWA.checked
                && !form.IncludeWWQld.checked
                && !form.IncludeWWNSW.checked
                && !form.IncludeWWVic.checked
                && !form.IncludeWWTas.checked) {
            errorCount++;
            errors += "  - check at least one of the publications.\r\n";
        }
        

        if (form.NName.value != "") {
            if (form.NSAdd1.value == "") {
                errorCount++;
                errors += "  - enter your address.\r\n";
            }
            if (form.NContactNo.value == "") {
                errorCount++;
                errors += "  - enter your phone number.\r\n";
            }
        }
        
        
        if(!form.ChkAgree.checked){
            errorCount++;
            errors += "  - check the terms and conditions.\r\n";
        }
        
        if (errorCount == 1) {
            alert("Please " + errors.substring(4, errors.length));
        } else if (errorCount > 1) {
            alert("Please complete the following and re-submit the nomination:\r\n" + errors);
        }
        
        return (errorCount == 0);
    } catch (e) {
        alert("Could not validate form. Please email your nomination if this error persists. (" + e + ")");
        return false;
    }
}
