function submitForm(form)
{
	form.submit(); disableButtons(form);
}

function disableButtons(form)
{
	if (!form) return false;
	for (var index = 0; index < form.elements.length; index++) form.elements[index].disabled = true;
}

/***************************************************/
function MainNaviInit() {
    if (document.getElementById) {
        var NavContainer = document.getElementById("NaviChannel");
        var Navis = NavContainer.getElementsByTagName('ul');
        for (var i in Navis) {
            var ul = Navis[i];
            // wenn 2. Ebene, ...
            if (ul.nodeName == 'UL' && ul.className == 'NaviLevel1') {
                var NavItems = NavContainer.getElementsByTagName('li');
                for (var j in NavItems) {
                    var li = NavItems[j];
                    //...dann 3. Ebene einblenden, falls vorhanden
                    if (li.nodeName == 'LI' && li.className.indexOf('NaviSubNavigation') > -1) {
                        li.onmouseover = function() {
                            if (this.getElementsByTagName('ul')[0] && this.getElementsByTagName('ul')[0].style) this.getElementsByTagName('ul')[0].style.display = "block";
                        }
                        li.onmouseout = function() {
                            if (this.getElementsByTagName('ul')[0] && this.getElementsByTagName('ul')[0].style) this.getElementsByTagName('ul')[0].style.display = "none";
                        }
                    }
                }
            }
        }
    }
}

function LetterNaviInit() {
    var HIGHLIGHT_COLOR = '#F2BE55';
    if (document.getElementById) {
        var NavContainer = document.getElementById("letterNavi");
        var Navis = NavContainer.getElementsByTagName('td');
        for (var i in Navis) {
            var td = Navis[i];
            if (td.nodeName == 'TD' && td.style && td.style.backgroundColor.toLowerCase() != HIGHLIGHT_COLOR.toLowerCase() ) {
                td.onmouseover = function() {
                    if (this.style) {
                        this.style.cursor = 'pointer';
                        this.style.backgroundColor = '#FFFFFF';
                    }
                }
                td.onmouseout = function() {
                    if (this.style) {
                        this.style.cursor = 'normal';
                        this.style.backgroundColor = '#F7E07F';
                    }
                }
                td.onmousedown = function() {
                    if (this.getElementsByTagName && this.getElementsByTagName('a')) {
                        this.getElementsByTagName('a')[0].click();
                    }
                }
            }
        }
    }
}

function LatinNaviInit() {
    if (document.getElementById) {
        var LatinWindowButton = document.getElementById('LatinWinBut');
        LatinWindowButton.onmouseover = function() {
           if (document.getElementById('LatinWindow') && document.getElementById('LatinWindow').style)
              document.getElementById('LatinWindow').style.display = 'block';
        };
        LatinWindowButton.onmouseout = function() {
           if (document.getElementById('LatinWindow') && document.getElementById('LatinWindow').style)
              document.getElementById('LatinWindow').style.display = 'none';
        }
    }
}

/***************************************************/
function setPointer(theRow, theAction /* [over|out] */, theNewColor)
{
    if (typeof(document.getElementsByTagName) == 'undefined') { return false; }
    if (typeof(theRow.style) == 'undefined')  { return false; }

    if (theAction == 'over') {
        theRow.style.cursor='pointer';
    } else {
        theRow.style.cursor='normal';
    }

    var theCells = theRow.getElementsByTagName('td');
    var rowCellsCnt  = theCells.length;

    if (rowCellsCnt > 0) {
        for (c = 0; c < rowCellsCnt; c++) {
            if (theCells[c].style) {
                theCells[c].style.backgroundColor = theNewColor;
            }
        }
    }
    return true;
}

/***************************************************/
function setBackground(theRow, theNewColor)
{
    if (typeof(document.getElementsByTagName) == 'undefined') { return false; }
    if (typeof(theRow.style) == 'undefined')  { return false; }

    var theCells = theRow.getElementsByTagName('td');
    var rowCellsCnt  = theCells.length;

    if (rowCellsCnt > 0) {
        for (c = 0; c < rowCellsCnt; c++) {
            if (theCells[c].style) {
                theCells[c].style.backgroundColor = theNewColor;
            }
        }
    }
    return true;
}

/********************************************************/
function clickLine(theRow)
{
    var theCells = null;
    if (typeof(document.getElementsByTagName) == 'undefined') { return false; }
    theCells = theRow.getElementsByTagName('td');
    // ersten Link in erstem td anklicken
    if (theCells[0] && theCells[0].getElementsByTagName('a')[0]) {
        theCells[0].getElementsByTagName('a')[0].click();
    }
    // Im Firefox funktioniert this.getElemetsByTagName nicht.
    // könnte man umgehen durch:
    //     theRow.childNodes[0]/* td */.childNodes[0]/* a */.click();
    // nützt aber nichts, weil click() bei Gecko-DOM nur für INPUT-Elemente funktioniert,
    // nicht aber für A-Elemente
}


