Best JavaScript code snippet using unexpected
regress-302439.js
Source:regress-302439.js
1/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */2/* ***** BEGIN LICENSE BLOCK *****3 * Version: MPL 1.1/GPL 2.0/LGPL 2.14 *5 * The contents of this file are subject to the Mozilla Public License Version6 * 1.1 (the "License"); you may not use this file except in compliance with7 * the License. You may obtain a copy of the License at8 * http://www.mozilla.org/MPL/9 *10 * Software distributed under the License is distributed on an "AS IS" basis,11 * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License12 * for the specific language governing rights and limitations under the13 * License.14 *15 * The Original Code is JavaScript Engine testing utilities.16 *17 * The Initial Developer of the Original Code is18 * Mozilla Foundation.19 * Portions created by the Initial Developer are Copyright (C) 200520 * the Initial Developer. All Rights Reserved.21 *22 * Contributor(s): Silviu Trasca23 *24 * Alternatively, the contents of this file may be used under the terms of25 * either the GNU General Public License Version 2 or later (the "GPL"), or26 * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),27 * in which case the provisions of the GPL or the LGPL are applicable instead28 * of those above. If you wish to allow use of your version of this file only29 * under the terms of either the GPL or the LGPL, and not to allow others to30 * use your version of this file under the terms of the MPL, indicate your31 * decision by deleting the provisions above and replace them with the notice32 * and other provisions required by the GPL or the LGPL. If you do not delete33 * the provisions above, a recipient may use your version of this file under34 * the terms of any one of the MPL, the GPL or the LGPL.35 *36 * ***** END LICENSE BLOCK ***** */37var gTestfile = 'regress-302439.js';38//-----------------------------------------------------------------------------39var BUGNUMBER = 302439;40var summary = 'spandep fu should skip unused JSOP_TABLESWITCH jump table entries';41var actual = 'No Crash';42var expect = 'No Crash';43printBugNumber(BUGNUMBER);44printStatus (summary);45function productList(catID,famID) {46 clearBox(document.Support_Form.Product_ID);47 switch(parseInt(catID)) {48 case 1 : // Sound Blaster49 switch(parseInt(famID)) {50 case 434 : // Audigy 451 break;52 case 204 : // Audigy 253 break;54 case 205 : // Audigy55 try { addBoxItem(document.Support_Form.Product_ID, 'Audigy Platinum eX', '45'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //56 try { addBoxItem(document.Support_Form.Product_ID, 'Audigy Platinum', '4846'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //57 try { addBoxItem(document.Support_Form.Product_ID, 'Audigy LS (SE)', '10365'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //58 try { addBoxItem(document.Support_Form.Product_ID, 'Audigy Digital Entertainment', '5085'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //59 try { addBoxItem(document.Support_Form.Product_ID, 'Audigy ES', '5086'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //60 break;61 case 206 : // Live!62 try { addBoxItem(document.Support_Form.Product_ID, 'Live! 24-bit External', '10702'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //63 try { addBoxItem(document.Support_Form.Product_ID, 'Sound Blaster Live! MP3+ 5.1', '573'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //64 try { addBoxItem(document.Support_Form.Product_ID, 'Live! 5.1', '50'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //65 try { addBoxItem(document.Support_Form.Product_ID, 'Live! Digital Entertainment 5.1 (SE)', '4855'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //66 try { addBoxItem(document.Support_Form.Product_ID, 'Live! Platinum 5.1', '572'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //67 try { addBoxItem(document.Support_Form.Product_ID, 'Sound Blaster Live! 5.1 Digital (Dell)', '1853'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //68 try { addBoxItem(document.Support_Form.Product_ID, 'Live! Platinum', '3203'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //69 try { addBoxItem(document.Support_Form.Product_ID, 'Sound Blaster Live! Value', '4856'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //70 try { addBoxItem(document.Support_Form.Product_ID, 'Sound Blaster Live!', '4857'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //71 break;72 case 207 : // Others73 try { addBoxItem(document.Support_Form.Product_ID, 'Extigy', '585'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //74 try { addBoxItem(document.Support_Form.Product_ID, 'Ensoniq AudioPCI', '420'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //75 try { addBoxItem(document.Support_Form.Product_ID, 'PCI4.1 Digital', '681'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //76 try { addBoxItem(document.Support_Form.Product_ID, 'Vibra128 4D', '9032'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //77 try { addBoxItem(document.Support_Form.Product_ID, 'Digital Music', '154'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //78 try { addBoxItem(document.Support_Form.Product_ID, 'Vibra 128', '4851'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //79 try { addBoxItem(document.Support_Form.Product_ID, 'Sound Blaster 32', '1844'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //80 try { addBoxItem(document.Support_Form.Product_ID, 'SB AWE64 Digital', '1821'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //81 try { addBoxItem(document.Support_Form.Product_ID, 'SB PCI 5.1', '1828'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //82 try { addBoxItem(document.Support_Form.Product_ID, 'Sound Blaster\u00AE', '1841'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //83 try { addBoxItem(document.Support_Form.Product_ID, 'Sound Blaster\u00AE 16', '1842'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //84 try { addBoxItem(document.Support_Form.Product_ID, 'Sound Blaster 16 Wave Effects', '1843'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //85 try { addBoxItem(document.Support_Form.Product_ID, 'Sound Blaster AWE32', '1848'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //86 try { addBoxItem(document.Support_Form.Product_ID, 'Sound Blaster AWE64', '1849'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //87 try { addBoxItem(document.Support_Form.Product_ID, 'Sound Blaster AWE64 Gold', '1850'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //88 try { addBoxItem(document.Support_Form.Product_ID, 'Sound Blaster Microchannels', '1861'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //89 try { addBoxItem(document.Support_Form.Product_ID, 'Sound Blaster PCI 128', '1864'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //90 try { addBoxItem(document.Support_Form.Product_ID, 'Sound Blaster PCI 64', '1865'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //91 try { addBoxItem(document.Support_Form.Product_ID, 'Sound Blaster Pro', '1866'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //92 try { addBoxItem(document.Support_Form.Product_ID, 'Sound Blaster Audio PCI', '1559'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //93 break;94 case 16 : // Accessories95 try { addBoxItem(document.Support_Form.Product_ID, 'Live!Drive II', '9278'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //96 try { addBoxItem(document.Support_Form.Product_ID, 'Sound Blaster MIDI Adapter', '251'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //97 try { addBoxItem(document.Support_Form.Product_ID, 'Mini to Standard MIDI Adapter', '252'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //98 break;99 }100 break;101 case 210 : // Portable Media Players102 switch(parseInt(famID)) {103 case 211 : // Zen104 try { addBoxItem(document.Support_Form.Product_ID, 'Zen Portable Media Center', '9882'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //105 break;106 case 212 : // Accessories107 try { addBoxItem(document.Support_Form.Product_ID, 'Zen PMC Docking Station', '10756'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //108 try { addBoxItem(document.Support_Form.Product_ID, 'Zen PMC Li-ion Polymer Battery', '10679'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //109 try { addBoxItem(document.Support_Form.Product_ID, 'Zen PMC FM Wired Remote', '10663'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //110 break;111 }112 break;113 case 213 : // MP3 Players114 switch(parseInt(famID)) {115 case 214 : // Zen116 try { addBoxItem(document.Support_Form.Product_ID, 'Zen Touch', '10274'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //117 try { addBoxItem(document.Support_Form.Product_ID, 'Zen Micro', '10795'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //118 try { addBoxItem(document.Support_Form.Product_ID, 'Zen', '11519'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //119 try { addBoxItem(document.Support_Form.Product_ID, 'Zen Xtra', '9288'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //120 try { addBoxItem(document.Support_Form.Product_ID, 'Zen NX', '4836'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //121 try { addBoxItem(document.Support_Form.Product_ID, 'Zen USB 2.0', '9019'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //122 try { addBoxItem(document.Support_Form.Product_ID, 'Creative NOMAD Jukebox Zen', '117'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //123 break;124 case 215 : // MuVo125 try { addBoxItem(document.Support_Form.Product_ID, 'MuVo Micro N200', '10737'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //126 try { addBoxItem(document.Support_Form.Product_ID, 'MuVo\u00B2 X-Trainer', '5080'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //127 try { addBoxItem(document.Support_Form.Product_ID, 'MuVo Slim', '10052'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //128 try { addBoxItem(document.Support_Form.Product_ID, 'MuVo Sport C100', '10794'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //129 try { addBoxItem(document.Support_Form.Product_ID, 'MuVo V200', '10732'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //130 try { addBoxItem(document.Support_Form.Product_ID, 'MuVo TX FM', '9771'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //131 try { addBoxItem(document.Support_Form.Product_ID, 'MuVo USB 2.0', '10919'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //132 try { addBoxItem(document.Support_Form.Product_ID, 'MuVo', '110'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //133 try { addBoxItem(document.Support_Form.Product_ID, 'MuVo NX', '4884'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //134 try { addBoxItem(document.Support_Form.Product_ID, 'MuVo\u00B2', '4908'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //135 try { addBoxItem(document.Support_Form.Product_ID, 'MuVo TX', '9672'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //136 break;137 case 216 : // Digital MP3 Player138 try { addBoxItem(document.Support_Form.Product_ID, 'Zen Xtra', '9288'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //139 try { addBoxItem(document.Support_Form.Product_ID, 'Rhomba NX', '10302'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //140 try { addBoxItem(document.Support_Form.Product_ID, 'MP3 Player FX120', '11010'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //141 try { addBoxItem(document.Support_Form.Product_ID, 'DXT 200', '4996'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //142 try { addBoxItem(document.Support_Form.Product_ID, 'Zen USB 2.0', '9019'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //143 try { addBoxItem(document.Support_Form.Product_ID, 'Jukebox 3', '296'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //144 try { addBoxItem(document.Support_Form.Product_ID, 'Creative CD-MP3 Slim 600', '1582'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //145 try { addBoxItem(document.Support_Form.Product_ID, 'Zen NX', '4836'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //146 try { addBoxItem(document.Support_Form.Product_ID, 'MP3 Player', '4983'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //147 try { addBoxItem(document.Support_Form.Product_ID, 'MP3 Player 2', '4984'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //148 try { addBoxItem(document.Support_Form.Product_ID, 'MP3 Player MX', '4985'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //149 try { addBoxItem(document.Support_Form.Product_ID, 'Creative NOMAD Jukebox Zen', '117'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //150 try { addBoxItem(document.Support_Form.Product_ID, 'JukeBox 2', '239'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //151 try { addBoxItem(document.Support_Form.Product_ID, 'Creative NOMAD JukeBox', '241'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //152 try { addBoxItem(document.Support_Form.Product_ID, 'Creative NOMAD JukeBox C', '242'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //153 try { addBoxItem(document.Support_Form.Product_ID, 'Jukebox 10GB', '261'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //154 try { addBoxItem(document.Support_Form.Product_ID, 'Creative CD-MP3 M100', '264'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //155 break;156 case 217 : // Accessories157 try { addBoxItem(document.Support_Form.Product_ID, 'Zen Micro Battery', '11215'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //158 try { addBoxItem(document.Support_Form.Product_ID, 'Universal Travel Adapter for Zen Micro', '11711'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //159 try { addBoxItem(document.Support_Form.Product_ID, 'Zen Neeon Stik-On', '12982'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //160 try { addBoxItem(document.Support_Form.Product_ID, 'Zen Neeon Universal Travel Adapter', '12979'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //161 try { addBoxItem(document.Support_Form.Product_ID, 'Leather Case', '11511'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //162 try { addBoxItem(document.Support_Form.Product_ID, 'Zen Neeon Leather Case', '12978'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //163 try { addBoxItem(document.Support_Form.Product_ID, 'Home Kit - Jukebox 3', '497'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //164 try { addBoxItem(document.Support_Form.Product_ID, 'Creative NOMAD Jukebox 3 Leather Case', '498'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //165 try { addBoxItem(document.Support_Form.Product_ID, 'Faceplates - Jukebox 3', '499'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //166 try { addBoxItem(document.Support_Form.Product_ID, 'MuVo Armband', '511'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //167 try { addBoxItem(document.Support_Form.Product_ID, 'NOMAD II MG Wired Remote', '515'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //168 try { addBoxItem(document.Support_Form.Product_ID, 'Creative NOMAD Jukebox Accessory Kit', '533'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //169 try { addBoxItem(document.Support_Form.Product_ID, 'Creative NOMAD Jukebox Battery Charger Kit', '538'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //170 try { addBoxItem(document.Support_Form.Product_ID, 'Creative NOMAD Jukebox Battery Pack', '539'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //171 try { addBoxItem(document.Support_Form.Product_ID, 'NOMAD II MG Travel Cable', '560'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //172 try { addBoxItem(document.Support_Form.Product_ID, 'Leather Case - Jukebox 2', '562'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //173 try { addBoxItem(document.Support_Form.Product_ID, 'Battery - Jukebox 2', '563'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //174 try { addBoxItem(document.Support_Form.Product_ID, 'MuVo Battery Modules', '999'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //175 try { addBoxItem(document.Support_Form.Product_ID, 'PlayDock PD200', '31'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //176 try { addBoxItem(document.Support_Form.Product_ID, 'TravelSound', '80'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //177 try { addBoxItem(document.Support_Form.Product_ID, 'Li-Ion Battery - Jukebox 3', '86'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //178 try { addBoxItem(document.Support_Form.Product_ID, 'FM Wired Remote - Jukebox 3/Jukebox Zen/MuVo\u00B2', '115'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //179 try { addBoxItem(document.Support_Form.Product_ID, 'Creative NOMAD Jukebox Power Adapter', '125'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //180 try { addBoxItem(document.Support_Form.Product_ID, 'Cassette Adapter Kit', '401'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //181 try { addBoxItem(document.Support_Form.Product_ID, 'Car Kit - Jukebox 3/Jukebox 2/Jukebox Zen/MuVo\u00B2', '496'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //182 try { addBoxItem(document.Support_Form.Product_ID, 'Battery Pack', '4997'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //183 try { addBoxItem(document.Support_Form.Product_ID, 'Battery Modules - MuVo NX / TX / TX FM', '9217'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //184 try { addBoxItem(document.Support_Form.Product_ID, 'Armband - MuVo NX / TX / TX FM', '10126'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //185 break;186 }187 break;188 case 4 : // Speaker Systems189 switch(parseInt(famID)) {190 case 113 : // 7.1 Systems191 try { addBoxItem(document.Support_Form.Product_ID, 'Inspire T7700', '5076'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //192 break;193 case 24 : // 6.1 Systems194 try { addBoxItem(document.Support_Form.Product_ID, 'Inspire 6.1 6600', '465'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //195 break;196 case 25 : // 5.1 Systems197 try { addBoxItem(document.Support_Form.Product_ID, 'Creative Inspire 5.1 5100', '1704'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //198 try { addBoxItem(document.Support_Form.Product_ID, 'PCWorks LX520', '9412'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //199 try { addBoxItem(document.Support_Form.Product_ID, 'I-Trigue 5600', '10736'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //200 try { addBoxItem(document.Support_Form.Product_ID, 'Inspire T5900', '10323'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //201 try { addBoxItem(document.Support_Form.Product_ID, 'Inspire P5800', '10596'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //202 try { addBoxItem(document.Support_Form.Product_ID, 'Desktop Theater 5.1 DTT2200', '428'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //203 try { addBoxItem(document.Support_Form.Product_ID, 'Inspire 5.1 5700 Digital', '439'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //204 try { addBoxItem(document.Support_Form.Product_ID, 'Creative Inspire 5.1 Digital 5500', '990'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //205 try { addBoxItem(document.Support_Form.Product_ID, 'Inspire 5.1 5200', '55'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //206 try { addBoxItem(document.Support_Form.Product_ID, 'Creative Inspire 5.1 5300', '238'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //207 try { addBoxItem(document.Support_Form.Product_ID, 'MegaWorks THX 5.1 550', '240'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //208 try { addBoxItem(document.Support_Form.Product_ID, 'Desktop Theater 5.1 DTT3500 Digital', '290'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //209 try { addBoxItem(document.Support_Form.Product_ID, 'PlayWorks DTT2500 Digital', '291'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //210 try { addBoxItem(document.Support_Form.Product_ID, 'Creative Inspire 5.1 5600', '1705'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //211 try { addBoxItem(document.Support_Form.Product_ID, 'Inspire T5400', '5077'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //212 try { addBoxItem(document.Support_Form.Product_ID, 'PlayWorks PS2000 Digital', '427'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //213 try { addBoxItem(document.Support_Form.Product_ID, 'Desktop Theater 5.1', '1628'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //214 try { addBoxItem(document.Support_Form.Product_ID, 'Desktop Theater 5.1 DTT2500 Digital', '1629'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //215 try { addBoxItem(document.Support_Form.Product_ID, 'Cambridge SoundWorks MegaWorks 510D', '478'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //216 break;217 case 26 : // 4.1 Systems218 try { addBoxItem(document.Support_Form.Product_ID, 'FPS1600', '47'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //219 try { addBoxItem(document.Support_Form.Product_ID, 'FPS2000 Digital', '297'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //220 try { addBoxItem(document.Support_Form.Product_ID, 'Inspire 4.1 4400', '446'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //221 try { addBoxItem(document.Support_Form.Product_ID, 'FPS1800', '424'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //222 try { addBoxItem(document.Support_Form.Product_ID, 'PC-Works FourPointSurround FPS1000', '378'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //223 try { addBoxItem(document.Support_Form.Product_ID, 'FPS1500', '388'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //224 break;225 case 27 : // 2.1 Systems226 try { addBoxItem(document.Support_Form.Product_ID, 'I-Trigue 3600', '10735'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //227 try { addBoxItem(document.Support_Form.Product_ID, 'Inspire T3000', '10329'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //228 try { addBoxItem(document.Support_Form.Product_ID, 'I-Trigue 3400', '10733'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //229 try { addBoxItem(document.Support_Form.Product_ID, 'Inspire G380', '9276'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //230 try { addBoxItem(document.Support_Form.Product_ID, 'Creative I-Trigue 3200', '10327'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //231 try { addBoxItem(document.Support_Form.Product_ID, 'PCWorks LX220', '9407'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //232 try { addBoxItem(document.Support_Form.Product_ID, 'Creative Inspire 2.1 Slim 2600', '434'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //233 try { addBoxItem(document.Support_Form.Product_ID, 'Inspire 2.1 2500', '461'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //234 try { addBoxItem(document.Support_Form.Product_ID, 'I-Trigue L3500', '4912'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //235 try { addBoxItem(document.Support_Form.Product_ID, 'I-Trigue L3450', '4913'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //236 try { addBoxItem(document.Support_Form.Product_ID, 'Inspire T2900', '9025'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //237 try { addBoxItem(document.Support_Form.Product_ID, 'Inspire P380', '9026'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //238 try { addBoxItem(document.Support_Form.Product_ID, 'SoundWorks SW320', '48'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //239 try { addBoxItem(document.Support_Form.Product_ID, 'MegaWorks THX 2.1 250D', '124'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //240 try { addBoxItem(document.Support_Form.Product_ID, 'I-Trigue 2.1 3300', '139'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //241 try { addBoxItem(document.Support_Form.Product_ID, 'Creative SBS 2.1 350 Speakers', '281'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //242 try { addBoxItem(document.Support_Form.Product_ID, 'SBS 370', '283'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //243 try { addBoxItem(document.Support_Form.Product_ID, 'PCWorks', '284'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //244 try { addBoxItem(document.Support_Form.Product_ID, 'Creative Inspire Slim 500', '289'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //245 try { addBoxItem(document.Support_Form.Product_ID, 'Creative Inspire 2.1 2400', '298'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //246 try { addBoxItem(document.Support_Form.Product_ID, 'SoundWorks Digital', '299'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //247 try { addBoxItem(document.Support_Form.Product_ID, 'SoundWorks SW310', '304'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //248 try { addBoxItem(document.Support_Form.Product_ID, 'I-Trigue i3350', '279'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //249 break;250 case 28 : // 2.0 Systems251 try { addBoxItem(document.Support_Form.Product_ID, 'Inspire Monitor M85-D', '4910'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //252 try { addBoxItem(document.Support_Form.Product_ID, 'Inspire 2.0 1300', '4918'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //253 try { addBoxItem(document.Support_Form.Product_ID, 'SBS 230 Speakers', '4905'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //254 try { addBoxItem(document.Support_Form.Product_ID, 'SBS52', '1'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //255 try { addBoxItem(document.Support_Form.Product_ID, 'SBS16', '2'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //256 try { addBoxItem(document.Support_Form.Product_ID, 'Cambridge SBS20', '3'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //257 try { addBoxItem(document.Support_Form.Product_ID, 'SBS50', '1834'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //258 try { addBoxItem(document.Support_Form.Product_ID, 'SBS10', '1831'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //259 try { addBoxItem(document.Support_Form.Product_ID, 'Creative SBS15', '4906'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //260 break;261 case 29 : // Portable Systems262 try { addBoxItem(document.Support_Form.Product_ID, 'TravelSound 200', '10164'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //263 try { addBoxItem(document.Support_Form.Product_ID, 'TravelSound MP3', '1874'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //264 try { addBoxItem(document.Support_Form.Product_ID, 'PlayDock PD200', '31'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //265 try { addBoxItem(document.Support_Form.Product_ID, 'TravelSound', '80'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //266 try { addBoxItem(document.Support_Form.Product_ID, 'TravelSound i-300', '9022'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //267 try { addBoxItem(document.Support_Form.Product_ID, 'Creative TravelSound MP3 Titanium', '991'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //268 break;269 case 136 : // Decoders270 try { addBoxItem(document.Support_Form.Product_ID, 'Decoder DDTS-100', '9468'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //271 break;272 case 30 : // Accessories273 try { addBoxItem(document.Support_Form.Product_ID, 'MT-1100 Speaker Stands', '166'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //274 try { addBoxItem(document.Support_Form.Product_ID, 'Headphones HQ-1700', '11164'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //275 try { addBoxItem(document.Support_Form.Product_ID, 'Headphones HQ-1300', '4936'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //276 try { addBoxItem(document.Support_Form.Product_ID, 'Headphones HN-505', '4938'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //277 try { addBoxItem(document.Support_Form.Product_ID, 'Backphones HQ-65', '4916'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //278 try { addBoxItem(document.Support_Form.Product_ID, 'Backphones HQ-60', '4937'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //279 try { addBoxItem(document.Support_Form.Product_ID, 'Earphones EP-880', '11156'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //280 try { addBoxItem(document.Support_Form.Product_ID, 'Earphones EP-480', '11708'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //281 try { addBoxItem(document.Support_Form.Product_ID, 'Headset HE-100', '11023'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //282 try { addBoxItem(document.Support_Form.Product_ID, 'Headset HS-300', '4939'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //283 try { addBoxItem(document.Support_Form.Product_ID, 'MT-1200 Speaker Stands', '9515'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //284 try { addBoxItem(document.Support_Form.Product_ID, 'SurroundStation', '32'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //285 try { addBoxItem(document.Support_Form.Product_ID, 'Creative HQ-2000 Headphones', '4'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //286 try { addBoxItem(document.Support_Form.Product_ID, 'MT-500 Speaker Tripods', '399'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //287 try { addBoxItem(document.Support_Form.Product_ID, 'Inspire 2600 Spkr Grilles', '636'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //288 try { addBoxItem(document.Support_Form.Product_ID, 'Inspire 5300 Spkr Grilles', '637'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //289 try { addBoxItem(document.Support_Form.Product_ID, 'Inspire 5700 Spkr Grilles', '664'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //290 try { addBoxItem(document.Support_Form.Product_ID, 'Creative HQ-1000 Headphones', '4988'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //291 break;292 }293 break;294 case 218 : // Web Cameras295 switch(parseInt(famID)) {296 case 219 : // WebCam297 try { addBoxItem(document.Support_Form.Product_ID, 'WebCam Live! Ultra for Notebooks', '11491'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //298 try { addBoxItem(document.Support_Form.Product_ID, 'WebCam Live! Ultra', '10451'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //299 try { addBoxItem(document.Support_Form.Product_ID, 'WebCam Live! Pro', '10450'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //300 try { addBoxItem(document.Support_Form.Product_ID, 'WebCam Live!', '10412'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //301 try { addBoxItem(document.Support_Form.Product_ID, 'WebCam Instant', '10410'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //302 try { addBoxItem(document.Support_Form.Product_ID, 'WebCam NX Ultra', '9340'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //303 try { addBoxItem(document.Support_Form.Product_ID, 'WebCam NX Pro', '628'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //304 try { addBoxItem(document.Support_Form.Product_ID, 'WebCam NX', '627'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //305 try { addBoxItem(document.Support_Form.Product_ID, 'WebCam PRO eX', '243'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //306 try { addBoxItem(document.Support_Form.Product_ID, 'WebCam PRO', '616'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //307 try { addBoxItem(document.Support_Form.Product_ID, 'WebCam Go Plus', '15'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //308 try { addBoxItem(document.Support_Form.Product_ID, 'Webcam Go ES', '1898'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //309 try { addBoxItem(document.Support_Form.Product_ID, 'WebCam Go Mini', '1900'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //310 try { addBoxItem(document.Support_Form.Product_ID, 'WebCam Go', '17'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //311 try { addBoxItem(document.Support_Form.Product_ID, 'Video Blaster WebCam Plus', '16'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //312 try { addBoxItem(document.Support_Form.Product_ID, 'WebCam Notebook', '629'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //313 try { addBoxItem(document.Support_Form.Product_ID, 'WebCam Mobile', '4890'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //314 try { addBoxItem(document.Support_Form.Product_ID, 'WebCam 5', '1896'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //315 try { addBoxItem(document.Support_Form.Product_ID, 'WebCam Vista Pro', '11053'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //316 try { addBoxItem(document.Support_Form.Product_ID, 'WebCam Vista Plus', '11043'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //317 try { addBoxItem(document.Support_Form.Product_ID, 'WebCam', '65'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //318 try { addBoxItem(document.Support_Form.Product_ID, 'WebCam II', '4900'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //319 try { addBoxItem(document.Support_Form.Product_ID, 'WebCam 3', '1908'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //320 try { addBoxItem(document.Support_Form.Product_ID, 'WebCam Vista', '1907'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //321 break;322 case 220 : // PC-CAM323 try { addBoxItem(document.Support_Form.Product_ID, 'PC-CAM 900', '10119'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //324 try { addBoxItem(document.Support_Form.Product_ID, 'PC-CAM 930 Slim', '11431'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //325 try { addBoxItem(document.Support_Form.Product_ID, 'PC-CAM 920 Slim', '10823'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //326 try { addBoxItem(document.Support_Form.Product_ID, 'PC-CAM 880', '308'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //327 try { addBoxItem(document.Support_Form.Product_ID, 'PC-CAM 750', '4878'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //328 try { addBoxItem(document.Support_Form.Product_ID, 'PC-CAM 850', '4879'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //329 try { addBoxItem(document.Support_Form.Product_ID, 'Creative PC-CAM 300', '49'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //330 try { addBoxItem(document.Support_Form.Product_ID, 'PC-CAM 350', '106'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //331 try { addBoxItem(document.Support_Form.Product_ID, 'PC-CAM 550', '107'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //332 try { addBoxItem(document.Support_Form.Product_ID, 'CardCam Value', '116'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //333 try { addBoxItem(document.Support_Form.Product_ID, 'PC-CAM 600', '260'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //334 break;335 }336 break;337 case 437 : // Headphones & Headsets338 switch(parseInt(famID)) {339 case 438 : // Headphones340 try { addBoxItem(document.Support_Form.Product_ID, 'Headphones HQ-1700', '11164'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //341 try { addBoxItem(document.Support_Form.Product_ID, 'Headphones HQ-1300', '4936'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //342 try { addBoxItem(document.Support_Form.Product_ID, 'Headphones CB2530', '11644'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //343 break;344 case 439 : // Noise-Cancelling Headphones345 try { addBoxItem(document.Support_Form.Product_ID, 'Headphones HN-505', '4938'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //346 break;347 case 440 : // Backphones348 try { addBoxItem(document.Support_Form.Product_ID, 'Backphones HQ-65', '4916'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //349 try { addBoxItem(document.Support_Form.Product_ID, 'Backphones HQ-60', '4937'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //350 break;351 case 441 : // Earphones352 try { addBoxItem(document.Support_Form.Product_ID, 'Earphones EP-880', '11156'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //353 try { addBoxItem(document.Support_Form.Product_ID, 'Earphones EP-630', '11397'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //354 try { addBoxItem(document.Support_Form.Product_ID, 'Earphones EP-480', '11708'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //355 try { addBoxItem(document.Support_Form.Product_ID, 'Earphones EP-380', '11229'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //356 break;357 case 442 : // Headsets358 try { addBoxItem(document.Support_Form.Product_ID, 'Headset HE-100', '11023'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //359 try { addBoxItem(document.Support_Form.Product_ID, 'Headset HS-300', '4939'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //360 break;361 }362 break;363 case 9 : // Storage Devices364 switch(parseInt(famID)) {365 case 259 : // DVD±RW Drive366 try { addBoxItem(document.Support_Form.Product_ID, 'DVD±RW Dual 8X', '9599'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //367 try { addBoxItem(document.Support_Form.Product_ID, 'DVD±RW Dual 8x8', '10305'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //368 try { addBoxItem(document.Support_Form.Product_ID, 'DVD+RW Dual External 8x8', '10583'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //369 break;370 case 47 : // Combo Drive371 try { addBoxItem(document.Support_Form.Product_ID, 'Combo Drive 52.32.52x/16x', '11712'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //372 try { addBoxItem(document.Support_Form.Product_ID, 'Combo Drive 40-12-40/16', '4998'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //373 try { addBoxItem(document.Support_Form.Product_ID, 'Combo Drive NS', '9454'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //374 break;375 case 46 : // CD-RW Drive376 try { addBoxItem(document.Support_Form.Product_ID, 'CD-RW External 52-32-52x', '9481'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //377 try { addBoxItem(document.Support_Form.Product_ID, 'CD-RW Blaster 12-10-32', '8'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //378 try { addBoxItem(document.Support_Form.Product_ID, 'CD-RW 52.24.52', '1590'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //379 try { addBoxItem(document.Support_Form.Product_ID, 'CD-RW Blaster 24-10-40 External', '4944'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //380 try { addBoxItem(document.Support_Form.Product_ID, 'CD-RW External 52-24-52x', '9027'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //381 try { addBoxItem(document.Support_Form.Product_ID, 'CD-RW 52-32-52x', '9453'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //382 try { addBoxItem(document.Support_Form.Product_ID, 'CD-RW Blaster 48-12-48 External', '9020'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //383 try { addBoxItem(document.Support_Form.Product_ID, 'CD-RW Blaster 48-12-48', '4941'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //384 break;385 case 45 : // PC-DVD Drive386 try { addBoxItem(document.Support_Form.Product_ID, 'PC-DVD Encore 12x', '6'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //387 try { addBoxItem(document.Support_Form.Product_ID, 'PC-DVD ROM 12x', '1486'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //388 try { addBoxItem(document.Support_Form.Product_ID, 'PC-DVD DVD-ROM 16x', '1490'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //389 try { addBoxItem(document.Support_Form.Product_ID, 'PC-DVD MPEG-1 Decoder Board', '1801'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //390 break;391 case 44 : // CD-ROM Drive392 try { addBoxItem(document.Support_Form.Product_ID, 'CD-ROM Blaster Digital iR52X', '3562'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //393 try { addBoxItem(document.Support_Form.Product_ID, 'CD-ROM Blaster 52X', '11'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //394 try { addBoxItem(document.Support_Form.Product_ID, '12x CD-ROM Drives', '1485'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //395 try { addBoxItem(document.Support_Form.Product_ID, '16x CD-ROM Drives', '1489'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //396 try { addBoxItem(document.Support_Form.Product_ID, '48x CD-ROM Drives', '1548'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //397 try { addBoxItem(document.Support_Form.Product_ID, '1x & 2x CD-ROM Drives', '1493'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //398 try { addBoxItem(document.Support_Form.Product_ID, '24x CD-ROM Drives', '1495'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //399 try { addBoxItem(document.Support_Form.Product_ID, '2x & 3x CD-ROM (SCSI)', '1496'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //400 try { addBoxItem(document.Support_Form.Product_ID, '32x CD-ROM Drives', '1498'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //401 try { addBoxItem(document.Support_Form.Product_ID, '36x CD-ROM Drives', '1499'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //402 try { addBoxItem(document.Support_Form.Product_ID, '40x CD-Rom Drives', '1547'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //403 try { addBoxItem(document.Support_Form.Product_ID, '4x CD-ROM Drives', '1549'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //404 try { addBoxItem(document.Support_Form.Product_ID, '6x CD-ROM Drives', '1552'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //405 try { addBoxItem(document.Support_Form.Product_ID, '8x CD-ROM Drives', '1554'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //406 break;407 case 49 : // Portable Harddisk408 try { addBoxItem(document.Support_Form.Product_ID, 'Storage Blaster Portable Harddisk', '8996'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //409 break;410 case 265 : // Portable Storage411 try { addBoxItem(document.Support_Form.Product_ID, 'ThumbDrive', '10681'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //412 break;413 }414 break;415 case 12 : // PC Barebone416 switch(parseInt(famID)) {417 case 54 : // SLiX PC418 try { addBoxItem(document.Support_Form.Product_ID, 'SLiX PC MPC61Y0', '11766'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //419 break;420 }421 break;422 case 11 : // Monitors423 switch(parseInt(famID)) {424 case 53 : // LCD425 try { addBoxItem(document.Support_Form.Product_ID, '17" TFT LCD Monitor With DVI', '9980'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //426 break;427 }428 break;429 case 60 : // Video430 switch(parseInt(famID)) {431 case 96 : // Video Editing432 try { addBoxItem(document.Support_Form.Product_ID, 'Video Blaster MovieMaker', '13'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //433 break;434 }435 break;436 case 13 : // Accessories437 switch(parseInt(famID)) {438 case 55 : // Sound Blaster439 try { addBoxItem(document.Support_Form.Product_ID, 'Optical Digital I/O Card II', '30'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //440 try { addBoxItem(document.Support_Form.Product_ID, 'Sound Blaster MIDI Adapter', '251'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //441 try { addBoxItem(document.Support_Form.Product_ID, 'Mini to Standard MIDI Adapter', '252'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //442 try { addBoxItem(document.Support_Form.Product_ID, 'Live!Drive II', '9278'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //443 try { addBoxItem(document.Support_Form.Product_ID, 'Sound Blaster Audigy Internal Drive', '88'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //444 try { addBoxItem(document.Support_Form.Product_ID, 'Sound Blaster Audigy External Drive', '89'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //445 try { addBoxItem(document.Support_Form.Product_ID, 'Live! Drive IR', '26'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //446 try { addBoxItem(document.Support_Form.Product_ID, 'Live! Drive I', '27'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //447 try { addBoxItem(document.Support_Form.Product_ID, 'Remote Controller SBLive', '1816'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //448 break;449 case 449 : // Zen Micro450 try { addBoxItem(document.Support_Form.Product_ID, 'Universal Travel Adapter for Zen Micro', '11711'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //451 try { addBoxItem(document.Support_Form.Product_ID, 'Leather Case', '11511'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //452 break;453 case 483 : // Zen Neeon454 try { addBoxItem(document.Support_Form.Product_ID, 'Zen Neeon Stik-On', '12982'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //455 try { addBoxItem(document.Support_Form.Product_ID, 'Zen Neeon Leather Case', '12978'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //456 try { addBoxItem(document.Support_Form.Product_ID, 'Zen Neeon Universal Travel Adapter', '12979'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //457 break;458 case 264 : // Portable Media Center459 try { addBoxItem(document.Support_Form.Product_ID, 'Zen PMC Docking Station', '10756'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //460 try { addBoxItem(document.Support_Form.Product_ID, 'Zen PMC Li-ion Polymer Battery', '10679'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //461 try { addBoxItem(document.Support_Form.Product_ID, 'Zen PMC FM Wired Remote', '10663'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //462 break;463 case 57 : // MP3 Players464 try { addBoxItem(document.Support_Form.Product_ID, 'Creative NOMAD JukeBox 3 Car Kit', '4894'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //465 try { addBoxItem(document.Support_Form.Product_ID, 'Home Kit - Jukebox 3', '497'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //466 try { addBoxItem(document.Support_Form.Product_ID, 'Creative NOMAD Jukebox 3 Leather Case', '498'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //467 try { addBoxItem(document.Support_Form.Product_ID, 'Faceplates - Jukebox 3', '499'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //468 try { addBoxItem(document.Support_Form.Product_ID, 'MuVo Armband', '511'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //469 try { addBoxItem(document.Support_Form.Product_ID, 'Creative NOMAD Jukebox Accessory Kit', '533'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //470 try { addBoxItem(document.Support_Form.Product_ID, 'Creative NOMAD Jukebox Battery Charger Kit', '538'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //471 try { addBoxItem(document.Support_Form.Product_ID, 'Creative NOMAD Jukebox Battery Pack', '539'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //472 try { addBoxItem(document.Support_Form.Product_ID, 'Leather Case - Jukebox 2', '562'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //473 try { addBoxItem(document.Support_Form.Product_ID, 'Battery - Jukebox 2', '563'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //474 try { addBoxItem(document.Support_Form.Product_ID, 'Li-Ion Battery - Jukebox 3', '86'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //475 try { addBoxItem(document.Support_Form.Product_ID, 'FM Wired Remote - Jukebox 3/Jukebox Zen/MuVo\u00B2', '115'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //476 try { addBoxItem(document.Support_Form.Product_ID, 'Creative NOMAD Jukebox Power Adapter', '125'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //477 try { addBoxItem(document.Support_Form.Product_ID, 'Cassette Adapter Kit', '401'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //478 try { addBoxItem(document.Support_Form.Product_ID, 'Car Kit - Jukebox 3/Jukebox 2/Jukebox Zen/MuVo\u00B2', '496'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //479 try { addBoxItem(document.Support_Form.Product_ID, 'Battery Modules - MuVo NX / TX / TX FM', '9217'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //480 try { addBoxItem(document.Support_Form.Product_ID, 'Armband - MuVo NX / TX / TX FM', '10126'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //481 break;482 case 58 : // Speaker Systems483 try { addBoxItem(document.Support_Form.Product_ID, 'MT-1100 Speaker Stands', '166'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //484 try { addBoxItem(document.Support_Form.Product_ID, 'Headphones HQ-1700', '11164'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //485 try { addBoxItem(document.Support_Form.Product_ID, 'Earphones EP-880', '11156'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //486 try { addBoxItem(document.Support_Form.Product_ID, 'Headset HE-100', '11023'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //487 try { addBoxItem(document.Support_Form.Product_ID, 'MT-500 Speaker Tripods', '399'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //488 try { addBoxItem(document.Support_Form.Product_ID, 'Speaker Extension Cables', '415'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //489 try { addBoxItem(document.Support_Form.Product_ID, 'Inspire 5300 Spkr Grilles', '637'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //490 try { addBoxItem(document.Support_Form.Product_ID, 'Inspire 5700 Spkr Grilles', '664'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //491 break;492 case 256 : // Wireless493 try { addBoxItem(document.Support_Form.Product_ID, 'Wireless Headset for Bluetooth', '10287'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //494 try { addBoxItem(document.Support_Form.Product_ID, 'Headset CB2455', '11394'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //495 try { addBoxItem(document.Support_Form.Product_ID, 'Headphones CB2530', '11644'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //496 break;497 case 59 : // Storage498 try { addBoxItem(document.Support_Form.Product_ID, 'S-Video Cable Coupler', '250'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //499 try { addBoxItem(document.Support_Form.Product_ID, 'IDE Cable Set', '255'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //500 try { addBoxItem(document.Support_Form.Product_ID, 'Dxr2 Decoder Board', '1648'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //501 try { addBoxItem(document.Support_Form.Product_ID, 'Dxr3 Decoder Card', '12'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //502 break;503 }504 break;505 case 118 : // Digital Cameras506 switch(parseInt(famID)) {507 case 117 : // Digital Still Cameras508 try { addBoxItem(document.Support_Form.Product_ID, 'DC-CAM 4200ZS', '10822'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //509 try { addBoxItem(document.Support_Form.Product_ID, 'DC-CAM 3200Z', '9762'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //510 try { addBoxItem(document.Support_Form.Product_ID, 'DC-CAM 3000Z', '9028'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //511 try { addBoxItem(document.Support_Form.Product_ID, 'CardCam', '120'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //512 try { addBoxItem(document.Support_Form.Product_ID, 'CardCam Value', '116'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //513 break;514 case 309 : // Digital Video Cameras515 try { addBoxItem(document.Support_Form.Product_ID, 'DiVi CAM 316', '11175'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //516 break;517 }518 break;519 case 10 : // Mice & Keyboards520 switch(parseInt(famID)) {521 case 223 : // Wired Mice522 try { addBoxItem(document.Support_Form.Product_ID, 'Mouse 5500', '11387'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //523 try { addBoxItem(document.Support_Form.Product_ID, 'Mouse 3500', '11388'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //524 try { addBoxItem(document.Support_Form.Product_ID, 'Mouse Classic', '4919'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //525 try { addBoxItem(document.Support_Form.Product_ID, 'Mouse Optical Lite', '4920'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //526 try { addBoxItem(document.Support_Form.Product_ID, 'Mouse Optical 3000', '4924'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //527 try { addBoxItem(document.Support_Form.Product_ID, 'Creative Optical Mouse', '262'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //528 try { addBoxItem(document.Support_Form.Product_ID, 'Mouse Notebook Optical', '9147'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //529 break;530 case 224 : // Wireless Mice531 try { addBoxItem(document.Support_Form.Product_ID, 'FreePoint Travel', '11165'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //532 try { addBoxItem(document.Support_Form.Product_ID, 'FreePoint Travel Mini', '11166'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //533 try { addBoxItem(document.Support_Form.Product_ID, 'FreePoint 5500', '11178'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //534 try { addBoxItem(document.Support_Form.Product_ID, 'FreePoint 3500', '11386'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //535 try { addBoxItem(document.Support_Form.Product_ID, 'Mouse Wireless Optical 5000', '9145'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //536 try { addBoxItem(document.Support_Form.Product_ID, 'Mouse Wireless Optical', '263'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //537 try { addBoxItem(document.Support_Form.Product_ID, 'Mouse Wireless Optical 3000', '4923'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //538 break;539 case 227 : // Wireless Mice & Keyboards540 try { addBoxItem(document.Support_Form.Product_ID, 'Desktop Wireless 9000 Pro', '11493'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //541 try { addBoxItem(document.Support_Form.Product_ID, 'Desktop Wireless 8000', '10104'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //542 try { addBoxItem(document.Support_Form.Product_ID, 'Desktop Wireless 6000', '5039'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //543 break;544 case 228 : // Wired PC & MIDI Keyboards545 try { addBoxItem(document.Support_Form.Product_ID, 'Prodikeys DM', '9389'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //546 try { addBoxItem(document.Support_Form.Product_ID, 'Prodikeys DM Value', '9600'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //547 try { addBoxItem(document.Support_Form.Product_ID, 'Prodikeys', '504'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //548 break;549 case 52 : // Gaming Devices550 try { addBoxItem(document.Support_Form.Product_ID, 'Avant Force NX', '9394'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //551 try { addBoxItem(document.Support_Form.Product_ID, 'Cobra Force 3D', '9396'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //552 try { addBoxItem(document.Support_Form.Product_ID, 'Gamepad I', '1658'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //553 break;554 }555 break;556 case 8 : // Musical Keyboards557 switch(parseInt(famID)) {558 case 234 : // PC & MIDI Keyboards559 try { addBoxItem(document.Support_Form.Product_ID, 'Prodikeys DM', '9389'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //560 try { addBoxItem(document.Support_Form.Product_ID, 'Prodikeys DM Value', '9600'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //561 try { addBoxItem(document.Support_Form.Product_ID, 'Prodikeys', '504'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //562 break;563 case 231 : // MIDI Keyboards564 try { addBoxItem(document.Support_Form.Product_ID, 'Creative Blasterkeys', '40'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //565 break;566 }567 break;568 case 237 : // Creative Professional569 switch(parseInt(famID)) {570 case 239 : // Digital Audio Systems571 try { addBoxItem(document.Support_Form.Product_ID, 'E-MU 1820M', '10496'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //572 try { addBoxItem(document.Support_Form.Product_ID, 'E-MU 1212M', '10500'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //573 try { addBoxItem(document.Support_Form.Product_ID, 'E-MU 1820', '10494'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //574 try { addBoxItem(document.Support_Form.Product_ID, 'E-MU 0404', '10498'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //575 break;576 case 240 : // Desktop Sampling Systems577 try { addBoxItem(document.Support_Form.Product_ID, 'Emulator X', '10502'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //578 try { addBoxItem(document.Support_Form.Product_ID, 'Emulator X Studio', '10504'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //579 try { addBoxItem(document.Support_Form.Product_ID, 'Proteus X', '11074'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //580 break;581 case 421 : // Desktop Sound Modules582 try { addBoxItem(document.Support_Form.Product_ID, 'Proteus X', '11074'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //583 break;584 case 258 : // Accessories and Upgrades585 try { addBoxItem(document.Support_Form.Product_ID, 'Proteus X Software Upgrade', '11073'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //586 try { addBoxItem(document.Support_Form.Product_ID, 'Emulator X OS Upgrade', '10225'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //587 try { addBoxItem(document.Support_Form.Product_ID, 'Mo\'Phatt X', '11329'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //588 try { addBoxItem(document.Support_Form.Product_ID, 'Planet Earth X', '11330'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //589 try { addBoxItem(document.Support_Form.Product_ID, 'Virtuoso X', '11332'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //590 try { addBoxItem(document.Support_Form.Product_ID, 'Vintage X Pro Collection', '11072'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //591 try { addBoxItem(document.Support_Form.Product_ID, 'Street Kits', '11331'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //592 try { addBoxItem(document.Support_Form.Product_ID, 'AudioDock M', '10229'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //593 try { addBoxItem(document.Support_Form.Product_ID, 'Audio Dock', '10230'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //594 try { addBoxItem(document.Support_Form.Product_ID, 'Beat Shop 2', '10404'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //595 try { addBoxItem(document.Support_Form.Product_ID, 'EDI Cable', '10227'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //596 try { addBoxItem(document.Support_Form.Product_ID, 'Sync Daughter Card', '10576'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //597 break;598 }599 break;600 case 243 : // Wireless601 switch(parseInt(famID)) {602 case 246 : // Mice & Keyboards603 try { addBoxItem(document.Support_Form.Product_ID, 'FreePoint 5500', '11178'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //604 try { addBoxItem(document.Support_Form.Product_ID, 'FreePoint 3500', '11386'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //605 try { addBoxItem(document.Support_Form.Product_ID, 'Mouse Wireless Optical 5000', '9145'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //606 try { addBoxItem(document.Support_Form.Product_ID, 'Desktop Wireless 8000', '10104'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //607 try { addBoxItem(document.Support_Form.Product_ID, 'Desktop Wireless 6000', '5039'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //608 try { addBoxItem(document.Support_Form.Product_ID, 'Mouse Wireless Optical', '263'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //609 try { addBoxItem(document.Support_Form.Product_ID, 'Mouse Wireless Optical 3000', '4923'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //610 break;611 case 248 : // Accessories612 try { addBoxItem(document.Support_Form.Product_ID, 'Headset CB2460', '11238'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //613 try { addBoxItem(document.Support_Form.Product_ID, 'Headset CB2455', '11394'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //614 try { addBoxItem(document.Support_Form.Product_ID, 'Wireless Headset for Bluetooth', '10287'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //615 try { addBoxItem(document.Support_Form.Product_ID, 'Headphones CB2530', '11644'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //616 break;617 }618 break;619 case 244 : // Notebook Products620 switch(parseInt(famID)) {621 case 250 : // PCMCIA Sound Blaster622 try { addBoxItem(document.Support_Form.Product_ID, 'Audigy 2 ZS Notebook', '10769'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //623 break;624 case 249 : // USB Sound Blaster625 try { addBoxItem(document.Support_Form.Product_ID, 'Audigy 2 NX', '9103'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //626 try { addBoxItem(document.Support_Form.Product_ID, 'Live! 24-bit External', '10702'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //627 try { addBoxItem(document.Support_Form.Product_ID, 'Digital Music LX', '10246'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //628 try { addBoxItem(document.Support_Form.Product_ID, 'Digital Music', '154'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //629 try { addBoxItem(document.Support_Form.Product_ID, 'Extigy', '585'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //630 break;631 case 251 : // Portable Speaker Systems632 try { addBoxItem(document.Support_Form.Product_ID, 'TravelSound 200', '10164'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //633 try { addBoxItem(document.Support_Form.Product_ID, 'TravelSound i-300', '9022'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //634 try { addBoxItem(document.Support_Form.Product_ID, 'TravelSound MP3', '1874'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //635 break;636 case 252 : // Mice & Keyboards637 try { addBoxItem(document.Support_Form.Product_ID, 'Mouse Wireless NoteBook Optical', '10188'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //638 try { addBoxItem(document.Support_Form.Product_ID, 'Mouse Notebook Optical', '9147'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //639 break;640 case 253 : // Web Cameras641 try { addBoxItem(document.Support_Form.Product_ID, 'WebCam Live! Ultra for Notebooks', '11491'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //642 try { addBoxItem(document.Support_Form.Product_ID, 'WebCam Notebook', '629'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //643 try { addBoxItem(document.Support_Form.Product_ID, 'WebCam Mobile', '4890'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //644 break;645 }646 break;647 case 6 : // Graphics648 switch(parseInt(famID)) {649 case 37 : // ATI Radeon 9000 series650 try { addBoxItem(document.Support_Form.Product_ID, '3D Blaster RX9250', '11489'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //651 try { addBoxItem(document.Support_Form.Product_ID, '3D Blaster RX9250 Xtreme', '11490'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //652 break;653 case 230 : // 3D Labs654 try { addBoxItem(document.Support_Form.Product_ID, 'Graphics Blaster Picture Perfect', '164'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //655 break;656 case 99 : // NVIDIA GeForce657 try { addBoxItem(document.Support_Form.Product_ID, '3D Blaster GeForce', '1500'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //658 try { addBoxItem(document.Support_Form.Product_ID, '3D Blaster GeForce 2', '1501'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //659 try { addBoxItem(document.Support_Form.Product_ID, '3D Blaster GeForce Pro', '1505'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //660 try { addBoxItem(document.Support_Form.Product_ID, '3D Blaster GeForce2 ULTRA 64MB AGP', '1512'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //661 break;662 case 98 : // NVIDIA Riva TNT Series663 try { addBoxItem(document.Support_Form.Product_ID, '3D Blaster RIVA TNT2 Pro', '1527'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //664 try { addBoxItem(document.Support_Form.Product_ID, 'Graphics Blaster RIVA128ZX', '1689'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //665 try { addBoxItem(document.Support_Form.Product_ID, '3D Blaster Riva TNT2', '4841'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //666 try { addBoxItem(document.Support_Form.Product_ID, '3D Blaster RIVA TNT2 Value', '4842'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //667 try { addBoxItem(document.Support_Form.Product_ID, '3D Blaster TNT2 Ultra', '4843'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //668 break;669 case 73 : // 3D Blaster670 try { addBoxItem(document.Support_Form.Product_ID, '3D Blaster 4 Titanium 4200', '1516'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //671 try { addBoxItem(document.Support_Form.Product_ID, '3D Blaster 5 RX9700 Pro', '1524'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //672 try { addBoxItem(document.Support_Form.Product_ID, '3D Blaster 4 MX440', '1539'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //673 try { addBoxItem(document.Support_Form.Product_ID, '3D Blaster 5 RX9000 64MB', '1540'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //674 try { addBoxItem(document.Support_Form.Product_ID, '3D Blaster 5 RX9000 Pro', '1541'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //675 try { addBoxItem(document.Support_Form.Product_ID, '3D Blaster 4 MX420', '4869'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //676 try { addBoxItem(document.Support_Form.Product_ID, '3D Blaster 5 RX9800 Pro', '4917'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //677 try { addBoxItem(document.Support_Form.Product_ID, '3D Blaster 4 MX460', '4969'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //678 try { addBoxItem(document.Support_Form.Product_ID, '3D Blaster 5 RX9600', '4973'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //679 try { addBoxItem(document.Support_Form.Product_ID, '3D Blaster 5 RX9000 Pro 128MB', '8995'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //680 try { addBoxItem(document.Support_Form.Product_ID, '3D Blaster 5 RX9200 SE', '9024'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //681 try { addBoxItem(document.Support_Form.Product_ID, '3D Blaster 5 RX9600 Pro', '9576'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //682 try { addBoxItem(document.Support_Form.Product_ID, '3D Blaster 5 RX9600 XT', '10311'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //683 try { addBoxItem(document.Support_Form.Product_ID, '3D Blaster 5 RX9600 SE', '10335'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //684 try { addBoxItem(document.Support_Form.Product_ID, '3D Blaster Savage 4', '1536'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //685 try { addBoxItem(document.Support_Form.Product_ID, '3D Blaster VLB', '1537'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //686 try { addBoxItem(document.Support_Form.Product_ID, '3D Blaster Voodoo 2', '1538'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //687 try { addBoxItem(document.Support_Form.Product_ID, '3D Blaster PCI', '1523'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //688 try { addBoxItem(document.Support_Form.Product_ID, '3D Blaster Banshee', '1506'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //689 try { addBoxItem(document.Support_Form.Product_ID, '3D Blaster Banshee AGP', '1507'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //690 break;691 }692 break;693 case 7 : // Modems & Networking694 switch(parseInt(famID)) {695 case 41 : // Wireless696 try { addBoxItem(document.Support_Form.Product_ID, 'USB Adapter CB2431', '10863'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //697 try { addBoxItem(document.Support_Form.Product_ID, 'Network Blaster Wireless PCMCIA Card', '3868'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //698 break;699 case 42 : // Broadband700 try { addBoxItem(document.Support_Form.Product_ID, 'Broadband Blaster DSL Router 8015U', '11176'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //701 try { addBoxItem(document.Support_Form.Product_ID, 'Broadband Blaster Router 8110', '10280'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //702 try { addBoxItem(document.Support_Form.Product_ID, 'Broadband Blaster ADSL Bridge ', '4873'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //703 try { addBoxItem(document.Support_Form.Product_ID, 'Broadband Blaster USB Modem', '4871'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //704 try { addBoxItem(document.Support_Form.Product_ID, 'Broadband Blaster DSL', '4921'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //705 break;706 case 40 : // Analog707 try { addBoxItem(document.Support_Form.Product_ID, 'Modem Blaster PCMCIA', '24'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //708 try { addBoxItem(document.Support_Form.Product_ID, 'Modem Blaster V.92 PCI', '52'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //709 try { addBoxItem(document.Support_Form.Product_ID, 'Modem Blaster V.92 Serial', '258'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //710 try { addBoxItem(document.Support_Form.Product_ID, 'Modem Blaster V.92 USB', '266'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //711 try { addBoxItem(document.Support_Form.Product_ID, 'Modem 56k Internal', '1715'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //712 try { addBoxItem(document.Support_Form.Product_ID, 'Modem Blaster Flash 56II ISA', '18'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //713 try { addBoxItem(document.Support_Form.Product_ID, 'Modem Blaster V.90 ISA', '19'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //714 try { addBoxItem(document.Support_Form.Product_ID, 'Modem Blaster Flash 56 PCI', '21'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //715 try { addBoxItem(document.Support_Form.Product_ID, 'Modem Blaster V.90 USB', '22'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //716 try { addBoxItem(document.Support_Form.Product_ID, 'Modem Blaster V.90 External', '23'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //717 try { addBoxItem(document.Support_Form.Product_ID, 'Modem Blaster USB (DE5675)', '8992'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //718 try { addBoxItem(document.Support_Form.Product_ID, 'Modem Blaster USB (DE5673)', '8991'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //719 try { addBoxItem(document.Support_Form.Product_ID, 'Modem Blaster PCI (DI5663)', '4999'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //720 try { addBoxItem(document.Support_Form.Product_ID, 'Modem Blaster PCI (DI5656)', '8988'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //721 try { addBoxItem(document.Support_Form.Product_ID, 'Modem Blaster PCI (DI5655)', '8989'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //722 try { addBoxItem(document.Support_Form.Product_ID, 'Modem Blaster External (DE5625)', '8990'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //723 try { addBoxItem(document.Support_Form.Product_ID, 'Modem Blaster 28.8 External', '5000'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //724 try { addBoxItem(document.Support_Form.Product_ID, 'CT5451 Modem Blaster Voice PnP', '5001'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //725 try { addBoxItem(document.Support_Form.Product_ID, 'Phone Blaster', '1809'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //726 break;727 }728 break;729 case 106 : // Software730 switch(parseInt(famID)) {731 case 241 : // HansVision DXT732 try { addBoxItem(document.Support_Form.Product_ID, 'HansVision DXT 2005 Edition', '12218'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //733 break;734 case 242 : // Children\'s Multimedia Educational735 try { addBoxItem(document.Support_Form.Product_ID, 'WaWaYaYa Happy Mandarin Series', '11269'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //736 try { addBoxItem(document.Support_Form.Product_ID, 'WaWaYaYa Happy English Series', '4932'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //737 break;738 case 107 : // HansVision739 try { addBoxItem(document.Support_Form.Product_ID, 'HansVision DXT', '4928'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //740 break;741 case 108 : // WaWaYaYa742 try { addBoxItem(document.Support_Form.Product_ID, 'WaWaYaYa Comprehensive Ability Series', '4930'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //743 break;744 case 109 : // Others745 break;746 }747 break;748 }749 // addBoxItem(document.Support_Form.Product_ID, 'Zen Portable Media Center', 'DUMMYPREFIX_ZenPMC_Temp|9882');750}751try752{753 productList(0,0);754}755catch(e)756{757}...
extension.js
Source:extension.js
1/*2 * This file is part of Top-Bar-Organizer (a Gnome Shell Extension for3 * organizing your Gnome Shell top bar).4 * Copyright (C) 2021 Julian Schacher5 *6 * Top-Bar-Organizer is free software: you can redistribute it and/or modify7 * it under the terms of the GNU General Public License as published by8 * the Free Software Foundation, either version 3 of the License, or9 * (at your option) any later version.10 *11 * This program is distributed in the hope that it will be useful,12 * but WITHOUT ANY WARRANTY; without even the implied warranty of13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the14 * GNU General Public License for more details.15 *16 * You should have received a copy of the GNU General Public License17 * along with this program. If not, see <https://www.gnu.org/licenses/>.18 */19/* exported init */20"use strict";21const ExtensionUtils = imports.misc.extensionUtils;22const Me = ExtensionUtils.getCurrentExtension();23const Main = imports.ui.main;24const Panel = imports.ui.panel;25const AppIndicatorKStatusNotifierItemManager = Me.imports.extensionModules.AppIndicatorKStatusNotifierItemManager;26const BoxOrderCreator = Me.imports.extensionModules.BoxOrderCreator;27class Extension {28 constructor() {29 }30 enable() {31 this.settings = ExtensionUtils.getSettings();32 // Create an instance of AppIndicatorKStatusNotifierItemManager to33 // handle AppIndicator/KStatusNotifierItem items.34 this._appIndicatorKStatusNotifierItemManager = new AppIndicatorKStatusNotifierItemManager.AppIndicatorKStatusNotifierItemManager();35 // Create an instance of BoxOrderCreator for the creation of special box36 // orders.37 this._boxOrderCreator = new BoxOrderCreator.BoxOrderCreator(this._appIndicatorKStatusNotifierItemManager);38 this._addNewItemsToBoxOrders();39 this._orderTopBarItemsOfAllBoxes();40 this._overwritePanelAddToPanelBox();41 // Handle changes of configured box orders.42 this._settingsHandlerIds = [ ];43 const addConfiguredBoxOrderChangeHandler = (box) => {44 let handlerId = this.settings.connect(`changed::${box}-box-order`, () => {45 this._orderTopBarItems(box);46 /// For the case, where the currently saved box order is based47 /// on a permutation of an outdated box order, get an updated48 /// box order and save it, if needed.49 let updatedBoxOrder;50 switch (box) {51 case "left":52 updatedBoxOrder = this._createUpdatedBoxOrders().left;53 break;54 case "center":55 updatedBoxOrder = this._createUpdatedBoxOrders().center;56 break;57 case "right":58 updatedBoxOrder = this._createUpdatedBoxOrders().right;59 break;60 }61 // Only save the updated box order to settings, if it is62 // different, to avoid looping.63 const currentBoxOrder = this.settings.get_strv(`${box}-box-order`);64 if (JSON.stringify(currentBoxOrder) !== JSON.stringify(updatedBoxOrder)) {65 this.settings.set_strv(`${box}-box-order`, updatedBoxOrder);66 }67 });68 this._settingsHandlerIds.push(handlerId);69 };70 addConfiguredBoxOrderChangeHandler("left");71 addConfiguredBoxOrderChangeHandler("center");72 addConfiguredBoxOrderChangeHandler("right");73 }74 disable() {75 // Revert the overwrite of `Panel._addToPanelBox`.76 Panel.Panel.prototype._addToPanelBox = Panel.Panel.prototype._originalAddToPanelBox;77 // Set `Panel._originalAddToPanelBox` to `undefined`.78 Panel._originalAddToPanelBox = undefined;79 // Disconnect signals.80 for (const handlerId of this._settingsHandlerIds) {81 this.settings.disconnect(handlerId);82 }83 }84 ////////////////////////////////////////////////////////////////////////////85 /// Methods used on extension enable. ///86 ////////////////////////////////////////////////////////////////////////////87 /**88 * This method adds all new items currently present in the Gnome Shell top89 * bar to the box orders.90 */91 _addNewItemsToBoxOrders() {92 const boxOrders = this._createUpdatedBoxOrders();93 this.settings.set_strv("left-box-order", boxOrders.left);94 this.settings.set_strv("center-box-order", boxOrders.center);95 this.settings.set_strv("right-box-order", boxOrders.right);96 }97 /**98 * This methods orders the top bar items of all boxes according to the99 * configured box orders using `this._orderTopBarItems`.100 */101 _orderTopBarItemsOfAllBoxes() {102 this._orderTopBarItems("left");103 this._orderTopBarItems("center");104 this._orderTopBarItems("right");105 }106 /**107 * An object containing a position and box overwrite.108 * @typedef PositionAndBoxOverwrite109 * @property {Number} position - The position overwrite.110 * @property {string} box - The position box overwrite.111 */112 /**113 * Overwrite `Panel._addToPanelBox` with a custom method, which handles top114 * bar item additions to make sure that they are added in the correct115 * position and box.116 */117 _overwritePanelAddToPanelBox() {118 // Add the original `Panel._addToPanelBox` method as119 // `Panel._originalAddToPanelBox`.120 Panel.Panel.prototype._originalAddToPanelBox = Panel.Panel.prototype._addToPanelBox;121 // This function gets used by the `Panel._addToPanelBox` overwrite to122 // determine the position and box for a new item.123 // It also adds the new item to the relevant box order, if it isn't in124 // it already.125 const getPositionAndBoxOverwrite = (role, box, indicator) => {126 const boxOrders = {127 left: this.settings.get_strv("left-box-order"),128 center: this.settings.get_strv("center-box-order"),129 right: this.settings.get_strv("right-box-order"),130 };131 let boxOrder;132 // Handle the case where the new item is a133 // AppIndicator/KStatusNotifierItem.134 if (role.startsWith("appindicator-")) {135 switch (box) {136 case "left":137 boxOrder = this.settings.get_strv("left-box-order");138 this._appIndicatorKStatusNotifierItemManager.handleAppIndicatorKStatusNotifierItemItem(indicator.container, role, boxOrder, boxOrders);139 this.settings.set_strv("left-box-order", boxOrder);140 break;141 case "center":142 boxOrder = this.settings.get_strv("center-box-order");143 this._appIndicatorKStatusNotifierItemManager.handleAppIndicatorKStatusNotifierItemItem(indicator.container, role, boxOrder, boxOrders);144 this.settings.set_strv("center-box-order", boxOrder);145 break;146 case "right":147 boxOrder = this.settings.get_strv("right-box-order");148 this._appIndicatorKStatusNotifierItemManager.handleAppIndicatorKStatusNotifierItemItem(indicator.container, role, boxOrder, boxOrders, true);149 this.settings.set_strv("right-box-order", boxOrder);150 break;151 }152 }153 // Get the resolved box orders for all boxes.154 const resolvedBoxOrders = {155 left: this._appIndicatorKStatusNotifierItemManager.createResolvedBoxOrder(this.settings.get_strv("left-box-order")),156 center: this._appIndicatorKStatusNotifierItemManager.createResolvedBoxOrder(this.settings.get_strv("center-box-order")),157 right: this._appIndicatorKStatusNotifierItemManager.createResolvedBoxOrder(this.settings.get_strv("right-box-order")),158 };159 // Also get the restricted valid box order of the target box.160 const restrictedValidBoxOrderOfTargetBox = this._boxOrderCreator.createRestrictedValidBoxOrder(box);161 // Get the index of the role for each box order.162 const indices = {163 left: resolvedBoxOrders.left.indexOf(role),164 center: resolvedBoxOrders.center.indexOf(role),165 right: resolvedBoxOrders.right.indexOf(role),166 };167 // If the role is not already configured in one of the box orders,168 // just add it to the target box order at the end/beginning, save169 // the updated box order and return the relevant position and box.170 if (indices.left === -1171 && indices.center === -1172 && indices.right === -1) {173 switch (box) {174 // For the left and center box, insert the role at the end,175 // since they're LTR.176 case "left":177 boxOrders["left"].push(role);178 this.settings.set_strv("left-box-order", boxOrders["left"]);179 return {180 position: restrictedValidBoxOrderOfTargetBox.length - 1,181 box: box182 };183 case "center":184 boxOrders["center"].push(role);185 this.settings.set_strv("center-box-order", boxOrders["center"]);186 return {187 position: restrictedValidBoxOrderOfTargetBox.length - 1,188 box: box189 };190 // For the right box, insert the role at the beginning,191 // since it's RTL.192 case "right":193 boxOrders["right"].unshift(role);194 this.settings.set_strv("right-box-order", boxOrders["right"]);195 return {196 position: 0,197 box: box198 };199 }200 }201 /// Since the role is already configured in one of the box orders,202 /// determine the correct insertion index for the position.203 const determineInsertionIndex = (index, restrictedValidBoxOrder, boxOrder) => {204 // Set the insertion index initially to 0, so that if no closest205 // item can be found, the new item just gets inserted at the206 // beginning.207 let insertionIndex = 0;208 // Find the index of the closest item, which is also in the209 // valid box order and before the new item.210 // This way, we can insert the new item just after the index of211 // this closest item.212 for (let i = index - 1; i >= 0; i--) {213 let potentialClosestItemIndex = restrictedValidBoxOrder.indexOf(boxOrder[i]);214 if (potentialClosestItemIndex !== -1) {215 insertionIndex = potentialClosestItemIndex + 1;216 break;217 }218 }219 return insertionIndex;220 };221 if (indices.left !== -1) {222 return {223 position: determineInsertionIndex(indices.left, this._boxOrderCreator.createRestrictedValidBoxOrder("left"), resolvedBoxOrders.left),224 box: "left"225 };226 }227 if (indices.center !== -1) {228 return {229 position: determineInsertionIndex(indices.center, this._boxOrderCreator.createRestrictedValidBoxOrder("center"), resolvedBoxOrders.center),230 box: "center"231 };232 }233 if (indices.right !== -1) {234 return {235 position: determineInsertionIndex(indices.right, this._boxOrderCreator.createRestrictedValidBoxOrder("right"), resolvedBoxOrders.right),236 box: "right"237 };238 }239 };240 // Overwrite `Panel._addToPanelBox`.241 Panel.Panel.prototype._addToPanelBox = function (role, indicator, position, box) {242 // Get the position and box overwrite.243 let positionBoxOverwrite;244 switch (box) {245 case this._leftBox:246 positionBoxOverwrite = getPositionAndBoxOverwrite(role, "left", indicator);247 break;248 case this._centerBox:249 positionBoxOverwrite = getPositionAndBoxOverwrite(role, "center", indicator);250 break;251 case this._rightBox:252 positionBoxOverwrite = getPositionAndBoxOverwrite(role, "right", indicator);253 break;254 }255 // Call the original `Panel._addToPanelBox` with the position256 // overwrite as the position argument and the box determined by the257 // box overwrite as the box argument.258 switch (positionBoxOverwrite.box) {259 case "left":260 this._originalAddToPanelBox(role, indicator, positionBoxOverwrite.position, Main.panel._leftBox);261 break;262 case "center":263 this._originalAddToPanelBox(role, indicator, positionBoxOverwrite.position, Main.panel._centerBox);264 break;265 case "right":266 this._originalAddToPanelBox(role, indicator, positionBoxOverwrite.position, Main.panel._rightBox);267 break;268 }269 };270 }271 ////////////////////////////////////////////////////////////////////////////272 /// Helper methods holding logic needed by other methods. ///273 ////////////////////////////////////////////////////////////////////////////274 /**275 * An object containing a box order for the left, center and right top bar276 * box.277 * @typedef {Object} BoxOrders278 * @property {string[]} left - The box order for the left top bar box.279 * @property {string[]} center - The box order for the center top bar box.280 * @property {string[]} right - The box order for the right top bar box.281 */282 /**283 * This method adds all new items currently present in the Gnome Shell top284 * bar to the correct box order and returns the new box orders.285 * @returns {BoxOrders} - The updated box orders.286 */287 _createUpdatedBoxOrders() {288 // Load the configured box orders from settings.289 const boxOrders = {290 left: this.settings.get_strv("left-box-order"),291 center: this.settings.get_strv("center-box-order"),292 right: this.settings.get_strv("right-box-order"),293 };294 // Get items (or rather their roles) currently present in the Gnome295 // Shell top bar and index them using their associated indicator296 // container.297 let indicatorContainerRoleMap = new Map();298 for (const role in Main.panel.statusArea) {299 indicatorContainerRoleMap.set(Main.panel.statusArea[role].container, role);300 }301 // Get the indicator containers (of the items) currently present in the302 // Gnome Shell top bar boxes.303 const boxOrderIndicatorContainers = {304 left: Main.panel._leftBox.get_children(),305 center: Main.panel._centerBox.get_children(),306 // Reverse this array, since the items in the left and center box307 // are logically LTR, while the items in the right box are RTL.308 right: Main.panel._rightBox.get_children().reverse()309 };310 // This function goes through the items (or rather their indicator311 // containers) of the given box and adds new items (or rather their312 // roles) to the box order.313 const addNewItemsToBoxOrder = (boxIndicatorContainers, boxOrder, box) => {314 for (const indicatorContainer of boxIndicatorContainers) {315 // First get the role associated with the current indicator316 // container.317 const associatedRole = indicatorContainerRoleMap.get(indicatorContainer);318 if (!associatedRole) continue;319 // Handle an AppIndicator/KStatusNotifierItem item differently.320 if (associatedRole.startsWith("appindicator-")) {321 this._appIndicatorKStatusNotifierItemManager.handleAppIndicatorKStatusNotifierItemItem(indicatorContainer, associatedRole, boxOrder, boxOrders, box === "right");322 continue;323 }324 // Add the role to the box order, if it isn't in in one already.325 if (!boxOrders.left.includes(associatedRole)326 && !boxOrders.center.includes(associatedRole)327 && !boxOrders.right.includes(associatedRole)) {328 if (box === "right") {329 // Add the items to the beginning for this array, since330 // its RTL.331 boxOrder.unshift(associatedRole);332 } else {333 boxOrder.push(associatedRole);334 }335 }336 }337 };338 addNewItemsToBoxOrder(boxOrderIndicatorContainers.left, boxOrders.left, "left");339 addNewItemsToBoxOrder(boxOrderIndicatorContainers.center, boxOrders.center, "center");340 addNewItemsToBoxOrder(boxOrderIndicatorContainers.right, boxOrders.right, "right");341 return boxOrders;342 }343 /**344 * This method orders the top bar items of the specified box according to345 * the configured box orders.346 * @param {string} box - The box to order.347 */348 _orderTopBarItems(box) {349 // Get the valid box order.350 const validBoxOrder = this._boxOrderCreator.createValidBoxOrder(box);351 // Get the relevant box of `Main.panel`.352 let panelBox;353 switch (box) {354 case "left":355 panelBox = Main.panel._leftBox;356 break;357 case "center":358 panelBox = Main.panel._centerBox;359 break;360 case "right":361 panelBox = Main.panel._rightBox;362 break;363 }364 /// Go through the items (or rather their roles) of the validBoxOrder365 /// and order the panelBox accordingly.366 for (let i = 0; i < validBoxOrder.length; i++) {367 const role = validBoxOrder[i];368 // Get the indicator container associated with the current role.369 const associatedIndicatorContainer = Main.panel.statusArea[role].container;370 associatedIndicatorContainer.get_parent().remove_child(associatedIndicatorContainer);371 panelBox.insert_child_at_index(associatedIndicatorContainer, i);372 }373 // To handle the case, where the box order got set to a permutation374 // of an outdated box order, it would be wise, if the caller updated the375 // box order now to include the items present in the top bar.376 }377}378function init() {379 return new Extension();...
box_test.js
Source:box_test.js
1// Copyright 2006 The Closure Library Authors. All Rights Reserved.2//3// Licensed under the Apache License, Version 2.0 (the "License");4// you may not use this file except in compliance with the License.5// You may obtain a copy of the License at6//7// http://www.apache.org/licenses/LICENSE-2.08//9// Unless required by applicable law or agreed to in writing, software10// distributed under the License is distributed on an "AS-IS" BASIS,11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.12// See the License for the specific language governing permissions and13// limitations under the License.14goog.provide('goog.math.BoxTest');15goog.setTestOnly('goog.math.BoxTest');16goog.require('goog.math.Box');17goog.require('goog.math.Coordinate');18goog.require('goog.testing.jsunit');19function testBoxEquals() {20 var a = new goog.math.Box(1, 2, 3, 4);21 var b = new goog.math.Box(1, 2, 3, 4);22 assertTrue(goog.math.Box.equals(a, a));23 assertTrue(goog.math.Box.equals(a, b));24 assertTrue(goog.math.Box.equals(b, a));25 assertFalse('Box should not equal null.', goog.math.Box.equals(a, null));26 assertFalse('Box should not equal null.', goog.math.Box.equals(null, a));27 assertFalse(goog.math.Box.equals(a, new goog.math.Box(4, 2, 3, 4)));28 assertFalse(goog.math.Box.equals(a, new goog.math.Box(1, 4, 3, 4)));29 assertFalse(goog.math.Box.equals(a, new goog.math.Box(1, 2, 4, 4)));30 assertFalse(goog.math.Box.equals(a, new goog.math.Box(1, 2, 3, 1)));31 assertTrue('Null boxes should be equal.', goog.math.Box.equals(null, null));32}33function testBoxClone() {34 var b = new goog.math.Box(0, 0, 0, 0);35 assertTrue(goog.math.Box.equals(b, b.clone()));36 b.left = 0;37 b.top = 1;38 b.right = 2;39 b.bottom = 3;40 assertTrue(goog.math.Box.equals(b, b.clone()));41}42function testBoxRelativePositionX() {43 var box = new goog.math.Box(50, 100, 100, 50);44 assertEquals(0,45 goog.math.Box.relativePositionX(box, new goog.math.Coordinate(75, 0)));46 assertEquals(0,47 goog.math.Box.relativePositionX(box, new goog.math.Coordinate(75, 75)));48 assertEquals(0,49 goog.math.Box.relativePositionX(box, new goog.math.Coordinate(75, 105)));50 assertEquals(-5,51 goog.math.Box.relativePositionX(box, new goog.math.Coordinate(45, 75)));52 assertEquals(5,53 goog.math.Box.relativePositionX(box, new goog.math.Coordinate(105, 75)));54}55function testBoxRelativePositionY() {56 var box = new goog.math.Box(50, 100, 100, 50);57 assertEquals(0,58 goog.math.Box.relativePositionY(box, new goog.math.Coordinate(0, 75)));59 assertEquals(0,60 goog.math.Box.relativePositionY(box, new goog.math.Coordinate(75, 75)));61 assertEquals(0,62 goog.math.Box.relativePositionY(box, new goog.math.Coordinate(105, 75)));63 assertEquals(-5,64 goog.math.Box.relativePositionY(box, new goog.math.Coordinate(75, 45)));65 assertEquals(5,66 goog.math.Box.relativePositionY(box, new goog.math.Coordinate(75, 105)));67}68function testBoxDistance() {69 var box = new goog.math.Box(50, 100, 100, 50);70 assertEquals(0,71 goog.math.Box.distance(box, new goog.math.Coordinate(75, 75)));72 assertEquals(25,73 goog.math.Box.distance(box, new goog.math.Coordinate(75, 25)));74 assertEquals(10,75 goog.math.Box.distance(box, new goog.math.Coordinate(40, 80)));76 assertEquals(5,77 goog.math.Box.distance(box, new goog.math.Coordinate(46, 47)));78 assertEquals(10,79 goog.math.Box.distance(box, new goog.math.Coordinate(106, 108)));80}81function testBoxContains() {82 var box = new goog.math.Box(50, 100, 100, 50);83 assertTrue(goog.math.Box.contains(box, new goog.math.Coordinate(75, 75)));84 assertTrue(goog.math.Box.contains(box, new goog.math.Coordinate(50, 100)));85 assertTrue(goog.math.Box.contains(box, new goog.math.Coordinate(100, 99)));86 assertFalse(goog.math.Box.contains(box, new goog.math.Coordinate(100, 101)));87 assertFalse(goog.math.Box.contains(box, new goog.math.Coordinate(49, 50)));88 assertFalse(goog.math.Box.contains(box, new goog.math.Coordinate(25, 25)));89}90function testBoxContainsBox() {91 var box = new goog.math.Box(50, 100, 100, 50);92 function assertContains(boxB) {93 assertTrue(box + ' expected to contain ' + boxB,94 goog.math.Box.contains(box, boxB));95 }96 function assertNotContains(boxB) {97 assertFalse(box + ' expected to not contain ' + boxB,98 goog.math.Box.contains(box, boxB));99 }100 assertContains(new goog.math.Box(60, 90, 90, 60));101 assertNotContains(new goog.math.Box(1, 3, 4, 2));102 assertNotContains(new goog.math.Box(30, 90, 60, 60));103 assertNotContains(new goog.math.Box(60, 110, 60, 60));104 assertNotContains(new goog.math.Box(60, 90, 110, 60));105 assertNotContains(new goog.math.Box(60, 90, 60, 40));106}107function testBoxesIntersect() {108 var box = new goog.math.Box(50, 100, 100, 50);109 function assertIntersects(boxB) {110 assertTrue(box + ' expected to intersect ' + boxB,111 goog.math.Box.intersects(box, boxB));112 }113 function assertNotIntersects(boxB) {114 assertFalse(box + ' expected to not intersect ' + boxB,115 goog.math.Box.intersects(box, boxB));116 }117 assertIntersects(box);118 assertIntersects(new goog.math.Box(20, 80, 80, 20));119 assertIntersects(new goog.math.Box(50, 80, 100, 20));120 assertIntersects(new goog.math.Box(80, 80, 120, 20));121 assertIntersects(new goog.math.Box(20, 100, 80, 50));122 assertIntersects(new goog.math.Box(80, 100, 120, 50));123 assertIntersects(new goog.math.Box(20, 120, 80, 80));124 assertIntersects(new goog.math.Box(50, 120, 100, 80));125 assertIntersects(new goog.math.Box(80, 120, 120, 80));126 assertIntersects(new goog.math.Box(20, 120, 120, 20));127 assertIntersects(new goog.math.Box(70, 80, 80, 70));128 assertNotIntersects(new goog.math.Box(10, 30, 30, 10));129 assertNotIntersects(new goog.math.Box(10, 70, 30, 30));130 assertNotIntersects(new goog.math.Box(10, 100, 30, 50));131 assertNotIntersects(new goog.math.Box(10, 120, 30, 80));132 assertNotIntersects(new goog.math.Box(10, 140, 30, 120));133 assertNotIntersects(new goog.math.Box(30, 30, 70, 10));134 assertNotIntersects(new goog.math.Box(30, 140, 70, 120));135 assertNotIntersects(new goog.math.Box(50, 30, 100, 10));136 assertNotIntersects(new goog.math.Box(50, 140, 100, 120));137 assertNotIntersects(new goog.math.Box(80, 30, 120, 10));138 assertNotIntersects(new goog.math.Box(80, 140, 120, 120));139 assertNotIntersects(new goog.math.Box(120, 30, 140, 10));140 assertNotIntersects(new goog.math.Box(120, 70, 140, 30));141 assertNotIntersects(new goog.math.Box(120, 100, 140, 50));142 assertNotIntersects(new goog.math.Box(120, 120, 140, 80));143 assertNotIntersects(new goog.math.Box(120, 140, 140, 120));144}145function testBoxesIntersectWithPadding() {146 var box = new goog.math.Box(50, 100, 100, 50);147 function assertIntersects(boxB, padding) {148 assertTrue(box + ' expected to intersect ' + boxB + ' with padding ' +149 padding, goog.math.Box.intersectsWithPadding(box, boxB, padding));150 }151 function assertNotIntersects(boxB, padding) {152 assertFalse(box + ' expected to not intersect ' + boxB + ' with padding ' +153 padding, goog.math.Box.intersectsWithPadding(box, boxB, padding));154 }155 assertIntersects(box, 10);156 assertIntersects(new goog.math.Box(20, 80, 80, 20), 10);157 assertIntersects(new goog.math.Box(50, 80, 100, 20), 10);158 assertIntersects(new goog.math.Box(80, 80, 120, 20), 10);159 assertIntersects(new goog.math.Box(20, 100, 80, 50), 10);160 assertIntersects(new goog.math.Box(80, 100, 120, 50), 10);161 assertIntersects(new goog.math.Box(20, 120, 80, 80), 10);162 assertIntersects(new goog.math.Box(50, 120, 100, 80), 10);163 assertIntersects(new goog.math.Box(80, 120, 120, 80), 10);164 assertIntersects(new goog.math.Box(20, 120, 120, 20), 10);165 assertIntersects(new goog.math.Box(70, 80, 80, 70), 10);166 assertIntersects(new goog.math.Box(10, 30, 30, 10), 20);167 assertIntersects(new goog.math.Box(10, 70, 30, 30), 20);168 assertIntersects(new goog.math.Box(10, 100, 30, 50), 20);169 assertIntersects(new goog.math.Box(10, 120, 30, 80), 20);170 assertIntersects(new goog.math.Box(10, 140, 30, 120), 20);171 assertIntersects(new goog.math.Box(30, 30, 70, 10), 20);172 assertIntersects(new goog.math.Box(30, 140, 70, 120), 20);173 assertIntersects(new goog.math.Box(50, 30, 100, 10), 20);174 assertIntersects(new goog.math.Box(50, 140, 100, 120), 20);175 assertIntersects(new goog.math.Box(80, 30, 120, 10), 20);176 assertIntersects(new goog.math.Box(80, 140, 120, 120), 20);177 assertIntersects(new goog.math.Box(120, 30, 140, 10), 20);178 assertIntersects(new goog.math.Box(120, 70, 140, 30), 20);179 assertIntersects(new goog.math.Box(120, 100, 140, 50), 20);180 assertIntersects(new goog.math.Box(120, 120, 140, 80), 20);181 assertIntersects(new goog.math.Box(120, 140, 140, 120), 20);182 assertNotIntersects(new goog.math.Box(10, 30, 30, 10), 10);183 assertNotIntersects(new goog.math.Box(10, 70, 30, 30), 10);184 assertNotIntersects(new goog.math.Box(10, 100, 30, 50), 10);185 assertNotIntersects(new goog.math.Box(10, 120, 30, 80), 10);186 assertNotIntersects(new goog.math.Box(10, 140, 30, 120), 10);187 assertNotIntersects(new goog.math.Box(30, 30, 70, 10), 10);188 assertNotIntersects(new goog.math.Box(30, 140, 70, 120), 10);189 assertNotIntersects(new goog.math.Box(50, 30, 100, 10), 10);190 assertNotIntersects(new goog.math.Box(50, 140, 100, 120), 10);191 assertNotIntersects(new goog.math.Box(80, 30, 120, 10), 10);192 assertNotIntersects(new goog.math.Box(80, 140, 120, 120), 10);193 assertNotIntersects(new goog.math.Box(120, 30, 140, 10), 10);194 assertNotIntersects(new goog.math.Box(120, 70, 140, 30), 10);195 assertNotIntersects(new goog.math.Box(120, 100, 140, 50), 10);196 assertNotIntersects(new goog.math.Box(120, 120, 140, 80), 10);197 assertNotIntersects(new goog.math.Box(120, 140, 140, 120), 10);198}199function testExpandToInclude() {200 var box = new goog.math.Box(10, 50, 50, 10);201 box.expandToInclude(new goog.math.Box(60, 70, 70, 60));202 assertEquals(10, box.left);203 assertEquals(10, box.top);204 assertEquals(70, box.right);205 assertEquals(70, box.bottom);206 box.expandToInclude(new goog.math.Box(30, 40, 40, 30));207 assertEquals(10, box.left);208 assertEquals(10, box.top);209 assertEquals(70, box.right);210 assertEquals(70, box.bottom);211 box.expandToInclude(new goog.math.Box(0, 100, 100, 0));212 assertEquals(0, box.left);213 assertEquals(0, box.top);214 assertEquals(100, box.right);215 assertEquals(100, box.bottom);216}217function testGetWidth() {218 var box = new goog.math.Box(10, 50, 30, 25);219 assertEquals(25, box.getWidth());220}221function testGetHeight() {222 var box = new goog.math.Box(10, 50, 30, 25);223 assertEquals(20, box.getHeight());224}225function testBoundingBox() {226 assertObjectEquals(227 new goog.math.Box(1, 10, 11, 0),228 goog.math.Box.boundingBox(229 new goog.math.Coordinate(5, 5),230 new goog.math.Coordinate(5, 11),231 new goog.math.Coordinate(0, 5),232 new goog.math.Coordinate(5, 1),233 new goog.math.Coordinate(10, 5)));234}235function testBoxCeil() {236 var box = new goog.math.Box(11.4, 26.6, 17.8, 9.2);237 assertEquals('The function should return the target instance',238 box, box.ceil());239 assertObjectEquals(new goog.math.Box(12, 27, 18, 10), box);240}241function testBoxFloor() {242 var box = new goog.math.Box(11.4, 26.6, 17.8, 9.2);243 assertEquals('The function should return the target instance',244 box, box.floor());245 assertObjectEquals(new goog.math.Box(11, 26, 17, 9), box);246}247function testBoxRound() {248 var box = new goog.math.Box(11.4, 26.6, 17.8, 9.2);249 assertEquals('The function should return the target instance',250 box, box.round());251 assertObjectEquals(new goog.math.Box(11, 27, 18, 9), box);252}253function testBoxTranslateCoordinate() {254 var box = new goog.math.Box(10, 30, 20, 5);255 var c = new goog.math.Coordinate(10, 5);256 assertEquals('The function should return the target instance',257 box, box.translate(c));258 assertObjectEquals(new goog.math.Box(15, 40, 25, 15), box);259}260function testBoxTranslateXY() {261 var box = new goog.math.Box(10, 30, 20, 5);262 assertEquals('The function should return the target instance',263 box, box.translate(5, 2));264 assertObjectEquals(new goog.math.Box(12, 35, 22, 10), box);265}266function testBoxTranslateX() {267 var box = new goog.math.Box(10, 30, 20, 5);268 assertEquals('The function should return the target instance',269 box, box.translate(3));270 assertObjectEquals(new goog.math.Box(10, 33, 20, 8), box);271}272function testBoxScaleXY() {273 var box = new goog.math.Box(10, 20, 30, 5);274 assertEquals('The function should return the target instance',275 box, box.scale(2, 3));276 assertObjectEquals(new goog.math.Box(30, 40, 90, 10), box);277}278function testBoxScaleFactor() {279 var box = new goog.math.Box(10, 20, 30, 5);280 assertEquals('The function should return the target instance',281 box, box.scale(2));282 assertObjectEquals(new goog.math.Box(20, 40, 60, 10), box);...
box.js
Source:box.js
1// Copyright 2006 The Closure Library Authors. All Rights Reserved.2//3// Licensed under the Apache License, Version 2.0 (the "License");4// you may not use this file except in compliance with the License.5// You may obtain a copy of the License at6//7// http://www.apache.org/licenses/LICENSE-2.08//9// Unless required by applicable law or agreed to in writing, software10// distributed under the License is distributed on an "AS-IS" BASIS,11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.12// See the License for the specific language governing permissions and13// limitations under the License.14/**15 * @fileoverview A utility class for representing a numeric box.16 */17goog.provide('goog.math.Box');18goog.require('goog.math.Coordinate');19/**20 * Class for representing a box. A box is specified as a top, right, bottom,21 * and left. A box is useful for representing margins and padding.22 *23 * This class assumes 'screen coordinates': larger Y coordinates are further24 * from the top of the screen.25 *26 * @param {number} top Top.27 * @param {number} right Right.28 * @param {number} bottom Bottom.29 * @param {number} left Left.30 * @constructor31 */32goog.math.Box = function(top, right, bottom, left) {33 /**34 * Top35 * @type {number}36 */37 this.top = top;38 /**39 * Right40 * @type {number}41 */42 this.right = right;43 /**44 * Bottom45 * @type {number}46 */47 this.bottom = bottom;48 /**49 * Left50 * @type {number}51 */52 this.left = left;53};54/**55 * Creates a Box by bounding a collection of goog.math.Coordinate objects56 * @param {...goog.math.Coordinate} var_args Coordinates to be included inside57 * the box.58 * @return {!goog.math.Box} A Box containing all the specified Coordinates.59 */60goog.math.Box.boundingBox = function(var_args) {61 var box = new goog.math.Box(arguments[0].y, arguments[0].x,62 arguments[0].y, arguments[0].x);63 for (var i = 1; i < arguments.length; i++) {64 var coord = arguments[i];65 box.top = Math.min(box.top, coord.y);66 box.right = Math.max(box.right, coord.x);67 box.bottom = Math.max(box.bottom, coord.y);68 box.left = Math.min(box.left, coord.x);69 }70 return box;71};72/**73 * @return {number} width The width of this Box.74 */75goog.math.Box.prototype.getWidth = function() {76 return this.right - this.left;77};78/**79 * @return {number} height The height of this Box.80 */81goog.math.Box.prototype.getHeight = function() {82 return this.bottom - this.top;83};84/**85 * Creates a copy of the box with the same dimensions.86 * @return {!goog.math.Box} A clone of this Box.87 */88goog.math.Box.prototype.clone = function() {89 return new goog.math.Box(this.top, this.right, this.bottom, this.left);90};91if (goog.DEBUG) {92 /**93 * Returns a nice string representing the box.94 * @return {string} In the form (50t, 73r, 24b, 13l).95 * @override96 */97 goog.math.Box.prototype.toString = function() {98 return '(' + this.top + 't, ' + this.right + 'r, ' + this.bottom + 'b, ' +99 this.left + 'l)';100 };101}102/**103 * Returns whether the box contains a coordinate or another box.104 *105 * @param {goog.math.Coordinate|goog.math.Box} other A Coordinate or a Box.106 * @return {boolean} Whether the box contains the coordinate or other box.107 */108goog.math.Box.prototype.contains = function(other) {109 return goog.math.Box.contains(this, other);110};111/**112 * Expands box with the given margins.113 *114 * @param {number|goog.math.Box} top Top margin or box with all margins.115 * @param {number=} opt_right Right margin.116 * @param {number=} opt_bottom Bottom margin.117 * @param {number=} opt_left Left margin.118 * @return {!goog.math.Box} A reference to this Box.119 */120goog.math.Box.prototype.expand = function(top, opt_right, opt_bottom,121 opt_left) {122 if (goog.isObject(top)) {123 this.top -= top.top;124 this.right += top.right;125 this.bottom += top.bottom;126 this.left -= top.left;127 } else {128 this.top -= top;129 this.right += opt_right;130 this.bottom += opt_bottom;131 this.left -= opt_left;132 }133 return this;134};135/**136 * Expand this box to include another box.137 * NOTE(user): This is used in code that needs to be very fast, please don't138 * add functionality to this function at the expense of speed (variable139 * arguments, accepting multiple argument types, etc).140 * @param {goog.math.Box} box The box to include in this one.141 */142goog.math.Box.prototype.expandToInclude = function(box) {143 this.left = Math.min(this.left, box.left);144 this.top = Math.min(this.top, box.top);145 this.right = Math.max(this.right, box.right);146 this.bottom = Math.max(this.bottom, box.bottom);147};148/**149 * Compares boxes for equality.150 * @param {goog.math.Box} a A Box.151 * @param {goog.math.Box} b A Box.152 * @return {boolean} True iff the boxes are equal, or if both are null.153 */154goog.math.Box.equals = function(a, b) {155 if (a == b) {156 return true;157 }158 if (!a || !b) {159 return false;160 }161 return a.top == b.top && a.right == b.right &&162 a.bottom == b.bottom && a.left == b.left;163};164/**165 * Returns whether a box contains a coordinate or another box.166 *167 * @param {goog.math.Box} box A Box.168 * @param {goog.math.Coordinate|goog.math.Box} other A Coordinate or a Box.169 * @return {boolean} Whether the box contains the coordinate or other box.170 */171goog.math.Box.contains = function(box, other) {172 if (!box || !other) {173 return false;174 }175 if (other instanceof goog.math.Box) {176 return other.left >= box.left && other.right <= box.right &&177 other.top >= box.top && other.bottom <= box.bottom;178 }179 // other is a Coordinate.180 return other.x >= box.left && other.x <= box.right &&181 other.y >= box.top && other.y <= box.bottom;182};183/**184 * Returns the relative x position of a coordinate compared to a box. Returns185 * zero if the coordinate is inside the box.186 *187 * @param {goog.math.Box} box A Box.188 * @param {goog.math.Coordinate} coord A Coordinate.189 * @return {number} The x position of {@code coord} relative to the nearest190 * side of {@code box}, or zero if {@code coord} is inside {@code box}.191 */192goog.math.Box.relativePositionX = function(box, coord) {193 if (coord.x < box.left) {194 return coord.x - box.left;195 } else if (coord.x > box.right) {196 return coord.x - box.right;197 }198 return 0;199};200/**201 * Returns the relative y position of a coordinate compared to a box. Returns202 * zero if the coordinate is inside the box.203 *204 * @param {goog.math.Box} box A Box.205 * @param {goog.math.Coordinate} coord A Coordinate.206 * @return {number} The y position of {@code coord} relative to the nearest207 * side of {@code box}, or zero if {@code coord} is inside {@code box}.208 */209goog.math.Box.relativePositionY = function(box, coord) {210 if (coord.y < box.top) {211 return coord.y - box.top;212 } else if (coord.y > box.bottom) {213 return coord.y - box.bottom;214 }215 return 0;216};217/**218 * Returns the distance between a coordinate and the nearest corner/side of a219 * box. Returns zero if the coordinate is inside the box.220 *221 * @param {goog.math.Box} box A Box.222 * @param {goog.math.Coordinate} coord A Coordinate.223 * @return {number} The distance between {@code coord} and the nearest224 * corner/side of {@code box}, or zero if {@code coord} is inside225 * {@code box}.226 */227goog.math.Box.distance = function(box, coord) {228 var x = goog.math.Box.relativePositionX(box, coord);229 var y = goog.math.Box.relativePositionY(box, coord);230 return Math.sqrt(x * x + y * y);231};232/**233 * Returns whether two boxes intersect.234 *235 * @param {goog.math.Box} a A Box.236 * @param {goog.math.Box} b A second Box.237 * @return {boolean} Whether the boxes intersect.238 */239goog.math.Box.intersects = function(a, b) {240 return (a.left <= b.right && b.left <= a.right &&241 a.top <= b.bottom && b.top <= a.bottom);242};243/**244 * Returns whether two boxes would intersect with additional padding.245 *246 * @param {goog.math.Box} a A Box.247 * @param {goog.math.Box} b A second Box.248 * @param {number} padding The additional padding.249 * @return {boolean} Whether the boxes intersect.250 */251goog.math.Box.intersectsWithPadding = function(a, b, padding) {252 return (a.left <= b.right + padding && b.left <= a.right + padding &&253 a.top <= b.bottom + padding && b.top <= a.bottom + padding);254};255/**256 * Rounds the fields to the next larger integer values.257 *258 * @return {!goog.math.Box} This box with ceil'd fields.259 */260goog.math.Box.prototype.ceil = function() {261 this.top = Math.ceil(this.top);262 this.right = Math.ceil(this.right);263 this.bottom = Math.ceil(this.bottom);264 this.left = Math.ceil(this.left);265 return this;266};267/**268 * Rounds the fields to the next smaller integer values.269 *270 * @return {!goog.math.Box} This box with floored fields.271 */272goog.math.Box.prototype.floor = function() {273 this.top = Math.floor(this.top);274 this.right = Math.floor(this.right);275 this.bottom = Math.floor(this.bottom);276 this.left = Math.floor(this.left);277 return this;278};279/**280 * Rounds the fields to nearest integer values.281 *282 * @return {!goog.math.Box} This box with rounded fields.283 */284goog.math.Box.prototype.round = function() {285 this.top = Math.round(this.top);286 this.right = Math.round(this.right);287 this.bottom = Math.round(this.bottom);288 this.left = Math.round(this.left);289 return this;290};291/**292 * Translates this box by the given offsets. If a {@code goog.math.Coordinate}293 * is given, then the left and right values are translated by the coordinate's294 * x value and the top and bottom values are translated by the coordinate's y295 * value. Otherwise, {@code tx} and {@code opt_ty} are used to translate the x296 * and y dimension values.297 *298 * @param {number|goog.math.Coordinate} tx The value to translate the x299 * dimension values by or the the coordinate to translate this box by.300 * @param {number=} opt_ty The value to translate y dimension values by.301 * @return {!goog.math.Box} This box after translating.302 */303goog.math.Box.prototype.translate = function(tx, opt_ty) {304 if (tx instanceof goog.math.Coordinate) {305 this.left += tx.x;306 this.right += tx.x;307 this.top += tx.y;308 this.bottom += tx.y;309 } else {310 this.left += tx;311 this.right += tx;312 if (goog.isNumber(opt_ty)) {313 this.top += opt_ty;314 this.bottom += opt_ty;315 }316 }317 return this;318};319/**320 * Scales this coordinate by the given scale factors. The x and y dimension321 * values are scaled by {@code sx} and {@code opt_sy} respectively.322 * If {@code opt_sy} is not given, then {@code sx} is used for both x and y.323 *324 * @param {number} sx The scale factor to use for the x dimension.325 * @param {number=} opt_sy The scale factor to use for the y dimension.326 * @return {!goog.math.Box} This box after scaling.327 */328goog.math.Box.prototype.scale = function(sx, opt_sy) {329 var sy = goog.isNumber(opt_sy) ? opt_sy : sx;330 this.left *= sx;331 this.right *= sx;332 this.top *= sy;333 this.bottom *= sy;334 return this;...
Using AI Code Generation
1const expect = require('unexpected');2const unexpectedSinon = require('unexpected-sinon');3const sinon = require('sinon');4expect.use(unexpectedSinon);5describe('test', () => {6 it('test', () => {7 const callback = sinon.stub();8 callback.withArgs(42).returns(43);9 expect(callback, 'was called with', 42);10 expect(callback, 'was called with', 42);11 expect(callback, 'was called with', 42);12 expect(callback, 'was called with', 42);13 });14});15 1 passing (5ms)
Using AI Code Generation
1const messy = require('unexpected-messy');2const expect = messy.createExpect();3const messy = require('unexpected-messy');4const expect = messy.createExpect();5expect('foo', 'to equal', 'foo');6expect('foo', 'to equal', 'bar');7expect('foo', 'to equal', 'foo');8expect('foo', 'to equal', 'bar');9expect('foo', 'to equal', 'foo');10expect('foo', 'to equal', 'bar');11expect('foo', 'to equal', 'foo');12expect('foo', 'to equal', 'bar');13expect('foo', 'to equal', 'foo');14expect('foo', 'to equal', 'bar');15expect('foo', 'to equal', 'foo');16expect('foo', 'to equal', 'bar');17const messy = require('unexpected-messy');18const expect = messy.createExpect();19expect('foo', 'to equal', 'foo');20expect('foo', 'to equal', 'bar');21expect('foo', 'to equal', 'foo');22expect('foo', 'to equal', 'bar');23expect('foo', 'to equal', 'foo');24expect('foo', 'to equal', 'bar');25expect('foo', 'to equal', 'foo');26expect('foo', 'to equal', 'bar');27const messy = require('unexpected-messy');28const expect = messy.createExpect();29expect('foo', 'to equal', 'foo');30expect('foo', 'to equal', 'bar');31expect('foo', 'to equal', 'foo');32const messy = require('unexpected-messy');33const expect = messy.createExpect();34expect('foo', 'to equal', 'foo');35const messy = require('unexpected-messy');36const expect = messy.createExpect();37expect('foo', 'to equal', 'foo');38expect('foo', 'to equal', 'bar');39const messy = require('unexpected-messy');40const expect = messy.createExpect();41expect('foo', 'to equal', 'foo');42expect('foo', 'to equal
Using AI Code Generation
1var unexpected = require('unexpected');2var unexpectedSinon = require('unexpected-sinon');3var unexpectedSinonStub = require('unexpected-sinon-stub');4var sinon = require('sinon');5var expect = unexpected.clone()6 .use(unexpectedSinon)7 .use(unexpectedSinonStub);8describe('my test', function () {9 it('should work', function () {10 var stub = sinon.stub();11 stub.a = 'a';12 stub.b = 'b';13 expect(stub, 'to have stubs', {14 });15 });16});
Using AI Code Generation
1const expect = require('unexpected')2 .clone()3 .use(require('unexpected-express'));4const app = require('./app');5describe('GET /', () => {6 it('should respond with "Hello World!"', () => {7 return expect(8 { url: '/', method: 'GET' },9 );10 });11});
Using AI Code Generation
1var expect = require('unexpected')2 .clone()3 .use(require('unexpected-sinon'));4var sinon = require('sinon');5var http = require('http');6var expect = require('unexpected')7 .clone()8 .use(require('unexpected-http'));9var mitm = require('unexpected-mitm');10var expect = require('unexpected')11 .clone()12 .use(mitm);13var expect = require('unexpected')14 .clone()15 .use(require('unexpected-check'));16var expect = require('unexpected')17 .clone()18 .use(require('unexpected-check'));19var expect = require('unexpected')20 .clone()21 .use(require('unexpected-check'));22var expect = require('unexpected')23 .clone()24 .use(require('unexpected-check'));25var expect = require('unexpected')26 .clone()27 .use(require('unexpected-check'));28var expect = require('unexpected')29 .clone()30 .use(require('unexpected-check'));31var expect = require('unexpected')32 .clone()33 .use(require('unexpected-check'));34var expect = require('unexpected')35 .clone()36 .use(require('unexpected-check'));37var expect = require('unexpected')38 .clone()39 .use(require('unexpected-check'));40var expect = require('unexpected')41 .clone()42 .use(require('unexpected-sinon'));43var sinon = require('sinon');44var http = require('http');45var expect = require('unexpected')46 .clone()47 .use(require('unexpected-http'));48var mitm = require('unexpected-mitm');49var expect = require('unexpected')50 .clone()51 .use(mitm);52var expect = require('unexpected')53 .clone()54 .use(require('unexpected-check'));
Using AI Code Generation
1const expect = require('unexpected')2 .clone()3 .use(require('unexpected-box'));4const box = require('./box');5describe('box', () => {6 it('should return a box with the correct width and height', () => {7 expect(
Using AI Code Generation
1const {expect,assert} = require('unexpected')2 .clone()3 .use(require('unexpected-sinon'));4const sinon = require('sinon');5const express = require('express');6const request = require('supertest');7const bodyParser = require('body-parser');8const app = express();9const router = express.Router();10const {get,post,put,del} = require('../routes');11const {getUsers,getUserById,addUser,updateUser,deleteUser} = require('../controllers');12describe('GET /users', () => {13 it('should return 200 OK', () => {14 return request(app)15 .get('/users')16 .expect(200);17 });18 it('should return an array of users', () => {19 return request(app)20 .get('/users')21 .expect('Content-Type', /json/)22 .expect(200)23 .then(response => {24 expect(response.body, 'to be an array');25 });26 });27});28describe('GET /users/:id', () => {29 it('should return 200 OK', () => {30 return request(app)31 .get('/users/1')32 .expect(200);33 });34 it('should return a user object', () => {35 return request(app)36 .get('/users/1')37 .expect('Content-Type', /json/)38 .expect(200)39 .then(response => {40 expect(response.body, 'to be an object');41 });42 });43});44describe('POST /users', () => {45 it('should return 201 OK', () => {46 return request(app)47 .post('/users')48 .send({ name: 'John', age: 25 })49 .expect(201);50 });51 it('should return a user object', () => {52 return request(app)53 .post('/users')54 .send({ name: 'John', age: 25 })55 .expect('Content-Type', /json/)56 .expect(201)57 .then(response => {58 expect(response.body, 'to be an object');59 });60 });61});62describe('PUT /users/:id', () => {63 it('should return 200 OK', () => {64 return request(app)65 .put('/users/1
Using AI Code Generation
1var expect = require('unexpected')2 .clone()3 .use(require('unexpected-sinon'))4 .use(require('unexpected-check'));5var sinon = require('sinon');6describe('test', function() {7 it('should test', function() {8 var spy = sinon.spy();9 spy();10 expect(spy, 'was called once');11 });12});13 1 passing (9ms)
Using AI Code Generation
1const expect = require('unexpected');2const unexpected = require('unexpected');3const unexpectedSinon = require('unexpected-sinon');4const sinon = require('sinon');5const expect = unexpected.clone().use(unexpectedSinon);6const mySpy = sinon.spy();7mySpy();8expect(mySpy, 'was called');9expect(mySpy, 'was not called');10expect(mySpy, 'was called once');11expect(mySpy, 'was called twice');12expect(mySpy, 'was called thrice');13expect(mySpy, 'was called 4 times');14expect(mySpy, 'was called 5 times');15expect(mySpy, 'was called 6 times');16expect(mySpy, 'was called 7 times');17expect(mySpy, 'was called 8 times');18expect(mySpy, 'was called 9 times');19expect(mySpy, 'was called 10 times');20expect(mySpy, 'was called 11 times');21expect(mySpy, 'was called 12 times');22expect(mySpy, 'was called 13 times');23expect(mySpy, 'was called 14 times');24expect(mySpy, 'was called 15 times');25expect(mySpy, 'was called 16 times');26expect(mySpy, 'was called 17 times');27expect(mySpy, 'was called 18 times');
Learn to execute automation testing from scratch with LambdaTest Learning Hub. Right from setting up the prerequisites to run your first automation test, to following best practices and diving deeper into advanced test scenarios. LambdaTest Learning Hubs compile a list of step-by-step guides to help you be proficient with different test automation frameworks i.e. Selenium, Cypress, TestNG etc.
You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.
Get 100 minutes of automation test minutes FREE!!