var blankImg        = 'DESIGN/Blank.jpg';
var operationCount  = 0;

function ZoomText(object
                , startSize
                , endSize
                , speed)
{
    if (typeof(object) == 'string')
    {
        object = document.getElementById(object);
    }
    
    if (!object.oopct)
    {
        speed = speed || 100;
        
        if (blankImg)
        {
            object.style.backgroundImage = 'url(' + blankImg + ')';
        }
        
        object.oopct = new OperationTextZoom(object
                                           , startSize
                                           , endSize
                                           , speed);
    }
    
    clearTimeout(object.oopct.to);
    object.oopct.minmax[4] *= -1;
    object.oopct.cngtxt();
}

function OperationTextZoom(object
                         , startSize
                         , endSize
                         , speed)
{
    this.object = object;
    
    if (object.style.position)
    {
        if (object.style.position = 'absolute')
        {
            this.abs=[object.offsetLeft
                    , object.offsetWidth];
        }
    }
    
    this.ref            = 'oopct' + operationCount++;
    window[this.ref]    = this;
    this.minmax         = [startSize
                         , Math.min(startSize
                                  , endSize)
                         , Math.max(startSize
                                  , endSize)
                         , speed
                         , (startSize < endSize)
                           ? -1
                           : 1];
    this.to = null;
}

OperationTextZoom.prototype.cngtxt = function()
                                     {
                                        if ((this.minmax[4] > 0                 &&
                                             this.minmax[0] < this.minmax[2])   ||
                                            (this.minmax[4] < 0                 &&
                                             this.minmax[0] > this.minmax[1]))
                                        {
                                            this.object.style.fontSize = (this.minmax[0] += this.minmax[4]) + 'px';
                                            
                                            if (this.abs)
                                            {
                                                this.object.parentNode.style.width = (this.object.offsetWidth + parseInt(this.object.style.fontSize)) + 'px';
                                                this.object.parentNode.style.left  = (parseInt(this.object.style.fontSize) / 2) + 'px';
                                            }
                                          
                                            this.to = this.setTimeOut('cngtxt();'
                                                                    , this.minmax[3]);
                                        }
                                      }

OperationTextZoom.prototype.setTimeOut = function(f
                                                , d)
                                         {
                                            this.to=setTimeout('window.' + this.ref + '.' + f
                                                             , d);
                                         }