var Property = new function() {

    this.ValidateDetails = function() {
        f.SetClassIf('txtYourName', 'error', f.GetValue('txtYourName') == '');
        f.SetClassIf('txtEmail', 'error', !IsEmail(f.GetValue('txtEmail')) || f.GetValue('txtEmail') == '');
        f.SetClassIf('txtFriendsEmail', 'error', !IsEmail(f.GetValue('txtFriendsEmail')) || f.GetValue('txtFriendsEmail') == '');

        var aErrorControls = f.GetElementsByClassName('*', 'error', 'divEmailForm');
        if (aErrorControls.length == 0) {
            ButtonPostBack(f.GetObject('btnSendNow'));
        } else {
            FormHandler.ShowWarning("Please make sure that all of the required fields have been completed and that a valid email address has been provided");
            aErrorControls[0].focus();
        }
    }
}