        if ("undefined" === typeof window.PasswordFuncs) {
            window.PasswordFuncs = {};
        }

        PasswordFuncs.showStatus = function(message,timeout)
        {        
            alert(message);
            return;
                
            if (!message)
            {
                message = "Ready";
            }

            var jCtl = $("#divStatusBar").text(message).addClass("statusbarhighlight");
            if (timeout)
            {
                setTimeout(function() { jCtl.removeClass("statusbarhighlight").text("Ready"); },timeout);
            }
        };

        PasswordFuncs.onPageError = function(xhr,errorMsg,thrown)
        {
            if ("string" === typeof xhr)
            {
                PasswordFuncs.showStatus(xhr, 5000);
                return;
            }
            
            if (errorMsg && (errorMsg !== "error"))
            {
                PasswordFuncs.showStatus("errormsg: " + errorMsg, 5000);
            }
            else if (("string" === typeof xhr.responseText) && (xhr.responseText !== ""))
            {
				alert(xhr.responseText);
                var err = JSON.parse(xhr.responseText);
                if ("object" === typeof err)
                {
                    PasswordFuncs.showStatus(err.Message, 5000);
                }
                else    
                    PasswordFuncs.showStatus("Unknown server error.", 5000);
            }
            else
                PasswordFuncs.showStatus("Unknown error occurred in callback.", 5000);
        };

        // *** Service Calling Proxy Class
        PasswordFuncs.setupServiceProxy = function(serviceUrl) {
            PasswordFuncs.serviceUrl = serviceUrl;
         
            // *** Call a wrapped object
            PasswordFuncs.invokeServiceMethod = function(method,data,callback,bare)
            {
                // *** Convert input data into JSON - REQUIRES Json2.js
                var json = JSON.stringify(data);
         
                // *** The service endpoint URL        
                var url = PasswordFuncs.serviceUrl + method;
         
                $.ajax( { 
                    url: url,
                    data: json,
                    type: "POST",
                    processData: false,
                    contentType: "application/json",
                    timeout: 10000,
                    dataType: "text",  // not "json" we'll parse
                    success: 
                    function(res) 
                    {                                                            
                        if (!callback) return;

                        // *** Use json library so we can fix up MS AJAX dates
                        var result = JSON.parse(res);
                        
                        if (result.ExceptionDetail)
                        {
                            PasswordFuncs.onPageError(result.Message);
                            return;
                        }
                        
                        // *** Bare message IS result
                        if (bare)
                        { callback(result); return; }
                        
                        // *** Wrapped message contains top level object node
                        // *** strip it off
                        for(var property in result)
                        {
                            callback( result[property] );
                            break;
                        }                    
                    },
                    error:  PasswordFuncs.onPageError
                 });
            }
        };

        if ("undefined" === typeof PasswordFuncs.serviceUrl) {
            PasswordFuncs.setupServiceProxy("/password.aspx/");
        }
