function Progress()
{
	this.Init = function(id)
	{
	    this._clientId = id;
        this._ignoreBkg = false;
	    
	    
	    // Add handlers so we can call functions associated with this object.
        
        // Setup a method to cleanup
//        var delDispose = Function.createDelegate(this, this.Dispose);
//        Sys.Application.add_unload(delDispose);
	}
	
    // Clean up after ourself
	this.Dispose = function()
	{
	}

    this.Open = function(message, showImage)
    {
        //Set defaults
        if(message == null) message = 'Please wait ...';
        if(showImage == null) showImage = true;
        
        //Show/hide image
        var el = $get('profileProgressImage');
        if(showImage)
            el.style.display = 'inline';
        else
            el.style.display = 'none';
            
        // Set message text
        el = $get('progressText');
        el.innerHTML = message; 
        el.style.color = '#20558A';
        
        // If the background Div is visible, we won't change it when showing/hiding the alert.
        this._ignoreBkg = !Sys.UI.DomElement.containsCssClass($get('alertBackground'), 'hide');
        if(!this._ignoreBkg)
        {
            showAlertBackground();
        }

        showDIV('profileProgress');

        // Position the popup in case the browser is scrolled.
        setPopupDivPosition('profileProgress');
        
        return false;
    }

    this.Close = function()
    {
        if(!this._ignoreBkg)
        {
            hideAlertBackground();
        }
        
        hideDIV('profileProgress');

        this._ignoreBkg = false;
        return false;
    }
	
	this.SuccessfulComplete = function (mess, timeout)
    {
        // Hide the processing message.
        var el = $get('profileProgressImage');
        el.style.display = 'none';
        // Display the successful message text.
        el = $get('progressText');
        el.innerHTML = mess;
        el.style.color = '#20558A';
        
        setTimeout(this.Close, timeout);
    }

	this.FailureComplete = function (mess, timeout)
    {
        this.SuccessfulComplete(mess, timeout)
    }
}
