jquery slide down function with a contact form

jquery slide down function with a contact form

Hi, I'm using the following code (taken from design shack) for a slide down form. The problem is when I send the form #messagesent doesn't show and the form just slides back up. I've looked at a few tutorials and tried a few things but without success. Could anyone help? Thanks.

$(document).ready(function(){

$("#contactLink").click(function(){
if ($("#contactForm").is(":hidden")){
$("#contactForm").slideDown("slow");
}
else{
$("#contactForm").slideUp("slow");

}
});

});

function closeForm(){
$("#messageSent").show("slow");
setTimeout('$("#messageSent").hide();$("#contactForm").slideUp("slow")', 2000);
}