
function resizeWin(maxX,maxY,win,stayCentered){
    
	if (!win)     this.win = self;    else this.win = eval(win);

	if (!maxX)    this.maxX = 800;    else this.maxX = maxX;
	if (!maxY)    this.maxY = 600;    else this.maxY = maxY;

	this.doResize = (document.all || document.getElementById);

	this.stayCentered = (stayCentered);
		
	this.getX =  function(){
		if (document.all) return (this.win.top.document.body.clientWidth + 10)
		else if (document.getElementById)
			return this.win.top.outerWidth;
		else return this.win.top.outerWidth - 12;
	}
	
	this.getY = function(){
		if (document.all) return (this.win.top.document.body.clientHeight + 29)
		else if (document.getElementById)
			return this.win.top.outerHeight;
		else return this.win.top.outerHeight - 31; 
	}

	this.Centered = function(){
		if(this.stayCentered) {
				x1 = (screen.width - this.getX()) / 2;
				y1 = (screen.height - this.getY()) / 2
				if(!(x1<0 || y1<0)) //alert("some erroro")
	 		    this.win.moveTo(x1,y1);
		}
	}

	this.FastResize = function(){
			this.win.focus();
			this.win.resizeTo(parseInt(this.maxX),parseInt(this.maxY));
			this.Centered()
		}


	return this;
}

var MyResize
function I(){
//DumyEr = window.onerror
//window.onerror = null

    try{
        if(MyResize) if(MyResize.FastResize) MyResize.FastResize()
    }
    catch(e){
    }
	if(Dumy1) Dumy1()
//	window.onerror = null
}
//MyResize = new resizeWin(800,600);
//MyResize.stayCentered();

function Dumy1(){}

function DumyEr(){}








