﻿

function ob_OnNodeSelect(id) {
    var vtitel
    if (ob_ev("OnNodeSelect")) {
        if (typeof ob_post == "object") {
            if (document.getElementById(id).parentNode.parentNode.firstChild.firstChild.className != "ob_t8") {
                // Tree Menu oder andere
                if (ob_t2_Data[id].NodeMenu == "M") {
                    document.getElementById('ctl00_ParamSpr').value = ob_t2_Data[id].NodeSpr;
                }
                else {
                    // Detail ausblenden
                    GridHidden()
                    if (ob_t2_Data[id].NodeKeyId != "") {
                        // Parameter
                        document.getElementById('ctl00_cphShoot_ParamID').value = id.replace("oCont_", "");
                        document.getElementById('ctl00_cphShoot_ParamNodeKey').value = ob_t2_Data[id].NodeKey;
                        document.getElementById('ctl00_cphShoot_ParamNodeKeyID').value = ob_t2_Data[id].NodeKeyId;  
                        // Stich Resultat einblenden
                        if (ob_t2_Data[id].NodeKey == "res") {
                            // Parameter Resultat
                            document.getElementById('ctl00_cphShoot_ParamWebTyp').value = 'RES'; 
                            // Titel Text
                            vtitel = ob_t2_Data[id].NodeResTyp + ' ' + ob_t2_Data[id].NodeResDiszi + '<br />' + ob_t2_Data[id].NodeResTitel
                            TitelResultat(vtitel)
                            // Titel zwischenspeichern
                            document.getElementById('ctl00_cphShoot_ParamResTitelZeile1').value = ob_t2_Data[id].NodeResTyp + ' ' + ob_t2_Data[id].NodeResDiszi;
                            document.getElementById('ctl00_cphShoot_ParamResTitelZeile2').value = ob_t2_Data[id].NodeResTitel;
                            // Titel einblenden
                            LabelTitelVisible()
                            // Grid einblenden
                            GridStiResVisible()
                            ogResultat.refresh()
                        }
                        // Teamwettkampf Resultate einblenden
                        if (ob_t2_Data[id].NodeKey == "tmw") {
                            // Parameter Resultat
                            document.getElementById('ctl00_cphShoot_ParamWebTyp').value = 'RES'; 
                            // Titel Text
                            vtitel = ob_t2_Data[id].NodeResTyp + ' ' + ob_t2_Data[id].NodeResDiszi + '<br />' + ob_t2_Data[id].NodeResTitel
                            TitelResultat(vtitel)
                            // Titel zwischenspeichern
                            document.getElementById('ctl00_cphShoot_ParamResTitelZeile1').value = ob_t2_Data[id].NodeResTyp + ' ' + ob_t2_Data[id].NodeResDiszi;
                            document.getElementById('ctl00_cphShoot_ParamResTitelZeile2').value = ob_t2_Data[id].NodeResTitel;
                            // Titel einblenden
                            LabelTitelVisible()
                            // Grid einblenden
                            GridTeamWkResVisible()
                            ogTeamWk.refresh()
                        }
                        // Vereinswettkampf Resultate einblenden
                        if (ob_t2_Data[id].NodeKey == "vw") {
                            // Parameter Resultat
                            document.getElementById('ctl00_cphShoot_ParamWebTyp').value = 'RES'; 
                            // Titel Text
                            vtitel = ob_t2_Data[id].NodeResTyp + ' ' + ob_t2_Data[id].NodeResDiszi + '<br />' + ob_t2_Data[id].NodeResTitel
                            TitelResultat(vtitel)
                            // Titel zwischenspeichern
                            document.getElementById('ctl00_cphShoot_ParamResTitelZeile1').value = ob_t2_Data[id].NodeResTyp + ' ' + ob_t2_Data[id].NodeResDiszi;
                            document.getElementById('ctl00_cphShoot_ParamResTitelZeile2').value = ob_t2_Data[id].NodeResTitel;
                            // Titel einblenden
                            LabelTitelVisible()
                            // Grid einblenden
                            GridVereinWkResVisible()
                            ogVereinWk.refresh()
                        }
                        // Festsieger Resultate einblenden
                        if (ob_t2_Data[id].NodeKey == "fsw") {
                            // Parameter Resultat
                            document.getElementById('ctl00_cphShoot_ParamWebTyp').value = 'RES'; 
                            // Titel Text
                            vtitel = ob_t2_Data[id].NodeResTyp + ' ' + ob_t2_Data[id].NodeResDiszi + '<br />' + ob_t2_Data[id].NodeResTitel
                            TitelResultat(vtitel)
                            // Titel zwischenspeichern
                            document.getElementById('ctl00_cphShoot_ParamResTitelZeile1').value = ob_t2_Data[id].NodeResTyp + ' ' + ob_t2_Data[id].NodeResDiszi;
                            document.getElementById('ctl00_cphShoot_ParamResTitelZeile2').value = ob_t2_Data[id].NodeResTitel;
                            // Titel einblenden
                            LabelTitelVisible()
                            // Grid einblenden
                            GridFestsiegerResVisible()
                            ogFestsieger.refresh()                     
                        }
                        // Spezialwettkämpfe Resultat einblenden
                        if (ob_t2_Data[id].NodeKey == "resspez") {
                            // Parameter Resultat
                            document.getElementById('ctl00_cphShoot_ParamWebTyp').value = 'RES';
                            // Titel Text
                            vtitel = ob_t2_Data[id].NodeResTyp + ' ' + ob_t2_Data[id].NodeResDiszi + '<br />' + ob_t2_Data[id].NodeResTitel
                            TitelResultat(vtitel)
                            // Titel zwischenspeichern
                            document.getElementById('ctl00_cphShoot_ParamResTitelZeile1').value = ob_t2_Data[id].NodeResTyp + ' ' + ob_t2_Data[id].NodeResDiszi;
                            document.getElementById('ctl00_cphShoot_ParamResTitelZeile2').value = ob_t2_Data[id].NodeResTitel;
                            // Titel einblenden
                            LabelTitelVisible()
                            // Grid einblenden
                            GridSpWkResVisible()
                            ogSpWkRes.refresh()

                        }
                        // Spezialwettkämpfe Teamwettkampf einblenden
                        if (ob_t2_Data[id].NodeKey == "tmwspez") {
                            // Parameter Resultat
                            document.getElementById('ctl00_cphShoot_ParamWebTyp').value = 'RES';
                            // Titel Text
                            vtitel = ob_t2_Data[id].NodeResTyp + ' ' + ob_t2_Data[id].NodeResDiszi + '<br />' + ob_t2_Data[id].NodeResTitel
                            TitelResultat(vtitel)
                            // Titel zwischenspeichern
                            document.getElementById('ctl00_cphShoot_ParamResTitelZeile1').value = ob_t2_Data[id].NodeResTyp + ' ' + ob_t2_Data[id].NodeResDiszi;
                            document.getElementById('ctl00_cphShoot_ParamResTitelZeile2').value = ob_t2_Data[id].NodeResTitel;
                            // Titel einblenden
                            LabelTitelVisible()
                            // Grid einblenden
                            GridSpWkTeamWkVisible()
                            ogSpWkTmWk.refresh()
                        }
                        // Spezialwettkämpfe Vereinswettkampf einblenden
                        if (ob_t2_Data[id].NodeKey == "vwspez") {
                            // Parameter Resultat
                            document.getElementById('ctl00_cphShoot_ParamWebTyp').value = 'RES';
                            // Titel Text
                            vtitel = ob_t2_Data[id].NodeResTyp + ' ' + ob_t2_Data[id].NodeResDiszi + '<br />' + ob_t2_Data[id].NodeResTitel
                            TitelResultat(vtitel)
                            // Titel zwischenspeichern
                            document.getElementById('ctl00_cphShoot_ParamResTitelZeile1').value = ob_t2_Data[id].NodeResTyp + ' ' + ob_t2_Data[id].NodeResDiszi;
                            document.getElementById('ctl00_cphShoot_ParamResTitelZeile2').value = ob_t2_Data[id].NodeResTitel;
                            // Titel einblenden
                            LabelTitelVisible()
                            // Grid einblenden
                            GridSpWkVereinWkVisible()
                            ogSpWkVeWk.refresh()                        
                        }                             
                        // Statistik einblenden
                        if (ob_t2_Data[id].NodeKey == "stat") {
                            // Paramter Statistik
                            document.getElementById('ctl00_cphShoot_ParamWebTyp').value = 'STAT';
                            // Titel
                            vtitel = ""
                            TitelResultat(vtitel)
                            // Titel zwischenspeichern
                            document.getElementById('ctl00_cphShoot_ParamResTitelZeile1').value = vtitel;
                            document.getElementById('ctl00_cphShoot_ParamResTitelZeile2').value = vtitel;
                            // Titel einblenden
                            LabelTitelVisible()
                            // Grid einblenden
                            GridStatistikVisible()
                            ogStatistik.refresh()
                        }
                    }
                    else {
                        GridNewsVisible()
                    }
                }
            }
        }
    }
}


