
	var winId = 0;

	function openWnd(file, x, y, oneInstance) {
		winId++;
		if(y == -1) y = screen.height;
		if(!x) x = 350;
		if(!y) y = 350;
		if(oneInstance) {
			var wid = 'file';
		}
		else {
			var wid = 'file' + winId;
		}
		cleft = (screen.width / 2) - (x / 2);
		ctop = (screen.height / 2) - (y / 2);
		var windowId;
		windowId=window.open(file, wid,'toolbar=0,directories=0,status=0,menubar=0,width=' + x +',height=' + y + ',scrollbars=auto,resizable=no,left=' + cleft + ',top=' + ctop);
		windowId.focus();
		return true;
	}

	function openImg(file, vertical, x, y) {
		winId++;
		if(y == -1) y = screen.height;
		if(!x) x = 700;
		if(!y) y = 467;
		if(vertical) {
			z = x;
			x = y;
			y = z;
		}
		x += 20;
		y += 20;
		var wid = 'file' + winId;
		cleft = (screen.width / 2) - (x / 2);
		ctop = (screen.height / 2) - (y / 2);
		var windowId;
		windowId=window.open(file, wid,'toolbar=0,directories=0,status=0,menubar=0,width=' + x +',height=' + y + ',scrollbars=auto,resizable=no,left=' + cleft + ',top=' + ctop);
		windowId.focus();
		return true;
	}

