docs: function(event) {
      
      var els, i;
      
      // does the origin sending the message match the current host? if not dev/null the request
      if ((window.location.protocol !== 'file:') && (event.origin !== window.location.protocol+'//'+window.location.host)) {
        return;
      }
      
      var data = {};
      try {
        data = (typeof event.data !== 'string') ? event.data : JSON.parse(event.data);
      } catch(e) {}
      
      if ((data.event !== undefined) && (data.event == "patternLab.pageLoad")) {
        
        if ((modalViewer.active === false) && (data.patternpartial !== undefined) && (data.patternpartial.indexOf('viewall-') === 0) && (config.defaultShowPatternInfo !== undefined) && (config.defaultShowPatternInfo)) {
          modalViewer.queryPattern(false);
        } else if (modalViewer.active === true) {
          modalViewer.queryPattern();
        }
        
      } else if ((data.event !== undefined) && (data.event == 'patternLab.patternQueryInfo')) {
        
        // refresh the modal if a new pattern is loaded and the modal is active
        modalViewer.refresh(data.patternData, data.iframePassback, data.switchText);
        
      } else if ((data.event !== undefined) && (data.event == 'patternLab.annotationNumberClicked')) {
        
        // slide to a given annoation
        modalViewer.slideToAnnotation(data.displayNumber);
        
      }
      
    }