if(top.frames.length > 0) top.location.href=self.location;

function Browser()
{
    if(((parseInt(navigator.appVersion) >= 3)) && ((navigator.appName.indexOf("Netscape") >= 0))
    || ((parseInt(navigator.appVersion) >= 4)) && ((navigator.appName.indexOf("Microsoft") >= 0))
    || ((parseInt(navigator.appVersion) >= 4)) && ((navigator.appName.indexOf("Opera") >= 0)))
    {
        return true;
    }
}

function BW(BildID, Bildobjekt)
{
    if(Browser())
    {
        window.document.images[BildID].src = eval(Bildobjekt + ".src");
    }
    return true;
}

function OpenWindow(datei, breite, hoehe)
{
    new_window = window.open(datei, 'PopUp', 'width='+breite+',height='+hoehe+',resizable=yes,menubar=no,scrollbars=no,toolbar=no,locationbar=no,screenx=20,screeny=20,top=20,left=20,status=no,innerwidth=0,innerheight=0');
    new_window.resizeTo(breite, hoehe);
    new_window.focus();
}

function ImagePopup(datei, breite, hoehe)
{
    popup = window.open('', 'Zoom', 'width='+breite+',height='+hoehe+',resizable=no,menubar=no,scrollbars=no,toolbar=no,locationbar=no,screenx=20,screeny=20,top=20,left=20,status=no,innerwidth=0,innerheight=0');
    popup.document.open();
    with(popup.document)
    {
        write('<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">');
        write('<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="de" lang="de">');
        write('<head>');
        write('<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />');
        write('<title>Image Zoom</title>');
        write('</head>');
        write('<body bgcolor="#000000" style="margin:0px;padding:0px;border:0px;text-align:center;" onclick="self.close();" onblur="self.close();">');
        write('<img src="' + datei + '" width="' + breite + '" height="' + hoehe + '" border="0" style="margin:0px;padding:0px;border:0px;" alt="" name="ImageZoom" id="ImageZoom" onclick="self.close();" />');
        write('</body>');
        write('</html>');
    }
    popup.document.close();
    popup.focus();
}

function FO(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=FO(n,d.layers[i].document);
    if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function SH()
{
    var i, p, v, obj, args=SH.arguments;
    for(i = 0; i < (args.length - 2); i += 3)
    {
        if((obj = FO(args[i])) != null)
        {
            v = args[i + 2];
            if(obj.style)
            {
                obj = obj.style;
                v = (v == 'show') ? 'visible' : (v == 'hide') ? 'hidden' : v;
            }
            obj.visibility = v;
        }
    }
}

function SH2()
{
    var i, p, v, obj, args=SH2.arguments;
    for(i = 0; i < (args.length - 2); i += 3)
    {
        if((obj = FO(args[i])) != null)
        {
            v = args[i + 2];
            if(obj.style)
            {
                obj = obj.style;
                v = (v == 'show') ? 'block' : (v == 'hide') ? 'none' : v;
            }
            obj.display = v;
        }
    }
}

function Toggle()
{
    var i, obj, show_hide, toggle_values, C_Toggle, C_ToggleCookie, args=Toggle.arguments;
    var max_args = args.length;
    if(max_args != null && max_args > 0)
    {
        if(args[1] != "" && args[1] != null)
        {
            show_hide = args[1];
        }
        else
        {
            show_hide = FO(args[0]).style.display;

            if(show_hide == "none") show_hide = "block";
            else if(show_hide == "block") show_hide = "none";
            else show_hide = "none";
        }

        if((obj = FO(args[0])) != null)
        {
            obj.style.display = show_hide;
            if((objtog = FO(args[0] + '-toggle')) != null)
            {
                objtog.value = show_hide;
            }
        }

        for(i = 1; i < (max_args); i++)
        {
            if((obj = FO(args[i])) != null)
            {
                show_hide = obj.style.display;
                obj.style.display = "none";
                if((objtog = FO(args[0] + '-toggle')) != null)
                {
                    objtog.value = show_hide;
                }
            }
        }

        for(i = 0; i < (max_args); i++)
        {
            if((obj = FO(args[i])) != null)
            {
                toggle_values = toggle_values + "'" + args[i] + "',";
            }
            else
            {
                toggle_values = "";
            }
        }
        if(toggle_values != "") toggle_values = toggle_values.substring(0,(toggle_values.length - 1));
        if((obj = FO('toggle')) != null) obj.value = toggle_values;
    }
/*
    var uls = FO('main-menu').getElementsByTagName('ul');
    for(i = 0; i < uls.length; i++)
    {
        if(args[0] != uls[i])
        {
            SH2(uls[i],'','hide');
        }
    }
*/
    return true;
}

function ClearField()
{
    var obj, args=ClearField.arguments;
    if((obj = FO(args[0])) != null)
    {
        if(obj.value == args[1]) obj.value = '';
    }
    return true;
}
