// JavaScript Document

function openpopup(text, xsize, ysize, name)
{
	if( name = "") { name = "PopUp"; }
	var popurl=text;
	var x=xsize;
	var y=ysize;
	winpops=window.open(popurl, name, 'width=' + x +',height=' + y + ',scrollbars,resizable=yes,status=yes,dependent=yes,dialog=yes,modal=yes');
}


function autoResize() 
{
	var isMSIE = (navigator.appName == "Microsoft Internet Explorer");
	var isOpera = (navigator.userAgent.indexOf("Opera") != -1);

	if (isOpera)
		return;

	if (isMSIE) {
		try { window.resizeTo(10, 10); } catch (e) {}

		var elm = document.body;
		var width = elm.offsetWidth;
		var height = elm.offsetHeight;
		var dx = (elm.scrollWidth - width) + 4;
		var dy = elm.scrollHeight - height;

		try { window.resizeBy(dx, dy); } catch (e) {}
	} else {
		window.scrollBy(1000, 1000);
		if (window.scrollX > 0 || window.scrollY > 0) {
			window.resizeBy(window.innerWidth * 2, window.innerHeight * 2);
			window.sizeToContent();
			window.scrollTo(0, 0);
			var x = parseInt(screen.width / 2.0) - (window.outerWidth / 2.0);
			var y = parseInt(screen.height / 2.0) - (window.outerHeight / 2.0);
			window.moveTo(x, y);
		}
	}
}

function fitPicture( width, height) 
{
	var NS = (navigator.appName=="Netscape")?true:false;
	iWidth = (NS)?window.innerWidth:document.documentElement.clientHeight;
	iHeight = (NS)?window.innerHeight:document.documentElement.clientHeight;
	iWidth = width - iWidth;
	iHeight = height - iHeight + 20;
	window.resizeBy(iWidth, iHeight);
	self.focus();
};
