
// ppp image toggler
jQuery(document).ready(function(){
    
    // get active medium and give the img a class active
    var activeId = jQuery(".navtitels.titel_active").attr('id');
    jQuery("#img_" + activeId).addClass("active");
    
    // checks if a button exist in an active state
    if ($(".navtitels.titel_active").length) {
        jQuery(".img_ppp img").toggle();
    }
    
    jQuery(".img_ppp.active img").toggle();
    
    jQuery(".navtitels").hover(function() {
        // get current id of link
        var currentId = jQuery(this).attr('id');
      
        // if hover is not on a active medium than toggle hover class and fader_image
        if (!(jQuery(this).attr('id') == activeId)) {
            
            // checks if a button exist in an active state
            if ($('.active').length) {
                jQuery("#img_" + currentId + " img").toggle();
            }
            jQuery("#img_" + currentId).toggleClass("hover");
        }
    });
});
