var wo = null;
if (typeof (top.total) == 'undefined')
    {
    wo = location.href.slice (location.href.indexOf ('fleunde'));
    top.location.replace ('../../abschweb.html?' + wo);
    }



var TestBilder = new Array (), n = 0;





function aufblasen ()
{
if (xtop.aktuellModus == 'text')
    {
    xtop.document.getElementById ('Gott').cols = '1024,*';

    with (document)
        {
        for (var i = 0; i < images.length; i++)
            {
            var gross = images [i].src;
            gross = gross.slice (0, gross.indexOf ('-.')) + gross.slice (gross.lastIndexOf ('.'));

            TestBilder [n] = new Image ();
            TestBilder [n].src = gross;
            TestBilder [n].ok = false;
            TestBilder [n++].onload = function () { this.ok = true; };
            
            images [i].src = gross;
            images [i].removeAttribute ('width');
            images [i].removeAttribute ('height');
            }

        for (var i = 0; i < getElementsByTagName ('div').length; i++)
            with (getElementsByTagName ('div')[i])
                if (className == 'Kante')
                    {
                    with (style)
                        {
                        marginLeft = '0px';
                        width = '1003px';
                        textAlign = 'right';
//                        border = 'thin solid red';
                        }

                    with (firstChild)
{
                        if (nodeName == 'IMG')
                            with (style)
                                {
                                marginRight = '0px';
                                float = 'none';
                                }
}
                    }
        }
    }
else
    xtop.document.getElementById ('Gott').cols = '1020,*';

}




function check_geladen ()
{
var versagt = 0;

for (var i = 0; i < TestBilder.length; i++)
    if (!TestBilder [i].ok)
        versagt++;

if (versagt > 0)
    {
    Konglo = parent.Einstiegsreferenz.slice (parent.Einstiegsreferenz.lastIndexOf ('/'));
    Konglo = Konglo.slice (0, Konglo.indexOf ('.htm'));
    Konglo = TestBilder [0].src.slice (0, TestBilder [0].src.lastIndexOf ('/')) + Konglo + '.jpg';

    TestBilder [n] = new Image ();
    TestBilder [n].src = Konglo;
    TestBilder [n].ok = false;
    TestBilder [n].onload = function () { this.ok = true; };

    setTimeout ("check_geladen_2 ()", 500);
    }
}





function check_geladen_2 ()
{
var versagt = 0;

for (var i = 0; i < document.images.length; i++)
    if (!TestBilder [i].ok)
        versagt++;

if (versagt > 0)
    if (TestBilder [n].ok)
        {
        var erst = true;
        for (i = 0; i < document.images.length; i++)
            {
            if (!TestBilder [i].ok)
                if (erst)
                    { 
                    document.images [i].src = TestBilder [n].src;
                    erst = false;
                    }
                else
                    document.images [i].style.display = 'none';
            }
        }
    else
        setTimeout ("check_geladen_2 ()", 500);
}





function Init ()
{
parent.geladen = true;
aufblasen ();
}




top.Datei = location.href.slice (location.href.lastIndexOf ('/', location.href.lastIndexOf ('/') - 1) + 1);
    

if (wo == null)
    if (!(top.aktuellModus == 'spar' || top.aktuellModus == 'text'))
        {
        top.total.location.replace ('../fein/' + top.Datei);
        }
    else
        {
        if (window.name != "Inhalt")
            top.total.location.replace ('../fleunde.htm?' + top.Datei)
        else
            {
            top.document.title = document.title;
            }

        window.onload = Init;
        }



