// JavaScript Document

resize();

// ===== RESIZE FUNCTIONS =====

function resize() {
	chromeHeight = 34;
	chromeWidth = 8;
	var borderWidth = 32; // borders, padding
	var borderHeight = 12+20+20; // borders, padding and nav
	self.resizeTo(w + borderWidth + chromeWidth, h + borderHeight + chromeHeight);
	resizeWindow(w + borderWidth, h + borderHeight);
	self.moveTo(30,30);
	self.focus();
}


function getInnerSize () {
	var x,y;
	if (self.innerHeight) { // all except Explorer
		x = self.innerWidth;
		y = self.innerHeight;
	}
	else if (document.documentElement && document.documentElement.clientHeight) { // Explorer 6 Strict Mode
		x = document.documentElement.clientWidth;
		y = document.documentElement.clientHeight;
	}
	else if (document.body) { // other Explorers
		x = document.body.clientWidth;
		y = document.body.clientHeight;
	}
	return [x,y];
} 

function  resizeWindow (w, h) {
	var inner = getInnerSize();
	var dx = w-inner[0]+chromeWidth;
	var dy = h-inner[1]+chromeHeight;
	self.resizeTo(w+dx, h+dy);
}
				

