var image = null;
function showImage(destination, width, height) {

    if (image != null) { if (image.closed!=true) {image.close() } }
    image = window.open("","Message","width=" + width + ",resizable=yes,scrollbars=yes,directories=no,menubar=no,location=no,height=" + height + ",status=no");
    window.image.focus();
    image.location.href = destination;
    window.image.focus();
}

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) {
	// 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();
	var ox = screen.availWidth-inner[0];
	var oy = screen.availHeight-inner[1];
	// now that we have an offset value, size the browser
	// and position it
	window.resizeTo(w+ox, h+oy);
	window.moveTo((screen.availWidth - (w + ox)) / 2, (screen.availHeight - (h + oy)) / 2 - 10);
}

