/* global appRoot */
/* jshint -W061 */
/* jshint -W098 */
(function () {
    "use strict";

    appRoot.controller('CheckAppStatusController', ['$scope', function ($scope) {

        
        $scope.ValidateAppNumber = function (input, scope) {

            if (input === null || input === undefined || input === "") {
                return true;
            }
            else {
                var rxPattern = "[RWrw][0-9][0-9][0-9][0-9][0-9][0-9][0-9]";
                if (input.match(rxPattern)) { return true; }
                else {
                    return false;
                }
            }
        };
       
        $scope.triggerClick = function (keyEvent)
        {
            if(keyEvent.which === 13)
                $("#SubmitButton_CheckStatus").click();
        }
        $scope.triggerRequired = function ()
        {
            var el = angular.element('#ApplicationSearchRequest_ApplicationNumber');
            el.attr('required', true);
        }
        
    }]);
  
}());
;
