( function() {  var mapping = [{"appname":"", "appid":"MC_APPS_PIC32CM_MC_INTRODUCTION", "path":"GUID-C56B2F23-004F-4BC7-9C20-272F38B12A0D.html"},{"appname":"", "appid":"MC_APPS_PIC32CM_MC_PMSM_FOC_USING_REDUCED_ORDER_LUENBERGER_OBSERVER", "path":"GUID-BE0FF70E-D56F-4D07-BE5C-BB6ED5EC7F35.html"},{"appname":"", "appid":"MC_APPS_PIC32CM_MC_BLDC_BLOCK_COMMUTATION_HALL_SENSOR", "path":"GUID-F9334945-6F20-474E-8B0E-86CFDDF119D9.html"},{"appname":"", "appid":"MC_APPS_PIC32CM_MC_ACIM_VHZ_CONTROL", "path":"GUID-F5A645B3-00BC-4144-9E1B-5120BF67A912.html"},{"appname":"", "appid":"MH3_pic32cm_mc_apps_pll_estimator", "path":"GUID-9558E0C2-EF63-4A1C-92A9-2381CA20EB48.html"},{"appname":"", "appid":"MC_APPS_PIC32CM_MC_BLDC_BC_SENSORLESS", "path":"GUID-37C374A9-3071-468E-A6CC-61510BC0323A.html"},{"appname":"", "appid":"MC_APPS_PIC32CM_MC_HW_SETUP", "path":"GUID-72FEAB96-72D6-44BA-8FCB-8974F44CA92D.html"},{"appname":"", "appid":"MC_APPS_PIC32CM_MC_MCLV_DB_SETUP_BLDC_SENSORLESS_MODE", "path":"GUID-EE1EBF3B-C1AA-4C87-9A55-84CCF3E3081E.html"},{"appname":"", "appid":"MC_APPS_PIC32CM_MC_MCHV3_DB_SETUP_ACIM_SENSORLESS_MODE", "path":"GUID-1BD1EBEE-3E26-4108-8D72-B38B64D9EDC8.html"},{"appname":"", "appid":"MC_APPS_PIC32CM_MC_MCHV3_DB_SETUP_PMSM_SENSORLESS_MODE", "path":"GUID-81F815BA-1282-49AC-A3CB-1EB00E2412CE.html"},{"appname":"", "appid":"MC_APPS_PIC32CM_MC_MCLV2_DB_SETUP_PMSM_SENSORLESS_MODE", "path":"GUID-1F652B91-315A-463D-955C-C8522ED46ABF.html"},{"appname":"", "appid":"MC_APPS_PIC32CM_MC_MCLV2_DB_SETUP_BLDC_HALL_SENSOR_MODE", "path":"GUID-BA425B3A-ADA0-41AC-9B23-577F2ABBAFC8.html"},{"appname":"", "appid":"MC_APPS_PIC32CM_MC_MCLV_DB_SETUP_PMSM_SENSORLESS_MODE", "path":"GUID-64BC9F8D-9ACE-45F1-98BC-59F79B66F3E2.html"},{"appname":"", "appid":"MH3_mc_apps_pic32cm_mc_release_notes", "path":"GUID-24519A35-AA4B-4F37-90B8-6E17818E0D3D.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
              });

        })();