var isNav, isIE;

if (parseInt(navigator.appVersion.charAt(0)) >= 4) {
	isNav = (navigator.appName == "Netscape") ? 1 : 0;
	isIE = (navigator.appName.indexOf("Microsoft") != -1) ? 1 : 0;
}

//IE Max
IEMaxH = 535; //530
IEMaxW = 640; //612

//Nav Max
NavMaxH = 558;
NavMaxW = 652;

function fitWindowSize() {
	if (isNav) {
	
		if ( document['imgBookImage'] )
		{
			height = document['imgBookImage'].height + 100;  //100 to compensate for window title bar and footer height
			width = document['imgBookImage'].width;

			if (height<NavMaxH) {
			    height = NavMaxH;
			}

			if (width<NavMaxW) {
			    width = NavMaxW;
			}

			window.outerHeight = height;
			window.outerWidth = width;
		}
	}
 
	if (isIE) {
		if ( document.images['imgBookImage'] )
		{
			window.resizeTo(IEMaxH, IEMaxW);

			height = document.images['imgBookImage'].height + 100; //80 to compensate for window title bar and footer height
			width = document.images['imgBookImage'].width + 12; //12 to compensate for left and right window border width

			if (height<IEMaxH) {
				height = IEMaxH;
			}

			if (width<IEMaxW) {
				width = IEMaxW;
			}
	
			window.resizeTo(width, height);
		}
    }
}

function openResizableWindow(page) {
	window.open(page, "comicsWindowResizable", "width=646,innerwidth=646,height=480,innerheight=480,toolbar=no,titlebar=no,menubar=no,location=no,scrollbars=yes,resizable=yes");
}

function openNonResizableWindow(page) {
	window.open(page, "comicsWindowNonResizable", "width=610,innerwidth=610,height=460,innerheight=460,toolbar=no,titlebar=no,menubar=no,location=no,scrollbars=no,resizable=no");
}

