
function GetInnerSize () {
	var x,y;
	if (self.innerHeight) // all except Explorer
	{
		x = self.innerWidth;
		y = self.innerHeight;
	}
	else if (document.documentElement && document.documentElement.clientHeight)
		// Explorer 6 Strict Mode
	{
		x = document.documentElement.clientWidth;
		y = document.documentElement.clientHeight;
	}
	else if (document.body) // other Explorers
	{
		x = document.body.clientWidth;
		y = document.body.clientHeight;
	}
	return [x,y];
}

function ResizeToInner (w, h) {
	// make sure we have a final x/y value
	// pick one or the other windows value, not both
	x = window.screenLeft || window.screenX;
	y = window.screenTop || window.screenY;
	// for now, move the window to the top left
	// then resize to the maximum viewable dimension possible
	//window.moveTo(0,0);
	window.resizeTo(screen.availWidth,screen.availHeight);
	// now that we have set the browser to it's biggest possible size
	// get the inner dimensions.  the offset is the difference.
	var inner = GetInnerSize();
	if(inner[1] < h){
		w = (inner[1] / h) * w;
		//alert("available height was not enough for "+h+" so width has been reduced to "+w);
		h = inner[1];
		x = 0;
		y = 0;
	}
	var ox = screen.availWidth-inner[0];
	var oy = screen.availHeight-inner[1];
	
	//alert("available height is "+screen.availHeight+" inner height of full screen has been found to be "+inner[1]+" so toolbars are "+oy+"px high");
	// now that we have an offset value, size the browser
	// and position it
	window.resizeTo(w+ox, h+oy);
	//window.moveTo(x,y);
}

if(screen.availWidth >= 1000 && screen.availHeight >= 600){
	if(self.innerHeight){
		ResizeToInner(1000, 600);
	} else if(document.documentElement){
		if(document.documentElement.clientWidth + 4< screen.availWidth){
			ResizeToInner(1000, 600);
		}
	}
}

