jQuery(function( $ ) {
	
	$.scrollTo( 0 );

});

/* 
 * JQuery - Menü Osteuropa - Artikel 
 */

function str_replace(search, replace, subject) {
  return subject.split(search).join(replace);
}
 
function artikel_hide_all() {

    $('.artikel_kat_1_sub').hide();
    $('.artikel_kat_2_sub').hide();
    $('.artikel_kat_3_sub').hide();
    $('.artikel_kat_3_sub_1').hide();
    $('.artikel_kat_3_sub_2').hide();
    $('.artikel_kat_3_sub_3').hide();
    $('.artikel_kat_4_sub').hide();
    $('.artikel_kat_5_sub').hide();
    $('.artikel_kat_6_sub').hide();
    $('.artikel_kat_7_sub').hide();
    $('.artikel_kat_8_sub').hide();
    $('.artikel_kat_9_sub').hide();
    $('.artikel_kat_10_sub').hide();
}

function artikel_show_hier_hide_all() {

    if ($('#artikel_kat_1').hasClass('hier')) {
	$('.artikel_kat_1_sub').show();
    } else  {
	$('.artikel_kat_1_sub').hide();
    }
    if ($('#artikel_kat_2').hasClass('hier')) {
	$('.artikel_kat_2_sub').show();
    } else {
	$('.artikel_kat_2_sub').hide();
    }
    if ($('#artikel_kat_3').hasClass('hier')) {
	$('.artikel_kat_3_sub').show();
    } else {
	$('.artikel_kat_3_sub').hide();
    }
    if ($('#artikel_kat_3_sub_1').hasClass('hier')) {
	$('.artikel_kat_3_sub').show();
	$('.artikel_kat_3_sub_1').show();
    } else {
	$('.artikel_kat_3_sub_1').hide();
    }
    if ($('#artikel_kat_3_sub_2').hasClass('hier')) {
	$('.artikel_kat_3_sub').show();
	$('.artikel_kat_3_sub_2').show();
    } else {
	$('.artikel_kat_3_sub_2').hide();
    }
    if ($('#artikel_kat_3_sub_3').hasClass('hier')) {
	$('.artikel_kat_3_sub').show();
	$('.artikel_kat_3_sub_3').show();
    } else {
	$('.artikel_kat_3_sub_3').hide();
    }
    if ($('#artikel_kat_4').hasClass('hier')) {
	$('.artikel_kat_4_sub').show();
    } else {
	$('.artikel_kat_4_sub').hide();
    }
    if ($('#artikel_kat_5').hasClass('hier')) {  
	$('.artikel_kat_5_sub').show();
    } else {
	$('.artikel_kat_5_sub').hide();
    }
    if ($('#artikel_kat_6').hasClass('hier')) {
	$('.artikel_kat_6_sub').show();
    } else {
	$('.artikel_kat_6_sub').hide();
    }
    if ($('#artikel_kat_7').hasClass('hier')) {
	$('.artikel_kat_7_sub').show();
    } else {
	$('.artikel_kat_7_sub').hide();
    }
    if ($('#artikel_kat_8').hasClass('hier')) {
	$('.artikel_kat_8_sub').show();
    } else {
	$('.artikel_kat_8_sub').hide();
    }
    if ($('#artikel_kat_9').hasClass('hier')) {
	$('.artikel_kat_9_sub').show();
    } else {
	$('.artikel_kat_9_sub').hide();
    }
    if ($('#artikel_kat_10').hasClass('hier')) {
	$('.artikel_kat_10_sub').show();
    } else {
	$('.artikel_kat_10_sub').hide();
    }

/*each(index, function(){

	alert(index);

    })
/*.click(function(index) {
	alert(index);
//        $('.artikel_kat_1_sub').show();
    });
*/
}
 
$(document).ready(function(){

    //artikel_hide_all();
    artikel_show_hier_hide_all()
//    artikel_show_hier();

    $('#artikel_kat_1').click(function() {
	artikel_hide_all();
	$('.artikel_kat_1_sub').show();

    });
    $('#artikel_kat_2').click(function() {
	artikel_hide_all();
	$('.artikel_kat_2_sub').show();
//	$('#artikel_kat_2').addClass('hier');
    });
    $('#artikel_kat_3').click(function() {
	artikel_hide_all();
	$('.artikel_kat_3_sub').show();
    });
    $('#artikel_kat_3_sub_1').click(function() {
	artikel_hide_all();
	$('.artikel_kat_3_sub').show();
	$('.artikel_kat_3_sub_1').show();
    });
    $('#artikel_kat_3_sub_2').click(function() {
	artikel_hide_all();
	$('.artikel_kat_3_sub').show();
	$('.artikel_kat_3_sub_2').show();
    });
    $('#artikel_kat_3_sub_3').click(function() {
	artikel_hide_all();
	$('.artikel_kat_3_sub').show();
	$('.artikel_kat_3_sub_3').show();
    });
     
    $('#artikel_kat_4').click(function() {
	artikel_hide_all();
	$('.artikel_kat_4_sub').show();
    });
    $('#artikel_kat_5').click(function() {
	artikel_hide_all();
	$('.artikel_kat_5_sub').show();
    });
    $('#artikel_kat_6').click(function() {
	artikel_hide_all();
	$('.artikel_kat_6_sub').show();
    });
    $('#artikel_kat_7').click(function() {
	artikel_hide_all();
	$('.artikel_kat_7_sub').show();
    });
    $('#artikel_kat_8').click(function() {
	artikel_hide_all();
	$('.artikel_kat_8_sub').show();
    });
    $('#artikel_kat_9').click(function() {
	artikel_hide_all();
	$('.artikel_kat_9_sub').show();
    });
    $('#artikel_kat_10').click(function() {
	artikel_hide_all();
	$('.artikel_kat_10_sub').show();
    });


    $('.txt_u_illu').html(function(i, v) {
  return v.replace(/------------------------------------------------------------/g, '</p><p style="border-top: 1px solid #598A91;">');   
});


/*    $('.hier').mouseover(function() { 
	var Classes = this.className;
        if (Classes != undefined) {
            var Classe = Classes.split(" ");
	    if (Classe[0] != undefined) {
    		$('.'+Classe[0]).show();
    	    }
	}
    });
*/
    
});
 



    


