You certainly can. Try this:
$("#maingraphic").toggle(function(){
$(this).animate({height:450},'slow',function(){ /* optionally do stuff once animation finishes */});
},function(){
$(this).animate({height:200},'slow',function(){ /* optionally do stuff once animation finishes */});
});