HI Everyone,

Its been a while since I've been here. I need some help. I am in need of a JS code which can set a cookie for a domain so that its active while a user is visiting the site and its pages, but upon leaving the site by any method (ie closing the window or leaving the domain) an alert box with a message appears. The alert box should only popup once, when they leave, not when they go to each page of the site. I am a designer so my basic knowledge of JS won't do in this instance. IF anyone can please help I'd be a happy designer.

Thanks and happy coding.