Set cookie on click on element

Job ID: 32848431

Budget: €8 – €30 EUR

I have a div that shows after 5 seconds after the users enter the website.

setTimeout(function(){
$('.popup').fadeIn();
}, 5000);

I want a small code that sets a cookie when the user presses a "the close div", so the div doesn't get shown for a week.
Related categories: JavaScript HTML jQuery / Prototype