Subversion-Projekte lars-tiefland.content-management

Revision

Blame | Letzte Änderung | Log anzeigen | RSS feed

function reg()
{
        // Event-Handler verankern
        if (document.all)
        {       // Internet Explorer
                document.onmousedown=MouseDown
        }
        else
        {       // Opera & Netscape
                window.captureEvents(Event.MOUSEDOWN);
                window.onmousedown = MouseDown;
        }
}

// Handlerfunktion
function MouseDown()
{
        // Parameter auslesen
        if (MouseDown.arguments.length == 0)
        {       // Internet Explorer
                var button = window.event.button;
                var Source = window.event.srcElement;
        }
        else
        {       // Opera
                var button = MouseDown.arguments[0].which;
                var Source = MouseDown.arguments[0].target;
        }

        // Ziel verifizieren
        if (Source.tagName == "IMG") {Source=Source.parentNode;}
        if (Source.tagName == "DIV") 
        {
                switch(button)
                {
                        case(1):
                                        with (Source)
                                        {
                                                if (lastChild.style.display!="none") 
                                                {
                                                        // Unterverzeichnisse ausblenden
                                                        lastChild.style.display="none";
                                                        
                                                        // Falls Unterverzeichnisse existieren den Kreis in einen Pfeil ändern
                                                        if (lastChild.childNodes.length > 0)
                                                        {
                                                                firstChild.setAttribute("src","images/webelemente/pfeil.gif"); 
                                                        }
                                                }
                                                else
                                                {
                                                        lastChild.style.display="";
                                                        firstChild.setAttribute("src","images/webelemente/kreis.gif"); 
                                                }

                                                // im Frameset die SubDir-Seite laden
                                                parent.content.location.href="subdir.php?ID="+id;
                                        }
                        break;
                }
        }
}
reg();