You need:
jQuery(document).ready(function() {
jQuery('#contactFlyout').click(function()
{
jQuery(".togglepanel:visible").hide();
jQuery("#contact_panel").animate({width:'toggle',height:'toggle'},200 );
});
// the close button
$('.closeDiv').click(function()
{
jQuery(".togglepanel:visible").animate({width:'toggle',height:'toggle'},200 );
});
});
See: http://jsfiddle.net/DcRHh/2/
Or you can use the shorthand as pointed out by Fabricio. Although I would stick with jQuery over $ inside Wordpress, unless you know what you are doing when it comes to avoiding conflict with other scripts.