// =================
// Auto-Sizing Image Popup Window
// Browsers: NS6-7 & IE4 and later
// =================
PositionX = PositionY = 100;
dfWidth = dfHeight = 500;

var AutoClose = true;

if(parseInt(navigator.appVersion.charAt(0))>=4){
	var isNN=navigator.appName=="Netscape"?1:0;
	var isIE=navigator.appName.indexOf("Microsoft")!=-1?1:0;
}

var optIE='scrollbars=no,width=150,height=100,left='+PositionX+',top='+PositionY;
var optNN='scrollbars=no,width='+dfWidth+',height='+dfHeight+',left='+PositionX+',top='+PositionY;

function popImage(imageURL,imageTitle){
	if(isNN) imgWin = window.open('about:blank', '', optNN);
	else if(isIE) imgWin = window.open('about:blank', '', optIE);
	with(imgWin.document){
		writeln('<html><head><title>Loading...</title><style>body{margin:0px;}</style><sc' + 'ript>');
		writeln('var isNN=' + isNN + ', isIE=' + isIE + ';');
		writeln("function reSizeToImage(){if(isIE) { window.resizeTo(100,100); width=100-(document.body.clientWidth-document.images[0].width); height=100-(document.body.clientHeight-document.images[0].height);window.resizeTo(width, height);} else if(isNN) {	window.innerWidth = document.images['George'].width; window.innerHeight = document.images['George'].height; }}");
		writeln('function doTitle() { document.title="' + imageTitle + '";}</sc' + 'ript>');
		writeln('</head><body scroll="no" onload="reSizeToImage();doTitle();self.focus()" onblur="self.close()" style="margin:0">');
		writeln('<img name="George" src=' + imageURL + ' style="display:block"></body></html>');
		close();
	}
}

// popup window
function openWin(url, name, width, height) {
	return window.open(url, name, 'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,width='+width+',height='+height);
	
}

function openDlg(url, obj, width, height) {
	return showModalDialog(url, editdoc, "resizable:no; help:no; status:no; scroll:no; toolbar:no; location:no; menubar:no; width:"+width+"; height:"+height);
}