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';
        
        showShadowBox('profileProgress');
        
        return false;
    }

    this.Close = function()
    {
        hideShadowBox('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';
		
        showShadowBox('profileProgress');
        setTimeout(this.Close, timeout);
    }

	this.FailureComplete = function (mess, timeout)
    {
        this.SuccessfulComplete(mess, timeout)
    }
}

