if (typeof (iframe) == 'undefined')
    var iframe = false;

if (typeof (wmk_top) == 'undefined')
    var wmk_top = 20;

var wmk_heiss_x_fix = (typeof (wmk_heiss_x) != 'undefined');
if (!wmk_heiss_x_fix)
    var wmk_heiss_x = ((typeof (innerWidth) == 'number') ? innerWidth : document.body.offsetWidth) - 144;

var wmk_Verteiler_heiss_x_fix = (typeof (wmk_Verteiler_heiss_x) != 'undefined');
if (!wmk_Verteiler_heiss_x_fix)
    var wmk_Verteiler_heiss_x = ((typeof (innerWidth) == 'number') ? innerWidth : document.body.offsetWidth) - 170;

if (typeof (wmk_heiss_y) == 'undefined')
    var wmk_heiss_y = 50;

var wmk_Verteiler_heiss_y_fix = (typeof (wmk_Verteiler_heiss_y) != 'undefined');
if (!wmk_Verteiler_heiss_y_fix)
    var wmk_Verteiler_heiss_y = ((typeof (innerHeight) == 'number') ? innerHeight : document.body.offsetHeight) 
                                - ((typeof (xtop.Bereich) == 'undefined' 
                                        || xtop.Bereich.substr (0, 4) != 'Navi' 
                                        || xtop.Bereich.indexOf ('&uuml;') != -1) 
                                ? 100 : 76);

var wmk_Verteiler_top_fix = (typeof (wmk_Verteiler_top) != 'undefined');
if (!wmk_Verteiler_top_fix)
    var wmk_Verteiler_top = wmk_Verteiler_heiss_y + 5;

var wmk_left_fix = (typeof (wmk_left) != 'undefined');
if (!wmk_left_fix)
    var wmk_left = wmk_heiss_x + 20;

var wmk_Verteiler_left_fix = (typeof (wmk_Verteiler_left) != 'undefined');
if (!wmk_Verteiler_left_fix)
    var wmk_Verteiler_left = wmk_Verteiler_heiss_x + 15;


if (typeof (wmk_Ziel) == 'undefined')
    if (location.href.indexOf ('/geier/baby/') == -1 
                && location.href.indexOf ('/club/') == -1
                && (location.href.indexOf ('/schnupper/') == -1 || location.href.indexOf ('/schnupper/index.html') != -1))
        var wmk_Ziel = '../homepage/webmap.htm'
    else
        var wmk_Ziel = '../../homepage/webmap.htm';

var wmk_Basis = wmk_Ziel.slice (0, wmk_Ziel.indexOf ('homepage'))

if (typeof (wmk_no_Palette) == 'undefined')
    var wmk_no_Palette = false;

if (typeof (wmk_no_wmk) == 'undefined')
    var wmk_no_wmk = false;




function wmk_webmap ()
{
if (xtop.total)
    xtop.total.location.href = wmk_Ziel
else
    location.href = wmk_Ziel;
}





function wmk_in_Geier ()
{
return (location.href.indexOf ('/geier/') != -1);
}





function wmk_in_Bereich (Bereich)
{
if (wmk_in_Geier ())
    return false;

return (xtop.Bereich == Bereich);
}





function wmk_Geier ()
{
if (!xtop.total)
    {
    location.href = 'abschweb.html?geier/baby/intro.htm';
    return;
    }

if (typeof (GeierEbene) == 'function')
    GeierEbene ()
else
    {
    for (var i = 0; i < parent.frames.length; i++)
        if (typeof (parent.frames [i].GeierEbene) == 'function')
            {
            parent.frames [i].GeierEbene ();
            return;
            }

    if (typeof (parent.GeierEbene) == 'function')
        parent.GeierEbene ();
    }
}





function wmk_vorTagebuch (Datei)
{
return (Datei.substr (4, 1) == '9' || Datei == '020100.htm')
}





function wmk_Index ()
{
var Ziel = wmk_Basis + 'index/index.html';

if (xtop.total)
    xtop.total.location.href = Ziel
else
    location.href = Ziel;
}






function wmk_Region ()
{
var Ziel = wmk_Basis + 'region/index.html';
xtop.Region_direkt = true;

if (xtop.total)
    xtop.total.location.href = Ziel
else
    location.href = Ziel;
}






function wmk_fleunde ()
{
var Ziel = wmk_Basis + 'fleunde/index.html';

if (xtop.total)
    xtop.total.location.href = Ziel
else
    location.href = Ziel;
}







function wmk_rueck ()
{
var hier = location.href.split ('/');
//alert (location.href + '  ' + hier.length);
var Anzahl = hier.length - ((location.href.substr (0, 4) == 'http') ? 4 : 7);

var Rueck = '';
for (var i = 0; i < Anzahl; i++)
    Rueck += '../';

return Rueck;
}






