//var $j = jQuery.noConflict();

var FullscreenrOptions = {  width: 1900, height: 1000, bgID: '#background_bild' };
    // This will activate the full screen background!
    jQuery.fn.fullscreenr(FullscreenrOptions);

$(document).ready(function() {
    var_slide_down = 600;
    var_slide_up = 300;
    var_close_menu = 1000;

    // Aktion für teile
    $('.navigation_top_li_div').hover(
	function() {
            $(this).addClass('navigation_top_li_div_hover');
            if($(this).attr('class')!='navigation_top_li_div_active')$(this).find('a:first').addClass('top_active');
            $(this).find('a:first').removeClass('top');
              //$(this).find('.top').removeClass('blaue_farbe');
              //$(this).find('.top').addClass('weisse_farbe');
            //$(this).children('.top').attr('style','color: #ffffff;');
            $(this).children('.top_sub_navigation').show();
            //$(this).children('.top_sub_navigation').slideDown(var_slide_down);
    },
	function() {
            $(this).removeClass('navigation_top_li_div_hover');
            //$(this).find('.top').removeClass('top_active');
            //alert($(this).attr('class'));
            if($(this).attr('class')!='navigation_top_li_div navigation_top_li_div_active')$(this).find('a:first').removeClass('top_active');
            $(this).find('a:first').addClass('top');
                    //$(this).children('.navigation_top_name').removeClass('navigation_top_name_hover');
            //$(this).children('.top').attr('style','color: ;');
                //$(this).find('.top').removeClass('weisse_farbe');
                //$(this).find('.top').addClass('blaue_farbe');
            $(this).children('.top_sub_navigation').hide();
    });

    $('.top_sub_navigation li:not([class$=top_sub_navigation_super_active])').hover(
	function() {
            $(this).addClass('top_sub_navigation_active');
            $(this).removeClass('top_sub_navigation_pass');
            $(this).children('a').attr('style','color: #2c72b1;');

            //$(this).children('.top_sub_navigation').slideDown(var_slide_down);
    },
	function() {
            $(this).addClass('top_sub_navigation_pass');
            $(this).removeClass('top_sub_navigation_active');
            $(this).children('a').attr('style','color: ;');
    });


    /* VIDEOs Bearbeiten start */
        $('.video_trigger').click(function(){
            /* hide previous stream */
            $('.video_stream').hide();
            $('.video_trigger_hover').hide();
            $('.video_trigger_active').removeClass('video_trigger_active');
            /* show new stream */
            $('#'+$(this).attr('id')+'_show').fadeIn();

            $(this).addClass('video_trigger_active');

            /* create a video_trigger_hover */
            var img_h = $(this).find('img').height();
            var img_w = $(this).find('img').width();
            $(this).find('img').after("<div class=video_trigger_hover style='position: absolute; z-index: 2;'></div>");
            $(this).find('.video_trigger_hover').css('height','95px');
            $(this).find('.video_trigger_hover').css('width','165px');

        });

        $('.video_trigger').hover(
    	function() {
                if(!$(this).hasClass('video_trigger_active')) {
                    var img_h = $(this).find('img').height();
                    var img_w = $(this).find('img').width();
                    //alert(img_h);
                    //alert(img_w);
                    $(this).find('img').after("<div class=video_trigger_hover style='position: absolute; z-index: 2;'></div>");
                    $(this).find('.video_trigger_hover').css('height','95px');
                    $(this).find('.video_trigger_hover').css('width','165px');
                }
        },
    	function() {
                //$(this).addClass('top_sub_navigation_pass');
                if(!$(this).hasClass('video_trigger_active')) {
                    $(this).find('.video_trigger_hover').remove();
                }
        });

        $('.td_inhalt div[id*="ausgabe_"] input[id*="checkAll"]').click(function(){
            //alert($(this).attr('checked'));
            $('#'+$(this).parents('div').attr('id')+' input[type="checkbox"]').attr('checked',$(this).attr('checked'));
        });


        // erste einblenden
        $('.video_trigger:first').click();
    /* VIDEOs Bearbeiten ende */

    /* INDEX SUCHE start*/

        $('.b_suche_extra').hover(
            function() {
                $('#b_suche_helper').show();
            },
            function() {
                $('#b_suche_helper').hide();
            }
        );

        $('#b_suche_helper input').click(function(event){
            //alert($(this).val());

            $('.b_suche_extra').children('span').hide();
            $('#b_suche_ht_'+$(this).val()).show();
            //$(this).attr('longdesc','checked');
            $('#b_suche_helper').hide();
            //event.preventDefault();
        });

        $('.b_suche_extra').children('span').hide();
        $('#b_suche_helper input:first').click();
        //$('.b_suche_extra').children('span:first').show();

    /* INDEX SUCHE end*/

});
