var maxWidth = 1100;
var minWidth =  600;
var hMargins =   40; /* Includes space at right for vertical scroll bar */

var at = "@";
function Obj(Id) { return document.getElementById(Id) };
function set_width() {
    var iW, iH;
    if (navigator.appName=="Netscape") {
	iW = window.innerWidth;
	iH = window.innerHeight;
    }
    else if (navigator.appName.indexOf("Microsoft")!=-1) {
	iW = document.body.offsetWidth;
	iH = document.body.offsetHeight;
    } else {
	iW = window.innerWidth;
	iH = window.innerHeight;
//	alert("navigator.appName: "+navigator.appName);
    }
    var mH = Obj("main").height;
    var mW = Obj("main").width;
//    var s =	"Inner Height: " + iH + " px, Width: " + iW + " px\n"+
//		"Main  Height: " + mH + ", Width: " + mW + "   ";
//    alert(s);
    if(iW != undefined && mW != undefined) {
	var w = (iW>maxWidth)? maxWidth : (iW < minWidth)? minWidth : iW;
	Obj("main").width = w - hMargins;
	var word = Obj("word");
//	word.innerHTML = "width: "+w;
//	word.style.color = word.style.color.match(/white/)? "black" : "white";
    }
    return;
}
function sb(s) { var r=/\[([0-9A-F]{2})\]/g; document.write(unescape(s.replace(r,'%$1'))); }

function toggle() {
    var bd = Obj('bd').style;
    var tc = Obj('tc').style;
    if(bd)
       bd.background = bd.background.match(/white/)? "#996633" : "white";
    if(tc)
       tc.background = tc.background.match(/white/)? "#AD7A47" : "white";
}

