Run Javascript Event Code when overlay window is shown and closed

This is for the Tab JS custom code section:

function ju_windowevent(action,promoId){
// this function is called when the popup window is shown and hidden.
if (action=='load'){
// your code to run when the popup shows
}
if (action=='unload'){
// your code to run when the popup hides
}