[accordion] changing header size and back

[accordion] changing header size and back


hello, i want to modify my accordion header a little bit.
if you click on "header" the header size should change from 80px to
40px in height. and if you click again on the selected header it
should go back to 80px..
so i made and tested the code below, the code is working, but only
once.
i could open my accordion (the header size go to 40px) i could close
my selected header (it goes back to 80px)
but if i click again on my header it goes from 80px to 40px to 80px
without a stop on 40px.
ive tried to understand, whats wrong but i stuck. thanx for your help!
jQuery().ready(function(){
jQuery('#navigation').accordion({
    header: '.head',
    active: false,
alwaysOpen: false,
autoheight: true,
animated: 'easeslide'
    });
    $(".head").click(function(){
    $(".head").animate({height: "40"}, "slow");
$(".selected").click(function(){
    $(".head").animate({height: "80"}, "slow");
});
});
});