/home/suroeste/public_html/gorbus.transportessuroeste.com/suroeste/_lib/prod/lib/js
Edit: /home/suroeste/public_html/gorbus.transportessuroeste.com/suroeste/_lib/prod/lib/js/nm_gauge.js (6668B)
/**
* $Id: nm_gauge.js,v 1.1.1.1 2011-05-12 20:31:29 diogo Exp $
*/
function nmGauge(sName, sTitle, iSize, iMsg)
{
// Propriedades
this.image_dir = '';
this.msg_header = '';
this.name = sName;
this.now_size = 0;
this.now_step = 0;
this.perc = 0;
this.size = iSize;
this.status = false;
this.steps = 0;
this.title = sTitle;
// Metodos Privados
this.DrawBar = DrawBar;
this.GetBarSize = GetBarSize;
this.GetImageDir = GetImageDir;
this.GetMsgHeader = GetMsgHeader;
this.GetName = GetName;
this.GetPerc = GetPerc;
this.GetSize = GetSize;
this.GetSteps = GetSteps;
this.GetTitle = GetTitle;
this.IncStep = IncStep;
this.SetOk = SetOk;
this.ShowTitle = ShowTitle;
// Metodos Publicos
this.Finalize = Finalize;
this.Init = Init;
this.IsOk = IsOk;
this.SetMsgHeader = SetMsgHeader;
this.Step = Step;
// Desenha Barra
this.DrawBar(iMsg);
}
// Metodos Privados
function DrawBar(iMsg)
{
if(this.GetName() == 'pb'){
document.write('
');
}else{
document.write('
');
}
document.write('
');
document.write('
');
document.write('
');
document.write(' '+this.GetTitle());
document.write('
');
document.write('
');
document.write('
');
document.write('
');
document.write('
');
document.write('
'+ this.GetPerc()+'%');
document.write('
');
document.write('
');
document.write(' ');
document.write('
');
document.write('
'+iMsg+'
');
document.write('
');
document.write('
');
document.write('
');
document.write('
');
document.write('
');
document.write('
');
}
function GetBarSize()
{
return this.now_size;
}
function GetMsgHeader()
{
return this.msg_header;
}
function GetImageDir()
{
return this.image_dir;
}
function GetName()
{
return this.name;
}
function GetPerc()
{
return this.perc;
}
function GetSize()
{
return this.size;
}
function GetSteps()
{
return this.steps;
}
function GetTitle()
{
return this.title;
}
function IncStep(iStep)
{
this.now_step = iStep;
this.now_size = Math.round((this.now_step * this.GetSize()) / this.GetSteps());
this.perc = Math.round((this.now_step * 100) / this.GetSteps());
}
function SetOk()
{
this.status = true;
}
function ShowTitle()
{
return ('' != this.title);
}
// Metodos Publicos
function Finalize(sMsg)
{
document.getElementById('perc_' + this.GetName() + '_value').value = 100;
document.getElementById('perc_' + this.GetName()).innerHTML = '100%';
document.getElementById('msg_' + this.GetName()).style.display = "none";
document.getElementById('msg_' + this.GetName()).innerHTML = this.GetMsgHeader() + sMsg;
document.getElementById('finish_progress_'+this.GetName()).innerHTML = this.GetMsgHeader() + sMsg;
document.getElementById('finish_progress_'+this.GetName()).style.display = "";
}
function Init(iSteps, sImgDir)
{
this.steps = iSteps;
this.SetOk();
document.write('');
}
function IsOk()
{
return this.status;
}
function SetMsgHeader(sMsg)
{
this.msg_header = sMsg;
}
function Step(sMsg, iStep)
{
this.IncStep(iStep);
document.getElementById('perc_' + this.GetName() + '_value').value = this.GetPerc();
document.getElementById('perc_' + this.GetName()).innerHTML = this.GetPerc()+'%';
document.getElementById('msg_' + this.GetName()).innerHTML = this.GetMsgHeader() + sMsg;
}