App.Viewer = function() {
	var d;
	
	return {
		init: function() {
			if (! d) {
				d = new Ext.BasicDialog('viewer', {
					autoCreate: true,
					title: 'Anzeigefenster',
					width: 500,
					height: 300,
					draggable: true,
					shadow: true,
					syncHeightBeforeShow: true
				});
				d.body.addClass('x-layout-panel p05 x-box-mc');
				// d.addButton('Schließen', d.hide, d);
				d.addKeyListener(27, d.hide, d);
			}
		},
		
		AGB: function() {
			d.body.load('templates/AGB.html', null, App.Viewer.show);
		},
		
		Imprint: function() {
			d.body.load('templates/Imprint.html', null, App.Viewer.show);
		},
		
		show: function() {
			d.show();
		},
		
		load: function(url) {
			d.body.load(url, null, App.Viewer.show);
		}
	}
}();

Ext.onReady(App.Viewer.init, App.Viewer);
