if (typeof Ext != 'undefined') {
    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;
            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);
                            Ext.MessageBox.getDialog().center();
                            if (Ext.MessageBox.getDialog().size.height > 500) {
                                Ext.get("blubber").dom.style.height = "470px";
                                Ext.MessageBox.getDialog().resizeTo(conf_width, 500);
                            } else {
                                Ext.MessageBox.getDialog().resizeTo(conf_width, Ext.MessageBox.getDialog().size.height);
                            }
                            // Ext.MessageBox.getDialog().resizeTo(conf_width,conf_height);
                        }
                    }
                });
                return (false);
            }
        });
    });
};
var showPopup = function(lnk) {
    var conf_title = 'Weitere Informationen';
    var conf_modal = true;
    var conf_width = 640;
    var conf_height = 320;
    var conf_display_header = false;
    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...',
        modal : conf_modal,
        fn : function() {
            Ext.MessageBox.hide();
        }
    });
    Ext.Ajax.request({
        url : lnk,
        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);
                Ext.MessageBox.getDialog().center();
                if (Ext.MessageBox.getDialog().size.height > 500) {
                    Ext.get("blubber").dom.style.height = "420px";
                    Ext.MessageBox.getDialog().resizeTo(conf_width, 500);
                } else {
                    Ext.MessageBox.getDialog().resizeTo(conf_width, Ext.MessageBox.getDialog().size.height);
                }
                var els = Ext.get('fieldsbschwp');
                if (els) {
                    var i = els.select('img');
                    var c = i.getCount();
                    var n = 0;
                    i.each(function(e) {
                        if (e.dom.src.match(/no.gif/)) {
                            e.dom.parentNode.style.display = 'none';
                            n++;
                        }
                    });
                    if (n == c) {
                        els.dom.style.display = 'none';
                    }
                }
            }
        }
    });
};
if (typeof Ext != 'undefined') {
    var task = new Ext.util.DelayedTask();
    function showWebcam(lnk) {
        var jetzt = new Date();
        var Zeit = jetzt.getTime();
        var link = Ext.get(lnk);
        var url = "/webcam/www/bad/camera/bildbrk.jpg?" + Zeit;
        if (!Ext.MessageBox.getDialog().isVisible()) {
            Ext.MessageBox.show({
                title : 'Webcam Bad Brückenau - alle 60 Sekunden aktualisiert',
                msg : 'Loading',
                modal : false,
                width : 640,
                height : 480,
                animEl : link,
                fn : function() {
                    Ext.MessageBox.hide();
                    task.cancel();
                }
            });
        };
        var pic = Ext.get('webcampic');
        if (pic) {
            Ext.get('webcamcontainer').mask('Loading...');
            pic.on('load', function() {
                Ext.get('webcamcontainer').unmask();
            });
            pic.dom.src = url;
        } else {
            var txt = '<div id="webcamcontainer" style="width:640; height:480px;"><img id="webcampic" src="' + url + '" /></div>';
            Ext.MessageBox.updateText(txt);
            Ext.MessageBox.getDialog().center();
            Ext.MessageBox.getDialog().resizeTo(670, 540);
        }
        task.delay(60000, showWebcam, this, [
            lnk
        ]);
    };
};
/** ************ EVENTS ************* */
if (typeof Ext != 'undefined') {
    Ext.onReady(function() {
        var extlink2 = Ext.select('.extlink2');
        extlink2.each(function(el) {
            var lnk = el.dom;
            lnk.onclick = function() {
                /** * rausnehmen wenn die anderen nicht zu gehen sollen ** */
                var allcontainers = Ext.select('.evdetailcontainer');
                allcontainers.each(function(el) {
                    elSlideOut = Ext.get(el);
                    elSlideOut.slideOut('t', {
                        easing : 'easeOut',
                        duration : .5,
                        remove : false,
                        useDisplay : true
                    });
                });
                /** ******************************************************* */
                var idof = lnk.id.split("_");
                var container = 'detailcontainer' + idof[1];
                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];
                            var elSlideIn = Ext.get(container);
                            elSlideIn.dom.innerHTML = txt;
                            elSlideIn.slideIn('t', {
                                easing : 'easeIn',
                                duration : .5,
                                remove : false,
                                useDisplay : true
                            });
                        }
                    }
                });
                return false
            };
        });
    });
}
/** ********************************** */
runOnLoad(function() {
    var artikeluebersichtstartseite1bis4 = Ext.select('.artikeluebersichtstartseite1bis4');
    var h = 0;
    artikeluebersichtstartseite1bis4.each(function(el) {
        if (h < el.getHeight()) {
            h = el.getHeight();
        };
    });
    artikeluebersichtstartseite1bis4.each(function(el) {
        el.setHeight(h + 20);
    });
});
if (document.location.pathname == '/de/gastgeber/gastgeberverzeichnis/index.html' || document.location.pathname == '/de/gastgeber/gastgeberverzeichnis/' || document.location.pathname == '/de/gastgeber/gastgeberverzeichnis/17.Gastgeber_im_Staatsbad_Bad_Brueckenau.html') {
    document.write('<scr' + 'ipt type="text/javascript" src="/_/scripts/libs/src/googlemaps.js"></scr' + 'ipt>');
    document.write('<scr' + 'ipt type="text/javascript" src="/__/scripts/map.js"></scr' + 'ipt>');
}
