
// Lädt Bilder im Hintergrund vor; z.B.:
// <body onload="PreloadImages('img/dashotel2.jpg','img/zimmer2.jpg','img/buchung2.jpg')">
function PreloadImages() {
    var d = document; if (d.images) {
        if (!d.MM_p) d.MM_p = new Array();
        var i, j = d.MM_p.length, a = PreloadImages.arguments; for (i = 0; i < a.length; i++)
            if (a[i].indexOf("#") != 0) { d.MM_p[j] = new Image; d.MM_p[j++].src = a[i]; }
    }
}

//
function FindObject(n, d) {
    var p, i, x; if (!d) d = document; if ((p = n.indexOf("?")) > 0 && parent.frames.length) {
        d = parent.frames[n.substring(p + 1)].document; n = n.substring(0, p);
    }
    if (!(x = d[n]) && d.all) x = d.all[n]; for (i = 0; !x && i < d.forms.length; i++) x = d.forms[i][n];
    for (i = 0; !x && d.layers && i < d.layers.length; i++) x = FindObject(n, d.layers[i].document);
    if (!x && document.getElementById) x = document.getElementById(n); return x;
}

//
function SwapImage() {
    var i, j = 0, x, a = SwapImage.arguments;
    document.MM_sr = new Array;
    for (i = 0; i < (a.length - 2); i += 3)
        if ((x = FindObject(a[i])) != null) { 
           document.MM_sr[j++] = x; if (!x.oSrc) x.oSrc = x.src; x.src = a[i + 2]; }
    }

//
function SwapImageRestore() {
    var i, x, a = document.MM_sr;
    for (i = 0; a && i < a.length && (x = a[i]) && x.oSrc; i++)
        x.src = x.oSrc;
}

// Öffnet ein neues Fenster (http://molily.de/javascript-popups):
// <body onload="OpenWindow('xmas.htm','fenster1','width=413,height=236')">
// <a href="../common/apartmenthaus.htm" target="_blank" onclick="OpenWindow(this.href,'apartment','width=362,height=300,scrollbars=no,menubar=no,toolbar=no,resizable=no,status=no'); return false;"><img src="img/apartmenthaus_s.jpg" width="132" height="120" border="0" alt="Apartmenthaus" /></a>
function OpenWindow(url, name, features) {
    fenster = window.open(url, name, features);
    fenster.focus();
}

// Öffnet ein neues Fenster + X-Pixel-Rand
function OpenWindowX(url, name, breite, hoehe) {
    breite_popup = breite + 20;
    hoehe_popup = hoehe + 20;
    features = 'left=' + 0 + ',top=' + 0 + ',width=' + breite_popup + ',height=' + hoehe_popup + ',scrollbars=no,menubar=no,toolbar=no,resizable=yes,status=no';
    fenster = window.open(url, name, features);
    fenster.focus();
}

// Map24 (anfahrt.htm)
function Map24_removeDefaultValues(){
    if (document.link2map24.s.value == 'Adresse') document.link2map24.s.value = '';
}

// Funktion um die aktuelle Seite in den Favoriten zu speichern...
function addToFavorites(url) {
    if (navigator.appName != 'Microsoft Internet Explorer') {
        window.external.addPanel('Hotel ALFA Neu-Isenburg', url, '');
    } else {
        window.external.addFavorite(url, 'Hotel ALFA Neu-Isenburg');
    }
}
