
var sw = screen.width;
var sh = screen.height;
var iw;
var ih;
var ow;
var oh;

document.onerror = null;

function getSizes() {
  if (HM_NS4 || HM_NS6) {
	iw = frames.top.innerWidth;
	ih = frames.top.innerHeight;
	ow = frames.top.outerWidth;
	oh = frames.top.outerHeight;
  }
  if (HM_IE) {
	if (typeof(frames.top) != "undefined" && 
        typeof(frames.top.document) != "undefined" &&
        typeof(frames.top.document.body) != "undefined" &&
	    frames.top.document.body != null){
		ow = frames.top.document.body.offsetWidth;
		oh = frames.top.document.body.offsetHeight;
		iw = frames.top.document.body.clientWidth;
		ih = frames.top.document.body.clientHeight;
	} else {
		ow = sw;
		oh = sh;
		iw = sw;
		ih = sh;
	}
  }
}

function autoResize(w, h) {
  getSizes();
  if (h == '') {
	h = sh - 25;
  }
  if (w > sw || h > sh) {
	w = sw;
	h = sh;
  }
  if (iw < w || ih < h) {
		window.resizeTo(w,h);
  } 
	
}
