( function() {  var mapping = [{"appname":"", "appid":"BOOTLOADER_APPS_SDCARD_INTRODUCTION", "path":"GUID-E1BC6897-8F9B-44BA-9E80-06E0A27D73BD.html"},{"appname":"", "appid":"BOOTLOADER_APPS_SDCARD_SDCARD", "path":"GUID-E295B85B-F655-44BA-B5BF-AE328CFAD74C.html"},{"appname":"", "appid":"BOOTLOADER_APPS_SDCARD_PIC32MZ_DAS_SK", "path":"GUID-E7B037AE-8CDD-4C80-8F07-DF4C46DB7059.html"},{"appname":"", "appid":"BOOTLOADER_APPS_SDCARD_SAM_E54_XPRO", "path":"GUID-EF78BCAB-61FC-4F86-9ED7-18A0C467F8DF.html"},{"appname":"", "appid":"BOOTLOADER_APPS_SDCARD_SAM_E70_XULT", "path":"GUID-CC641FFA-6C81-4DA1-A898-2B8FEBD6995D.html"},{"appname":"", "appid":"BOOTLOADER_APPS_SDCARD_SAM_L22_XPRO", "path":"GUID-A17DB6C3-2C40-4395-9F69-5F133D54A1DC.html"},{"appname":"", "appid":"BOOTLOADER_APPS_SDCARD_APPLICATION_CONFIG", "path":"GUID-4CDC18FE-07CB-4E60-BB7D-6D4DA38E75DC.html"},{"appname":"", "appid":"BOOTLOADER_APPS_SDCARD_CONFIGURE_APP_PIC32CM", "path":"GUID-E3D8AF7A-EF89-4335-A7BF-7B1F93A2FEDD.html"},{"appname":"", "appid":"BOOTLOADER_APPS_SDCARD_CONFIGURE_APP_SAM", "path":"GUID-641ADB02-676E-4999-B96D-44F018028A43.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
              });

        })();