﻿/// <reference name="MicrosoftAjax.js"/>
//Make sure the Page_ClientValidate function exists
document.observe("dom:loaded", function() {
    if (typeof (Page_ClientValidate) == "function") {
        //Stash the old implementation in a temp variable
        Page_ClientValidateOld = Page_ClientValidate;

        //Create a new implementation and store it
        //in Page_ClientValidate. Callers will now get
        //this implementation.

        Page_ClientValidate = function(validationGroup) {
            var isValid;

            //Call the old implementation first…
            isValid = Page_ClientValidateOld(validationGroup);

            //and then call our extension
            if (!isValid) {

                var lblMessageErreur = $get('ctl00_ctl03_lblMessageToShow');
                if (lblMessageErreur) {
                    lblMessageErreur.innerHTML = '';
                }
                ShowPopupError('');
            }

            return isValid;
        }
    }
});


