You can check the current source of the image by looking at the src attribute, like so:
var currentSource = $('#animation').attr('src');
Then you can check what it is. If I were you, I'd use a simple regex test to see if it ends with suit.gif
, like so:
var alreadySuit = /suit\.gif$/i.test(currentSource);
Your code would then look like this:
<script type="text/javascript">
$(function() {
$("#nav").click(function() {
$('html,body').animate({
scrollTop: $(document).scrollTop()+600
}, 1000);
var anim = $('#animation');
if(!/suit\.gif$/i.test(anim.attr('src'))){
$('#animation').attr('src','images/suit.gif');
}
});
});
</script>