function wmk_Musik ()
{
var Ziel = wmk_Basis + 'musik/index.html';

if (xtop.total)
    xtop.total.location.href = Ziel
else
    location.href = Ziel;
}







function wmk_Tagebuch ()
{
var Ziel = wmk_Basis + 'tagebuch/index.html';

if (xtop.total)
    xtop.total.location.href = Ziel
else
    location.href = Ziel;
}







function wmk_Schnupper ()
{
var Ziel = wmk_Basis + 'schnupper/index.html';

if (xtop.total)
    xtop.total.location.href = Ziel
else
    location.href = Ziel;
}






function wmk_aus ()
{
wmk_no_Palette = true;
document.getElementById ('VerteilerPalette').style.visibility = 'hidden';
}





function wmk_checkMaus (e)
{ 
if (navigator.appName.indexOf ("Microsoft") == -1)
    { 
    Maus_x = e.pageX;
    Maus_y = e.pageY;

    rel_x = e.screenX;
    rel_y = e.screenY - 100;
    }
else
    { 
    Maus_x = event.clientX + document.body.scrollLeft;
    Maus_y = event.clientY + document.body.scrollTop;

    rel_x = event.clientX;
    rel_y = event.clientY;
    }

scroll_x = Maus_x - rel_x;
scroll_y = Maus_y - rel_y;


if (!wmk_heiss_x_fix)
    var wmk_heiss_x = ((typeof (innerWidth) == 'number') ? innerWidth : document.body.offsetWidth) - 144;

if (!wmk_Verteiler_heiss_x_fix)
    var wmk_Verteiler_heiss_x = ((typeof (innerWidth) == 'number') ? innerWidth : document.body.offsetWidth) - 170;

if (!wmk_Verteiler_heiss_y_fix)
    var wmk_Verteiler_heiss_y = ((typeof (innerHeight) == 'number') ? innerHeight : document.body.offsetHeight) 
                                - ((typeof (xtop.Bereich) == 'undefined' 
                                        || xtop.Bereich.substr (0, 4) != 'Navi' 
                                        || xtop.Bereich.indexOf ('&uuml;') != -1) 
                                ? 100 : 76);

if (!wmk_Verteiler_top_fix)
    var wmk_Verteiler_top = wmk_Verteiler_heiss_y + 5;

if (!wmk_left_fix)
    var wmk_left = wmk_heiss_x + 20;

if (!wmk_Verteiler_left_fix)
    var wmk_Verteiler_left = wmk_Verteiler_heiss_x + 15;


with (document)
    {
    if (!wmk_no_wmk)
        if (rel_y < wmk_heiss_y && rel_x > wmk_heiss_x)
            {
            getElementById ('wmk').style.top = scroll_y + wmk_top + 'px';
            getElementById ('wmk').style.left = scroll_x + wmk_left + 'px';
            getElementById ('wmk').style.visibility = 'visible';
            }
        else
            getElementById ('wmk').style.visibility = 'hidden';

    if (!wmk_no_Palette)
        if (xtop.oftPalette && rel_y > wmk_Verteiler_heiss_y && rel_x > wmk_Verteiler_heiss_x)
            {
            getElementById ('VerteilerPalette').style.top = scroll_y + wmk_Verteiler_top + 'px';
            getElementById ('VerteilerPalette').style.left = scroll_x + wmk_Verteiler_left + 'px';
            getElementById ('VerteilerPalette').style.visibility = 'visible';
            }
        else
            getElementById ('VerteilerPalette').style.visibility = 'hidden';
    }


//status = 'x = ' + Maus_x + '   y = ' + Maus_y + '    rel_x = ' + rel_x + '   rel_y = ' + rel_y;


if (wmk_onMouseMove != null)
    wmk_onMouseMove ();
}





function wmk_InitMaus ()
{
if (wmk_onLoad != null)
    wmk_onLoad ();

wmk_onMouseMove = document.onmousemove;
document.onmousemove = wmk_checkMaus;
}








function wmk_Init ()
{
wmk_InitMaus ();
}




var wmk_onMouseMove;
var wmk_onLoad = window.onload;
window.onload = wmk_Init;






