/* Terminal Status Bar Library
 * Copyright 2005, Steve Blinch
 *
 * Part of the BBS Web Terminal
 * http://bbs.blitzaffe.com
 *
 * Not licensed for redistribution
 */

function StatusBar(terminal) {
	this.terminal = terminal;
}

StatusBar.prototype.build = function() {
	this.write('status_title','WebBBS',6);
	this.write('status_name','',16);
	this.write('status_info1','',11);
	this.write('status_info2','',3);
	this.write('status_online','',15);
	
	el = get_obj('statusbar');
	el.style.visibility = 'visible';
}

StatusBar.prototype.write = function (cellid,msg,maxlen) {
	if (msg.length>maxlen) msg.length = maxlen;

	var l = maxlen - msg.length;
	while (l>0) {
		msg += '&nbsp;';
		l--;
	}
	
	el = get_obj(cellid);
	el.innerHTML = msg;
}


StatusBar.prototype.sendable = function(cansend) {
	var msg = "";
	if (cansend) {
		msg = 'CS';
	} else {
		msg = 'NS';
	}
		
	if (this.terminal.debug) this.write('status_info2',msg,3);
}
