extensions/net.sf.basedb.meludi/trunk/resources/libprep/inspect_libprep_kit_data.js

Code
Comments
Other
Rev Date Author Line
3561 27 Oct 15 olle 1 var ExtractionReg = function()
3561 27 Oct 15 olle 2 {
3561 27 Oct 15 olle 3   var exreg = {};
3561 27 Oct 15 olle 4   var debug = 0;
3561 27 Oct 15 olle 5   
3561 27 Oct 15 olle 6   var consumablesFileIsValid = false;
3561 27 Oct 15 olle 7   var jsonConsumables = {};
3561 27 Oct 15 olle 8   var jsonConsumablesOrig = {};
3561 27 Oct 15 olle 9   var jsonConsumablesModified = {};
3561 27 Oct 15 olle 10   var jsonKitArray = [];
4206 04 Nov 16 olle 11   var kitPlateInfo = {};
3561 27 Oct 15 olle 12   
3561 27 Oct 15 olle 13   // Page initialization
3561 27 Oct 15 olle 14   exreg.initPage = function()
3561 27 Oct 15 olle 15   {
3561 27 Oct 15 olle 16     // Step 1
3561 27 Oct 15 olle 17     Events.addEventHandler('step-1', 'wizard-validate', exreg.validateStep1);
3561 27 Oct 15 olle 18     //Events.addEventHandler('consumablesFile', 'change', exreg.consumablesFileOnChange);
3561 27 Oct 15 olle 19
3561 27 Oct 15 olle 20     // Step 2
3561 27 Oct 15 olle 21     Events.addEventHandler('step-2', 'wizard-initialize', exreg.initializeStep2);
3561 27 Oct 15 olle 22 /*
3561 27 Oct 15 olle 23     Events.addEventHandler('step-2', 'wizard-validate', exreg.validateStep2);
3561 27 Oct 15 olle 24 */
3561 27 Oct 15 olle 25
3561 27 Oct 15 olle 26     Buttons.addClickHandler('downloadLibPrepKitDataFile', exreg.downloadLibPrepKitDataFile);
3561 27 Oct 15 olle 27     
3561 27 Oct 15 olle 28     // Navigation
3561 27 Oct 15 olle 29     Buttons.addClickHandler('gocancel', Wizard.cancelWizard);
3561 27 Oct 15 olle 30     Buttons.addClickHandler('gorestart', Wizard.restartWizard);
3561 27 Oct 15 olle 31     Buttons.addClickHandler('gonext', Wizard.goNextOnClick);
3561 27 Oct 15 olle 32     Buttons.addClickHandler('goregister', Wizard.goRegister);
3561 27 Oct 15 olle 33 /*
3561 27 Oct 15 olle 34     Buttons.addClickHandler('gocreate', exreg.createProtocol);
3561 27 Oct 15 olle 35 */
3561 27 Oct 15 olle 36     
3561 27 Oct 15 olle 37     // Final registration
3561 27 Oct 15 olle 38     Events.addEventHandler('wizard', 'wizard-submit', exreg.submit);
3561 27 Oct 15 olle 39
3561 27 Oct 15 olle 40     exreg.initializeStep1();
3561 27 Oct 15 olle 41   }
3561 27 Oct 15 olle 42
3561 27 Oct 15 olle 43   exreg.initializeStep1 = function()
3561 27 Oct 15 olle 44   {
3561 27 Oct 15 olle 45     var frm = document.forms['meludi'];
3561 27 Oct 15 olle 46     Wizard.setCurrentStep(1);
3561 27 Oct 15 olle 47     Doc.show('step-1');
3561 27 Oct 15 olle 48     Doc.show('gonext');
3561 27 Oct 15 olle 49   }
3561 27 Oct 15 olle 50
3561 27 Oct 15 olle 51   exreg.validateStep1 = function(event)
3561 27 Oct 15 olle 52   {
3561 27 Oct 15 olle 53     var frm = document.forms['meludi'];
3561 27 Oct 15 olle 54 //alert("exreg.validateStep1(): consumablesFileIsValid = " + consumablesFileIsValid);
3561 27 Oct 15 olle 55 /*
3561 27 Oct 15 olle 56     if (!consumablesFileIsValid)
3561 27 Oct 15 olle 57     {
3561 27 Oct 15 olle 58       event.preventDefault();
3561 27 Oct 15 olle 59     }
3561 27 Oct 15 olle 60     else
3561 27 Oct 15 olle 61     {
3561 27 Oct 15 olle 62       Wizard.setInputStatus('consumablesFile', 'valid');
3561 27 Oct 15 olle 63     }
3561 27 Oct 15 olle 64 */
3561 27 Oct 15 olle 65   }
3561 27 Oct 15 olle 66   
3561 27 Oct 15 olle 67   exreg.consumablesFileOnChange = function()
3561 27 Oct 15 olle 68   {
3561 27 Oct 15 olle 69     var frm = document.forms['meludi'];
3561 27 Oct 15 olle 70     var file = frm.consumablesFile.files[0];
3561 27 Oct 15 olle 71     
3561 27 Oct 15 olle 72     var reader = new FileReader();
3561 27 Oct 15 olle 73     reader.onload = exreg.consumablesFileLoaded;
3561 27 Oct 15 olle 74     reader.readAsText(file);
3561 27 Oct 15 olle 75   }
3561 27 Oct 15 olle 76
3561 27 Oct 15 olle 77   exreg.consumablesFileLoaded = function(event)
3561 27 Oct 15 olle 78   {
3561 27 Oct 15 olle 79     exreg.parseConsumablesFile(event.target.result);
3561 27 Oct 15 olle 80   }
3561 27 Oct 15 olle 81
3561 27 Oct 15 olle 82   exreg.parseConsumablesFile = function(data)
3561 27 Oct 15 olle 83   {
3561 27 Oct 15 olle 84     var frm = document.forms['meludi'];
3561 27 Oct 15 olle 85     consumablesFileIsValid = false;
3561 27 Oct 15 olle 86
3561 27 Oct 15 olle 87     // Column data are stored in JSONArrays
3561 27 Oct 15 olle 88     var jsonHeaders = [];
3561 27 Oct 15 olle 89     var jsonKitName = [];
3561 27 Oct 15 olle 90     var jsonLibraryPrepBox1 = [];
3561 27 Oct 15 olle 91     var jsonIndexKit = [];
3561 27 Oct 15 olle 92     var jsonContentSetBox3 = [];
3561 27 Oct 15 olle 93     var jsonOligoPoolA_FPA = [];
3561 27 Oct 15 olle 94     var jsonOligoPoolB_FPB = [];
3561 27 Oct 15 olle 95     var jsonOligoHybridizationSequencingReagent3 = [];
3561 27 Oct 15 olle 96     var jsonStringentWash1_SW1 = [];
3561 27 Oct 15 olle 97     var jsonExtensionLigationMix3 = [];
3561 27 Oct 15 olle 98     var jsonPcrMasterMix2_PMM2 = [];
3561 27 Oct 15 olle 99     var jsonUB1 = [];
3561 27 Oct 15 olle 100     var jsonTDP = [];
3561 27 Oct 15 olle 101     var jsonFilterplate = [];
3561 27 Oct 15 olle 102     
3561 27 Oct 15 olle 103     var jsonIndexPrimerA701 = [];
3561 27 Oct 15 olle 104     var jsonIndexPrimerA702 = [];
3561 27 Oct 15 olle 105     var jsonIndexPrimerA703 = [];
3561 27 Oct 15 olle 106     var jsonIndexPrimerA704 = [];
3561 27 Oct 15 olle 107     var jsonIndexPrimerA705 = [];
3561 27 Oct 15 olle 108     var jsonIndexPrimerA706 = [];
3561 27 Oct 15 olle 109     var jsonIndexPrimerA707 = [];
3561 27 Oct 15 olle 110     var jsonIndexPrimerA708 = [];
3561 27 Oct 15 olle 111     var jsonIndexPrimerA709 = [];
3561 27 Oct 15 olle 112     var jsonIndexPrimerA710 = [];
3561 27 Oct 15 olle 113     var jsonIndexPrimerA711 = [];
3561 27 Oct 15 olle 114     var jsonIndexPrimerA712 = [];
3561 27 Oct 15 olle 115     
3561 27 Oct 15 olle 116     var jsonIndexPrimerA501 = [];
3561 27 Oct 15 olle 117     var jsonIndexPrimerA502 = [];
3561 27 Oct 15 olle 118     var jsonIndexPrimerA503 = [];
3561 27 Oct 15 olle 119     var jsonIndexPrimerA504 = [];
3561 27 Oct 15 olle 120     var jsonIndexPrimerA505 = [];
3561 27 Oct 15 olle 121     var jsonIndexPrimerA506 = [];
3561 27 Oct 15 olle 122     var jsonIndexPrimerA507 = [];
3561 27 Oct 15 olle 123     var jsonIndexPrimerA508 = [];
3561 27 Oct 15 olle 124
3561 27 Oct 15 olle 125     // Find column separator as first character after first occurrence of search string
3561 27 Oct 15 olle 126     var separator = ExtractUtils.findSeparator(data, "Consumables");
3561 27 Oct 15 olle 127     if (separator == null)
3561 27 Oct 15 olle 128     {
3561 27 Oct 15 olle 129       // Comma is default separator
3561 27 Oct 15 olle 130       separator = ',';
3561 27 Oct 15 olle 131     }
3561 27 Oct 15 olle 132 //alert("add_consumables_lot_number_file.js::parseConsumablesFile(): separator = \"" + separator + "\"");
3561 27 Oct 15 olle 133     var columnSplitRegexp = new RegExp(" *" + separator + " *",'');
3561 27 Oct 15 olle 134     var lines = data.split(/[\n\r]+/);
3561 27 Oct 15 olle 135 //alert("add_consumables_lot_number_file.js::parseConsumablesFile(): lines.length = " + lines.length);
3561 27 Oct 15 olle 136     //var columns = lines[0].split(columnSplitRegexp);
3561 27 Oct 15 olle 137
3561 27 Oct 15 olle 138     var numImported = 0;
3561 27 Oct 15 olle 139     for (var i = 1; i < lines.length; i++)
3561 27 Oct 15 olle 140     {
3561 27 Oct 15 olle 141       if (lines[i].match(/^\s*$/)) continue; // Ignore empty lines
3561 27 Oct 15 olle 142       var columns = lines[i].split(columnSplitRegexp);
3561 27 Oct 15 olle 143 //alert("add_consumables_lot_number_file.js::parseConsumablesFile(): i = " + i + " columns[0] = " + columns[0] + " columns[1] = " + columns[1]);
3561 27 Oct 15 olle 144       // First column is either empty, or equal to barcode sequence for index primers
3561 27 Oct 15 olle 145       header = columns[1];
3561 27 Oct 15 olle 146       firstDataIndex = 2;
3561 27 Oct 15 olle 147       // Skip lines without data
3561 27 Oct 15 olle 148       if (header != '')
3561 27 Oct 15 olle 149       {
3561 27 Oct 15 olle 150         jsonHeaders[jsonHeaders.length] = header;
3561 27 Oct 15 olle 151
3561 27 Oct 15 olle 152         for (var j = 0; j < (columns.length - firstDataIndex); j++)
3561 27 Oct 15 olle 153         {
3561 27 Oct 15 olle 154           var data = columns[firstDataIndex + j];
3561 27 Oct 15 olle 155           if (header == 'TruSight Tumor Library Preparation partI')
3561 27 Oct 15 olle 156           {
3561 27 Oct 15 olle 157             jsonKitName[j] = data;
3561 27 Oct 15 olle 158           }
3561 27 Oct 15 olle 159           else if (header == 'TruSight Tumor Library Prep Box 1')
3561 27 Oct 15 olle 160           {
3561 27 Oct 15 olle 161             jsonLibraryPrepBox1[j] = data;
3561 27 Oct 15 olle 162           }
3561 27 Oct 15 olle 163           else if (header == 'TruSight Tumor Index Kit')
3561 27 Oct 15 olle 164           {
3561 27 Oct 15 olle 165             jsonIndexKit[j] = data;
3561 27 Oct 15 olle 166           }
3561 27 Oct 15 olle 167           else if (header == 'TruSight Tumor Content Set Box 3')
3561 27 Oct 15 olle 168           {
3561 27 Oct 15 olle 169             jsonContentSetBox3[j] = data;
3561 27 Oct 15 olle 170           }
3561 27 Oct 15 olle 171           else if (header == 'TruSight Tumor Oligo Pool A (FPA)')
3561 27 Oct 15 olle 172           {
3561 27 Oct 15 olle 173             jsonOligoPoolA_FPA[j] = data;
3561 27 Oct 15 olle 174           }
3561 27 Oct 15 olle 175           else if (header == 'TruSight Tumor Oligo Pool B (FPB)')
3561 27 Oct 15 olle 176           {
3561 27 Oct 15 olle 177             jsonOligoPoolB_FPB[j] = data;
3561 27 Oct 15 olle 178           }
3561 27 Oct 15 olle 179           else if (header == 'Oligo Hybridization for Sequencing Reagent 3 (OHS3)')
3561 27 Oct 15 olle 180           {
3561 27 Oct 15 olle 181             jsonOligoHybridizationSequencingReagent3[j] = data;
3561 27 Oct 15 olle 182           }
3561 27 Oct 15 olle 183           else if (header == 'Stringent Wash 1 (SW1)')
3561 27 Oct 15 olle 184           {
3561 27 Oct 15 olle 185             jsonStringentWash1_SW1[j] = data;
3561 27 Oct 15 olle 186           }
3561 27 Oct 15 olle 187           else if (header == 'Extension Ligation Mix 3 (ELM3)')
3561 27 Oct 15 olle 188           {
3561 27 Oct 15 olle 189             jsonExtensionLigationMix3[j] = data;
3561 27 Oct 15 olle 190           }
3561 27 Oct 15 olle 191           else if (header == 'PCR Master Mix 2 (PMM2)')
3561 27 Oct 15 olle 192           {
3561 27 Oct 15 olle 193             jsonPcrMasterMix2_PMM2[j] = data;
3561 27 Oct 15 olle 194           }
3561 27 Oct 15 olle 195           else if (header == 'UB1')
3561 27 Oct 15 olle 196           {
3561 27 Oct 15 olle 197             jsonUB1[j] = data;
3561 27 Oct 15 olle 198           }
3561 27 Oct 15 olle 199           else if (header == 'TDP')
3561 27 Oct 15 olle 200           {
3561 27 Oct 15 olle 201             jsonTDP[j] = data;
3561 27 Oct 15 olle 202           }
3561 27 Oct 15 olle 203           else if (header == 'Filterplate')
3561 27 Oct 15 olle 204           {
3561 27 Oct 15 olle 205             jsonFilterplate[j] = data;
3561 27 Oct 15 olle 206           }
3561 27 Oct 15 olle 207           else if (header == 'Index Primer A701')
3561 27 Oct 15 olle 208           {
3561 27 Oct 15 olle 209             jsonIndexPrimerA701[j] = data;
3561 27 Oct 15 olle 210           }
3561 27 Oct 15 olle 211           else if (header == 'Index Primer A702')
3561 27 Oct 15 olle 212           {
3561 27 Oct 15 olle 213             jsonIndexPrimerA702[j] = data;
3561 27 Oct 15 olle 214           }
3561 27 Oct 15 olle 215           else if (header == 'Index Primer A703')
3561 27 Oct 15 olle 216           {
3561 27 Oct 15 olle 217             jsonIndexPrimerA703[j] = data;
3561 27 Oct 15 olle 218           }
3561 27 Oct 15 olle 219           else if (header == 'Index Primer A704')
3561 27 Oct 15 olle 220           {
3561 27 Oct 15 olle 221             jsonIndexPrimerA704[j] = data;
3561 27 Oct 15 olle 222           }
3561 27 Oct 15 olle 223           else if (header == 'Index Primer A705')
3561 27 Oct 15 olle 224           {
3561 27 Oct 15 olle 225             jsonIndexPrimerA705[j] = data;
3561 27 Oct 15 olle 226           }
3561 27 Oct 15 olle 227           else if (header == 'Index Primer A706')
3561 27 Oct 15 olle 228           {
3561 27 Oct 15 olle 229             jsonIndexPrimerA706[j] = data;
3561 27 Oct 15 olle 230           }
3561 27 Oct 15 olle 231           else if (header == 'Index Primer A707')
3561 27 Oct 15 olle 232           {
3561 27 Oct 15 olle 233             jsonIndexPrimerA707[j] = data;
3561 27 Oct 15 olle 234           }
3561 27 Oct 15 olle 235           else if (header == 'Index Primer A708')
3561 27 Oct 15 olle 236           {
3561 27 Oct 15 olle 237             jsonIndexPrimerA708[j] = data;
3561 27 Oct 15 olle 238           }
3561 27 Oct 15 olle 239           else if (header == 'Index Primer A709')
3561 27 Oct 15 olle 240           {
3561 27 Oct 15 olle 241             jsonIndexPrimerA709[j] = data;
3561 27 Oct 15 olle 242           }
3561 27 Oct 15 olle 243           else if (header == 'Index Primer A710')
3561 27 Oct 15 olle 244           {
3561 27 Oct 15 olle 245             jsonIndexPrimerA710[j] = data;
3561 27 Oct 15 olle 246           }
3561 27 Oct 15 olle 247           else if (header == 'Index Primer A711')
3561 27 Oct 15 olle 248           {
3561 27 Oct 15 olle 249             jsonIndexPrimerA711[j] = data;
3561 27 Oct 15 olle 250           }
3561 27 Oct 15 olle 251           else if (header == 'Index Primer A712')
3561 27 Oct 15 olle 252           {
3561 27 Oct 15 olle 253             jsonIndexPrimerA712[j] = data;
3561 27 Oct 15 olle 254           }
3561 27 Oct 15 olle 255           else if (header == 'Index Primer A501')
3561 27 Oct 15 olle 256           {
3561 27 Oct 15 olle 257             jsonIndexPrimerA501[j] = data;
3561 27 Oct 15 olle 258           }
3561 27 Oct 15 olle 259           else if (header == 'Index Primer A502')
3561 27 Oct 15 olle 260           {
3561 27 Oct 15 olle 261             jsonIndexPrimerA502[j] = data;
3561 27 Oct 15 olle 262           }
3561 27 Oct 15 olle 263           else if (header == 'Index Primer A503')
3561 27 Oct 15 olle 264           {
3561 27 Oct 15 olle 265             jsonIndexPrimerA503[j] = data;
3561 27 Oct 15 olle 266           }
3561 27 Oct 15 olle 267           else if (header == 'Index Primer A504')
3561 27 Oct 15 olle 268           {
3561 27 Oct 15 olle 269             jsonIndexPrimerA504[j] = data;
3561 27 Oct 15 olle 270           }
3561 27 Oct 15 olle 271           else if (header == 'Index Primer A505')
3561 27 Oct 15 olle 272           {
3561 27 Oct 15 olle 273             jsonIndexPrimerA505[j] = data;
3561 27 Oct 15 olle 274           }
3561 27 Oct 15 olle 275           else if (header == 'Index Primer A506')
3561 27 Oct 15 olle 276           {
3561 27 Oct 15 olle 277             jsonIndexPrimerA506[j] = data;
3561 27 Oct 15 olle 278           }
3561 27 Oct 15 olle 279           else if (header == 'Index Primer A507')
3561 27 Oct 15 olle 280           {
3561 27 Oct 15 olle 281             jsonIndexPrimerA507[j] = data;
3561 27 Oct 15 olle 282           }
3561 27 Oct 15 olle 283           else if (header == 'Index Primer A508')
3561 27 Oct 15 olle 284           {
3561 27 Oct 15 olle 285             jsonIndexPrimerA508[j] = data;
3561 27 Oct 15 olle 286           }
3561 27 Oct 15 olle 287         }
3561 27 Oct 15 olle 288       }
3561 27 Oct 15 olle 289     }
3561 27 Oct 15 olle 290
3561 27 Oct 15 olle 291     jsonConsumables['Headers'] = jsonHeaders;
3561 27 Oct 15 olle 292
3561 27 Oct 15 olle 293     jsonConsumables['KitName'] = jsonKitName;
3561 27 Oct 15 olle 294     jsonConsumables['LibraryPrepBox1'] = jsonLibraryPrepBox1;
3561 27 Oct 15 olle 295     jsonConsumables['IndexKit'] = jsonIndexKit;
3561 27 Oct 15 olle 296     jsonConsumables['ContentSetBox3'] = jsonContentSetBox3;
3561 27 Oct 15 olle 297     jsonConsumables['OligoPoolA_FPA'] = jsonOligoPoolA_FPA;
3561 27 Oct 15 olle 298     jsonConsumables['OligoPoolB_FPB'] = jsonOligoPoolB_FPB;
3561 27 Oct 15 olle 299     jsonConsumables['OligoHybridizationSequencingReagent3'] = jsonOligoHybridizationSequencingReagent3;
3561 27 Oct 15 olle 300     jsonConsumables['StringentWash1_SW1'] = jsonStringentWash1_SW1;
3561 27 Oct 15 olle 301     jsonConsumables['ExtensionLigationMix3'] = jsonExtensionLigationMix3;
3561 27 Oct 15 olle 302     jsonConsumables['PcrMasterMix2_PMM2'] = jsonPcrMasterMix2_PMM2;
3561 27 Oct 15 olle 303     jsonConsumables['UB1'] = jsonUB1;
3561 27 Oct 15 olle 304     jsonConsumables['TDP'] = jsonTDP;
3561 27 Oct 15 olle 305     jsonConsumables['Filterplate'] = jsonFilterplate;
3561 27 Oct 15 olle 306
3561 27 Oct 15 olle 307     jsonConsumables['IndexPrimerA701'] = jsonIndexPrimerA701;
3561 27 Oct 15 olle 308     jsonConsumables['IndexPrimerA702'] = jsonIndexPrimerA702;
3561 27 Oct 15 olle 309     jsonConsumables['IndexPrimerA703'] = jsonIndexPrimerA703;
3561 27 Oct 15 olle 310     jsonConsumables['IndexPrimerA704'] = jsonIndexPrimerA704;
3561 27 Oct 15 olle 311     jsonConsumables['IndexPrimerA705'] = jsonIndexPrimerA705;
3561 27 Oct 15 olle 312     jsonConsumables['IndexPrimerA706'] = jsonIndexPrimerA706;
3561 27 Oct 15 olle 313     jsonConsumables['IndexPrimerA707'] = jsonIndexPrimerA707;
3561 27 Oct 15 olle 314     jsonConsumables['IndexPrimerA708'] = jsonIndexPrimerA708;
3561 27 Oct 15 olle 315     jsonConsumables['IndexPrimerA709'] = jsonIndexPrimerA709;
3561 27 Oct 15 olle 316     jsonConsumables['IndexPrimerA710'] = jsonIndexPrimerA710;
3561 27 Oct 15 olle 317     jsonConsumables['IndexPrimerA711'] = jsonIndexPrimerA711;
3561 27 Oct 15 olle 318     jsonConsumables['IndexPrimerA712'] = jsonIndexPrimerA712;
3561 27 Oct 15 olle 319
3561 27 Oct 15 olle 320     jsonConsumables['IndexPrimerA501'] = jsonIndexPrimerA501;
3561 27 Oct 15 olle 321     jsonConsumables['IndexPrimerA502'] = jsonIndexPrimerA502;
3561 27 Oct 15 olle 322     jsonConsumables['IndexPrimerA503'] = jsonIndexPrimerA503;
3561 27 Oct 15 olle 323     jsonConsumables['IndexPrimerA504'] = jsonIndexPrimerA504;
3561 27 Oct 15 olle 324     jsonConsumables['IndexPrimerA505'] = jsonIndexPrimerA505;
3561 27 Oct 15 olle 325     jsonConsumables['IndexPrimerA506'] = jsonIndexPrimerA506;
3561 27 Oct 15 olle 326     jsonConsumables['IndexPrimerA507'] = jsonIndexPrimerA507;
3561 27 Oct 15 olle 327     jsonConsumables['IndexPrimerA508'] = jsonIndexPrimerA508;
3561 27 Oct 15 olle 328
3561 27 Oct 15 olle 329     Wizard.setInputStatus('consumablesFile', 'valid');
3561 27 Oct 15 olle 330     consumablesFileIsValid = true;
3561 27 Oct 15 olle 331   }
3561 27 Oct 15 olle 332
3561 27 Oct 15 olle 333   exreg.initializeStep2 = function()
3561 27 Oct 15 olle 334   {
3561 27 Oct 15 olle 335     var frm = document.forms['meludi'];
3561 27 Oct 15 olle 336     var url = '../LibPrep.servlet?ID='+App.getSessionId();
3561 27 Oct 15 olle 337     url += '&cmd=GetLibPrepKitData';
3561 27 Oct 15 olle 338     url += '&libPrepKitFilter='+encodeURIComponent(frm.libPrepKitFilter.value);
3561 27 Oct 15 olle 339     Wizard.showLoadingAnimation('Getting kit data...');
3561 27 Oct 15 olle 340     Wizard.asyncJsonRequest(url, exreg.libPrepKitDataResults);
3561 27 Oct 15 olle 341   }
3561 27 Oct 15 olle 342
3561 27 Oct 15 olle 343   exreg.libPrepKitDataResults = function(response)
3561 27 Oct 15 olle 344   {
3561 27 Oct 15 olle 345     jsonConsumables = response.consumables;
3561 27 Oct 15 olle 346     // Make copy of original values
3561 27 Oct 15 olle 347     jsonConsumablesOrig = exreg.copyJsonConsumables(jsonConsumables);
3561 27 Oct 15 olle 348
3561 27 Oct 15 olle 349     exreg.updateDetailsTable();
3561 27 Oct 15 olle 350   }
3561 27 Oct 15 olle 351
3561 27 Oct 15 olle 352   exreg.updateDetailsTable = function()
3561 27 Oct 15 olle 353   {
3561 27 Oct 15 olle 354     var frm = document.forms['meludi'];
3561 27 Oct 15 olle 355
3561 27 Oct 15 olle 356     // Store data one kit a time, i.e. 'jsonKitArray' is a JSONArray with one JSONObject for each kit
3561 27 Oct 15 olle 357     //exreg.libPrepKitDataToJsonArray();
3561 27 Oct 15 olle 358
3561 27 Oct 15 olle 359     var kitFilterValue = frm.libPrepKitFilter.value;
3561 27 Oct 15 olle 360     var kitFilterName = exreg.fetchLibPrepFilterName(kitFilterValue);
3561 27 Oct 15 olle 361     var numItemsFiltered = jsonConsumables['numItemsFiltered'];
3561 27 Oct 15 olle 362     var numItemsTot = jsonConsumables['numItemsTot'];
3561 27 Oct 15 olle 363     Doc.element('libPrepKitFilterName').innerHTML = '<b>Library preparation kit filter: ' + kitFilterName + '</b>';
3561 27 Oct 15 olle 364     Doc.element('libPrepKitFilterName').innerHTML += '&nbsp;&nbsp;(' + numItemsFiltered + '&nbsp;of&nbsp;' + numItemsTot + ')';
3561 27 Oct 15 olle 365     var html = '<table id="detailsTable" class="step-form">';
3561 27 Oct 15 olle 366
3561 27 Oct 15 olle 367     // First header row
3561 27 Oct 15 olle 368     html += '<thead>';
3561 27 Oct 15 olle 369     html += '<tr>';
3705 19 Jan 16 olle 370     html += '<th></th>';
3705 19 Jan 16 olle 371     //
3561 27 Oct 15 olle 372     html += '<th>TruSight Tumor Library Preparation partI</th>';
3705 19 Jan 16 olle 373     //
3705 19 Jan 16 olle 374     html += '<td class="dottedleft">Registration date</td>';
3705 19 Jan 16 olle 375     html += '<td class="dottedleft">Last updated</td>';
3705 19 Jan 16 olle 376     html += '<td class="dottedleft">Expiration date</td>';
3705 19 Jan 16 olle 377     html += '<td class="dottedleft">Active</td>';
3705 19 Jan 16 olle 378     html += '<td class="dottedleft">#Times used</td>';
3705 19 Jan 16 olle 379     html += '<td class="dottedleft">Unused FPA plate locations</td>';
3705 19 Jan 16 olle 380     html += '<td class="dottedleft">Comment</td>';
3705 19 Jan 16 olle 381     //
3561 27 Oct 15 olle 382     html += '<th class="dottedleft">TruSight Tumor Library Prep Box 1</th>';
3561 27 Oct 15 olle 383     html += '<th class="dottedleft">TruSight Tumor Index Kit</th>';
3561 27 Oct 15 olle 384     html += '<th class="dottedleft">TruSight Tumor Content Set Box 3</th>';
3561 27 Oct 15 olle 385     html += '<th class="dottedleft">TruSight Tumor Oligo Pool A (FPA)</th>';
3561 27 Oct 15 olle 386     html += '<th class="dottedleft">TruSight Tumor Oligo Pool B (FPB)</th>';
3561 27 Oct 15 olle 387     html += '<th class="dottedleft">Oligo Hybridization for Sequencing Reagent 3 (OHS3)</th>';
3561 27 Oct 15 olle 388     html += '<th class="dottedleft">Stringent Wash 1 (SW1)</th>';
3561 27 Oct 15 olle 389     html += '<th class="dottedleft">Extension Ligation Mix 3 (ELM3)</th>';
3561 27 Oct 15 olle 390     html += '<th class="dottedleft">PCR Master Mix 2 (PMM2)</th>';
3561 27 Oct 15 olle 391     html += '<th class="dottedleft">UB1</th>';
3561 27 Oct 15 olle 392     html += '<th class="dottedleft">TDP</th>';
3561 27 Oct 15 olle 393     html += '<th class="dottedleft">Filterplate</th>';
3561 27 Oct 15 olle 394     html += '<th colspan="12" class="dottedleft">Index 1 Primers Lot Number</th>';
3561 27 Oct 15 olle 395     html += '<th colspan="8" class="dottedleft">Index 2 Primers Lot Number</th>';
3561 27 Oct 15 olle 396     html += '</tr>';
3561 27 Oct 15 olle 397     // Second header row
3561 27 Oct 15 olle 398     html += '<tr>';
3561 27 Oct 15 olle 399     html += '<th></th>';
3705 19 Jan 16 olle 400
3705 19 Jan 16 olle 401     html += '<th></th>';
3561 27 Oct 15 olle 402     html += '<th class="dottedleft"></th>';
3561 27 Oct 15 olle 403     html += '<td class="dottedleft"></td>';
3561 27 Oct 15 olle 404     html += '<td class="dottedleft"></td>';
3561 27 Oct 15 olle 405     html += '<td class="dottedleft"></td>';
3561 27 Oct 15 olle 406     html += '<td class="dottedleft"></td>';
3561 27 Oct 15 olle 407     html += '<td class="dottedleft"></td>';
3561 27 Oct 15 olle 408     html += '<td class="dottedleft"></td>';
3561 27 Oct 15 olle 409     html += '<td class="dottedleft"></td>';
3561 27 Oct 15 olle 410     html += '<td class="dottedleft"></td>';
3561 27 Oct 15 olle 411     html += '<td class="dottedleft"></td>';
3561 27 Oct 15 olle 412     html += '<td class="dottedleft"></td>';
3561 27 Oct 15 olle 413     html += '<td class="dottedleft"></td>';
3561 27 Oct 15 olle 414     // Index 1 Primers Lot Number
3561 27 Oct 15 olle 415     html += '<td class="dottedleft">ATCACGAC</td>';
3561 27 Oct 15 olle 416     html += '<td class="dottedleft">ACAGTGGT</td>';
3561 27 Oct 15 olle 417     html += '<td class="dottedleft">CAGATCCA</td>';
3561 27 Oct 15 olle 418     html += '<td class="dottedleft">ACAAACGG</td>';
3561 27 Oct 15 olle 419     html += '<td class="dottedleft">ACCCAGCA</td>';
3561 27 Oct 15 olle 420     html += '<td class="dottedleft">AACCCCTC</td>';
3561 27 Oct 15 olle 421     html += '<td class="dottedleft">CCCAACCT</td>';
3561 27 Oct 15 olle 422     html += '<td class="dottedleft">CACCACAC</td>';
3561 27 Oct 15 olle 423     html += '<td class="dottedleft">GAAACCCA</td>';
3561 27 Oct 15 olle 424     html += '<td class="dottedleft">TGTGACCA</td>';
3561 27 Oct 15 olle 425     html += '<td class="dottedleft">AGGGTCAA</td>';
3561 27 Oct 15 olle 426     html += '<td class="dottedleft">AGGAGTGG</td>';
3561 27 Oct 15 olle 427     // Index 2 Primers Lot Number
3561 27 Oct 15 olle 428     html += '<td class="dottedleft">TGAACCTT</td>';
3561 27 Oct 15 olle 429     html += '<td class="dottedleft">TGCTAAGT</td>';
3561 27 Oct 15 olle 430     html += '<td class="dottedleft">TGTTCTCT</td>';
3561 27 Oct 15 olle 431     html += '<td class="dottedleft">TAAGACAC</td>';
3561 27 Oct 15 olle 432     html += '<td class="dottedleft">CTAATCGA</td>';
3561 27 Oct 15 olle 433     html += '<td class="dottedleft">CTAGAACA</td>';
3561 27 Oct 15 olle 434     html += '<td class="dottedleft">TAAGTTCC</td>';
3561 27 Oct 15 olle 435     html += '<td class="dottedleft">TAGACCTA</td>';
3561 27 Oct 15 olle 436     html += '</tr>';
3561 27 Oct 15 olle 437     // Third header row
3561 27 Oct 15 olle 438     html += '<tr>';
3561 27 Oct 15 olle 439     html += '<th></th>';
3705 19 Jan 16 olle 440
3705 19 Jan 16 olle 441     html += '<th></th>';
3561 27 Oct 15 olle 442     html += '<th class="dottedleft"></th>';
3561 27 Oct 15 olle 443     html += '<td class="dottedleft"></td>';
3561 27 Oct 15 olle 444     html += '<td class="dottedleft"></td>';
3561 27 Oct 15 olle 445     html += '<td class="dottedleft"></td>';
3561 27 Oct 15 olle 446     html += '<td class="dottedleft"></td>';
3561 27 Oct 15 olle 447     html += '<td class="dottedleft"></td>';
3561 27 Oct 15 olle 448     html += '<td class="dottedleft"></td>';
3561 27 Oct 15 olle 449     html += '<td class="dottedleft"></td>';
3561 27 Oct 15 olle 450     html += '<td class="dottedleft"></td>';
3561 27 Oct 15 olle 451     html += '<td class="dottedleft"></td>';
3561 27 Oct 15 olle 452     html += '<td class="dottedleft"></td>';
3561 27 Oct 15 olle 453     html += '<td class="dottedleft"></td>';
3561 27 Oct 15 olle 454     // Index 1 Primers Lot Number
3561 27 Oct 15 olle 455     html += '<td class="dottedleft">A701</td>';
3561 27 Oct 15 olle 456     html += '<td class="dottedleft">A702</td>';
3561 27 Oct 15 olle 457     html += '<td class="dottedleft">A703</td>';
3561 27 Oct 15 olle 458     html += '<td class="dottedleft">A704</td>';
3561 27 Oct 15 olle 459     html += '<td class="dottedleft">A705</td>';
3561 27 Oct 15 olle 460     html += '<td class="dottedleft">A706</td>';
3561 27 Oct 15 olle 461     html += '<td class="dottedleft">A707</td>';
3561 27 Oct 15 olle 462     html += '<td class="dottedleft">A708</td>';
3561 27 Oct 15 olle 463     html += '<td class="dottedleft">A709</td>';
3561 27 Oct 15 olle 464     html += '<td class="dottedleft">A710</td>';
3561 27 Oct 15 olle 465     html += '<td class="dottedleft">A711</td>';
3561 27 Oct 15 olle 466     html += '<td class="dottedleft">A712</td>';
3561 27 Oct 15 olle 467     // Index 2 Primers Lot Number
3561 27 Oct 15 olle 468     html += '<td class="dottedleft">A501</td>';
3561 27 Oct 15 olle 469     html += '<td class="dottedleft">A502</td>';
3561 27 Oct 15 olle 470     html += '<td class="dottedleft">A503</td>';
3561 27 Oct 15 olle 471     html += '<td class="dottedleft">A504</td>';
3561 27 Oct 15 olle 472     html += '<td class="dottedleft">A505</td>';
3561 27 Oct 15 olle 473     html += '<td class="dottedleft">A506</td>';
3561 27 Oct 15 olle 474     html += '<td class="dottedleft">A507</td>';
3561 27 Oct 15 olle 475     html += '<td class="dottedleft">A508</td>';
3561 27 Oct 15 olle 476     //
3561 27 Oct 15 olle 477     html += '</tr>';
3561 27 Oct 15 olle 478     html += '</thead>';
3561 27 Oct 15 olle 479     html += '<tbody>';
3561 27 Oct 15 olle 480
3561 27 Oct 15 olle 481     // Get JSONArrays with data for kits
3561 27 Oct 15 olle 482
3561 27 Oct 15 olle 483     var jsonHeaders = jsonConsumables['Headers'];
3561 27 Oct 15 olle 484
3561 27 Oct 15 olle 485     var jsonKitName = jsonConsumables['KitName'];
3705 19 Jan 16 olle 486
3705 19 Jan 16 olle 487     var jsonRegistrationDate = jsonConsumables['RegistrationDate'];
3705 19 Jan 16 olle 488     var jsonLastUpdatedDate = jsonConsumables['LastUpdatedDate'];
3705 19 Jan 16 olle 489     var jsonExpirationDate = jsonConsumables['ExpirationDate'];
3705 19 Jan 16 olle 490     var jsonActive = jsonConsumables['Active'];
3705 19 Jan 16 olle 491     var jsonTimesUsed = jsonConsumables['TimesUsed'];
3705 19 Jan 16 olle 492     var jsonUnusedFpaPlateLocs = jsonConsumables['UnusedFpaPlateLocs'];
3705 19 Jan 16 olle 493     var jsonComment = jsonConsumables['Comment'];
3705 19 Jan 16 olle 494
3561 27 Oct 15 olle 495     var jsonLibraryPrepBox1 = jsonConsumables['LibraryPrepBox1'];
3561 27 Oct 15 olle 496     var jsonIndexKit = jsonConsumables['IndexKit'];
3561 27 Oct 15 olle 497     var jsonContentSetBox3 = jsonConsumables['ContentSetBox3'];
3561 27 Oct 15 olle 498     var jsonOligoPoolA_FPA = jsonConsumables['OligoPoolA_FPA'];
3561 27 Oct 15 olle 499     var jsonOligoPoolB_FPB = jsonConsumables['OligoPoolB_FPB'];
3561 27 Oct 15 olle 500     var jsonOligoHybridizationSequencingReagent3 = jsonConsumables['OligoHybridizationSequencingReagent3'];
3561 27 Oct 15 olle 501     var jsonStringentWash1_SW1 = jsonConsumables['StringentWash1_SW1'];
3561 27 Oct 15 olle 502     var jsonExtensionLigationMix3 = jsonConsumables['ExtensionLigationMix3'];
3561 27 Oct 15 olle 503     var jsonPcrMasterMix2_PMM2 = jsonConsumables['PcrMasterMix2_PMM2'];
3561 27 Oct 15 olle 504     var jsonUB1 = jsonConsumables['UB1'];
3561 27 Oct 15 olle 505     var jsonTDP = jsonConsumables['TDP'];
3561 27 Oct 15 olle 506     var jsonFilterplate = jsonConsumables['Filterplate'];
3561 27 Oct 15 olle 507     
3561 27 Oct 15 olle 508     var jsonIndexPrimerA701 = jsonConsumables['IndexPrimerA701'];
3561 27 Oct 15 olle 509     var jsonIndexPrimerA702 = jsonConsumables['IndexPrimerA702'];
3561 27 Oct 15 olle 510     var jsonIndexPrimerA703 = jsonConsumables['IndexPrimerA703'];
3561 27 Oct 15 olle 511     var jsonIndexPrimerA704 = jsonConsumables['IndexPrimerA704'];
3561 27 Oct 15 olle 512     var jsonIndexPrimerA705 = jsonConsumables['IndexPrimerA705'];
3561 27 Oct 15 olle 513     var jsonIndexPrimerA706 = jsonConsumables['IndexPrimerA706'];
3561 27 Oct 15 olle 514     var jsonIndexPrimerA707 = jsonConsumables['IndexPrimerA707'];
3561 27 Oct 15 olle 515     var jsonIndexPrimerA708 = jsonConsumables['IndexPrimerA708'];
3561 27 Oct 15 olle 516     var jsonIndexPrimerA709 = jsonConsumables['IndexPrimerA709'];
3561 27 Oct 15 olle 517     var jsonIndexPrimerA710 = jsonConsumables['IndexPrimerA710'];
3561 27 Oct 15 olle 518     var jsonIndexPrimerA711 = jsonConsumables['IndexPrimerA711'];
3561 27 Oct 15 olle 519     var jsonIndexPrimerA712 = jsonConsumables['IndexPrimerA712'];
3561 27 Oct 15 olle 520     
3561 27 Oct 15 olle 521     var jsonIndexPrimerA501 = jsonConsumables['IndexPrimerA501'];
3561 27 Oct 15 olle 522     var jsonIndexPrimerA502 = jsonConsumables['IndexPrimerA502'];
3561 27 Oct 15 olle 523     var jsonIndexPrimerA503 = jsonConsumables['IndexPrimerA503'];
3561 27 Oct 15 olle 524     var jsonIndexPrimerA504 = jsonConsumables['IndexPrimerA504'];
3561 27 Oct 15 olle 525     var jsonIndexPrimerA505 = jsonConsumables['IndexPrimerA505'];
3561 27 Oct 15 olle 526     var jsonIndexPrimerA506 = jsonConsumables['IndexPrimerA506'];
3561 27 Oct 15 olle 527     var jsonIndexPrimerA507 = jsonConsumables['IndexPrimerA507'];
3561 27 Oct 15 olle 528     var jsonIndexPrimerA508 = jsonConsumables['IndexPrimerA508'];
3561 27 Oct 15 olle 529
3561 27 Oct 15 olle 530     var numItems = jsonKitName.length;
3561 27 Oct 15 olle 531
3561 27 Oct 15 olle 532     for (var i = 0; i < numItems; i++)
3561 27 Oct 15 olle 533     {
3610 20 Nov 15 olle 534       var activeStr = 'yes';
3610 20 Nov 15 olle 535       if (!jsonActive[i])
3610 20 Nov 15 olle 536       {
3610 20 Nov 15 olle 537         activeStr = 'no';
3610 20 Nov 15 olle 538       }
3610 20 Nov 15 olle 539       var timesUsed = '' + jsonTimesUsed[i];
3610 20 Nov 15 olle 540
3561 27 Oct 15 olle 541       html += '<tr class="highlight">';
3705 19 Jan 16 olle 542       // Add edit button
3705 19 Jan 16 olle 543       html += '<td><div class="button basicbutton interactable edit-details" style="width: 5em;" data-index="'+i+'">Edit&hellip;</div></td>';
3705 19 Jan 16 olle 544
3705 19 Jan 16 olle 545       html += '<th class="dottedleft" id="kitName'+i+'">' + Strings.encodeTags(jsonKitName[i]) + '</th>';
3705 19 Jan 16 olle 546
3705 19 Jan 16 olle 547       html += '<td class="dottedleft" id="registrationDate'+i+'">' + Strings.encodeTags(jsonRegistrationDate[i]) + '</td>';
3705 19 Jan 16 olle 548       html += '<td class="dottedleft" id="lastUpdatedDate'+i+'">' + Strings.encodeTags(jsonLastUpdatedDate[i]) + '</td>';
3705 19 Jan 16 olle 549       html += '<td class="dottedleft" id="expirationDate'+i+'">' + Strings.encodeTags(jsonExpirationDate[i]) + '</td>';
3705 19 Jan 16 olle 550       html += '<td class="dottedleft" id="active'+i+'">' + Strings.encodeTags(activeStr) + '</td>';
3705 19 Jan 16 olle 551       html += '<td class="dottedleft" id="numTimesUsed'+i+'">' + Strings.encodeTags(timesUsed) + '</td>';
3705 19 Jan 16 olle 552       html += '<td class="dottedleft" id="unusedFpaLoc'+i+'">' + Strings.encodeTags(jsonUnusedFpaPlateLocs[i]) + '</td>';
3705 19 Jan 16 olle 553       html += '<td class="dottedleft" id="kitComment'+i+'">' + Strings.encodeTags(jsonComment[i]) + '</td>';
3705 19 Jan 16 olle 554
3561 27 Oct 15 olle 555       html += '<td class="dottedleft" id="libraryPrepBox1'+i+'">' + Strings.encodeTags(jsonLibraryPrepBox1[i]) + '</td>';
3561 27 Oct 15 olle 556       html += '<td class="dottedleft" id="indexKit'+i+'">' + Strings.encodeTags(jsonIndexKit[i]) + '</td>';
3561 27 Oct 15 olle 557       html += '<td class="dottedleft" id="contentSetBox3'+i+'">' + Strings.encodeTags(jsonContentSetBox3[i]) + '</td>';
3561 27 Oct 15 olle 558       html += '<td class="dottedleft" id="oligoPoolA_FPA'+i+'">' + Strings.encodeTags(jsonOligoPoolA_FPA[i]) + '</td>';
3561 27 Oct 15 olle 559       html += '<td class="dottedleft" id="oligoPoolB_FPB'+i+'">' + Strings.encodeTags(jsonOligoPoolB_FPB[i]) + '</td>';
3561 27 Oct 15 olle 560       html += '<td class="dottedleft" id="oligoHybridizationSequencingReagent3'+i+'">' + Strings.encodeTags(jsonOligoHybridizationSequencingReagent3[i]) + '</td>';
3561 27 Oct 15 olle 561       html += '<td class="dottedleft" id="stringentWash1_SW1'+i+'">' + Strings.encodeTags(jsonStringentWash1_SW1[i]) + '</td>';
3561 27 Oct 15 olle 562       html += '<td class="dottedleft" id="extensionLigationMix3'+i+'">' + Strings.encodeTags(jsonExtensionLigationMix3[i]) + '</td>';
3561 27 Oct 15 olle 563       html += '<td class="dottedleft" id="pcrMasterMix2_PMM2'+i+'">' + Strings.encodeTags(jsonPcrMasterMix2_PMM2[i]) + '</td>';
3561 27 Oct 15 olle 564       html += '<td class="dottedleft" id="ub1'+i+'">' + Strings.encodeTags(jsonUB1[i]) + '</td>';
3561 27 Oct 15 olle 565       html += '<td class="dottedleft" id="tdp'+i+'">' + Strings.encodeTags(jsonTDP[i]) + '</td>';
3561 27 Oct 15 olle 566       html += '<td class="dottedleft" id="filterplate'+i+'">' + Strings.encodeTags(jsonFilterplate[i]) + '</td>';
3561 27 Oct 15 olle 567
3561 27 Oct 15 olle 568       html += '<td class="dottedleft" id="indexPrimerA701'+i+'">' + Strings.encodeTags(jsonIndexPrimerA701[i]) + '</td>';
3561 27 Oct 15 olle 569       html += '<td class="dottedleft" id="indexPrimerA702'+i+'">' + Strings.encodeTags(jsonIndexPrimerA702[i]) + '</td>';
3561 27 Oct 15 olle 570       html += '<td class="dottedleft" id="indexPrimerA703'+i+'">' + Strings.encodeTags(jsonIndexPrimerA703[i]) + '</td>';
3608 18 Nov 15 olle 571       html += '<td class="dottedleft" id="indexPrimerA704'+i+'">' + Strings.encodeTags(jsonIndexPrimerA704[i]) + '</td>';
3561 27 Oct 15 olle 572       html += '<td class="dottedleft" id="indexPrimerA705'+i+'">' + Strings.encodeTags(jsonIndexPrimerA705[i]) + '</td>';
3561 27 Oct 15 olle 573       html += '<td class="dottedleft" id="indexPrimerA706'+i+'">' + Strings.encodeTags(jsonIndexPrimerA706[i]) + '</td>';
3561 27 Oct 15 olle 574       html += '<td class="dottedleft" id="indexPrimerA707'+i+'">' + Strings.encodeTags(jsonIndexPrimerA707[i]) + '</td>';
3561 27 Oct 15 olle 575       html += '<td class="dottedleft" id="indexPrimerA708'+i+'">' + Strings.encodeTags(jsonIndexPrimerA708[i]) + '</td>';
3561 27 Oct 15 olle 576       html += '<td class="dottedleft" id="indexPrimerA709'+i+'">' + Strings.encodeTags(jsonIndexPrimerA709[i]) + '</td>';
3561 27 Oct 15 olle 577       html += '<td class="dottedleft" id="indexPrimerA710'+i+'">' + Strings.encodeTags(jsonIndexPrimerA710[i]) + '</td>';
3561 27 Oct 15 olle 578       html += '<td class="dottedleft" id="indexPrimerA711'+i+'">' + Strings.encodeTags(jsonIndexPrimerA711[i]) + '</td>';
3561 27 Oct 15 olle 579       html += '<td class="dottedleft" id="indexPrimerA712'+i+'">' + Strings.encodeTags(jsonIndexPrimerA712[i]) + '</td>';
3561 27 Oct 15 olle 580
3561 27 Oct 15 olle 581       html += '<td class="dottedleft" id="indexPrimerA501'+i+'">' + Strings.encodeTags(jsonIndexPrimerA501[i]) + '</td>';
3561 27 Oct 15 olle 582       html += '<td class="dottedleft" id="indexPrimerA502'+i+'">' + Strings.encodeTags(jsonIndexPrimerA502[i]) + '</td>';
3561 27 Oct 15 olle 583       html += '<td class="dottedleft" id="indexPrimerA503'+i+'">' + Strings.encodeTags(jsonIndexPrimerA503[i]) + '</td>';
3561 27 Oct 15 olle 584       html += '<td class="dottedleft" id="indexPrimerA504'+i+'">' + Strings.encodeTags(jsonIndexPrimerA504[i]) + '</td>';
3561 27 Oct 15 olle 585       html += '<td class="dottedleft" id="indexPrimerA505'+i+'">' + Strings.encodeTags(jsonIndexPrimerA505[i]) + '</td>';
3561 27 Oct 15 olle 586       html += '<td class="dottedleft" id="indexPrimerA506'+i+'">' + Strings.encodeTags(jsonIndexPrimerA506[i]) + '</td>';
3561 27 Oct 15 olle 587       html += '<td class="dottedleft" id="indexPrimerA507'+i+'">' + Strings.encodeTags(jsonIndexPrimerA507[i]) + '</td>';
3561 27 Oct 15 olle 588       html += '<td class="dottedleft" id="indexPrimerA508'+i+'">' + Strings.encodeTags(jsonIndexPrimerA508[i]) + '</td>';
3561 27 Oct 15 olle 589
3561 27 Oct 15 olle 590       // Add edit button
3561 27 Oct 15 olle 591       html += '<td><div class="button basicbutton interactable edit-details" style="width: 5em;" data-index="'+i+'">Edit&hellip;</div></td>';
3561 27 Oct 15 olle 592
3561 27 Oct 15 olle 593       html += '</tr>';
3561 27 Oct 15 olle 594     }
3561 27 Oct 15 olle 595     html += '</tbody>';
3561 27 Oct 15 olle 596     html += '</table>';
3561 27 Oct 15 olle 597     Doc.element('detailsSection').innerHTML = html;
3561 27 Oct 15 olle 598
3561 27 Oct 15 olle 599     // Highlight modified items
3561 27 Oct 15 olle 600     
3705 19 Jan 16 olle 601     var jsonRegistrationDateOrig = jsonConsumablesOrig['RegistrationDate'];
3705 19 Jan 16 olle 602     var jsonLastUpdatedDateOrig = jsonConsumablesOrig['LastUpdatedDate'];
3705 19 Jan 16 olle 603     var jsonExpirationDateOrig = jsonConsumablesOrig['ExpirationDate'];
3705 19 Jan 16 olle 604     var jsonActiveOrig = jsonConsumablesOrig['Active'];
3705 19 Jan 16 olle 605     var jsonTimesUsedOrig = jsonConsumablesOrig['TimesUsed'];
3705 19 Jan 16 olle 606     var jsonUnusedFpaPlateLocsOrig = jsonConsumablesOrig['UnusedFpaPlateLocs'];
3705 19 Jan 16 olle 607     var jsonCommentOrig = jsonConsumablesOrig['Comment'];
3705 19 Jan 16 olle 608
3561 27 Oct 15 olle 609     var jsonLibraryPrepBox1Orig = jsonConsumablesOrig['LibraryPrepBox1'];
3561 27 Oct 15 olle 610     var jsonIndexKitOrig = jsonConsumablesOrig['IndexKit'];
3561 27 Oct 15 olle 611     var jsonContentSetBox3Orig = jsonConsumablesOrig['ContentSetBox3'];
3561 27 Oct 15 olle 612     var jsonOligoPoolA_FPAOrig = jsonConsumablesOrig['OligoPoolA_FPA'];
3561 27 Oct 15 olle 613     var jsonOligoPoolB_FPBOrig = jsonConsumablesOrig['OligoPoolB_FPB'];
3561 27 Oct 15 olle 614     var jsonOligoHybridizationSequencingReagent3Orig = jsonConsumablesOrig['OligoHybridizationSequencingReagent3'];
3561 27 Oct 15 olle 615     var jsonStringentWash1_SW1Orig = jsonConsumablesOrig['StringentWash1_SW1'];
3561 27 Oct 15 olle 616     var jsonExtensionLigationMix3Orig = jsonConsumablesOrig['ExtensionLigationMix3'];
3561 27 Oct 15 olle 617     var jsonPcrMasterMix2_PMM2Orig = jsonConsumablesOrig['PcrMasterMix2_PMM2'];
3561 27 Oct 15 olle 618     var jsonUB1Orig = jsonConsumablesOrig['UB1'];
3561 27 Oct 15 olle 619     var jsonTDPOrig = jsonConsumablesOrig['TDP'];
3561 27 Oct 15 olle 620     var jsonFilterplateOrig = jsonConsumablesOrig['Filterplate'];
3561 27 Oct 15 olle 621     
3561 27 Oct 15 olle 622     var jsonIndexPrimerA701Orig = jsonConsumablesOrig['IndexPrimerA701'];
3561 27 Oct 15 olle 623     var jsonIndexPrimerA702Orig = jsonConsumablesOrig['IndexPrimerA702'];
3561 27 Oct 15 olle 624     var jsonIndexPrimerA703Orig = jsonConsumablesOrig['IndexPrimerA703'];
3561 27 Oct 15 olle 625     var jsonIndexPrimerA704Orig = jsonConsumablesOrig['IndexPrimerA704'];
3561 27 Oct 15 olle 626     var jsonIndexPrimerA705Orig = jsonConsumablesOrig['IndexPrimerA705'];
3561 27 Oct 15 olle 627     var jsonIndexPrimerA706Orig = jsonConsumablesOrig['IndexPrimerA706'];
3561 27 Oct 15 olle 628     var jsonIndexPrimerA707Orig = jsonConsumablesOrig['IndexPrimerA707'];
3561 27 Oct 15 olle 629     var jsonIndexPrimerA708Orig = jsonConsumablesOrig['IndexPrimerA708'];
3561 27 Oct 15 olle 630     var jsonIndexPrimerA709Orig = jsonConsumablesOrig['IndexPrimerA709'];
3561 27 Oct 15 olle 631     var jsonIndexPrimerA710Orig = jsonConsumablesOrig['IndexPrimerA710'];
3561 27 Oct 15 olle 632     var jsonIndexPrimerA711Orig = jsonConsumablesOrig['IndexPrimerA711'];
3561 27 Oct 15 olle 633     var jsonIndexPrimerA712Orig = jsonConsumablesOrig['IndexPrimerA712'];
3561 27 Oct 15 olle 634     
3561 27 Oct 15 olle 635     var jsonIndexPrimerA501Orig = jsonConsumablesOrig['IndexPrimerA501'];
3561 27 Oct 15 olle 636     var jsonIndexPrimerA502Orig = jsonConsumablesOrig['IndexPrimerA502'];
3561 27 Oct 15 olle 637     var jsonIndexPrimerA503Orig = jsonConsumablesOrig['IndexPrimerA503'];
3561 27 Oct 15 olle 638     var jsonIndexPrimerA504Orig = jsonConsumablesOrig['IndexPrimerA504'];
3561 27 Oct 15 olle 639     var jsonIndexPrimerA505Orig = jsonConsumablesOrig['IndexPrimerA505'];
3561 27 Oct 15 olle 640     var jsonIndexPrimerA506Orig = jsonConsumablesOrig['IndexPrimerA506'];
3561 27 Oct 15 olle 641     var jsonIndexPrimerA507Orig = jsonConsumablesOrig['IndexPrimerA507'];
3561 27 Oct 15 olle 642     var jsonIndexPrimerA508Orig = jsonConsumablesOrig['IndexPrimerA508'];
3561 27 Oct 15 olle 643
3561 27 Oct 15 olle 644     for (var i = 0; i < numItems; i++)
3561 27 Oct 15 olle 645     {
3561 27 Oct 15 olle 646       // Test of modification highlight
3705 19 Jan 16 olle 647       Doc.addOrRemoveClass('registrationDate'+i, 'nondefault', jsonRegistrationDate[i] != jsonRegistrationDateOrig[i]);
3705 19 Jan 16 olle 648       Doc.addOrRemoveClass('lastUpdatedDate'+i, 'nondefault', jsonLastUpdatedDate[i] != jsonLastUpdatedDateOrig[i]);
3705 19 Jan 16 olle 649       Doc.addOrRemoveClass('expirationDate'+i, 'nondefault', jsonExpirationDate[i] != jsonExpirationDateOrig[i]);
3705 19 Jan 16 olle 650       Doc.addOrRemoveClass('active'+i, 'nondefault', jsonActive[i] != jsonActiveOrig[i]);
3705 19 Jan 16 olle 651       Doc.addOrRemoveClass('numTimesUsed'+i, 'nondefault', jsonTimesUsed[i] != jsonTimesUsedOrig[i]);
3705 19 Jan 16 olle 652       Doc.addOrRemoveClass('unusedFpaLoc'+i, 'nondefault', jsonUnusedFpaPlateLocs[i] != jsonUnusedFpaPlateLocsOrig[i]);
3705 19 Jan 16 olle 653       Doc.addOrRemoveClass('kitComment'+i, 'nondefault', jsonComment[i] != jsonCommentOrig[i]);
3705 19 Jan 16 olle 654
3561 27 Oct 15 olle 655       Doc.addOrRemoveClass('libraryPrepBox1'+i, 'nondefault', jsonLibraryPrepBox1[i] != jsonLibraryPrepBox1Orig[i]);
3561 27 Oct 15 olle 656       Doc.addOrRemoveClass('indexKit'+i, 'nondefault', jsonIndexKit[i] != jsonIndexKitOrig[i]);
3561 27 Oct 15 olle 657       Doc.addOrRemoveClass('contentSetBox3'+i, 'nondefault', jsonContentSetBox3[i] != jsonContentSetBox3Orig[i]);
3561 27 Oct 15 olle 658       Doc.addOrRemoveClass('oligoPoolA_FPA'+i, 'nondefault', jsonOligoPoolA_FPA[i] != jsonOligoPoolA_FPAOrig[i]);
3561 27 Oct 15 olle 659       Doc.addOrRemoveClass('oligoPoolB_FPB'+i, 'nondefault', jsonOligoPoolB_FPB[i] != jsonOligoPoolB_FPBOrig[i]);
3561 27 Oct 15 olle 660       Doc.addOrRemoveClass('oligoHybridizationSequencingReagent3'+i, 'nondefault', jsonOligoHybridizationSequencingReagent3[i] != jsonOligoHybridizationSequencingReagent3Orig[i]);
3561 27 Oct 15 olle 661       Doc.addOrRemoveClass('stringentWash1_SW1'+i, 'nondefault', jsonStringentWash1_SW1[i] != jsonStringentWash1_SW1Orig[i]);
3561 27 Oct 15 olle 662       Doc.addOrRemoveClass('extensionLigationMix3'+i, 'nondefault', jsonExtensionLigationMix3[i] != jsonExtensionLigationMix3Orig[i]);
3561 27 Oct 15 olle 663       Doc.addOrRemoveClass('pcrMasterMix2_PMM2'+i, 'nondefault', jsonPcrMasterMix2_PMM2[i] != jsonPcrMasterMix2_PMM2Orig[i]);
3561 27 Oct 15 olle 664       Doc.addOrRemoveClass('ub1'+i, 'nondefault', jsonUB1[i] != jsonUB1Orig[i]);
3561 27 Oct 15 olle 665       Doc.addOrRemoveClass('tdp'+i, 'nondefault', jsonTDP[i] != jsonTDPOrig[i]);
3561 27 Oct 15 olle 666       Doc.addOrRemoveClass('filterplate'+i, 'nondefault', jsonFilterplate[i] != jsonFilterplateOrig[i]);
3561 27 Oct 15 olle 667
3561 27 Oct 15 olle 668       Doc.addOrRemoveClass('indexPrimerA701'+i, 'nondefault', jsonIndexPrimerA701[i] != jsonIndexPrimerA701Orig[i]);
3561 27 Oct 15 olle 669       Doc.addOrRemoveClass('indexPrimerA702'+i, 'nondefault', jsonIndexPrimerA702[i] != jsonIndexPrimerA702Orig[i]);
3561 27 Oct 15 olle 670       Doc.addOrRemoveClass('indexPrimerA703'+i, 'nondefault', jsonIndexPrimerA703[i] != jsonIndexPrimerA703Orig[i]);
3561 27 Oct 15 olle 671       Doc.addOrRemoveClass('indexPrimerA704'+i, 'nondefault', jsonIndexPrimerA704[i] != jsonIndexPrimerA704Orig[i]);
3561 27 Oct 15 olle 672       Doc.addOrRemoveClass('indexPrimerA705'+i, 'nondefault', jsonIndexPrimerA705[i] != jsonIndexPrimerA705Orig[i]);
3561 27 Oct 15 olle 673       Doc.addOrRemoveClass('indexPrimerA706'+i, 'nondefault', jsonIndexPrimerA706[i] != jsonIndexPrimerA706Orig[i]);
3561 27 Oct 15 olle 674       Doc.addOrRemoveClass('indexPrimerA707'+i, 'nondefault', jsonIndexPrimerA707[i] != jsonIndexPrimerA707Orig[i]);
3561 27 Oct 15 olle 675       Doc.addOrRemoveClass('indexPrimerA708'+i, 'nondefault', jsonIndexPrimerA708[i] != jsonIndexPrimerA708Orig[i]);
3561 27 Oct 15 olle 676       Doc.addOrRemoveClass('indexPrimerA709'+i, 'nondefault', jsonIndexPrimerA709[i] != jsonIndexPrimerA709Orig[i]);
3561 27 Oct 15 olle 677       Doc.addOrRemoveClass('indexPrimerA710'+i, 'nondefault', jsonIndexPrimerA710[i] != jsonIndexPrimerA710Orig[i]);
3561 27 Oct 15 olle 678       Doc.addOrRemoveClass('indexPrimerA711'+i, 'nondefault', jsonIndexPrimerA711[i] != jsonIndexPrimerA711Orig[i]);
3561 27 Oct 15 olle 679       Doc.addOrRemoveClass('indexPrimerA712'+i, 'nondefault', jsonIndexPrimerA712[i] != jsonIndexPrimerA712Orig[i]);
3561 27 Oct 15 olle 680
3561 27 Oct 15 olle 681       Doc.addOrRemoveClass('indexPrimerA501'+i, 'nondefault', jsonIndexPrimerA501[i] != jsonIndexPrimerA501Orig[i]);
3561 27 Oct 15 olle 682       Doc.addOrRemoveClass('indexPrimerA502'+i, 'nondefault', jsonIndexPrimerA502[i] != jsonIndexPrimerA502Orig[i]);
3561 27 Oct 15 olle 683       Doc.addOrRemoveClass('indexPrimerA503'+i, 'nondefault', jsonIndexPrimerA503[i] != jsonIndexPrimerA503Orig[i]);
3561 27 Oct 15 olle 684       Doc.addOrRemoveClass('indexPrimerA504'+i, 'nondefault', jsonIndexPrimerA504[i] != jsonIndexPrimerA504Orig[i]);
3561 27 Oct 15 olle 685       Doc.addOrRemoveClass('indexPrimerA505'+i, 'nondefault', jsonIndexPrimerA505[i] != jsonIndexPrimerA505Orig[i]);
3561 27 Oct 15 olle 686       Doc.addOrRemoveClass('indexPrimerA506'+i, 'nondefault', jsonIndexPrimerA506[i] != jsonIndexPrimerA506Orig[i]);
3561 27 Oct 15 olle 687       Doc.addOrRemoveClass('indexPrimerA507'+i, 'nondefault', jsonIndexPrimerA507[i] != jsonIndexPrimerA507Orig[i]);
3561 27 Oct 15 olle 688       Doc.addOrRemoveClass('indexPrimerA508'+i, 'nondefault', jsonIndexPrimerA508[i] != jsonIndexPrimerA508Orig[i]);
3561 27 Oct 15 olle 689     }
3561 27 Oct 15 olle 690
3561 27 Oct 15 olle 691     // Collect data for modified kits
3561 27 Oct 15 olle 692
3561 27 Oct 15 olle 693     var jsonKitNameModified = [];
3705 19 Jan 16 olle 694
3705 19 Jan 16 olle 695     var jsonRegistrationDateModified = [];
3705 19 Jan 16 olle 696     var jsonLastUpdatedDateModified = [];
3705 19 Jan 16 olle 697     var jsonExpirationDateModified = [];
3705 19 Jan 16 olle 698     var jsonActiveModified = [];
3705 19 Jan 16 olle 699     var jsonTimesUsedModified = [];
3705 19 Jan 16 olle 700     var jsonUnusedFpaPlateLocsModified = [];
3705 19 Jan 16 olle 701     var jsonCommentModified = [];
3705 19 Jan 16 olle 702
3561 27 Oct 15 olle 703     var jsonLibraryPrepBox1Modified = [];
3561 27 Oct 15 olle 704     var jsonIndexKitModified = [];
3561 27 Oct 15 olle 705     var jsonContentSetBox3Modified = [];
3561 27 Oct 15 olle 706     var jsonOligoPoolA_FPAModified = [];
3561 27 Oct 15 olle 707     var jsonOligoPoolB_FPBModified = [];
3561 27 Oct 15 olle 708     var jsonOligoHybridizationSequencingReagent3Modified = [];
3561 27 Oct 15 olle 709     var jsonStringentWash1_SW1Modified = [];
3561 27 Oct 15 olle 710     var jsonExtensionLigationMix3Modified = [];
3561 27 Oct 15 olle 711     var jsonPcrMasterMix2_PMM2Modified = [];
3561 27 Oct 15 olle 712     var jsonUB1Modified = [];
3561 27 Oct 15 olle 713     var jsonTDPModified = [];
3561 27 Oct 15 olle 714     var jsonFilterplateModified = [];
3561 27 Oct 15 olle 715     
3561 27 Oct 15 olle 716     var jsonIndexPrimerA701Modified = [];
3561 27 Oct 15 olle 717     var jsonIndexPrimerA702Modified = [];
3561 27 Oct 15 olle 718     var jsonIndexPrimerA703Modified = [];
3561 27 Oct 15 olle 719     var jsonIndexPrimerA704Modified = [];
3561 27 Oct 15 olle 720     var jsonIndexPrimerA705Modified = [];
3561 27 Oct 15 olle 721     var jsonIndexPrimerA706Modified = [];
3561 27 Oct 15 olle 722     var jsonIndexPrimerA707Modified = [];
3561 27 Oct 15 olle 723     var jsonIndexPrimerA708Modified = [];
3561 27 Oct 15 olle 724     var jsonIndexPrimerA709Modified = [];
3561 27 Oct 15 olle 725     var jsonIndexPrimerA710Modified = [];
3561 27 Oct 15 olle 726     var jsonIndexPrimerA711Modified = [];
3561 27 Oct 15 olle 727     var jsonIndexPrimerA712Modified = [];
3561 27 Oct 15 olle 728     
3561 27 Oct 15 olle 729     var jsonIndexPrimerA501Modified = [];
3561 27 Oct 15 olle 730     var jsonIndexPrimerA502Modified = [];
3561 27 Oct 15 olle 731     var jsonIndexPrimerA503Modified = [];
3561 27 Oct 15 olle 732     var jsonIndexPrimerA504Modified = [];
3561 27 Oct 15 olle 733     var jsonIndexPrimerA505Modified = [];
3561 27 Oct 15 olle 734     var jsonIndexPrimerA506Modified = [];
3561 27 Oct 15 olle 735     var jsonIndexPrimerA507Modified = [];
3561 27 Oct 15 olle 736     var jsonIndexPrimerA508Modified = [];
3561 27 Oct 15 olle 737
3561 27 Oct 15 olle 738     var someKitIsModified = false;
3561 27 Oct 15 olle 739     var numKitsModified = 0;
3561 27 Oct 15 olle 740     for (var i = 0; i < numItems; i++)
3561 27 Oct 15 olle 741     {
3561 27 Oct 15 olle 742       // Check if data for kit has been modified
3561 27 Oct 15 olle 743       var kitIsModified = false;
3705 19 Jan 16 olle 744
3705 19 Jan 16 olle 745       if (jsonRegistrationDate[i] != jsonRegistrationDateOrig[i])
3561 27 Oct 15 olle 746       {
3561 27 Oct 15 olle 747         kitIsModified = true;
3561 27 Oct 15 olle 748       }
3705 19 Jan 16 olle 749       else if (jsonLastUpdatedDate[i] != jsonLastUpdatedDateOrig[i])
3705 19 Jan 16 olle 750       {
3705 19 Jan 16 olle 751         kitIsModified = true;
3705 19 Jan 16 olle 752       }
3705 19 Jan 16 olle 753       else if (jsonExpirationDate[i] != jsonExpirationDateOrig[i])
3705 19 Jan 16 olle 754       {
3705 19 Jan 16 olle 755         kitIsModified = true;
3705 19 Jan 16 olle 756       }
3705 19 Jan 16 olle 757       else if (jsonActive[i] != jsonActiveOrig[i])
3705 19 Jan 16 olle 758       {
3705 19 Jan 16 olle 759         kitIsModified = true;
3705 19 Jan 16 olle 760       }
3705 19 Jan 16 olle 761       else if (jsonTimesUsed[i] != jsonTimesUsedOrig[i])
3705 19 Jan 16 olle 762       {
3705 19 Jan 16 olle 763         kitIsModified = true;
3705 19 Jan 16 olle 764       }
3705 19 Jan 16 olle 765       else if (jsonUnusedFpaPlateLocs[i] != jsonUnusedFpaPlateLocsOrig[i])
3705 19 Jan 16 olle 766       {
3705 19 Jan 16 olle 767         kitIsModified = true;
3705 19 Jan 16 olle 768       }
3705 19 Jan 16 olle 769       else if (jsonComment[i] != jsonCommentOrig[i])
3705 19 Jan 16 olle 770       {
3705 19 Jan 16 olle 771         kitIsModified = true;
3705 19 Jan 16 olle 772       }
3705 19 Jan 16 olle 773
3705 19 Jan 16 olle 774       else if (jsonLibraryPrepBox1[i] != jsonLibraryPrepBox1Orig[i])
3705 19 Jan 16 olle 775       {
3705 19 Jan 16 olle 776         kitIsModified = true;
3705 19 Jan 16 olle 777       }
3561 27 Oct 15 olle 778       else if (jsonIndexKit[i] != jsonIndexKitOrig[i])
3561 27 Oct 15 olle 779       {
3561 27 Oct 15 olle 780         kitIsModified = true;
3561 27 Oct 15 olle 781       }
3561 27 Oct 15 olle 782       else if (jsonContentSetBox3[i] != jsonContentSetBox3Orig[i])
3561 27 Oct 15 olle 783       {
3561 27 Oct 15 olle 784         kitIsModified = true;
3561 27 Oct 15 olle 785       }
3561 27 Oct 15 olle 786       else if (jsonOligoPoolA_FPA[i] != jsonOligoPoolA_FPAOrig[i])
3561 27 Oct 15 olle 787       {
3561 27 Oct 15 olle 788         kitIsModified = true;
3561 27 Oct 15 olle 789       }
3561 27 Oct 15 olle 790       else if (jsonOligoPoolB_FPB[i] != jsonOligoPoolB_FPBOrig[i])
3561 27 Oct 15 olle 791       {
3561 27 Oct 15 olle 792         kitIsModified = true;
3561 27 Oct 15 olle 793       }
3561 27 Oct 15 olle 794       else if (jsonOligoHybridizationSequencingReagent3[i] != jsonOligoHybridizationSequencingReagent3Orig[i])
3561 27 Oct 15 olle 795       {
3561 27 Oct 15 olle 796         kitIsModified = true;
3561 27 Oct 15 olle 797       }
3561 27 Oct 15 olle 798       else if (jsonStringentWash1_SW1[i] != jsonStringentWash1_SW1Orig[i])
3561 27 Oct 15 olle 799       {
3561 27 Oct 15 olle 800         kitIsModified = true;
3561 27 Oct 15 olle 801       }
3561 27 Oct 15 olle 802       else if (jsonExtensionLigationMix3[i] != jsonExtensionLigationMix3Orig[i])
3561 27 Oct 15 olle 803       {
3561 27 Oct 15 olle 804         kitIsModified = true;
3561 27 Oct 15 olle 805       }
3561 27 Oct 15 olle 806       else if (jsonPcrMasterMix2_PMM2[i] != jsonPcrMasterMix2_PMM2Orig[i])
3561 27 Oct 15 olle 807       {
3561 27 Oct 15 olle 808         kitIsModified = true;
3561 27 Oct 15 olle 809       }
3561 27 Oct 15 olle 810       else if (jsonUB1[i] != jsonUB1Orig[i])
3561 27 Oct 15 olle 811       {
3561 27 Oct 15 olle 812         kitIsModified = true;
3561 27 Oct 15 olle 813       }
3561 27 Oct 15 olle 814       else if (jsonTDP[i] != jsonTDPOrig[i])
3561 27 Oct 15 olle 815       {
3561 27 Oct 15 olle 816         kitIsModified = true;
3561 27 Oct 15 olle 817       }
3561 27 Oct 15 olle 818       else if (jsonFilterplate[i] != jsonFilterplateOrig[i])
3561 27 Oct 15 olle 819       {
3561 27 Oct 15 olle 820         kitIsModified = true;
3561 27 Oct 15 olle 821       }
3561 27 Oct 15 olle 822
3561 27 Oct 15 olle 823       else if (jsonIndexPrimerA701[i] != jsonIndexPrimerA701Orig[i])
3561 27 Oct 15 olle 824       {
3561 27 Oct 15 olle 825         kitIsModified = true;
3561 27 Oct 15 olle 826       }
3561 27 Oct 15 olle 827       else if (jsonIndexPrimerA702[i] != jsonIndexPrimerA702Orig[i])
3561 27 Oct 15 olle 828       {
3561 27 Oct 15 olle 829         kitIsModified = true;
3561 27 Oct 15 olle 830       }
3561 27 Oct 15 olle 831       else if (jsonIndexPrimerA703[i] != jsonIndexPrimerA703Orig[i])
3561 27 Oct 15 olle 832       {
3561 27 Oct 15 olle 833         kitIsModified = true;
3561 27 Oct 15 olle 834       }
3561 27 Oct 15 olle 835       else if (jsonIndexPrimerA704[i] != jsonIndexPrimerA704Orig[i])
3561 27 Oct 15 olle 836       {
3561 27 Oct 15 olle 837         kitIsModified = true;
3561 27 Oct 15 olle 838       }
3561 27 Oct 15 olle 839       else if (jsonIndexPrimerA705[i] != jsonIndexPrimerA705Orig[i])
3561 27 Oct 15 olle 840       {
3561 27 Oct 15 olle 841         kitIsModified = true;
3561 27 Oct 15 olle 842       }
3561 27 Oct 15 olle 843       else if (jsonIndexPrimerA706[i] != jsonIndexPrimerA706Orig[i])
3561 27 Oct 15 olle 844       {
3561 27 Oct 15 olle 845         kitIsModified = true;
3561 27 Oct 15 olle 846       }
3561 27 Oct 15 olle 847       else if (jsonIndexPrimerA707[i] != jsonIndexPrimerA707Orig[i])
3561 27 Oct 15 olle 848       {
3561 27 Oct 15 olle 849         kitIsModified = true;
3561 27 Oct 15 olle 850       }
3561 27 Oct 15 olle 851       else if (jsonIndexPrimerA708[i] != jsonIndexPrimerA708Orig[i])
3561 27 Oct 15 olle 852       {
3561 27 Oct 15 olle 853         kitIsModified = true;
3561 27 Oct 15 olle 854       }
3561 27 Oct 15 olle 855       else if (jsonIndexPrimerA709[i] != jsonIndexPrimerA709Orig[i])
3561 27 Oct 15 olle 856       {
3561 27 Oct 15 olle 857         kitIsModified = true;
3561 27 Oct 15 olle 858       }
3561 27 Oct 15 olle 859       else if (jsonIndexPrimerA710[i] != jsonIndexPrimerA710Orig[i])
3561 27 Oct 15 olle 860       {
3561 27 Oct 15 olle 861         kitIsModified = true;
3561 27 Oct 15 olle 862       }
3561 27 Oct 15 olle 863       else if (jsonIndexPrimerA711[i] != jsonIndexPrimerA711Orig[i])
3561 27 Oct 15 olle 864       {
3561 27 Oct 15 olle 865         kitIsModified = true;
3561 27 Oct 15 olle 866       }
3561 27 Oct 15 olle 867       else if (jsonIndexPrimerA712[i] != jsonIndexPrimerA712Orig[i])
3561 27 Oct 15 olle 868       {
3561 27 Oct 15 olle 869         kitIsModified = true;
3561 27 Oct 15 olle 870       }
3561 27 Oct 15 olle 871
3561 27 Oct 15 olle 872       else if (jsonIndexPrimerA501[i] != jsonIndexPrimerA501Orig[i])
3561 27 Oct 15 olle 873       {
3561 27 Oct 15 olle 874         kitIsModified = true;
3561 27 Oct 15 olle 875       }
3561 27 Oct 15 olle 876       else if (jsonIndexPrimerA502[i] != jsonIndexPrimerA502Orig[i])
3561 27 Oct 15 olle 877       {
3561 27 Oct 15 olle 878         kitIsModified = true;
3561 27 Oct 15 olle 879       }
3561 27 Oct 15 olle 880       else if (jsonIndexPrimerA503[i] != jsonIndexPrimerA503Orig[i])
3561 27 Oct 15 olle 881       {
3561 27 Oct 15 olle 882         kitIsModified = true;
3561 27 Oct 15 olle 883       }
3561 27 Oct 15 olle 884       else if (jsonIndexPrimerA504[i] != jsonIndexPrimerA504Orig[i])
3561 27 Oct 15 olle 885       {
3561 27 Oct 15 olle 886         kitIsModified = true;
3561 27 Oct 15 olle 887       }
3561 27 Oct 15 olle 888       else if (jsonIndexPrimerA505[i] != jsonIndexPrimerA505Orig[i])
3561 27 Oct 15 olle 889       {
3561 27 Oct 15 olle 890         kitIsModified = true;
3561 27 Oct 15 olle 891       }
3561 27 Oct 15 olle 892       else if (jsonIndexPrimerA506[i] != jsonIndexPrimerA506Orig[i])
3561 27 Oct 15 olle 893       {
3561 27 Oct 15 olle 894         kitIsModified = true;
3561 27 Oct 15 olle 895       }
3561 27 Oct 15 olle 896       else if (jsonIndexPrimerA507[i] != jsonIndexPrimerA507Orig[i])
3561 27 Oct 15 olle 897       {
3561 27 Oct 15 olle 898         kitIsModified = true;
3561 27 Oct 15 olle 899       }
3561 27 Oct 15 olle 900       else if (jsonIndexPrimerA508[i] != jsonIndexPrimerA508Orig[i])
3561 27 Oct 15 olle 901       {
3561 27 Oct 15 olle 902         kitIsModified = true;
3561 27 Oct 15 olle 903       }
3561 27 Oct 15 olle 904
3561 27 Oct 15 olle 905       if (kitIsModified)
3561 27 Oct 15 olle 906       {
3561 27 Oct 15 olle 907         someKitIsModified = true;
3561 27 Oct 15 olle 908         // Store data for modified kit
3561 27 Oct 15 olle 909
3561 27 Oct 15 olle 910         jsonKitNameModified[numKitsModified] = jsonKitName[i];
3705 19 Jan 16 olle 911
3705 19 Jan 16 olle 912         jsonRegistrationDateModified[numKitsModified] = jsonRegistrationDate[i];
3705 19 Jan 16 olle 913         jsonLastUpdatedDateModified[numKitsModified] = jsonLastUpdatedDate[i];
3705 19 Jan 16 olle 914         jsonExpirationDateModified[numKitsModified] = jsonExpirationDate[i];
3705 19 Jan 16 olle 915         jsonActiveModified[numKitsModified] = jsonActive[i];
3705 19 Jan 16 olle 916         jsonTimesUsedModified[numKitsModified] = jsonTimesUsed[i];
3705 19 Jan 16 olle 917         jsonUnusedFpaPlateLocsModified[numKitsModified] = jsonUnusedFpaPlateLocs[i];
3705 19 Jan 16 olle 918         jsonCommentModified[numKitsModified] = jsonComment[i];
3705 19 Jan 16 olle 919
3561 27 Oct 15 olle 920         jsonLibraryPrepBox1Modified[numKitsModified] = jsonLibraryPrepBox1[i];
3561 27 Oct 15 olle 921         jsonIndexKitModified[numKitsModified] = jsonIndexKit[i];
3561 27 Oct 15 olle 922         jsonContentSetBox3Modified[numKitsModified] = jsonContentSetBox3[i];
3561 27 Oct 15 olle 923         jsonOligoPoolA_FPAModified[numKitsModified] = jsonOligoPoolA_FPA[i];
3561 27 Oct 15 olle 924         jsonOligoPoolB_FPBModified[numKitsModified] = jsonOligoPoolB_FPB[i];
3561 27 Oct 15 olle 925         jsonOligoHybridizationSequencingReagent3Modified[numKitsModified] = jsonOligoHybridizationSequencingReagent3[i];
3561 27 Oct 15 olle 926         jsonStringentWash1_SW1Modified[numKitsModified] = jsonStringentWash1_SW1[i];
3561 27 Oct 15 olle 927         jsonExtensionLigationMix3Modified[numKitsModified] = jsonExtensionLigationMix3[i];
3561 27 Oct 15 olle 928         jsonPcrMasterMix2_PMM2Modified[numKitsModified] = jsonPcrMasterMix2_PMM2[i];
3561 27 Oct 15 olle 929         jsonUB1Modified[numKitsModified] = jsonUB1[i];
3561 27 Oct 15 olle 930         jsonTDPModified[numKitsModified] = jsonTDP[i];
3561 27 Oct 15 olle 931         jsonFilterplateModified[numKitsModified] = jsonFilterplate[i];
3561 27 Oct 15 olle 932     
3561 27 Oct 15 olle 933         jsonIndexPrimerA701Modified[numKitsModified] = jsonIndexPrimerA701[i];
3561 27 Oct 15 olle 934         jsonIndexPrimerA702Modified[numKitsModified] = jsonIndexPrimerA702[i];
3561 27 Oct 15 olle 935         jsonIndexPrimerA703Modified[numKitsModified] = jsonIndexPrimerA703[i];
3561 27 Oct 15 olle 936         jsonIndexPrimerA704Modified[numKitsModified] = jsonIndexPrimerA704[i];
3561 27 Oct 15 olle 937         jsonIndexPrimerA705Modified[numKitsModified] = jsonIndexPrimerA705[i];
3561 27 Oct 15 olle 938         jsonIndexPrimerA706Modified[numKitsModified] = jsonIndexPrimerA706[i];
3561 27 Oct 15 olle 939         jsonIndexPrimerA707Modified[numKitsModified] = jsonIndexPrimerA707[i];
3561 27 Oct 15 olle 940         jsonIndexPrimerA708Modified[numKitsModified] = jsonIndexPrimerA708[i];
3561 27 Oct 15 olle 941         jsonIndexPrimerA709Modified[numKitsModified] = jsonIndexPrimerA709[i];
3561 27 Oct 15 olle 942         jsonIndexPrimerA710Modified[numKitsModified] = jsonIndexPrimerA710[i];
3561 27 Oct 15 olle 943         jsonIndexPrimerA711Modified[numKitsModified] = jsonIndexPrimerA711[i];
3561 27 Oct 15 olle 944         jsonIndexPrimerA712Modified[numKitsModified] = jsonIndexPrimerA712[i];
3561 27 Oct 15 olle 945     
3561 27 Oct 15 olle 946         jsonIndexPrimerA501Modified[numKitsModified] = jsonIndexPrimerA501[i];
3561 27 Oct 15 olle 947         jsonIndexPrimerA502Modified[numKitsModified] = jsonIndexPrimerA502[i];
3561 27 Oct 15 olle 948         jsonIndexPrimerA503Modified[numKitsModified] = jsonIndexPrimerA503[i];
3561 27 Oct 15 olle 949         jsonIndexPrimerA504Modified[numKitsModified] = jsonIndexPrimerA504[i];
3561 27 Oct 15 olle 950         jsonIndexPrimerA505Modified[numKitsModified] = jsonIndexPrimerA505[i];
3561 27 Oct 15 olle 951         jsonIndexPrimerA506Modified[numKitsModified] = jsonIndexPrimerA506[i];
3561 27 Oct 15 olle 952         jsonIndexPrimerA507Modified[numKitsModified] = jsonIndexPrimerA507[i];
3561 27 Oct 15 olle 953         jsonIndexPrimerA508Modified[numKitsModified] = jsonIndexPrimerA508[i];
3561 27 Oct 15 olle 954
3561 27 Oct 15 olle 955         numKitsModified++;
3561 27 Oct 15 olle 956       }
3561 27 Oct 15 olle 957     }
3561 27 Oct 15 olle 958     jsonConsumablesModified = {};
3561 27 Oct 15 olle 959
3561 27 Oct 15 olle 960     jsonConsumablesModified['Headers'] = jsonHeaders;
3561 27 Oct 15 olle 961
3561 27 Oct 15 olle 962     jsonConsumablesModified['KitName'] = jsonKitNameModified;
3705 19 Jan 16 olle 963
3705 19 Jan 16 olle 964     jsonConsumablesModified['RegistrationDate'] = jsonRegistrationDateModified;
3705 19 Jan 16 olle 965     jsonConsumablesModified['LastUpdatedDate'] = jsonLastUpdatedDateModified;
3705 19 Jan 16 olle 966     jsonConsumablesModified['ExpirationDate'] = jsonExpirationDateModified;
3705 19 Jan 16 olle 967     jsonConsumablesModified['Active'] = jsonActiveModified;
3705 19 Jan 16 olle 968     jsonConsumablesModified['TimesUsed'] = jsonTimesUsedModified;
3705 19 Jan 16 olle 969     jsonConsumablesModified['UnusedFpaPlateLocs'] = jsonUnusedFpaPlateLocsModified;
3705 19 Jan 16 olle 970     jsonConsumablesModified['Comment'] = jsonCommentModified;
3705 19 Jan 16 olle 971
3561 27 Oct 15 olle 972     jsonConsumablesModified['LibraryPrepBox1'] = jsonLibraryPrepBox1Modified;
3561 27 Oct 15 olle 973     jsonConsumablesModified['IndexKit'] = jsonIndexKitModified;
3561 27 Oct 15 olle 974     jsonConsumablesModified['ContentSetBox3'] = jsonContentSetBox3Modified;
3561 27 Oct 15 olle 975     jsonConsumablesModified['OligoPoolA_FPA'] = jsonOligoPoolA_FPAModified;
3561 27 Oct 15 olle 976     jsonConsumablesModified['OligoPoolB_FPB'] = jsonOligoPoolB_FPBModified;
3561 27 Oct 15 olle 977     jsonConsumablesModified['OligoHybridizationSequencingReagent3'] = jsonOligoHybridizationSequencingReagent3Modified;
3561 27 Oct 15 olle 978     jsonConsumablesModified['StringentWash1_SW1'] = jsonStringentWash1_SW1Modified;
3561 27 Oct 15 olle 979     jsonConsumablesModified['ExtensionLigationMix3'] = jsonExtensionLigationMix3Modified;
3561 27 Oct 15 olle 980     jsonConsumablesModified['PcrMasterMix2_PMM2'] = jsonPcrMasterMix2_PMM2Modified;
3561 27 Oct 15 olle 981     jsonConsumablesModified['UB1'] = jsonUB1Modified;
3561 27 Oct 15 olle 982     jsonConsumablesModified['TDP'] = jsonTDPModified;
3561 27 Oct 15 olle 983     jsonConsumablesModified['Filterplate'] = jsonFilterplateModified;
3561 27 Oct 15 olle 984
3561 27 Oct 15 olle 985     jsonConsumablesModified['IndexPrimerA701'] = jsonIndexPrimerA701Modified;
3561 27 Oct 15 olle 986     jsonConsumablesModified['IndexPrimerA702'] = jsonIndexPrimerA702Modified;
3561 27 Oct 15 olle 987     jsonConsumablesModified['IndexPrimerA703'] = jsonIndexPrimerA703Modified;
3561 27 Oct 15 olle 988     jsonConsumablesModified['IndexPrimerA704'] = jsonIndexPrimerA704Modified;
3561 27 Oct 15 olle 989     jsonConsumablesModified['IndexPrimerA705'] = jsonIndexPrimerA705Modified;
3561 27 Oct 15 olle 990     jsonConsumablesModified['IndexPrimerA706'] = jsonIndexPrimerA706Modified;
3561 27 Oct 15 olle 991     jsonConsumablesModified['IndexPrimerA707'] = jsonIndexPrimerA707Modified;
3561 27 Oct 15 olle 992     jsonConsumablesModified['IndexPrimerA708'] = jsonIndexPrimerA708Modified;
3561 27 Oct 15 olle 993     jsonConsumablesModified['IndexPrimerA709'] = jsonIndexPrimerA709Modified;
3561 27 Oct 15 olle 994     jsonConsumablesModified['IndexPrimerA710'] = jsonIndexPrimerA710Modified;
3561 27 Oct 15 olle 995     jsonConsumablesModified['IndexPrimerA711'] = jsonIndexPrimerA711Modified;
3561 27 Oct 15 olle 996     jsonConsumablesModified['IndexPrimerA712'] = jsonIndexPrimerA712Modified;
3561 27 Oct 15 olle 997
3561 27 Oct 15 olle 998     jsonConsumablesModified['IndexPrimerA501'] = jsonIndexPrimerA501Modified;
3561 27 Oct 15 olle 999     jsonConsumablesModified['IndexPrimerA502'] = jsonIndexPrimerA502Modified;
3561 27 Oct 15 olle 1000     jsonConsumablesModified['IndexPrimerA503'] = jsonIndexPrimerA503Modified;
3561 27 Oct 15 olle 1001     jsonConsumablesModified['IndexPrimerA504'] = jsonIndexPrimerA504Modified;
3561 27 Oct 15 olle 1002     jsonConsumablesModified['IndexPrimerA505'] = jsonIndexPrimerA505Modified;
3561 27 Oct 15 olle 1003     jsonConsumablesModified['IndexPrimerA506'] = jsonIndexPrimerA506Modified;
3561 27 Oct 15 olle 1004     jsonConsumablesModified['IndexPrimerA507'] = jsonIndexPrimerA507Modified;
3561 27 Oct 15 olle 1005     jsonConsumablesModified['IndexPrimerA508'] = jsonIndexPrimerA508Modified;
3561 27 Oct 15 olle 1006
3561 27 Oct 15 olle 1007     var buttons = Doc.element('detailsSection').getElementsByClassName('edit-details');
3705 19 Jan 16 olle 1008     // Add tool tips and click handlers to edit buttons (two buttons per table row)
3561 27 Oct 15 olle 1009     for (var i = 0; i < buttons.length; i++)
3561 27 Oct 15 olle 1010     {
3705 19 Jan 16 olle 1011       // Add tool tip with kit name to button at end of table row
3705 19 Jan 16 olle 1012       var kitName = jsonKitName[Math.floor(i/2)];
3705 19 Jan 16 olle 1013       var buttonTooltip = kitName;
3705 19 Jan 16 olle 1014       if (i%2 == 0)
3705 19 Jan 16 olle 1015       {
3705 19 Jan 16 olle 1016         buttonTooltip = '';
3705 19 Jan 16 olle 1017       }
3653 08 Dec 15 olle 1018       var tooltip = [];
3705 19 Jan 16 olle 1019       tooltip[tooltip.length] = buttonTooltip;
3653 08 Dec 15 olle 1020       buttons[i].title = tooltip.join('\n');
3653 08 Dec 15 olle 1021       // Add click handler to button
3561 27 Oct 15 olle 1022       Buttons.addClickHandler(buttons[i], exreg.editLibPrepKitDetails);
3561 27 Oct 15 olle 1023     }
3561 27 Oct 15 olle 1024
3561 27 Oct 15 olle 1025     Wizard.setCurrentStep(2);
3561 27 Oct 15 olle 1026     Doc.show('gocancel');
3561 27 Oct 15 olle 1027     Doc.show('gocreate');
3561 27 Oct 15 olle 1028     // Disable "Register" button if no data has been changed
3561 27 Oct 15 olle 1029     if (!someKitIsModified)
3561 27 Oct 15 olle 1030     {
3561 27 Oct 15 olle 1031       Doc.addClass('goregister', 'disabled');
3561 27 Oct 15 olle 1032     }
3561 27 Oct 15 olle 1033     else
3561 27 Oct 15 olle 1034     {
3561 27 Oct 15 olle 1035       Doc.removeClass('goregister', 'disabled');
3561 27 Oct 15 olle 1036     }
3561 27 Oct 15 olle 1037     Doc.show('goregister');
3561 27 Oct 15 olle 1038     
3561 27 Oct 15 olle 1039     Wizard.keepSessionAlive();
3561 27 Oct 15 olle 1040   }
3561 27 Oct 15 olle 1041
3561 27 Oct 15 olle 1042   exreg.fetchJsonConsumables = function()
3561 27 Oct 15 olle 1043   {
3561 27 Oct 15 olle 1044     return jsonConsumables;
3561 27 Oct 15 olle 1045   }
3561 27 Oct 15 olle 1046
3561 27 Oct 15 olle 1047   exreg.copyJsonConsumables = function(jsonConsumablesSrc)
3561 27 Oct 15 olle 1048   {
3561 27 Oct 15 olle 1049     // Get JSONArrays with data for kits
3561 27 Oct 15 olle 1050
3561 27 Oct 15 olle 1051     var jsonHeaders = jsonConsumablesSrc['Headers'];
3561 27 Oct 15 olle 1052
3561 27 Oct 15 olle 1053     var jsonKitName = jsonConsumablesSrc['KitName'];
3561 27 Oct 15 olle 1054     var jsonLibraryPrepBox1 = jsonConsumablesSrc['LibraryPrepBox1'];
3561 27 Oct 15 olle 1055     var jsonIndexKit = jsonConsumablesSrc['IndexKit'];
3561 27 Oct 15 olle 1056     var jsonContentSetBox3 = jsonConsumablesSrc['ContentSetBox3'];
3561 27 Oct 15 olle 1057     var jsonOligoPoolA_FPA = jsonConsumablesSrc['OligoPoolA_FPA'];
3561 27 Oct 15 olle 1058     var jsonOligoPoolB_FPB = jsonConsumablesSrc['OligoPoolB_FPB'];
3561 27 Oct 15 olle 1059     var jsonOligoHybridizationSequencingReagent3 = jsonConsumablesSrc['OligoHybridizationSequencingReagent3'];
3561 27 Oct 15 olle 1060     var jsonStringentWash1_SW1 = jsonConsumablesSrc['StringentWash1_SW1'];
3561 27 Oct 15 olle 1061     var jsonExtensionLigationMix3 = jsonConsumablesSrc['ExtensionLigationMix3'];
3561 27 Oct 15 olle 1062     var jsonPcrMasterMix2_PMM2 = jsonConsumablesSrc['PcrMasterMix2_PMM2'];
3561 27 Oct 15 olle 1063     var jsonUB1 = jsonConsumablesSrc['UB1'];
3561 27 Oct 15 olle 1064     var jsonTDP = jsonConsumablesSrc['TDP'];
3561 27 Oct 15 olle 1065     var jsonFilterplate = jsonConsumablesSrc['Filterplate'];
3561 27 Oct 15 olle 1066     
3561 27 Oct 15 olle 1067     var jsonIndexPrimerA701 = jsonConsumablesSrc['IndexPrimerA701'];
3561 27 Oct 15 olle 1068     var jsonIndexPrimerA702 = jsonConsumablesSrc['IndexPrimerA702'];
3561 27 Oct 15 olle 1069     var jsonIndexPrimerA703 = jsonConsumablesSrc['IndexPrimerA703'];
3561 27 Oct 15 olle 1070     var jsonIndexPrimerA704 = jsonConsumablesSrc['IndexPrimerA704'];
3561 27 Oct 15 olle 1071     var jsonIndexPrimerA705 = jsonConsumablesSrc['IndexPrimerA705'];
3561 27 Oct 15 olle 1072     var jsonIndexPrimerA706 = jsonConsumablesSrc['IndexPrimerA706'];
3561 27 Oct 15 olle 1073     var jsonIndexPrimerA707 = jsonConsumablesSrc['IndexPrimerA707'];
3561 27 Oct 15 olle 1074     var jsonIndexPrimerA708 = jsonConsumablesSrc['IndexPrimerA708'];
3561 27 Oct 15 olle 1075     var jsonIndexPrimerA709 = jsonConsumablesSrc['IndexPrimerA709'];
3561 27 Oct 15 olle 1076     var jsonIndexPrimerA710 = jsonConsumablesSrc['IndexPrimerA710'];
3561 27 Oct 15 olle 1077     var jsonIndexPrimerA711 = jsonConsumablesSrc['IndexPrimerA711'];
3561 27 Oct 15 olle 1078     var jsonIndexPrimerA712 = jsonConsumablesSrc['IndexPrimerA712'];
3561 27 Oct 15 olle 1079     
3561 27 Oct 15 olle 1080     var jsonIndexPrimerA501 = jsonConsumablesSrc['IndexPrimerA501'];
3561 27 Oct 15 olle 1081     var jsonIndexPrimerA502 = jsonConsumablesSrc['IndexPrimerA502'];
3561 27 Oct 15 olle 1082     var jsonIndexPrimerA503 = jsonConsumablesSrc['IndexPrimerA503'];
3561 27 Oct 15 olle 1083     var jsonIndexPrimerA504 = jsonConsumablesSrc['IndexPrimerA504'];
3561 27 Oct 15 olle 1084     var jsonIndexPrimerA505 = jsonConsumablesSrc['IndexPrimerA505'];
3561 27 Oct 15 olle 1085     var jsonIndexPrimerA506 = jsonConsumablesSrc['IndexPrimerA506'];
3561 27 Oct 15 olle 1086     var jsonIndexPrimerA507 = jsonConsumablesSrc['IndexPrimerA507'];
3561 27 Oct 15 olle 1087     var jsonIndexPrimerA508 = jsonConsumablesSrc['IndexPrimerA508'];
3561 27 Oct 15 olle 1088
3561 27 Oct 15 olle 1089     var jsonRegistrationDate = jsonConsumablesSrc['RegistrationDate'];
3561 27 Oct 15 olle 1090     var jsonLastUpdatedDate = jsonConsumablesSrc['LastUpdatedDate'];
3561 27 Oct 15 olle 1091     var jsonExpirationDate = jsonConsumablesSrc['ExpirationDate'];
3610 20 Nov 15 olle 1092     var jsonActive = jsonConsumablesSrc['Active'];
3561 27 Oct 15 olle 1093     var jsonTimesUsed = jsonConsumablesSrc['TimesUsed'];
3561 27 Oct 15 olle 1094     var jsonUnusedFpaPlateLocs = jsonConsumablesSrc['UnusedFpaPlateLocs'];
3561 27 Oct 15 olle 1095     var jsonComment = jsonConsumablesSrc['Comment'];
3561 27 Oct 15 olle 1096
3561 27 Oct 15 olle 1097     // Create new JSONArrays for copy
3561 27 Oct 15 olle 1098
3561 27 Oct 15 olle 1099     var jsonHeadersCopy = [];
3561 27 Oct 15 olle 1100
3561 27 Oct 15 olle 1101     var jsonKitNameCopy = [];
3561 27 Oct 15 olle 1102     var jsonLibraryPrepBox1Copy = [];
3561 27 Oct 15 olle 1103     var jsonIndexKitCopy = [];
3561 27 Oct 15 olle 1104     var jsonContentSetBox3Copy = [];
3561 27 Oct 15 olle 1105     var jsonOligoPoolA_FPACopy = [];
3561 27 Oct 15 olle 1106     var jsonOligoPoolB_FPBCopy = [];
3561 27 Oct 15 olle 1107     var jsonOligoHybridizationSequencingReagent3Copy = [];
3561 27 Oct 15 olle 1108     var jsonStringentWash1_SW1Copy = [];
3561 27 Oct 15 olle 1109     var jsonExtensionLigationMix3Copy = [];
3561 27 Oct 15 olle 1110     var jsonPcrMasterMix2_PMM2Copy = [];
3561 27 Oct 15 olle 1111     var jsonUB1Copy = [];
3561 27 Oct 15 olle 1112     var jsonTDPCopy = [];
3561 27 Oct 15 olle 1113     var jsonFilterplateCopy = [];
3561 27 Oct 15 olle 1114     
3561 27 Oct 15 olle 1115     var jsonIndexPrimerA701Copy = [];
3561 27 Oct 15 olle 1116     var jsonIndexPrimerA702Copy = [];
3561 27 Oct 15 olle 1117     var jsonIndexPrimerA703Copy = [];
3561 27 Oct 15 olle 1118     var jsonIndexPrimerA704Copy = [];
3561 27 Oct 15 olle 1119     var jsonIndexPrimerA705Copy = [];
3561 27 Oct 15 olle 1120     var jsonIndexPrimerA706Copy = [];
3561 27 Oct 15 olle 1121     var jsonIndexPrimerA707Copy = [];
3561 27 Oct 15 olle 1122     var jsonIndexPrimerA708Copy = [];
3561 27 Oct 15 olle 1123     var jsonIndexPrimerA709Copy = [];
3561 27 Oct 15 olle 1124     var jsonIndexPrimerA710Copy = [];
3561 27 Oct 15 olle 1125     var jsonIndexPrimerA711Copy = [];
3561 27 Oct 15 olle 1126     var jsonIndexPrimerA712Copy = [];
3561 27 Oct 15 olle 1127     
3561 27 Oct 15 olle 1128     var jsonIndexPrimerA501Copy = [];
3561 27 Oct 15 olle 1129     var jsonIndexPrimerA502Copy = [];
3561 27 Oct 15 olle 1130     var jsonIndexPrimerA503Copy = [];
3561 27 Oct 15 olle 1131     var jsonIndexPrimerA504Copy = [];
3561 27 Oct 15 olle 1132     var jsonIndexPrimerA505Copy = [];
3561 27 Oct 15 olle 1133     var jsonIndexPrimerA506Copy = [];
3561 27 Oct 15 olle 1134     var jsonIndexPrimerA507Copy = [];
3561 27 Oct 15 olle 1135     var jsonIndexPrimerA508Copy = [];
3561 27 Oct 15 olle 1136
3561 27 Oct 15 olle 1137     var jsonRegistrationDateCopy = [];
3561 27 Oct 15 olle 1138     var jsonLastUpdatedDateCopy = [];
3561 27 Oct 15 olle 1139     var jsonExpirationDateCopy = [];
3610 20 Nov 15 olle 1140     var jsonActiveCopy = [];
3561 27 Oct 15 olle 1141     var jsonTimesUsedCopy = [];
3561 27 Oct 15 olle 1142     var jsonUnusedFpaPlateLocsCopy = [];
3561 27 Oct 15 olle 1143     var jsonCommentCopy = [];
3561 27 Oct 15 olle 1144
3561 27 Oct 15 olle 1145     // Fill new JSONArrays with data from source
3561 27 Oct 15 olle 1146     var numItems = jsonKitName.length;
3561 27 Oct 15 olle 1147
3561 27 Oct 15 olle 1148     for (var i = 0; i < numItems; i++)
3561 27 Oct 15 olle 1149     {
3561 27 Oct 15 olle 1150       jsonKitNameCopy[i] = jsonKitName[i];
3561 27 Oct 15 olle 1151       jsonLibraryPrepBox1Copy[i] = jsonLibraryPrepBox1[i];
3561 27 Oct 15 olle 1152       jsonIndexKitCopy[i] = jsonIndexKit[i];
3561 27 Oct 15 olle 1153       jsonContentSetBox3Copy[i] = jsonContentSetBox3[i];
3561 27 Oct 15 olle 1154       jsonOligoPoolA_FPACopy[i] = jsonOligoPoolA_FPA[i];
3561 27 Oct 15 olle 1155       jsonOligoPoolB_FPBCopy[i] = jsonOligoPoolB_FPB[i];
3561 27 Oct 15 olle 1156       jsonOligoHybridizationSequencingReagent3Copy[i] = jsonOligoHybridizationSequencingReagent3[i];
3561 27 Oct 15 olle 1157       jsonStringentWash1_SW1Copy[i] = jsonStringentWash1_SW1[i];
3561 27 Oct 15 olle 1158       jsonExtensionLigationMix3Copy[i] = jsonExtensionLigationMix3[i];
3561 27 Oct 15 olle 1159       jsonPcrMasterMix2_PMM2Copy[i] = jsonPcrMasterMix2_PMM2[i];
3561 27 Oct 15 olle 1160       jsonUB1Copy[i] = jsonUB1[i];
3561 27 Oct 15 olle 1161       jsonTDPCopy[i] = jsonTDP[i];
3561 27 Oct 15 olle 1162       jsonFilterplateCopy[i] = jsonFilterplate[i];
3561 27 Oct 15 olle 1163     
3561 27 Oct 15 olle 1164       jsonIndexPrimerA701Copy[i] = jsonIndexPrimerA701[i];
3561 27 Oct 15 olle 1165       jsonIndexPrimerA702Copy[i] = jsonIndexPrimerA702[i];
3561 27 Oct 15 olle 1166       jsonIndexPrimerA703Copy[i] = jsonIndexPrimerA703[i];
3561 27 Oct 15 olle 1167       jsonIndexPrimerA704Copy[i] = jsonIndexPrimerA704[i];
3561 27 Oct 15 olle 1168       jsonIndexPrimerA705Copy[i] = jsonIndexPrimerA705[i];
3561 27 Oct 15 olle 1169       jsonIndexPrimerA706Copy[i] = jsonIndexPrimerA706[i];
3561 27 Oct 15 olle 1170       jsonIndexPrimerA707Copy[i] = jsonIndexPrimerA707[i];
3561 27 Oct 15 olle 1171       jsonIndexPrimerA708Copy[i] = jsonIndexPrimerA708[i];
3561 27 Oct 15 olle 1172       jsonIndexPrimerA709Copy[i] = jsonIndexPrimerA709[i];
3561 27 Oct 15 olle 1173       jsonIndexPrimerA710Copy[i] = jsonIndexPrimerA710[i];
3561 27 Oct 15 olle 1174       jsonIndexPrimerA711Copy[i] = jsonIndexPrimerA711[i];
3561 27 Oct 15 olle 1175       jsonIndexPrimerA712Copy[i] = jsonIndexPrimerA712[i];
3561 27 Oct 15 olle 1176     
3561 27 Oct 15 olle 1177       jsonIndexPrimerA501Copy[i] = jsonIndexPrimerA501[i];
3561 27 Oct 15 olle 1178       jsonIndexPrimerA502Copy[i] = jsonIndexPrimerA502[i];
3561 27 Oct 15 olle 1179       jsonIndexPrimerA503Copy[i] = jsonIndexPrimerA503[i];
3561 27 Oct 15 olle 1180       jsonIndexPrimerA504Copy[i] = jsonIndexPrimerA504[i];
3561 27 Oct 15 olle 1181       jsonIndexPrimerA505Copy[i] = jsonIndexPrimerA505[i];
3561 27 Oct 15 olle 1182       jsonIndexPrimerA506Copy[i] = jsonIndexPrimerA506[i];
3561 27 Oct 15 olle 1183       jsonIndexPrimerA507Copy[i] = jsonIndexPrimerA507[i];
3561 27 Oct 15 olle 1184       jsonIndexPrimerA508Copy[i] = jsonIndexPrimerA508[i];
3561 27 Oct 15 olle 1185
3561 27 Oct 15 olle 1186       jsonRegistrationDateCopy[i] = jsonRegistrationDate[i];
3561 27 Oct 15 olle 1187       jsonLastUpdatedDateCopy[i] = jsonLastUpdatedDate[i];
3561 27 Oct 15 olle 1188       jsonExpirationDateCopy[i] = jsonExpirationDate[i];
3610 20 Nov 15 olle 1189       jsonActiveCopy[i] = jsonActive[i];
3561 27 Oct 15 olle 1190       jsonTimesUsedCopy[i] = jsonTimesUsed[i];
3561 27 Oct 15 olle 1191       jsonUnusedFpaPlateLocsCopy[i] = jsonUnusedFpaPlateLocs[i];
3561 27 Oct 15 olle 1192       jsonCommentCopy[i] = jsonComment[i];
3561 27 Oct 15 olle 1193     }
3561 27 Oct 15 olle 1194
3561 27 Oct 15 olle 1195     // Create new JSONObject for copy
3561 27 Oct 15 olle 1196
3561 27 Oct 15 olle 1197     var jsonConsumablesCopy = {};
3561 27 Oct 15 olle 1198
3561 27 Oct 15 olle 1199     // Fill new JSONObject with data from source
3561 27 Oct 15 olle 1200     jsonConsumablesCopy['KitName'] = jsonKitNameCopy;
3561 27 Oct 15 olle 1201     jsonConsumablesCopy['LibraryPrepBox1'] = jsonLibraryPrepBox1Copy;
3561 27 Oct 15 olle 1202     jsonConsumablesCopy['IndexKit'] = jsonIndexKitCopy;
3561 27 Oct 15 olle 1203     jsonConsumablesCopy['ContentSetBox3'] = jsonContentSetBox3Copy;
3561 27 Oct 15 olle 1204     jsonConsumablesCopy['OligoPoolA_FPA'] = jsonOligoPoolA_FPACopy;
3561 27 Oct 15 olle 1205     jsonConsumablesCopy['OligoPoolB_FPB'] = jsonOligoPoolB_FPBCopy;
3561 27 Oct 15 olle 1206     jsonConsumablesCopy['OligoHybridizationSequencingReagent3'] = jsonOligoHybridizationSequencingReagent3Copy;
3561 27 Oct 15 olle 1207     jsonConsumablesCopy['StringentWash1_SW1'] = jsonStringentWash1_SW1Copy;
3561 27 Oct 15 olle 1208     jsonConsumablesCopy['ExtensionLigationMix3'] = jsonExtensionLigationMix3Copy;
3561 27 Oct 15 olle 1209     jsonConsumablesCopy['PcrMasterMix2_PMM2'] = jsonPcrMasterMix2_PMM2Copy;
3561 27 Oct 15 olle 1210     jsonConsumablesCopy['UB1'] = jsonUB1Copy;
3561 27 Oct 15 olle 1211     jsonConsumablesCopy['TDP'] = jsonTDPCopy;
3561 27 Oct 15 olle 1212     jsonConsumablesCopy['Filterplate'] = jsonFilterplateCopy;
3561 27 Oct 15 olle 1213
3561 27 Oct 15 olle 1214     jsonConsumablesCopy['IndexPrimerA701'] = jsonIndexPrimerA701Copy;
3561 27 Oct 15 olle 1215     jsonConsumablesCopy['IndexPrimerA702'] = jsonIndexPrimerA702Copy;
3561 27 Oct 15 olle 1216     jsonConsumablesCopy['IndexPrimerA703'] = jsonIndexPrimerA703Copy;
3561 27 Oct 15 olle 1217     jsonConsumablesCopy['IndexPrimerA704'] = jsonIndexPrimerA704Copy;
3561 27 Oct 15 olle 1218     jsonConsumablesCopy['IndexPrimerA705'] = jsonIndexPrimerA705Copy;
3561 27 Oct 15 olle 1219     jsonConsumablesCopy['IndexPrimerA706'] = jsonIndexPrimerA706Copy;
3561 27 Oct 15 olle 1220     jsonConsumablesCopy['IndexPrimerA707'] = jsonIndexPrimerA707Copy;
3561 27 Oct 15 olle 1221     jsonConsumablesCopy['IndexPrimerA708'] = jsonIndexPrimerA708Copy;
3561 27 Oct 15 olle 1222     jsonConsumablesCopy['IndexPrimerA709'] = jsonIndexPrimerA709Copy;
3561 27 Oct 15 olle 1223     jsonConsumablesCopy['IndexPrimerA710'] = jsonIndexPrimerA710Copy;
3561 27 Oct 15 olle 1224     jsonConsumablesCopy['IndexPrimerA711'] = jsonIndexPrimerA711Copy;
3561 27 Oct 15 olle 1225     jsonConsumablesCopy['IndexPrimerA712'] = jsonIndexPrimerA712Copy;
3561 27 Oct 15 olle 1226
3561 27 Oct 15 olle 1227     jsonConsumablesCopy['IndexPrimerA501'] = jsonIndexPrimerA501Copy;
3561 27 Oct 15 olle 1228     jsonConsumablesCopy['IndexPrimerA502'] = jsonIndexPrimerA502Copy;
3561 27 Oct 15 olle 1229     jsonConsumablesCopy['IndexPrimerA503'] = jsonIndexPrimerA503Copy;
3561 27 Oct 15 olle 1230     jsonConsumablesCopy['IndexPrimerA504'] = jsonIndexPrimerA504Copy;
3561 27 Oct 15 olle 1231     jsonConsumablesCopy['IndexPrimerA505'] = jsonIndexPrimerA505Copy;
3561 27 Oct 15 olle 1232     jsonConsumablesCopy['IndexPrimerA506'] = jsonIndexPrimerA506Copy;
3561 27 Oct 15 olle 1233     jsonConsumablesCopy['IndexPrimerA507'] = jsonIndexPrimerA507Copy;
3561 27 Oct 15 olle 1234     jsonConsumablesCopy['IndexPrimerA508'] = jsonIndexPrimerA508Copy;
3561 27 Oct 15 olle 1235
3561 27 Oct 15 olle 1236     jsonConsumablesCopy['RegistrationDate'] = jsonRegistrationDateCopy;
3561 27 Oct 15 olle 1237     jsonConsumablesCopy['LastUpdatedDate'] = jsonLastUpdatedDateCopy;
3561 27 Oct 15 olle 1238     jsonConsumablesCopy['ExpirationDate'] = jsonExpirationDateCopy;
3610 20 Nov 15 olle 1239     jsonConsumablesCopy['Active'] = jsonActiveCopy;
3561 27 Oct 15 olle 1240     jsonConsumablesCopy['TimesUsed'] = jsonTimesUsedCopy;
3561 27 Oct 15 olle 1241     jsonConsumablesCopy['UnusedFpaPlateLocs'] = jsonUnusedFpaPlateLocsCopy;
3561 27 Oct 15 olle 1242     jsonConsumablesCopy['Comment'] = jsonCommentCopy;
3561 27 Oct 15 olle 1243
3561 27 Oct 15 olle 1244     return jsonConsumablesCopy;
3561 27 Oct 15 olle 1245   }
3561 27 Oct 15 olle 1246
3561 27 Oct 15 olle 1247   exreg.libPrepKitDataToJsonArray = function()
3561 27 Oct 15 olle 1248   {
3561 27 Oct 15 olle 1249     // Reset JSONArray
3561 27 Oct 15 olle 1250     jsonKitArray = [];
3561 27 Oct 15 olle 1251
3561 27 Oct 15 olle 1252     // Get JSONArrays with data for kits
3561 27 Oct 15 olle 1253     // One kit component a time, e.g. 'jsonKitName' is a JSONArray with kit names
3561 27 Oct 15 olle 1254  
3561 27 Oct 15 olle 1255     var jsonHeaders = jsonConsumables['Headers'];
3561 27 Oct 15 olle 1256
3561 27 Oct 15 olle 1257     var jsonKitName = jsonConsumables['KitName'];
3561 27 Oct 15 olle 1258     var jsonLibraryPrepBox1 = jsonConsumables['LibraryPrepBox1'];
3561 27 Oct 15 olle 1259     var jsonIndexKit = jsonConsumables['IndexKit'];
3561 27 Oct 15 olle 1260     var jsonContentSetBox3 = jsonConsumables['ContentSetBox3'];
3561 27 Oct 15 olle 1261     var jsonOligoPoolA_FPA = jsonConsumables['OligoPoolA_FPA'];
3561 27 Oct 15 olle 1262     var jsonOligoPoolB_FPB = jsonConsumables['OligoPoolB_FPB'];
3561 27 Oct 15 olle 1263     var jsonOligoHybridizationSequencingReagent3 = jsonConsumables['OligoHybridizationSequencingReagent3'];
3561 27 Oct 15 olle 1264     var jsonStringentWash1_SW1 = jsonConsumables['StringentWash1_SW1'];
3561 27 Oct 15 olle 1265     var jsonExtensionLigationMix3 = jsonConsumables['ExtensionLigationMix3'];
3561 27 Oct 15 olle 1266     var jsonPcrMasterMix2_PMM2 = jsonConsumables['PcrMasterMix2_PMM2'];
3561 27 Oct 15 olle 1267     var jsonUB1 = jsonConsumables['UB1'];
3561 27 Oct 15 olle 1268     var jsonTDP = jsonConsumables['TDP'];
3561 27 Oct 15 olle 1269     var jsonFilterplate = jsonConsumables['Filterplate'];
3561 27 Oct 15 olle 1270     
3561 27 Oct 15 olle 1271     var jsonIndexPrimerA701 = jsonConsumables['IndexPrimerA701'];
3561 27 Oct 15 olle 1272     var jsonIndexPrimerA702 = jsonConsumables['IndexPrimerA702'];
3561 27 Oct 15 olle 1273     var jsonIndexPrimerA703 = jsonConsumables['IndexPrimerA703'];
3561 27 Oct 15 olle 1274     var jsonIndexPrimerA704 = jsonConsumables['IndexPrimerA704'];
3561 27 Oct 15 olle 1275     var jsonIndexPrimerA705 = jsonConsumables['IndexPrimerA705'];
3561 27 Oct 15 olle 1276     var jsonIndexPrimerA706 = jsonConsumables['IndexPrimerA706'];
3561 27 Oct 15 olle 1277     var jsonIndexPrimerA707 = jsonConsumables['IndexPrimerA707'];
3561 27 Oct 15 olle 1278     var jsonIndexPrimerA708 = jsonConsumables['IndexPrimerA708'];
3561 27 Oct 15 olle 1279     var jsonIndexPrimerA709 = jsonConsumables['IndexPrimerA709'];
3561 27 Oct 15 olle 1280     var jsonIndexPrimerA710 = jsonConsumables['IndexPrimerA710'];
3561 27 Oct 15 olle 1281     var jsonIndexPrimerA711 = jsonConsumables['IndexPrimerA711'];
3561 27 Oct 15 olle 1282     var jsonIndexPrimerA712 = jsonConsumables['IndexPrimerA712'];
3561 27 Oct 15 olle 1283     
3561 27 Oct 15 olle 1284     var jsonIndexPrimerA501 = jsonConsumables['IndexPrimerA501'];
3561 27 Oct 15 olle 1285     var jsonIndexPrimerA502 = jsonConsumables['IndexPrimerA502'];
3561 27 Oct 15 olle 1286     var jsonIndexPrimerA503 = jsonConsumables['IndexPrimerA503'];
3561 27 Oct 15 olle 1287     var jsonIndexPrimerA504 = jsonConsumables['IndexPrimerA504'];
3561 27 Oct 15 olle 1288     var jsonIndexPrimerA505 = jsonConsumables['IndexPrimerA505'];
3561 27 Oct 15 olle 1289     var jsonIndexPrimerA506 = jsonConsumables['IndexPrimerA506'];
3561 27 Oct 15 olle 1290     var jsonIndexPrimerA507 = jsonConsumables['IndexPrimerA507'];
3561 27 Oct 15 olle 1291     var jsonIndexPrimerA508 = jsonConsumables['IndexPrimerA508'];
3561 27 Oct 15 olle 1292
3561 27 Oct 15 olle 1293     var jsonRegistrationDate = jsonConsumables['RegistrationDate'];
3561 27 Oct 15 olle 1294     var jsonLastUpdatedDate = jsonConsumables['LastUpdatedDate'];
3561 27 Oct 15 olle 1295     var jsonExpirationDate = jsonConsumables['ExpirationDate'];
3610 20 Nov 15 olle 1296     var jsonActive = jsonConsumables['Active'];
3561 27 Oct 15 olle 1297     var jsonTimesUsed = jsonConsumables['TimesUsed'];
3561 27 Oct 15 olle 1298     var jsonUnusedFpaPlateLocs = jsonConsumables['UnusedFpaPlateLocs'];
3561 27 Oct 15 olle 1299     var jsonComment = jsonConsumables['Comment'];
3561 27 Oct 15 olle 1300
3561 27 Oct 15 olle 1301     // Get JSONArrays with data for kits
3561 27 Oct 15 olle 1302     // One kit a time, e.g. 'jsonKitArray' is a JSONArray with one JSONObject for each kit
3561 27 Oct 15 olle 1303
3561 27 Oct 15 olle 1304     var numItems = jsonKitName.length;
3561 27 Oct 15 olle 1305
3561 27 Oct 15 olle 1306     for (var i = 0; i < numItems; i++)
3561 27 Oct 15 olle 1307     {
3561 27 Oct 15 olle 1308       // Store data for kit number 'i' in JSONObject 'jsonKit'
3561 27 Oct 15 olle 1309       var jsonKit = {};
3561 27 Oct 15 olle 1310
3561 27 Oct 15 olle 1311       jsonKit['KitName'] = jsonKitName[i];
3561 27 Oct 15 olle 1312       jsonKit['LibraryPrepBox1'] = jsonLibraryPrepBox1[i];
3561 27 Oct 15 olle 1313       jsonKit['IndexKit'] = jsonIndexKit[i];
3561 27 Oct 15 olle 1314       jsonKit['ContentSetBox3'] = jsonContentSetBox3[i];
3561 27 Oct 15 olle 1315       jsonKit['OligoPoolA_FPA'] = jsonOligoPoolA_FPA[i];
3561 27 Oct 15 olle 1316       jsonKit['OligoPoolB_FPB'] = jsonOligoPoolB_FPB[i];
3561 27 Oct 15 olle 1317       jsonKit['OligoHybridizationSequencingReagent3'] = jsonOligoHybridizationSequencingReagent3[i];
3561 27 Oct 15 olle 1318       jsonKit['StringentWash1_SW1'] = jsonStringentWash1_SW1[i];
3561 27 Oct 15 olle 1319       jsonKit['ExtensionLigationMix3'] = jsonExtensionLigationMix3[i];
3561 27 Oct 15 olle 1320       jsonKit['PcrMasterMix2_PMM2'] = jsonPcrMasterMix2_PMM2[i];
3561 27 Oct 15 olle 1321       jsonKit['UB1'] = jsonUB1[i];
3561 27 Oct 15 olle 1322       jsonKit['TDP'] = jsonTDP[i];
3561 27 Oct 15 olle 1323       jsonKit['Filterplate'] = jsonFilterplate[i];
3561 27 Oct 15 olle 1324     
3561 27 Oct 15 olle 1325       jsonKit['IndexPrimerA701'] = jsonIndexPrimerA701[i];
3561 27 Oct 15 olle 1326       jsonKit['IndexPrimerA702'] = jsonIndexPrimerA702[i];
3561 27 Oct 15 olle 1327       jsonKit['IndexPrimerA703'] = jsonIndexPrimerA703[i];
3561 27 Oct 15 olle 1328       jsonKit['IndexPrimerA704'] = jsonIndexPrimerA704[i];
3561 27 Oct 15 olle 1329       jsonKit['IndexPrimerA705'] = jsonIndexPrimerA705[i];
3561 27 Oct 15 olle 1330       jsonKit['IndexPrimerA706'] = jsonIndexPrimerA706[i];
3561 27 Oct 15 olle 1331       jsonKit['IndexPrimerA707'] = jsonIndexPrimerA707[i];
3561 27 Oct 15 olle 1332       jsonKit['IndexPrimerA708'] = jsonIndexPrimerA708[i];
3561 27 Oct 15 olle 1333       jsonKit['IndexPrimerA709'] = jsonIndexPrimerA709[i];
3561 27 Oct 15 olle 1334       jsonKit['IndexPrimerA710'] = jsonIndexPrimerA710[i];
3561 27 Oct 15 olle 1335       jsonKit['IndexPrimerA711'] = jsonIndexPrimerA711[i];
3561 27 Oct 15 olle 1336       jsonKit['IndexPrimerA712'] = jsonIndexPrimerA712[i];
3561 27 Oct 15 olle 1337     
3561 27 Oct 15 olle 1338       jsonKit['IndexPrimerA501'] = jsonIndexPrimerA501[i];
3561 27 Oct 15 olle 1339       jsonKit['IndexPrimerA502'] = jsonIndexPrimerA502[i];
3561 27 Oct 15 olle 1340       jsonKit['IndexPrimerA503'] = jsonIndexPrimerA503[i];
3561 27 Oct 15 olle 1341       jsonKit['IndexPrimerA504'] = jsonIndexPrimerA504[i];
3561 27 Oct 15 olle 1342       jsonKit['IndexPrimerA505'] = jsonIndexPrimerA505[i];
3561 27 Oct 15 olle 1343       jsonKit['IndexPrimerA506'] = jsonIndexPrimerA506[i];
3561 27 Oct 15 olle 1344       jsonKit['IndexPrimerA507'] = jsonIndexPrimerA507[i];
3561 27 Oct 15 olle 1345       jsonKit['IndexPrimerA508'] = jsonIndexPrimerA508[i];
3561 27 Oct 15 olle 1346
3561 27 Oct 15 olle 1347       jsonKit['RegistrationDate'] = jsonRegistrationDate[i];
3561 27 Oct 15 olle 1348       jsonKit['LastUpdatedDate'] = jsonLastUpdatedDate[i];
3561 27 Oct 15 olle 1349       jsonKit['ExpirationDate'] = jsonExpirationDate[i];
3610 20 Nov 15 olle 1350       jsonKit['Active'] = jsonActive[i];
3561 27 Oct 15 olle 1351       jsonKit['TimesUsed'] = jsonTimesUsed[i];
3561 27 Oct 15 olle 1352       jsonKit['UnusedFpaPlateLocs'] = jsonUnusedFpaPlateLocs[i];
3561 27 Oct 15 olle 1353       jsonKit['Comment'] = jsonComment[i];
3561 27 Oct 15 olle 1354
3561 27 Oct 15 olle 1355       // Add JSONObject 'jsonKit' with data for kit number 'i' to JSONArray 'jsonKitArray'
3561 27 Oct 15 olle 1356       jsonKitArray[i] = jsonKit;      
3561 27 Oct 15 olle 1357     }
3561 27 Oct 15 olle 1358   }
3561 27 Oct 15 olle 1359
3561 27 Oct 15 olle 1360   exreg.editLibPrepKitDetails = function(event)
3561 27 Oct 15 olle 1361   {
3561 27 Oct 15 olle 1362     // 'index' is row value in table, starting with 0
3561 27 Oct 15 olle 1363     var index = Data.get(event.currentTarget, 'index');
3561 27 Oct 15 olle 1364     var frm = document.forms['meludi'];
3561 27 Oct 15 olle 1365     var jsonKitName = jsonConsumables['KitName'];
3561 27 Oct 15 olle 1366     var kitName = jsonKitName[index];
4206 04 Nov 16 olle 1367     // Call LibPrepServlet to get plate info for selected kit
4206 04 Nov 16 olle 1368     var url = '../LibPrep.servlet?ID='+App.getSessionId();
4206 04 Nov 16 olle 1369     url += '&cmd=GetLibPrepKitAsPlate';
4206 04 Nov 16 olle 1370     url += '&index=' + index;
4206 04 Nov 16 olle 1371     url += '&libPrepKitName=' + encodeURIComponent(kitName);
4206 04 Nov 16 olle 1372     
4206 04 Nov 16 olle 1373     Wizard.showLoadingAnimation('Loading information about kit...');
4206 04 Nov 16 olle 1374     Wizard.asyncJsonRequest(url, exreg.kitPlateInfoLoaded);
4206 04 Nov 16 olle 1375   }
4206 04 Nov 16 olle 1376
4206 04 Nov 16 olle 1377   exreg.kitPlateInfoLoaded = function(response)
4206 04 Nov 16 olle 1378   {
4206 04 Nov 16 olle 1379     // Store plate info for selected kit for later use by pop-up dialog
4206 04 Nov 16 olle 1380     kitPlateInfo = response.plate;
4206 04 Nov 16 olle 1381     // Get row index value from response
4206 04 Nov 16 olle 1382     var index = response.index;
4206 04 Nov 16 olle 1383
4206 04 Nov 16 olle 1384     // Continue with opening dialog pop-up window
4206 04 Nov 16 olle 1385     var frm = document.forms['meludi'];
4206 04 Nov 16 olle 1386     var jsonKitName = jsonConsumables['KitName'];
4206 04 Nov 16 olle 1387     var kitName = jsonKitName[index];
3561 27 Oct 15 olle 1388     var url = 'edit_libprep_kit_details.jsp?ID='+App.getSessionId();
3561 27 Oct 15 olle 1389     url += '&index='+index;
3561 27 Oct 15 olle 1390     //url += '&mode=' + 'LibPrepKitEdit';
3561 27 Oct 15 olle 1391     url += '&kitname=' + kitName;
3561 27 Oct 15 olle 1392     Dialogs.openPopup(url, 'EditLibPrepKitDetails'+index, 750, 500);  
3561 27 Oct 15 olle 1393   }
3561 27 Oct 15 olle 1394
4206 04 Nov 16 olle 1395   exreg.fetchKitPlateInfo = function()
4206 04 Nov 16 olle 1396   {
4206 04 Nov 16 olle 1397     return kitPlateInfo;
4206 04 Nov 16 olle 1398   }
4206 04 Nov 16 olle 1399
3561 27 Oct 15 olle 1400   exreg.downloadLibPrepKitDataFile = function()
3561 27 Oct 15 olle 1401   {
3561 27 Oct 15 olle 1402     var frm = document.forms['meludi'];
3561 27 Oct 15 olle 1403     var kitFilterValue = frm.libPrepKitFilter.value;
3561 27 Oct 15 olle 1404     var kitFilterName = exreg.fetchLibPrepFilterName(kitFilterValue);
3561 27 Oct 15 olle 1405     var numItemsFiltered = jsonConsumables['numItemsFiltered'];
3561 27 Oct 15 olle 1406     var numItemsTot = jsonConsumables['numItemsTot'];
3561 27 Oct 15 olle 1407     var reagentInfo = {};
3561 27 Oct 15 olle 1408
3561 27 Oct 15 olle 1409     var url = '../LibPrep.servlet?ID='+App.getSessionId();
3561 27 Oct 15 olle 1410     url += '&cmd=PrepareDownloadLibPrepKitDataFile';
3561 27 Oct 15 olle 1411     url += '&kitFilter='+encodeURIComponent(kitFilterValue);
3561 27 Oct 15 olle 1412     url += '&kitFilterName='+encodeURIComponent(kitFilterName);
3561 27 Oct 15 olle 1413     url += '&numItemsFiltered='+encodeURIComponent(numItemsFiltered);
3561 27 Oct 15 olle 1414     url += '&numItemsTot='+encodeURIComponent(numItemsTot);
3561 27 Oct 15 olle 1415
3561 27 Oct 15 olle 1416     // Reagents
3561 27 Oct 15 olle 1417     reagentInfo = jsonConsumables;
3561 27 Oct 15 olle 1418
3561 27 Oct 15 olle 1419     // POST
3561 27 Oct 15 olle 1420     Wizard.showLoadingAnimation('Performing registration...');
3561 27 Oct 15 olle 1421     Wizard.asyncJsonRequest(url, exreg.downloadLibPrepKitDataFileResults, 'POST', JSON.stringify(reagentInfo));
3561 27 Oct 15 olle 1422   }
3561 27 Oct 15 olle 1423
3561 27 Oct 15 olle 1424   exreg.downloadLibPrepKitDataFileResults = function(response)
3561 27 Oct 15 olle 1425   {
3561 27 Oct 15 olle 1426     var tmpFilePath = response;
3561 27 Oct 15 olle 1427     var frm = document.forms['meludi'];
3561 27 Oct 15 olle 1428     var kitFilterValue = frm.libPrepKitFilter.value;
3561 27 Oct 15 olle 1429
3561 27 Oct 15 olle 1430     var url = '../LibPrep.servlet?ID='+App.getSessionId();
3561 27 Oct 15 olle 1431     url += '&cmd=DownloadLibPrepKitDataFile';
3561 27 Oct 15 olle 1432     url += '&kitFilterValue='+encodeURIComponent(kitFilterValue);
3561 27 Oct 15 olle 1433     url += '&tmpFilePath='+encodeURIComponent(tmpFilePath);
3561 27 Oct 15 olle 1434     window.open(url);
3561 27 Oct 15 olle 1435   }
3561 27 Oct 15 olle 1436
3561 27 Oct 15 olle 1437   exreg.validateStep2 = function(event)
3561 27 Oct 15 olle 1438   {
3561 27 Oct 15 olle 1439     var valid = true;
3561 27 Oct 15 olle 1440     valid &= consumablesFileIsValid;
3561 27 Oct 15 olle 1441     
3561 27 Oct 15 olle 1442 //alert("exreg.validateStep2(): valid = " + valid);
3561 27 Oct 15 olle 1443     if (!valid) event.preventDefault();
3561 27 Oct 15 olle 1444   }
3561 27 Oct 15 olle 1445
3561 27 Oct 15 olle 1446   exreg.submit = function()
3561 27 Oct 15 olle 1447   {
3561 27 Oct 15 olle 1448     var frm = document.forms['meludi'];
3561 27 Oct 15 olle 1449     
3561 27 Oct 15 olle 1450     var submitInfo = {};
3561 27 Oct 15 olle 1451     submitInfo = jsonConsumablesModified;
3561 27 Oct 15 olle 1452
3561 27 Oct 15 olle 1453     // Library preparation reagent file
3561 27 Oct 15 olle 1454 /*
3561 27 Oct 15 olle 1455     submitInfo.referenceName = frm.consumablesFile.value;
3561 27 Oct 15 olle 1456     submitInfo.expirationDate = frm.expirationDate.value;
3561 27 Oct 15 olle 1457 */
3561 27 Oct 15 olle 1458
3561 27 Oct 15 olle 1459     var url = '../LibPrep.servlet?ID='+App.getSessionId();
3627 26 Nov 15 olle 1460     url += '&cmd=RegisterKits';
3561 27 Oct 15 olle 1461     url += '&overwrite=true';
3561 27 Oct 15 olle 1462     Wizard.showLoadingAnimation('Performing registration...');
3561 27 Oct 15 olle 1463     Wizard.asyncJsonRequest(url, exreg.submissionResults, 'POST', JSON.stringify(submitInfo));
3561 27 Oct 15 olle 1464   }
3561 27 Oct 15 olle 1465   
3561 27 Oct 15 olle 1466   exreg.submissionResults = function(response)
3561 27 Oct 15 olle 1467   {
3561 27 Oct 15 olle 1468     Wizard.showFinalMessage(response.messages);
3561 27 Oct 15 olle 1469     Doc.show('gorestart');
3561 27 Oct 15 olle 1470 /*
3561 27 Oct 15 olle 1471     Doc.show('gocreate');
3561 27 Oct 15 olle 1472 */
3561 27 Oct 15 olle 1473   }
3561 27 Oct 15 olle 1474
3561 27 Oct 15 olle 1475   exreg.createProtocol = function()
3561 27 Oct 15 olle 1476   {
3561 27 Oct 15 olle 1477     var frm = document.forms['meludi'];
3561 27 Oct 15 olle 1478     var submitInfo = {};
3561 27 Oct 15 olle 1479     submitInfo.items = [];
3561 27 Oct 15 olle 1480
3561 27 Oct 15 olle 1481     submitInfo.docMode = 'report';
3561 27 Oct 15 olle 1482     // Get list of selected extract source items
3561 27 Oct 15 olle 1483     var selItemsList = exreg.getSelectedItemsList();
3561 27 Oct 15 olle 1484     var numItems = selItemsList.length;
3561 27 Oct 15 olle 1485     var totNumItems = numItems;
3561 27 Oct 15 olle 1486     for (var i = 0; i < totNumItems; i++)
3561 27 Oct 15 olle 1487     {
3561 27 Oct 15 olle 1488       var item = null;
3561 27 Oct 15 olle 1489       item = selItemsList[i];
3561 27 Oct 15 olle 1490       submitInfo.items[submitInfo.items.length] = item;
3561 27 Oct 15 olle 1491     }
3561 27 Oct 15 olle 1492
3561 27 Oct 15 olle 1493     // Extraction
3561 27 Oct 15 olle 1494     submitInfo.startListName = frm.startListName.value;
3561 27 Oct 15 olle 1495     submitInfo.isolationDate = frm.isolationDate.value;
3561 27 Oct 15 olle 1496     submitInfo.extractionOperator = frm.extractionOperator.value;
3561 27 Oct 15 olle 1497     submitInfo.extractionProtocol = parseInt(frm.extractionProtocolId.value, 10);
3561 27 Oct 15 olle 1498     var extractionProtocolName = frm.extractionProtocolName.value;
3561 27 Oct 15 olle 1499     var protocolVersionNo = '';
3561 27 Oct 15 olle 1500     if (extractionProtocolName)
3561 27 Oct 15 olle 1501     {
3561 27 Oct 15 olle 1502       protocolVersionNo = extractionProtocolName;
3561 27 Oct 15 olle 1503       // Remove part of string up to and including last "v"
3561 27 Oct 15 olle 1504       var vIndex = protocolVersionNo.indexOf('v');
3561 27 Oct 15 olle 1505       while (vIndex >= 0)
3561 27 Oct 15 olle 1506       {
3561 27 Oct 15 olle 1507         // Remove part of string up to and including first "v"
3561 27 Oct 15 olle 1508         protocolVersionNo = protocolVersionNo.substring(vIndex + 1);
3561 27 Oct 15 olle 1509         vIndex = protocolVersionNo.indexOf('v');
3561 27 Oct 15 olle 1510       }
3561 27 Oct 15 olle 1511     }
3561 27 Oct 15 olle 1512     var protocolPreviewFlag = null;
3561 27 Oct 15 olle 1513     if (trackingProtocolPreview)
3561 27 Oct 15 olle 1514     {
3561 27 Oct 15 olle 1515       protocolPreviewFlag = 'true';
3561 27 Oct 15 olle 1516     }
3561 27 Oct 15 olle 1517     submitInfo.extractionProtocolName = extractionProtocolName;
3561 27 Oct 15 olle 1518     submitInfo.protocolVersionNo = protocolVersionNo;
3561 27 Oct 15 olle 1519     submitInfo.protocolPreviewFlag = protocolPreviewFlag;
3561 27 Oct 15 olle 1520     submitInfo.dnaDefaultVolume = ExtractUtils.getNumber(frm.dnaDefaultVolume.value);
3561 27 Oct 15 olle 1521     
3561 27 Oct 15 olle 1522     // QIAcube
3561 27 Oct 15 olle 1523     submitInfo.qiacubeDate = frm.qiacubeDate.value;
3561 27 Oct 15 olle 1524     submitInfo.qiacubeOperator = frm.qiacubeOperator.value;
3561 27 Oct 15 olle 1525     submitInfo.qiacubeRunNo = parseInt(frm.qiacubeRunNo.value, 10);
3561 27 Oct 15 olle 1526
3561 27 Oct 15 olle 1527     // Specimen reagents
3561 27 Oct 15 olle 1528     submitInfo.xyleneSpecimen = frm.xyleneSpecimen.value;
3561 27 Oct 15 olle 1529     submitInfo.etoh995Specimen = frm.etoh995Specimen.value;
3561 27 Oct 15 olle 1530     submitInfo.allPrepFfpeKit = frm.allPrepFfpeKit.value;
3561 27 Oct 15 olle 1531     submitInfo.bufferPkdSpecimen = frm.bufferPkdSpecimen.value;
3561 27 Oct 15 olle 1532     submitInfo.bufferAtlSpecimen = frm.bufferAtlSpecimen.value;
3561 27 Oct 15 olle 1533     submitInfo.proteinaseKSpecimen = frm.proteinaseKSpecimen.value;
3561 27 Oct 15 olle 1534     submitInfo.rnaseASpecimen = frm.rnaseASpecimen.value;
3561 27 Oct 15 olle 1535
3561 27 Oct 15 olle 1536     // QIAcube
3561 27 Oct 15 olle 1537     submitInfo.etoh995 = frm.etoh995.value;
3561 27 Oct 15 olle 1538     submitInfo.bufferRlt = frm.bufferRlt.value;
3561 27 Oct 15 olle 1539     submitInfo.bufferFrn = frm.bufferFrn.value;
3561 27 Oct 15 olle 1540     submitInfo.bufferRpe = frm.bufferRpe.value;
3561 27 Oct 15 olle 1541     submitInfo.bufferAl = frm.bufferAl.value;
3561 27 Oct 15 olle 1542     submitInfo.bufferAw1 = frm.bufferAw1.value;
3561 27 Oct 15 olle 1543     submitInfo.bufferAw2 = frm.bufferAw2.value;
3561 27 Oct 15 olle 1544     submitInfo.bufferAte = frm.bufferAte.value;
3561 27 Oct 15 olle 1545     submitInfo.bufferRdd = frm.bufferRdd.value;
3561 27 Oct 15 olle 1546     submitInfo.rnaseFreeWater = frm.rnaseFreeWater.value;
3561 27 Oct 15 olle 1547     submitInfo.dnaseMix = frm.dnaseMix.value;
3561 27 Oct 15 olle 1548     submitInfo.rneasyMinEluteSpinColumn = frm.rneasyMinEluteSpinColumn.value;
3561 27 Oct 15 olle 1549     submitInfo.qiaampMinEluteSpinColumn = frm.qiaampMinEluteSpinColumn.value;
3561 27 Oct 15 olle 1550
3561 27 Oct 15 olle 1551     // Quality control reagents
3561 27 Oct 15 olle 1552     submitInfo.kapaSybrFast = frm.kapaSybrFast.value;
3561 27 Oct 15 olle 1553     submitInfo.qualityControlPrimersQcpRgt = frm.qualityControlPrimersQcpRgt.value;
3561 27 Oct 15 olle 1554     submitInfo.qualityControlTemplateQct = frm.qualityControlTemplateQct.value;
3561 27 Oct 15 olle 1555     submitInfo.qubitDnaHighSens = frm.qubitDnaHighSens.value;
3561 27 Oct 15 olle 1556     submitInfo.qubitDnaBroadRange = frm.qubitDnaBroadRange.value;
3561 27 Oct 15 olle 1557
3561 27 Oct 15 olle 1558     // Save values in hidden input fields for retrieval after HTML request
3561 27 Oct 15 olle 1559     var submitInfoJsonStr = JSON.stringify(submitInfo);
3561 27 Oct 15 olle 1560     frm.hiddenSubmitInfo.value = submitInfoJsonStr;
3561 27 Oct 15 olle 1561     frm.hiddenNumItems.value = submitInfo.items.length;
3561 27 Oct 15 olle 1562     frm.hiddenCounterBalanceInfoRow.value = counterBalanceInfoRow;
3561 27 Oct 15 olle 1563
3561 27 Oct 15 olle 1564     // Calling frm.submit() will change jsp file to extraction_protocol2.jsp
3561 27 Oct 15 olle 1565     frm.submit();
3561 27 Oct 15 olle 1566   }
3561 27 Oct 15 olle 1567
3561 27 Oct 15 olle 1568   exreg.fetchLibPrepFilterName = function(filterValue)
3561 27 Oct 15 olle 1569   {
3561 27 Oct 15 olle 1570     var filterName = filterValue;
3561 27 Oct 15 olle 1571     if (filterValue != null && filterValue != '')
3561 27 Oct 15 olle 1572     {
3561 27 Oct 15 olle 1573       if (filterValue == 'all')
3561 27 Oct 15 olle 1574       {
3561 27 Oct 15 olle 1575         filterName = 'All';
3561 27 Oct 15 olle 1576       }
3610 20 Nov 15 olle 1577       else if (filterValue == 'used_active')
3561 27 Oct 15 olle 1578       {
3610 20 Nov 15 olle 1579         filterName = 'Used & active';
3561 27 Oct 15 olle 1580       }
3610 20 Nov 15 olle 1581       else if (filterValue == 'used_inactive')
3561 27 Oct 15 olle 1582       {
3610 20 Nov 15 olle 1583         filterName = 'Used & inactive';
3561 27 Oct 15 olle 1584       }
3561 27 Oct 15 olle 1585       else if (filterValue == 'used')
3561 27 Oct 15 olle 1586       {
3561 27 Oct 15 olle 1587         filterName = 'Used';
3561 27 Oct 15 olle 1588       }
3561 27 Oct 15 olle 1589       else if (filterValue == 'unused')
3561 27 Oct 15 olle 1590       {
3561 27 Oct 15 olle 1591         filterName = 'Unused';
3561 27 Oct 15 olle 1592       }
3610 20 Nov 15 olle 1593       else if (filterValue == 'active')
3561 27 Oct 15 olle 1594       {
3610 20 Nov 15 olle 1595         filterName = 'Active';
3561 27 Oct 15 olle 1596       }
3610 20 Nov 15 olle 1597       else if (filterValue == 'inactive')
3561 27 Oct 15 olle 1598       {
3610 20 Nov 15 olle 1599         filterName = 'Inactive';
3561 27 Oct 15 olle 1600       }
3561 27 Oct 15 olle 1601     }
3561 27 Oct 15 olle 1602     return filterName;
3561 27 Oct 15 olle 1603   }
3561 27 Oct 15 olle 1604
3561 27 Oct 15 olle 1605   return exreg;
3561 27 Oct 15 olle 1606 }();
3561 27 Oct 15 olle 1607
3561 27 Oct 15 olle 1608 Doc.onLoad(ExtractionReg.initPage);
3561 27 Oct 15 olle 1609