You need to wrap your jQuery call in a function
$.ajax({ url: 'content.php', data: '&go='+ tab, success: function (data) { setTimeout(pencil, 3250); //pass in a function reference preferably. setTimeout(function(){$("#content").html(data).fadeIn()}, 5000); //wrap it in a function }});