Ext.onReady( function() {
	var box;
	var initlink = Ext.select('.extwndowlink');
	initlink.each( function(el) {
		var lnk = el.dom;
		var conf_title = 'Weitere Informationen';
		var conf_modal = true;
		var conf_width = 740;
		var conf_height = 420;
		var conf_display_header = false;
		Ext.MessageBox.maxWidth = 800;
		lnk.onclick = function() {
			box = Ext.MessageBox.show( {
			    title :conf_title,
			    msg :'<img src=\"' + basepath + '_/scripts/ext/resources/images/default/grid/loading.gif\" alt=\"\" style=\"border:0; vertical-align:middle;\"> Loading...',
			    animEl :lnk,
			    modal :conf_modal,
			    fn : function() {
				    Ext.MessageBox.hide();
			    }
					
			});
			//
			if (conf_display_header == false) {
				box.getDialog().header.dom.style.display = 'none';
			}
			var url = lnk.href;
			Ext.Ajax.request( {
			    url :url,
			    success : function(req) {
				    var treg = /<!--\sINHALT\s-->(.+)<!--\sINHALT\s-->/gi;
				    var bd = treg.exec(req.responseText.split(/\n/).join(''));
				    if (bd && bd[1]) {
					    var txt = bd[1];
					    txt = '<div id="blubber" style="width:' + (conf_width - 40) + 'px; overflow-x:hidden;overflow-y:auto;">' + txt + '</div>';
					    Ext.MessageBox.updateText(txt);
					    
					    txt.evalScripts();
					    
					    var dlg = Ext.MessageBox.getDialog();
					    dlg.refreshSize();
					    dlg.center();
					    
					    
					    return;
					    if (dlg.size.height > 500) {
						    Ext.get("blubber").dom.style.height = "470px";
						    dlg.resizeTo(conf_width, 500);
					    } else {
					    	dlg.resizeTo(conf_width, dlg.size.height);
					    }
					    // dlg.resizeTo(conf_width,conf_height);
				    }
			    }
			});
			return (false);
		}
	});
});
var showAdressMap = function(id) {
	var map = Ext.get(id);
	if (!map) {
		var html = '<div id="' + id + '" style="height:500px; width:500px;" class="gmapmaps"></div>';
		Ext.MessageBox.show({
			title :'Karte',
			msg :html,
			modal :false
		});
		var mconfig = {
			id :id,
			autozoom :true
		};
		initGMap(mconfig);
	} else {
		Ext.MessageBox.getDialog().show();
	}
};
if (typeof gotoMapPosition != 'undefined') {
	gotoMapPosition = gotoMapPosition.createInterceptor( function(doc, c, z) {
		if (doc.name == 'gmap_10' && z >= 1) {
			z--;
		};
		doc.map.setCenter(c, z);
		return (false);
	});
};
