
// Window sizer to put the page on the center
// hendra@cciflorida.com

var winW = 630, winH = 460;
var mywidth = 800;
var timed = 20;
var nowloc = 0;

function grabbag() 
{
    var wind = document.getElementById("thewindow");
    var jax = document.getElementById("bug");
    if (parseInt(navigator.appVersion)>3) {
	if (navigator.appName=="Netscape") {
	    winW = window.innerWidth-16;
	    winH = window.innerHeight-16;
	}
	if (navigator.appName.indexOf("Microsoft")!=-1) {
	    winW = document.body.offsetWidth-20;
	    winH = document.body.offsetHeight-20;
	}
    }
    var TargetLeft = Math.round((winW - mywidth) / 2);
    if (TargetLeft < 1) {
	TargetLeft = 0;
    }
    nowloc = wind.style.left;
    nowloc = nowloc.replace(/\D/g,"");
    if (nowloc < TargetLeft) {
	nowloc = TargetLeft;
	timed = 10;
    } 
    if (nowloc > TargetLeft) {
	//	nowloc = nowloc - 1;
	nowloc = TargetLeft;
	timed = 10;
    } 
    if (nowloc == TargetLeft) {
	if (timed < 2100) {
	    timed += 10;
	}
    } 

    wind.style.left = nowloc;
    setTimeout ("grabbag()", timed);
}

