
var width;
var height;

function init(w, h) 
{
	width = w;
	height = h;
	if (width != getBWidth() || height != getBHeight()) {
		try {
			top.location.hostname;
		} catch (error) { 
			// error is a permission error that top.location is not accessible. We can't resize in this case
			return;
		}
		window.resizeTo(width, height);
		var width2 = width+(width-getBWidth());
		var height2 = height+(height-getBHeight());
		window.resizeTo(width2, height2);
	}
}

function getBWidth() 
{
	var w = window.innerWidth;
	if (w == null) {
		w = document.body.clientWidth;
	}
	if (w == null) {
		w = width;
	}
	return w;
}

function getBHeight() 
{
	var h = window.innerHeight;
	if (h == null) {
		h = document.body.clientHeight;
	}
	if (h == null) {
		h = height;
	}
	return h;
}


