var bgExit;

startAd = function() {
  "use strict";
  bgExit = document.getElementById("ad");
  addListeners();
  animation();
};

addListeners = function() {
  "use strict";
  bgExit.addEventListener('click', onExitHandler, false);
};

onExitHandler = function(e) {
  "use strict";
  Enabler.exit('HTML5_Background_Clickthrough');
  console.log("Exit code Initialized");
};

window.onload = function() {
  /* Initialize Enabler */
  if (Enabler.isInitialized()) {
    startAd();
  } else {
    Enabler.addEventListener(studio.events.StudioEvent.INIT, startAd);
  }
};

@@ -1,486 +1,577 @@
-var bgExit;%0A%0AstartAd = function() %7B%0A  %22use strict%22;%0A  bgExit = document.getElementById(%22ad%22);%0A  addListeners();%0A  animation();%0A%7D;%0A%0AaddListeners = function() %7B%0A  %22use strict%22;%0A  bgExit.addEventListener('click', onExitHandler, false);%0A%7D;%0A%0AonExitHandler = function(e) %7B%0A  %22use strict%22;%0A  Enabler.exit('HTML5_Background_Clickthrough');%0A  console.log(%22Exit code Initialized%22);%0A%7D;%0A%0Awindow.onload = function() %7B%0A  /* Initialize Enabler */%0A  if (Enabler.isInitialized()) %7B%0A    startAd
+window.onload = function() %7B%0A%09console.log('%5Bcustom%5D Window Loaded');%0A%09if (Enabler.isInitialized()) %7B%0A%09%09enablerInitHandler();%0A%09%7D else %7B%0A%09%09Enabler.addEventListener(studio.events.StudioEvent.INIT, enablerInitHandler);%0A%09%7D%0A%7D%0Afunction enablerInitHandler() %7B%0A%09console.log('%5Bcustom%5D DCS Enabler Init');%0A%09if (Enabler.isPageLoaded()) %7B%0A%09%09pageLoadedHandler();%0A%09%7D else %7B%0A%09%09Enabler.addEventListener(studio.events.StudioEvent.PAGE_LOADED, pageLoadedHandler);%0A%09%7D%0A%7D%0Afunction pageLoadedHandler() %7B%0A%09console.log('%5Bcustom%5D Page Loaded');%0A%09if (Enabler.isVisible()) %7B%0A%09%09adVisibilityHandler
 ();%0A
-  
+%09
 %7D el
@@ -579,12 +579,10 @@
 e %7B%0A
-    
+%09%09
 Enab
@@ -632,27 +632,278 @@
 ent.
-INIT, startAd);%0A  %7D%0A%7D
+VISIBLE, adVisibilityHandler);%0A%09%7D%0A%7D%0Afunction adVisibilityHandler() %7B%0A%09console.log('%5Bcustom%5D Ad Visible');%0A%09document.getElementById('ad').addEventListener('click', bgExitHandler, false);%0A%0A    animation();%0A%7D%0A%0A%0Afunction bgExitHandler(e) %7B%0A    Enabler.exit('Background Exit')
 ;%0A
+%7D

Update doubleclick.js to watch window load events