// mpd - I found this on the net and fixed a few bugs.  I'm not
// postive right now if the checkpoint div is really needed, but this
// appears to work.

// the orig is from http://www.bazon.net/mishoo/articles.epl?art_id=408

function inner_resize (w, h)
{
	// it is important to resize the window to the
	// wanted values first, even if we won't get them.
	
	if (window.innerWidth != undefined && window.innerHeight != undefined) {
		dw = w - window.innerWidth;
		dh = h - window.innerHeigh;
		window.innerWidth = w;
		window.innerHeight = h;
	} else {
		// do an initial resize for a starting point
		
		window.resizeTo(w, h);
		
		// create the checkpoint element
		
		var cp = document.createElement("div");
		
		// set up the absolute postion of the checkpoint to be the bottom
		// right corner of the document
		
		cp.style.position = "absolute";
		cp.style.right = "0px";
		cp.style.bottom = "0px";
		
		// insert it into the document
		
		document.body.appendChild(cp);
		
		// we can use the element offset (which is relative to the parent)
		// to figure out what the (x,y) and hence (width,height) really is
		// in our window
		
		var current_width = cp.offsetLeft;
		var current_height = cp.offsetTop + cp.offsetHeight;
		
		// compute the deltas
		
		var dw = w - current_width;
		var dh = h - current_height;
		
		// resize by the deltas
		
		window.resizeBy(dw, dh);
		
		// we can safely delete the checkpoint now
		
		document.body.removeChild(cp);
	}
}
