( function() {  var mapping = [{"appname":"", "appid":"NET_APPS_SAM_E70_V71_H3_TCP_IP_APP_SAM_E70_V71_FAMILY", "path":"GUID-1B418433-257B-421A-B251-3443D46108F8.html"},{"appname":"", "appid":"NET_APPS_SAM_E70_V71_BERKELEY_TCP_CLIENT", "path":"GUID-4277FB92-F576-488C-90B6-DA45473EADA7.html"},{"appname":"", "appid":"NET_APPS_SAM_E70_V71_BERKELEY_TCP_SERVER", "path":"GUID-60C87CDF-02EC-4B5E-894A-55787A225672.html"},{"appname":"", "appid":"NET_APPS_SAM_E70_V71_BERKELEY_UDP_CLIENT", "path":"GUID-EEF53CB2-E099-4E4B-9CB6-AF2756B180FB.html"},{"appname":"", "appid":"NET_APPS_SAM_E70_V71_BERKELEY_UDP_RELAY", "path":"GUID-C6BFC2D6-3624-446B-8362-FBF6D9B31747.html"},{"appname":"", "appid":"NET_APPS_SAM_E70_V71_BERKELEY_UDP_SERVER", "path":"GUID-0A0F6303-D515-480E-A92E-3F977D2B3874.html"},{"appname":"", "appid":"NET_APPS_SAM_E70_V71_IPERF_DEMO", "path":"GUID-0BB22BA8-96A3-483B-BFB5-05880C32C220.html"},{"appname":"", "appid":"NET_APPS_SAM_E70_V71_SNMPV3_NVM_MPFS", "path":"GUID-BA982D44-33D8-42B3-B3EA-2F77668ADC2A.html"},{"appname":"", "appid":"NET_APPS_SAM_E70_V71_SNMPV3_SDCARD_FATFS", "path":"GUID-2D574F52-B487-4339-8788-291189B93527.html"},{"appname":"", "appid":"NET_APPS_SAM_E70_V71_TCP_IP_CLIENT_SERVER", "path":"GUID-E2811E1E-1CF2-425B-B890-CE0C370F2B82.html"},{"appname":"", "appid":"NET_APPS_SAM_E70_V71_TCP_IP_TCP_CLIENT", "path":"GUID-8CA7886F-8C77-47FF-B785-DE2E9EB63938.html"},{"appname":"", "appid":"NET_APPS_SAM_E70_V71_TCP_IP_TCP_CLIENT_SERVER", "path":"GUID-61E9F2AD-ED2F-4645-91F4-B694307D02E6.html"},{"appname":"", "appid":"NET_APPS_SAM_E70_V71_TCP_IP_TCP_DEMO_AT24MAC", "path":"GUID-DF866D55-CAF1-4948-88F0-E03127A871AE.html"},{"appname":"", "appid":"NET_APPS_SAM_E70_V71_TCP_IP_TCP_SERVER", "path":"GUID-D5B98B05-A841-4C2B-B873-89154ECC504E.html"},{"appname":"", "appid":"NET_APPS_SAM_E70_V71_TCP_IP_UDP_CLIENT", "path":"GUID-6785C3DF-EBF6-4C59-8270-5B9C1AB250FF.html"},{"appname":"", "appid":"NET_APPS_SAM_E70_V71_TCP_IP_UDP_CLIENT_SERVER", "path":"GUID-AD9094FC-026D-4E85-99B0-1E38CC72040F.html"},{"appname":"", "appid":"NET_APPS_SAM_E70_V71_TCP_IP_UDP_SERVER", "path":"GUID-3928FD5F-E10D-4EDD-A5D7-5A61D735B362.html"},{"appname":"", "appid":"NET_APPS_SAM_E70_V71_WEB_FTP_SERVER_MPFS_FATFS", "path":"GUID-DB6DCC32-5BD0-48B7-BC90-234F7F5D4391.html"},{"appname":"", "appid":"NET_APPS_SAM_E70_V71_WEB_NET_SERVER_NVM_MPFS", "path":"GUID-22D642CF-BEBC-4185-8F79-FAC726048557.html"},{"appname":"", "appid":"NET_APPS_SAM_E70_V71_WEB_NET_SERVER_SDCARD_FATFS", "path":"GUID-55333844-7DE6-4DAF-BBD6-4D89A838F7A4.html"},{"appname":"", "appid":"NET_APPS_SAM_E70_V71_WOLFMQTT_DEMO", "path":"GUID-FF2EFAFD-35FD-4506-870B-1FD3945B1DC4.html"},{"appname":"", "appid":"NET_APPS_SAM_E70_V71_WOLFSSL_TCP_CLIENT", "path":"GUID-AE51F024-95BA-4BC2-9DF2-965F56C74224.html"},{"appname":"", "appid":"NET_APPS_SAM_E70_V71_WOLFSSL_TCP_SERVER", "path":"GUID-BB0724FA-3059-446A-A90F-D0BF11F232CB.html"}];
            var mchp = (function (mchp) {
                var mchp = mchp || {};
                var mapping = [];
        
                mchp.utils = {};
        
                mchp.utils.getQueryParam = function (name, url = window.location.href) {
                  name = name.replace(/[\[\]]/g, "\\$&");
                  var regex = new RegExp("[?&]" + name + "(=([^&#]*)|&|#|$)"),
                    results = regex.exec(url);
                  if (!results) return null;
                  if (!results[2]) return "";
                  return decodeURIComponent(results[2].replace(/\+/g, " "));
                };

                mchp.utils.isFirefox = typeof InstallTrigger !== 'undefined';
        
                mchp.init = function (options) {
                  mchp.mapping = options.mapping || [];
                  mchp.bindEvents();
                };
        
                mchp.bindEvents = function () {
                    if (mchp.utils.isFirefox) {
                      window.onload = mchp.checkRedirect;
                    } else {
                      document.onreadystatechange = mchp.checkRedirect;
                    }
                };

                mchp.checkRedirect = function() {
                  var contextId = mchp.utils.getQueryParam("contextId") || "";
                  if (contextId && contextId != undefined) {
                    var record = mchp.mapping.find(function(x){
                      return x.appid && x.appid.toLowerCase() == contextId.toLowerCase();
                    });
                    if (record && record.path) {
                      window.stop();
                      window.location = record.path;
                    }
                  }
                };
        
                return {
                  init: mchp.init,
                };
              })();
        
              mchp.init({
                mapping: mapping
              });

        })();