Execute code for X visits

Watch out! This tutorial is over 1 year old. Please keep this in mind as some code snippets provided may no longer work or need modification to work on current systems.
Tutorial Difficulty Level    

This JavaScript will let you execute code a certain number of times. For example, you might want to only show a pop up to visitors on their first 3 visits.

This code was shamelessly stolen from getbutterfly.com – check them out for lots more Javascript tutorials!