( function() {  var mapping = [{"appname":"", "appid":"MC_APPS_SAM_C2X_INTRODUCTION", "path":"GUID-07CE01CD-E31E-4F9F-B810-65019C216B93.html"},{"appname":"", "appid":"MC_APPS_SAM_C2X_ACIM_VHZ_CONTROL", "path":"GUID-D5677EB7-92C3-4B84-8ED9-A451A830CF77.html"},{"appname":"", "appid":"MC_APPS_SAM_C2X_BLDC_BLOCK_COMMUTATION_HALL_SENSOR", "path":"GUID-7B749828-7718-4C3A-8A31-1D62E1F57807.html"},{"appname":"", "appid":"MC_APPS_SAM_C2X_PMSM_FOC_REDUCED_ORDER_LUENBERGER_OBSERVER_FIELD_WEAKENING_MTPA", "path":"GUID-CFBE4D6C-EA39-45BE-B5D4-47CFAD3554F4.html"},{"appname":"", "appid":"MC_APPS_SAM_C2X_PMSM_FOC_SINGLE_SHUNT_CURRENT_RECONSTRUCTION", "path":"GUID-942885A0-341F-425F-94BD-714A4351EF12.html"},{"appname":"", "appid":"MC_APPS_SAM_C2X_PMSM_FOC_PLL", "path":"GUID-F1ACE792-113C-46C3-B2FC-B9B07EBD3825.html"},{"appname":"", "appid":"MC_APPS_SAM_C2X_HW_SETUP", "path":"GUID-441940E8-3704-495B-B71A-F664A0AE1294.html"},{"appname":"", "appid":"MC_APPS_SAM_C2X_MCHV3_DB_SAMC21_PIM_ACIM_VHZ_APP", "path":"GUID-DC3B5FA5-A83C-42D6-80E6-81EF7ECB6419.html"},{"appname":"", "appid":"MC_APPS_SAM_C2X_MCHV3_DB_SAMC21_PIM_PMSM_FOC_USING_ROLO_APP", "path":"GUID-AB7491CB-75B6-4FE5-9246-877F260B1E47.html"},{"appname":"", "appid":"MC_APPS_SAM_C2X_MCLV2_DB_SAMC21_PIM_BLDC_BLOCK_COMMUTATION_HALL_SENSOR", "path":"GUID-88699E8B-C00A-4063-BD07-072517AFBF20.html"},{"appname":"", "appid":"MC_APPS_SAM_C2X_MCLV2_DB_SAMC21_PIM_PMSM_FOC_USING_ROLO_APP", "path":"GUID-34F42DB2-AAAA-499C-88F3-1E9014A04F51.html"},{"appname":"", "appid":"MCLV-48V-300W SAMC21", "path":"GUID-6F144E9C-3C11-4B83-BDFC-66268074D436.html"},{"appname":"", "appid":"Releases Notes", "path":"GUID-22D60024-BE76-408A-A1A3-7A31595030D3.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
              });

        })();