var d=document;
var frameWidth = 0;
var frameHeight = 0;
var isOpera = Boolean(window["opera"]);
var isIE = (navigator.userAgent.indexOf("MSIE") != -1) && !isOpera;

function getWindowSize(){
	if (self.outerWidth){
		frameWidth = self.outerWidth;
		frameHeight = self.outerHeight;
	}else if (document.documentElement && document.documentElement.clientWidth){
		frameWidth = document.documentElement.clientWidth;
		frameHeight = document.documentElement.clientHeight;
	}else if (document.body){
		frameWidth = document.body.clientWidth;
		frameHeight = document.body.clientHeight;
	}else return false;
}

function centerWindow(){
	getWindowSize();
	var x = screen.width/2 - frameWidth/2;
	var y = screen.height/2 - frameHeight/2;
	window.moveTo(x, y);
	return;
}

var resizeWin = true;

function adjustWin(){
	//if (!isIE) return;
	if (!resizeWin) return;
	var w = d.images['i'].width + 190;
	var h = d.images['i'].height + 200;
	resizeTo(w, h);

	// bug fix for fucking ie
	getWindowSize();
	if (frameHeight < (h-10) ){
		window.moveTo(0, 0);
		resizeTo(w, h);
	}
	centerWindow();
}
