$(document).ready(function(){

if($('.article')[0]){
$('.article').each(function(){
    var mXArticle = $(this).height();
    $(this).attr('maxheight',mXArticle).addClass('off');
    $(this).find('h2').addClass('accordionHead');
});

$('.topLine').addClass('mXtopLine');
$('.topLine a').remove();
$('.topLine').append('<span class="out">weiter lesen</span><span class="accordionElement"></span>');

$('.topLine, .article h2').click(function(e){
    e.preventDefault();
    var mXContainer = $(this).parent();
    if(mXContainer.attr('class') == 'article on')
    {
    mXContainer.addClass('off').removeClass('on').animate({'height':'114px'},'slow');
    mXContainer.find('.in').replaceWith('<span class="out">weiter lesen</span>');
    }
    else
    {
    $('.article.on').addClass('off').removeClass('on').animate({'height':'114px'},'slow');
    setNewHeight = mXContainer.attr('maxheight');
    mXContainer.animate({'height':setNewHeight-20},'slow').addClass('on').removeClass('off');
    mXContainer.find('.out').replaceWith('<span class="in">einklappen</span>');
    }
});
}
/*
$('.topLine, .article h2').hover(
    function(){
    $(this).parent().addClass('mXArticleBg');
    },
    function(){
    $(this).parent().removeClass('mXArticleBg');
    });
*/

/*hovering VML */
if($('#mapVML')[0])
{
$('.landesgruppen a').hover(
    function(){$(this).find('.groupArea:not(#active), .extraBorder:not(#active)').attr('fillcolor','#dae5f0');},
    function(){$(this).find('.groupArea:not(#active), .extraBorder:not(#active)').attr('fillcolor','#fff');
});
$('.landesgruppen a').click(function(){
    $('.landesgruppen a').find('.groupArea, .extraBorder').attr('fillcolor','#fff');
    $(this).find('.groupArea, .extraBorder').attr('fillcolor','#dae5f0');
});
}
});

/* speciaNav */
if($('#specialNav')[0])
{
$('#specialNav li').click(function(){
    $('#specialNav li').removeClass('active');
    $('#rightSide div.show').removeClass('show').addClass('invisible');
    $(this).addClass('active');
    var showArticle = $(this).find('a').attr('href');
    $(showArticle).addClass('show');
});
$('#specialNav li a:not(a[href="akademie-intern.html"])').click(function(aFollow){aFollow.preventDefault();});
}