with (document)
    {
    if (!wmk_no_wmk)
        {
        write ('<div id="wmk" style="position:absolute; left:');
        write (wmk_left + 'px; top:');
        write (wmk_top + 'px; visibility:hidden; z-index:30">');
        write ('<button style="cursor:pointer" onClick="wmk_webmap ()">web map</button>');
        write ('</div>');
        }

    if (!wmk_no_Palette)
        {
        write ('<div id="VerteilerPalette" style="position:absolute; left:');
        write ((wmk_left - 36) + 'px; top:');
        write ('538px; width:115px; white-space:nowrap; visibility:hidden; z-index:30">');

        write ('<div style="position:absolute; top:0px; left:0px">');

        if (!wmk_in_Geier())
            write ('<button style="cursor:pointer; width:49px" onClick="wmk_Geier ()">Geier</button>')
        else
            write ('<div style="padding-top:1px; padding-left:1px"><img src="../../grafik/geier_.gif"></div>');

        write ('</div>');


        write ('<div style="position:absolute; top:0px; left:49px">');

        if (!wmk_in_Bereich ('region'))
            write ('<button style="cursor:pointer; width:66px" onClick="wmk_Region ()">Region</button>')
        else
            write ('<div style="padding-top:1px; padding-left:1px"><img src="../grafik/region.gif"></div>');

        write ('</div>');


        write ('<div style="position:absolute; top:24px; left:0px">');

        if (!wmk_in_Bereich ('Index'))
            write ('<button style="cursor:pointer; width:49px" onClick="wmk_Index ()">Index</button>')
        else
            {
            write ('<div style="padding-top:1px; padding-left:1px">');
            write ((location.href.indexOf ('impressum') == -1) ? '<img src="../' : '<img src="');
            write ('grafik/index.gif"></div>');
            }

        write ('</div>');


        write ('<div style="position:absolute; top:24px; left:49px">');

        if (!wmk_in_Bereich ('fleunde'))
            write ('<button style="cursor:pointer; width:66px" onClick="wmk_fleunde ()">fleunde</button>')
        else
            write ('<div style="padding-top:1px; padding-left:1px"><img src="' + ((fein) ? '../../' : ((!iframe) ? '../' : '')) 
                    + '../grafik/fleunde.gif"></div>');

        write ('</div>');


        write ('<div style="position:absolute; top:48px; left:0px">');

//alert ("wmk_in_Bereich ('Tagebuch')" + wmk_in_Bereich ('Tagebuch'));
//alert (xtop.Datei);

        if (!wmk_in_Bereich ('Tagebuch') || wmk_vorTagebuch (xtop.Datei) || xtop.Datei.indexOf ('/') != -1 || xtop.Datei == 'tagebuch.htm'
                                            || (xtop.Datei == 'Uebersicht' && isNaN (vonDatei.substr (0, 6))))
            {
            write ('<button style="cursor:pointer; width:75px" onClick="wmk_Tagebuch ()">Tagebuch</button>');
            }
        else
            if (xtop.Variable == '~')
                if (xtop.Datei != 'Uebersicht')
                    write ('<button style="cursor:pointer; width:115px" onClick="wmk_Schnupper ()">Schn. Übersicht</button>')
                else
                    write ('<div style="padding-top:1px; padding-left:1px"><img src="../grafik/schnupper.gif"></div>');
            else
                if (xtop.Variable == 'club')
                    write ('<div style="padding-top:1px; padding-left:1px"><img src="../../grafik/tagebuch.gif"></div>');
                else
                    if (xtop.Variable != 'Dias')
                        write ('<div style="padding-top:1px; padding-left:1px"><img src="../grafik/tagebuch.gif"></div>')
                    else
                        write ('<div style="padding-top:1px; padding-left:1px"><img src="grafik/tagebuch.gif"></div>');
        write ('</div>');

        if (xtop.Variable != '~')
            {
            write ('<div style="position:absolute; top:48px; left:75px">');
            if (!wmk_in_Bereich ('musik'))            
                write ('<button style="cursor:pointer; width:14px" onClick="wmk_Musik ()"><IMG SRC="' + wmk_rueck () + 'grafik/note.gif"></button>')
            else
                write ('<span style="padding-left:1px; padding-top:1px"><IMG SRC="../grafik/musik.gif"></span>');

            write ('</div>');

            write ('<div id="Kreuz" style="position:absolute; top:50px; left:91px">');
            write ('<a href="javascript:wmk_aus ()">');

            var Basis = (wmk_in_Bereich ('fleunde') && fein) ? '../../../' : 
                        ((xtop.Variable == 'club' || xtop.Variable == 'archiv_alt' 
                            || xtop.Variable == 'region/region' || wmk_in_Bereich ('fleunde') && !iframe || wmk_in_Geier()) 
                        ? '../../' : 
                        ((xtop.Variable != 'Dias' && location.href.indexOf ('rutsch') == -1 && location.href.indexOf ('impressum') == -1 && 
                            location.href.indexOf ('intro') == -1  || iframe) ? '../' : ''));

            write ('<img src="' + Basis + 'geier/nopop/kreuz.gif" border=0 ');
            write ('onMouseDown="this.src = ');
            write ("'" + Basis + "geier/nopop/kreuz_.gif'");
            write ('"'); 
            write ('onMouseUp="this.src = ');
            write ("'" + Basis + "geier/nopop/kreuz.gif'");
            write ('"'); 
            write ('onMouseOut="this.src = ');
            write ("'" + Basis + "geier/nopop/kreuz.gif'");
            write ('"'); 
            write ('></a>');
            write ('</div>');
            }
        write ('</div>');
        }
    }


