( function() {  var mapping = [{"appname":"", "appid":"CSP_APPS_PIC32AK_GC_INTRODUCTION", "path":"GUID-5308E539-7593-473A-88D3-B23955CED837.html"},{"appname":"", "appid":"CSP_APPS_PIC32AK_GC_ADC_POLLED", "path":"GUID-4AFD1750-F33F-42CE-BCF0-C1A91A8A8911.html"},{"appname":"", "appid":"CSP_APPS_PIC32AK_GC_CCP_CAPTURE_MODE", "path":"GUID-ABDB6F25-0528-4DC3-A856-9F682F87ED35.html"},{"appname":"", "appid":"CSP_APPS_PIC32AK_GC_CCP_COMPARE_MODE", "path":"GUID-70C2A60B-BA9E-4AD4-83DD-CEA3993F6374.html"},{"appname":"", "appid":"CSP_APPS_PIC32AK_GC_CCP_TIMER_MODE", "path":"GUID-4DBCD5A2-B3BB-4F71-87C4-CBD0252A8870.html"},{"appname":"", "appid":"CSP_APPS_PIC32AK_GC_CLC_MANCHESTER_ENCODER", "path":"GUID-C737A7CE-3BF4-4423-91FA-B290E93C1744.html"},{"appname":"", "appid":"CSP_APPS_PIC32AK_GC_CMP_DAC_SINE_WAVE", "path":"GUID-565CE2D1-6D0A-4868-A8BC-FEDEDE6DA8E8.html"},{"appname":"", "appid":"CSP_APPS_PIC32AK_GC_CRC32_GENERATION", "path":"GUID-A7750732-22FB-4908-847A-5355F19D74B6.html"},{"appname":"", "appid":"CSP_APPS_dsPIC33AK_DMA_MEMORY_TRANSFER", "path":"GUID-7CDD4CE9-0BBD-4D90-BF4C-48B88E9812D4.html"},{"appname":"", "appid":"CSP_APPS_PIC32AK_GC_I2C_EEPROM_EMULATION_I2C_CLIENT", "path":"GUID-5DDC7AA5-D3D9-44B6-9430-853A8F9AF430.html"},{"appname":"", "appid":"CSP_APPS_PIC32AK_GC_I2C_EEPROM_READ_WRITE", "path":"GUID-DEFDCCEA-DF37-49E5-B7BB-802F8E7E22C1.html"},{"appname":"", "appid":"CSP_APPS_PIC32AK_GC_PTG_INTERRUPT", "path":"GUID-65621FEC-8580-4B1B-BFBF-B73AD7A60974.html"},{"appname":"", "appid":"CSP_APPS_PIC32AK_GC_PWM_GENERATORS_SYNCHRONOUS_OUTPUT", "path":"GUID-AD8AD628-79DB-4D5F-B659-DC1E25267C2E.html"},{"appname":"", "appid":"CSP_APPS_PIC32AK_GC_SENT_RECEIVER", "path":"GUID-C38F729A-3078-4AA5-BB46-B50F2036F912.html"},{"appname":"", "appid":"CSP_APPS_PIC32AK_GC_SENT_TRANSMITTER", "path":"GUID-D98040D2-1354-4525-A19A-7B158454D4B7.html"},{"appname":"", "appid":"CSP_APPS_PIC32AK_GC_SPI_EEPROM_READ_WRITE", "path":"GUID-831B7792-F1D7-437B-9B11-80DA3C16B39A.html"},{"appname":"", "appid":"CSP_APPS_PIC32AK_GC_SPI_FLASH_WRITE_READ", "path":"GUID-48C45213-7886-4D2E-8755-107AC84FC553.html"},{"appname":"", "appid":"CSP_APPS_PIC32AK_GC_SPI_HOST_READ_WRITE_TEST_APPLICATION", "path":"GUID-C872F3AB-3F0F-4DDA-8108-B162E2D415F8.html"},{"appname":"", "appid":"CSP_APPS_PIC32AK_GC_SPI_CLIENT_READ_WRITE", "path":"GUID-1EEF0B52-7C2F-4397-80BF-F351C24F6CD9.html"},{"appname":"", "appid":"CSP_APPS_PIC32AK_GC_TIMER_INTERRUPT", "path":"GUID-5F2B1F2B-0057-4935-8694-259C2D97A26E.html"},{"appname":"", "appid":"CSP_APPS_PIC32AK_GC_UART_ECHO_BLOCKING", "path":"GUID-587D4DCC-767B-4791-B8EA-A6048F85B712.html"},{"appname":"", "appid":"CSP_APPS_PIC32AK_GC_UART_ECHO_INTERRUPT", "path":"GUID-FD36CC7B-836B-47C9-BDDE-E1B65B9DF8C8.html"},{"appname":"", "appid":"CSP_APPS_PIC32AK_GC_UART_RING_BUFFER", "path":"GUID-1A00FFDE-87CC-4597-8838-E8990D93E255.html"},{"appname":"", "appid":"CSP_APPS_PIC32AK_GC_WDT_TIMEOUT", "path":"GUID-631933C5-3E67-4720-BB02-C73E4997AAFB.html"},{"appname":"", "appid":"CSP_APPS_PIC32AK_GC_ADC_INTERRUPT", "path":"GUID-EE5CAC83-F976-403B-9C0F-A690771C4022.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
              });

        })();