function Floater(objId)
{
    var isIE = (
        (navigator.userAgent.indexOf("MSIE 6") > 0) || 
        (navigator.userAgent.indexOf("MSIE 5.5") > 0)
    );
    
    var _this = this;
    var _floaterDiv;
    var _floaterIframe;
    var _shadowDiv;
    var _shadowIframe;
    var _shadowImage;
    var _timer;
    
    _this.Id;
    _this.EnableShadow = false;
    _this.ShadowAlpha = 30;
    _this.ShadowColor = "#000000";
    _this.ShadowImageUrl;
    _this.ShadowLeftOffset = 15;
    _this.ShadowTopOffset = 15;
    _this.CloseTimeout = 0;
    
    _this.Init = function()
    {
        if(!_this.Id)
        {
            alert("You must specify the div's id.");
            return;
        }
        
        _floaterDiv = document.getElementById(_this.Id);
        if(isIE)
        {
			_floaterIframe = _createElement('iframe', 'floaterIframe', 99);
		}
        
        if(!_this.EnableShadow)
        {
            _toggleFloater(1);
        }
        else
        {
   		    _shadowDiv = _createElement('div', 'shadowDiv', 98);
            if(isIE)
            {
	            _shadowIframe = _createElement('iframe', 'shadowIframe', 97);
                _shadowIframe.style.position = "absolute";
		    }
            _toggleFloater(1);
            if(_this.ShadowImageUrl)
            {
                _shadowImage =  _createElement('img', 'shadowImage', null, _shadowDiv);
                _shadowImage.src = _this.ShadowImageUrl;
                _shadowImage.style.opacity = _this.ShadowAlpha/100;
                _shadowImage.style.filter = 'alpha(opacity=' + _this.ShadowAlpha + ')';
            }
            else
            {
                _shadowDiv.style.backgroundColor = _this.ShadowColor;
                _shadowDiv.style.position = "absolute";
                _shadowDiv.style.height = _floaterDiv.offsetHeight + "px";
                _shadowDiv.style.width = _floaterDiv.offsetWidth + "px";
                _shadowDiv.style.top = _floaterDiv.offsetTop + _this.ShadowTopOffset + "px";
                _shadowDiv.style.left = _floaterDiv.offsetLeft + _this.ShadowLeftOffset + "px";
                _shadowDiv.style.opacity = _this.ShadowAlpha/100;
                _shadowDiv.style.filter = 'alpha(opacity=' + _this.ShadowAlpha + ')';
                if(isIE)
                {
                    _shadowIframe.style.height = _floaterDiv.offsetHeight + "px";
                    _shadowIframe.style.width = _floaterDiv.offsetWidth + "px";
                    _shadowIframe.style.top = _floaterDiv.offsetTop + _this.ShadowTopOffset;
                    _shadowIframe.style.left = _floaterDiv.offsetLeft + _this.ShadowLeftOffset;
		        }
            }
        }
        
        if(_this.CloseTimeout > 0)
        {
            _timer = setTimeout(objId + ".Hide();", _this.CloseTimeout*1000);
        }
    }
    
    _this.Hide = function()
    {
        _toggleFloater(0);
        if(_timer)
        {
            clearTimeout(_timer);
        }
    }

    function _toggleFloater(state)
    {
        _floaterDiv.style.display = state ? "block" : "none";
        if(isIE)
        {
            _floaterIframe.style.display = state ? "block" : "none";
	    }
        
        if(_this.EnableShadow)
        {
            _shadowDiv.style.display = state ? "block" : "none";
            if(isIE)
            {
                _shadowIframe.style.display = state ? "block" : "none";
            }
        }
    }
    
    function _createElement(type, id, zindex, parentElement) {
        var obj = document.createElement(type);
        obj.id = id;
        obj.style.display = 'none';
        obj.style.position = 'absolute';
        obj.style.top = 10;
        obj.style.left = 10;
        obj.style.width = 175;
        obj.style.height = 125;
        if(type == "iframe") obj.style.filter='progid:DXImageTransform.Microsoft.Alpha(style=0,opacity=0)';
        if(zindex)
        {
            obj.style.zIndex = zindex;
        }
        if(parentElement)
        {
            parentElement.appendChild(obj);
        }
        else
        {
            document.body.appendChild(obj);
        }
        return obj;
    }
}
