﻿// JScript File

function InfoContainer(divResp,opt_opts)
{
    this._opt_opts = opt_opts || {};
    this._divResp = divResp;
    this._class =  this._opt_opts.cssClass || "infoContainer";
    this._gif      = this._opt_opts.image || (typeof(PATH)!='undefined'?PATH:'')+"img/ajax_loader_2.gif";
    //this._cssClass = opt_opt.cssClass || "options";
    this._divResp.className = this._class; 
    this._buffer = new StringBuffer();   
}

InfoContainer.prototype.clear=function()
{
    this._divResp.innerHTML = "";
    this._buffer.clear();
}

InfoContainer.prototype.append=function(txt)
{
    this._buffer.append("<li>" + txt +  "</li>");
}

InfoContainer.prototype.replaceLast=function(txt)
{
    if(this._buffer.buffer.length>0)
        this._buffer.buffer.splice(this._buffer.buffer.length-1,1);
    this._buffer.append("<li>" + txt +  "</li>");
}

InfoContainer.prototype.showText=function(txt)
{
    this._divResp.style.display = "block";
    this._divResp.innerHTML = txt;
}
InfoContainer.prototype.showLoader=function()
{
    this._divResp.style.display = "block";
    this._divResp.innerHTML = "<center><img src ='" + this._gif +"'></center>"
}
InfoContainer.prototype.showTextAndLoader=function(txt)
{
    this._divResp.style.display = "block";
    this._divResp.innerHTML = txt + "<center><img src ='" + this._gif +"'></center>"
}

InfoContainer.prototype.show=function()
{
    this._divResp.style.display = "block";
    this._divResp.innerHTML = "<ul>" + this._buffer.toString() + "</ul>";
}
InfoContainer.prototype.clear=function()
{
    this._divResp.innerHTML = "";
    this._buffer.clear();
}
InfoContainer.prototype.clearContent=function()
{
    this._divResp.innerHTML = "";
}
InfoContainer.prototype.hide=function()
{

    this._divResp.style.display = "none";
}

