 /**
  * @function postMessageToPortal
  * @param message - message  sent, Mandatory, ANY format
  * @param targetOrigin - target domain message is sent, Optional, String, default value = '*'
  * @return void
  *
  * @example
  * APP.method.postMessageToPortal('CloseGame');
  */
 ;
 (function(win) {
     var APP = win.APP = win.APP || {};
     var method = APP.method = APP.method || {};
     method.postMessageToPortal = function(message, targetOrigin) {
         targetOrigin = targetOrigin || '*';
         try {
             recursiveTarget(window.parent, message, targetOrigin)
         } catch (e) {
             return;
         }
     }

     function recursiveTarget(targetWindow, message, targetOrigin) {
         targetWindow.postMessage(message, targetOrigin);
         if (targetWindow != targetWindow.parent) {
             recursiveTarget(targetWindow.parent, message, targetOrigin);
         }
     }

 })(window);