﻿$(document).ready(function() {
    $(".thover tr:gt(0)").mouseover(function() {
        $(this).addClass('thoveron');
    });
    $(".thover tr:gt(0)").mouseout(function() {
        $(this).removeClass('thoveron');
    });
    $(".bover").mouseover(function() {
        $(this).addClass('boveron');
    });
    $(".bover").mouseout(function() {
        $(this).removeClass('boveron');
    });

    hideHiddenRows();

    // CSS DROPDOWN MENU
    $('ul.topnav li span').hover(
        function() {
            //Following events are applied to the subnav itself (moving subnav up and down)
            $(this).parent().find('ul.subnav').slideDown('fast').show(); //Drop down the subnav on click

            $(this).parent().hover(function() {
            }, function() {
                $(this).parent().find('ul.subnav').slideUp('slow'); //When the mouse hovers out of the subnav, move it back up
            });
        }, 
        function() { }
    ).hover(function() {
        $(this).addClass('subhover'); //On hover over, add class “subhover”
    }, function() { //On Hover Out
        $(this).removeClass('subhover'); //On hover out, remove class “subhover”
    });
});

function hideHiddenRows() {
    $("[id^='hiddenrow']").hide();
}

function showHiddenRow(name, num) {
    $("[id^='" + name + "" + num + "']").toggle();
}

var loadingImage = '<img src="/templates/global/images/loading_circle_small.gif" style="width:15px;height:15px;margin-left:10px;" alt="Bitte warten" />';