﻿var validationHelper = {
    /*
    * all xVal jQuery validate requests call this function, specific errorPlacement 
    * can be overridden within this function on a per form basis
    */
    globalCustomErrorPlacement: function(error, element) {

        var errGroup = element.parent(".errGroup");
        if (errGroup.length > 0) {
            // This element is part of an error group. Append the
            // error to the errMessage span, rather than after the input.
            var messagePlace = errGroup.children(".errMessage");
            if (messagePlace.length > 0) {
                messagePlace.append(error);
            }
        } else {
            // Standard validation applies
            element.after(error);
        }

//        switch (element.parents("form").attr("id")) {
//            default:
//                /* default error placement */
//                //element.parent().after(error);
//                element.after(error);
//                break;
//        }
    }
};
