var topW = 0;
var topH = 0;

function windowHeight() {
	var de = document.documentElement;
	return self.innerHeight ||
		( de && de.clientHeight ) ||
		document.body.clientHeight;
}

function windowWidth() {
	var de = document.documentElement;
	return self.innerWidth ||
		( de && de.clientWidth ) ||
		document.body.clientWidth;
}

function buildWH() {
	var cW=windowWidth();
	var cH=windowHeight();
	window.resizeTo(600,600)
	barsW=600-windowWidth();
	barsH=600-windowHeight();
	wW=barsW+cW;
	wH=barsH+cH;
	window.resizeTo(wW,wH)

	topW = wW;
	topH = wH;
	topW = topW - cW;
	topH = topH - cH;
	var popW = document.getElementById('pop_wrap').offsetWidth;
	var popH = document.getElementById('pop_wrap').offsetHeight;
	resizeWH(popW,popH);
}

function resizeWH(width,height) {
	if(navigator.userAgent.indexOf("Chrome") > -1 ){
		window.resizeTo(width+10,height+56);
	} else{
		window.resizeTo(width + topW,height + topH);
	}
}

domReady(function() {
	buildWH();
});

