// ===================================================================
// Author: Matt Kruse <matt@mattkruse.com>
// WWW: http://www.mattkruse.com/
//
// NOTICE: You may use this code for any purpose, commercial or
// private, without any further permission from the author. You may
// remove this notice from your final code if you wish, however it is
// appreciated by the author if at least my web site address is kept.
//
// You may *NOT* re-distribute this code in any way except through its
// use. That means, you can include it in your product, or your web
// site, or any other form where the code is actually being used. You
// may not put the plain javascript up on your site for download or
// include it in your javascript libraries for download. Instead,
// please just point to my URL to ensure the most up-to-date versions
// of the files. Thanks.
// ===================================================================
/* 
DynamicOptionList.js
Author: Matt Kruse
Last modified: 6/5/01

DESCRIPTION: This library allows you to create dynamic select list contents,
when the options in a list depend on which item is selected in another list.
It correctly supports multiple selection lists, including maintaining the
selected state of dynamic options.

COMPATABILITY: Works with Netscape 4.x, 6.x, IE 4.x, 5.x.
Not guaranteed to work correctly in Netscape 3.x, or Opera 5 (current
version of Opera does not support new Option()! ).

USAGE:
// Create a new DynamicOptionList object
// Pass it the NAME of its select list, then the NAME of each list that it
// is dependent on. In this example, the contents of the SELECT list named
// "B" is being defined, and its contents depend on this value selected in
// list "A"

var listB = new DynamicOptionList("B","A");

// Add options to the list
// The contents of this list depend on the value selected in "A". So, the 
// first argument to this function is the value of "A" which these values
// correspond to. Then text/value pairs follow as the other arguments.
// In this example, if list "A" has "West" selected as its value, then the
// contents of list "B" will be "California" and "Washington".
// You can add as many options as you wish in this call, or you may separate
// it into just one option added per call to addOptions()

listB.addOptions("West","California","California","Washington","Washington");

// When the new list is generated, you can set which of the options will be
// the default selected value. The first argument to this function is the
// value of the parent list that this default corresponds to.
// In this example, if list "A" as "West" selected then list "B" will be
// populated with "California" as the default option.

listB.setDefaultOption("West","California");

// This example creates a third-level list
// The contents of list "C" depend on the values selected in both list "A"
// and list "B". So when the new DynamicOptionList object is created, it is
// passed both "A" and "B" as the parent select lists

var listC = new DynamicOptionList("C","A","B");

// The contents of list "C" depend on both "A" and "B". So when the contents
// of list "C" are defined, they must be given for each possible combination
// of the selected values of "A" and "B". This is done by combining the values
// with a delimiter character. The default delimiter is "|" - this may be
// changed by calling setDelimiter(value).
// In this example, list "C" will contain the options "Los Angeles" and 
// "San Diego" if the value of list "A" is "West" and the value of list "B" is
// "California". Similar style is used when defining the default option.

listC.addOptions("West|California","Los Angeles","Los Angeles","San Diego","San Diego");

// Once the lists are defined (presumably in the HEAD of your HTML document)
// then several changes need to be made in the HTML itself to trigger the
// population of the lists.

// Add calls in the onLoad of your BODY tag to initialize the dynamic lists.
// Pass a reference to the FORM that they belong to. This must be done onLoad
// of the document because before that point the FORM object does not exist.

<BODY onLoad="listB.init(document.forms[0]); listC.init(document.forms[0]);">

// In each of the parent select lists, add an onChange handler to trigger the
// population of the child lists. populate() must be called on each list that
// depends on this select element. Since list "B" depends on "A" and list "C"
// depends on both "A" and "B", both must be populated when "A" is changed.
// When list "B" is changed, only list "C" needs to be populated.

<SELECT NAME="A" onChange="listB.populate(); listC.populate();">

...<SELECT NAME="B" onChange="listC.populate();">// Netscape<6 does not create new Options correctly. If you have no OPTION 
// tags in your SELECT list, newly-created OPTIONS will not display correctly.
// Also, Netscape does not change the size of the SELECT list depending on its
// contents. So if it is empty by default and then is populated with options,
// it will not expand to fit the whole text in the option space.
// To work around these bugs, blank OPTION tags are generated for Netscape.
// The last OPTION tag is given display text equal to the longest possible 
// OPTION text value that the list will ever hold. This ensures that there will
// be enough room to display all possible values in the SELECT list.
// Call printOptions() inside the SELECT list to generate these blank OPTION
// tags. For browsers other than Netscape<=4.x, this will not do anything.
// NOTE: In this example, the SCRIPT and /SCRIPT are split up because
// otherwise Netscape gets confused. In your actual source, do NOT include the
// space between R and I.<SELECT NAME="B" onChange="listC.populate();"><SCR IPT LANGUAGE="JavaScript">listB.printOptions();</SCR IPT>
</SELECT>

// That's it! That is all that is required to make the lists function.

NOTES:
	None

*/ 

// CONSTRUCTOR
// Pass in the name of the element, then the names of the lists it depends on
var listA = new DynamicOptionList('_Brand','_Category');
var listB = new DynamicOptionList('_Brand','_Category');
var listC = new DynamicOptionList('_Brand','_Category');
var listD = new DynamicOptionList('_Brand','_Category');
var listE = new DynamicOptionList('_Brand','_Category');
var listF = new DynamicOptionList('_Brand','_Category');

var Tees = new Array(11)
var T = 'Tee Shirts'
Tees[1] = 'A779 -Mid Weight Tee -5.6oz'
Tees[2] = 'G5000 -Cotton Tee - 5.4oz'
Tees[3] = 'A980 -Fashion Fit Tee - 4.5oz'
Tees[4] = 'A979  -Heavyweight 6.1oz'
Tees[5] = 'G2000 -Heavyweight 6.1oz'
Tees[6] = 'F20230-Heavyweight 6.1oz "Lofteez"'
Tees[7] = 'H5180 -Heavyweight 6.1oz "Beefy T"'
Tees[8] = 'A923  -Ringer Tee - 6.1oz'
Tees[9] = 'AA2001-Fine Jersey Tee'
Tees[10] = 'AA4400-Baby Rib Fitted Tee'
Tees[11] = 'AA2410-Fine Jersey Ringer Tee'

var GS = new Array(15)
var GSS = 'Girly Shirts'
GS[1] = 'G2000L-Gildan Heavy Tee'
GS[2] = 'G6400L-Gildan Ring Spun Tee'
GS[3] = 'AA4305-Basic Baby Ribbed Tee'
GS[4] = 'AA4321-Cap Sleeve'
GS[5] = 'AA2165-Fine Jersey Set In Arms'
GS[6] = 'AA4311-Spaghetti Strap Tank'
GS[7] = 'A1441-Scoopneck Tee'
GS[8] = 'AA4389-One Shoulder Top'
GS[9] = 'AA6311-Sheer Spaghetti Tank'
GS[10] = 'AA3308-Boy Beater Tank'
GS[11] = 'AA2102-Fine Jersey Tee'
GS[12] = 'AA4377-Cap Sleeve Raglan'
GS[13] = 'AA4356-V-Neck Tee'
GS[14] = 'AA4307-Ribbed Long Sleeve Tee'
GS[15] = 'AA4396-Sleeveless Hoody'

var LS = new Array(14)
var LSS = 'Long Sleeves'
LS[1] = 'G5400 Cotton LS - 5.4 oz'
LS[2] = 'F4930 Cotton LS - 5.6 oz'
LS[3] = 'J363LS Cotton LS - 5.6 oz'
LS[4] = 'A479	Cotton LS - 6.1 oz'
LS[5] = 'G2400 Cotton LS - 6.1 oz'
LS[6] = 'F49230 Cotton LS - 6.1 oz'
LS[7] = 'AA4344 Womens 3/4 Boat Neck'
LS[8] = 'AA2307 Womens LS T-Shirt'
LS[9] = 'H5186 Cotton LS - 6.1 oz'
LS[10] = 'AA2007 Long Sleeve T-Shirt'
LS[11] = 'AA4353 Womens 3/4 Sleeve Raglan'
LS[12] = 'AA4451 Long Sleeve Raglan'
LS[13] = 'AA4398 Womens LS Hoody'
LS[14] = 'AA4393 Womens LS Turtle Neck'

var SW = new Array(12)
var SWS = 'Sweat Shirts'
SW[1] = 'F1630 50/50 8oz Crewneck'
SW[2] = 'G18000 50/50 7.75oz Crewneck'
SW[3] = 'G12000 50/50 9.3oz Crewneck'
SW[4] = 'HP160 50/50 7.8oz Crewneck'
SW[5] = 'F1730 50/50 9oz Crewneck'
SW[6] = 'G9000 80/20 10oz Crewneck'
SW[7] = 'F16130 50/50 8oz Hoody'
SW[8] = 'G18500 50/50 7.75oz Hoody'
SW[9] = 'G12500 50/50 9.3oz Hoody'
SW[10] = 'J1805Z 90/10 10oz Hoody'
SW[11] = 'AA5399 Womens Zip Hoody'
SW[12] = 'CS5001 Womens Stretch Zip Hoody'

var BG = new Array(11)
var BGS = 'Bags'
BG[1] = 'HS002 15 X 14.5 X 3 Promo Tote'
BG[2] = 'HS003 15 X 14.5 X 1 Canvas Tote'
BG[3] = 'HS007 15 X 16 Canvas Rromo Tote'
BG[4] = 'HS010 11.5 X 14.5 X 3 Contrast Tote'
BG[5] = 'HS008 10.5 X 14 X 5 Book Tote'
BG[6] = 'HS019 16 X 14 X 3.5" Convention Tote'
BG[7] = 'HS001 13.75 X 18" Polyester Cinch Sack'
BG[8] = 'HS601 18.5 X 12 X 5.5" Boater Bag'
BG[9] = 'HSHY801	21 X 15.5 X 6.75" Contrast Tote'
BG[10] = 'GR801 Cinch Close Duffel w Straps'
BG[11] = 'M930 Contrasting Cinch Close Duffel'

var AP = new Array(4)
var APS = 'Aprons'
AP[1] = 'M890 Waist Tie 3 Pocket Apron'
AP[2] = 'M891 2 Pocket 24 Apron'
AP[3] = 'M892 2 Pocket 28 Apron'
AP[4] = 'M893 2 Pocket 30 Apron'

var JK = new Array(2)
var JKS = 'Jackets'
JK[1] = 'DIJT75 Unlined Eisenhower'
JK[2] = 'DIJT15 Lined Eisenhower'

var CP = new Array(8)
var CPS = 'Corporate'
CP[1] = 'G2800 Jersey Knit Sport Shirt 6.1oz'
CP[2] = 'H054X 50/50 Sport Shirt 5.5 oz'
CP[3] = 'A6002 Xtra Hvy Sport Shirt 6.8 oz'
CP[4] = 'H055X Steadan Sport Shirt 7oz'
CP[5] = 'A6003 Sport Shirt w Pocket 6.8oz'
CP[6] = 'G37000 Wide Stripe Sport Shirt'
CP[7] = 'G36000 Cotton Racing Shirt'
CP[8] = 'A6240 Long Sleeve Sport Shirt 6.8oz'

var UW = new Array(8)
var UWS = 'Underwear'
UW[1] = 'AA4313 Thong'
UW[2] = 'AA4314 Flat Bottom Panty'
UW[3] = 'AA4315 Bum Bottom Panty'
UW[4] = 'AA4318 Brazilian Bakini'
UW[5] = 'AA8312 Invisi-Thong'
UW[6] = 'AA7381 Interlock Halter Top'
UW[7] = 'AA8301 Hot Short'
UW[8] = 'AA8315 Boy Brief'

var CSS = 'Cust.Supplied'
var NS = 'Nothing Selected'

var CS = new Array(2)
CS[1] = 'Cust. Supplied Textile'
CS[2] = 'Customer Supplied Stock'

listA.addOptions('All','Select Item','All');
listA.setDefaultOption('All', 'All');
listB.addOptions('All','Select Item','All');
listB.setDefaultOption('All', 'All');
listC.addOptions('All','Select Item','All');
listC.setDefaultOption('All', 'All');
listD.addOptions('All','Select Item','All');
listD.setDefaultOption('All', 'All');
listE.addOptions('All','Select Item','All');
listE.setDefaultOption('All', 'All');
listF.addOptions('All','Select Item','All');
listF.setDefaultOption('All', 'All');

listA.addOptions(T,'Select Shirt','All'); listB.addOptions(T,'Select Shirt','All'); listC.addOptions(T,'Select Shirt','All'); listD.addOptions(T,'Select Shirt','All'); listE.addOptions(T,'Select Shirt','All'); listF.addOptions(T,'Select Shirt','All'); 
listA.setDefaultOption(T, 'All');listB.setDefaultOption(T, 'All');listC.setDefaultOption(T, 'All');listD.setDefaultOption(T, 'All');listE.setDefaultOption(T, 'All');listF.setDefaultOption(T, 'All');
listA.addOptions(T,Tees[1]);listB.addOptions(T,Tees[1]);listC.addOptions(T,Tees[1]);listD.addOptions(T,Tees[1]);listE.addOptions(T,Tees[1]);listF.addOptions(T,Tees[1]);
listA.addOptions(T,Tees[2]);listB.addOptions(T,Tees[2]);listC.addOptions(T,Tees[2]);listD.addOptions(T,Tees[2]);listE.addOptions(T,Tees[2]);listF.addOptions(T,Tees[2]);
listA.addOptions(T,Tees[3]);listB.addOptions(T,Tees[3]);listC.addOptions(T,Tees[3]);listD.addOptions(T,Tees[3]);listE.addOptions(T,Tees[3]);listF.addOptions(T,Tees[3]);
listA.addOptions(T,Tees[4]);listB.addOptions(T,Tees[4]);listC.addOptions(T,Tees[4]);listD.addOptions(T,Tees[4]);listE.addOptions(T,Tees[4]);listF.addOptions(T,Tees[4]);
listA.addOptions(T,Tees[5]);listB.addOptions(T,Tees[5]);listC.addOptions(T,Tees[5]);listD.addOptions(T,Tees[5]);listE.addOptions(T,Tees[5]);listF.addOptions(T,Tees[5]);
listA.addOptions(T,Tees[6]);listB.addOptions(T,Tees[6]);listC.addOptions(T,Tees[6]);listD.addOptions(T,Tees[6]);listE.addOptions(T,Tees[6]);listF.addOptions(T,Tees[6]);
listA.addOptions(T,Tees[7]);listB.addOptions(T,Tees[7]);listC.addOptions(T,Tees[7]);listD.addOptions(T,Tees[7]);listE.addOptions(T,Tees[7]);listF.addOptions(T,Tees[7]);
listA.addOptions(T,Tees[8]);listB.addOptions(T,Tees[8]);listC.addOptions(T,Tees[8]);listD.addOptions(T,Tees[8]);listE.addOptions(T,Tees[8]);listF.addOptions(T,Tees[8]);
listA.addOptions(T,Tees[9]);listB.addOptions(T,Tees[9]);listC.addOptions(T,Tees[9]);listD.addOptions(T,Tees[9]);listE.addOptions(T,Tees[9]);listF.addOptions(T,Tees[9]);
listA.addOptions(T,Tees[10]);listB.addOptions(T,Tees[10]);listC.addOptions(T,Tees[10]);listD.addOptions(T,Tees[10]);listE.addOptions(T,Tees[10]);listF.addOptions(T,Tees[10]);
listA.addOptions(T,Tees[11]);listB.addOptions(T,Tees[11]);listC.addOptions(T,Tees[10]);listD.addOptions(T,Tees[11]);listE.addOptions(T,Tees[11]);listF.addOptions(T,Tees[11]);

listA.addOptions(GSS,'Select Shirt','All'); listB.addOptions(GSS,'Select Shirt','All'); listC.addOptions(GSS,'Select Shirt','All'); listD.addOptions(GSS,'Select Shirt','All'); listE.addOptions(GSS,'Select Shirt','All'); listF.addOptions(GSS,'Select Shirt','All'); 
listA.setDefaultOption(GSS, 'All');listB.setDefaultOption(GSS, 'All');listC.setDefaultOption(GSS, 'All');listD.setDefaultOption(GSS, 'All');listE.setDefaultOption(GSS, 'All');listF.setDefaultOption(GSS, 'All');
listA.addOptions(GSS,GS[1]);listB.addOptions(GSS,GS[1]);listC.addOptions(GSS,GS[1]);listD.addOptions(GSS,GS[1]);listE.addOptions(GSS,GS[1]);listF.addOptions(GSS,GS[1]);
listA.addOptions(GSS,GS[2]);listB.addOptions(GSS,GS[2]);listC.addOptions(GSS,GS[2]);listD.addOptions(GSS,GS[2]);listE.addOptions(GSS,GS[2]);listF.addOptions(GSS,GS[2]);
listA.addOptions(GSS,GS[3]);listB.addOptions(GSS,GS[3]);listC.addOptions(GSS,GS[3]);listD.addOptions(GSS,GS[3]);listE.addOptions(GSS,GS[3]);listF.addOptions(GSS,GS[3]);
listA.addOptions(GSS,GS[4]);listB.addOptions(GSS,GS[4]);listC.addOptions(GSS,GS[4]);listD.addOptions(GSS,GS[4]);listE.addOptions(GSS,GS[4]);listF.addOptions(GSS,GS[4]);
listA.addOptions(GSS,GS[5]);listB.addOptions(GSS,GS[5]);listC.addOptions(GSS,GS[5]);listD.addOptions(GSS,GS[5]);listE.addOptions(GSS,GS[5]);listF.addOptions(GSS,GS[5]);
listA.addOptions(GSS,GS[6]);listB.addOptions(GSS,GS[6]);listC.addOptions(GSS,GS[6]);listD.addOptions(GSS,GS[6]);listE.addOptions(GSS,GS[6]);listF.addOptions(GSS,GS[6]);
listA.addOptions(GSS,GS[7]);listB.addOptions(GSS,GS[7]);listC.addOptions(GSS,GS[7]);listD.addOptions(GSS,GS[7]);listE.addOptions(GSS,GS[7]);listF.addOptions(GSS,GS[7]);
listA.addOptions(GSS,GS[8]);listB.addOptions(GSS,GS[8]);listC.addOptions(GSS,GS[8]);listD.addOptions(GSS,GS[8]);listE.addOptions(GSS,GS[8]);listF.addOptions(GSS,GS[8]);
listA.addOptions(GSS,GS[9]);listB.addOptions(GSS,GS[9]);listC.addOptions(GSS,GS[9]);listD.addOptions(GSS,GS[9]);listE.addOptions(GSS,GS[9]);listF.addOptions(GSS,GS[9]);
listA.addOptions(GSS,GS[10]);listB.addOptions(GSS,GS[10]);listC.addOptions(GSS,GS[10]);listD.addOptions(GSS,GS[10]);listE.addOptions(GSS,GS[10]);listF.addOptions(GSS,GS[10]);
listA.addOptions(GSS,GS[11]);listB.addOptions(GSS,GS[11]);listC.addOptions(GSS,GS[11]);listD.addOptions(GSS,GS[11]);listE.addOptions(GSS,GS[11]);listF.addOptions(GSS,GS[11]);
listA.addOptions(GSS,GS[12]);listB.addOptions(GSS,GS[12]);listC.addOptions(GSS,GS[12]);listD.addOptions(GSS,GS[12]);listE.addOptions(GSS,GS[12]);listF.addOptions(GSS,GS[12]);
listA.addOptions(GSS,GS[13]);listB.addOptions(GSS,GS[13]);listC.addOptions(GSS,GS[13]);listD.addOptions(GSS,GS[13]);listE.addOptions(GSS,GS[13]);listF.addOptions(GSS,GS[13]);
listA.addOptions(GSS,GS[14]);listB.addOptions(GSS,GS[14]);listC.addOptions(GSS,GS[14]);listD.addOptions(GSS,GS[14]);listE.addOptions(GSS,GS[14]);listF.addOptions(GSS,GS[14]);
listA.addOptions(GSS,GS[15]);listB.addOptions(GSS,GS[15]);listC.addOptions(GSS,GS[15]);listD.addOptions(GSS,GS[15]);listE.addOptions(GSS,GS[15]);listF.addOptions(GSS,GS[15]);

listA.addOptions(LSS,'Select Shirt','All'); listB.addOptions(LSS,'Select Shirt','All'); listC.addOptions(LSS,'Select Shirt','All'); listD.addOptions(LSS,'Select Shirt','All'); listE.addOptions(LSS,'Select Shirt','All'); listF.addOptions(LSS,'Select Shirt','All'); 
listA.setDefaultOption(LSS, 'All');listB.setDefaultOption(LSS, 'All');listC.setDefaultOption(LSS, 'All');listD.setDefaultOption(LSS, 'All');listE.setDefaultOption(LSS, 'All');listF.setDefaultOption(LSS, 'All');
listA.addOptions(LSS,LS[1]);listB.addOptions(LSS,LS[1]);listC.addOptions(LSS,LS[1]);listD.addOptions(LSS,LS[1]);listE.addOptions(LSS,LS[1]);listF.addOptions(LSS,LS[1]);
listA.addOptions(LSS,LS[2]);listB.addOptions(LSS,LS[2]);listC.addOptions(LSS,LS[2]);listD.addOptions(LSS,LS[2]);listE.addOptions(LSS,LS[2]);listF.addOptions(LSS,LS[2]);
listA.addOptions(LSS,LS[3]);listB.addOptions(LSS,LS[3]);listC.addOptions(LSS,LS[3]);listD.addOptions(LSS,LS[3]);listE.addOptions(LSS,LS[3]);listF.addOptions(LSS,LS[3]);
listA.addOptions(LSS,LS[4]);listB.addOptions(LSS,LS[4]);listC.addOptions(LSS,LS[4]);listD.addOptions(LSS,LS[4]);listE.addOptions(LSS,LS[4]);listF.addOptions(LSS,LS[4]);
listA.addOptions(LSS,LS[5]);listB.addOptions(LSS,LS[5]);listC.addOptions(LSS,LS[5]);listD.addOptions(LSS,LS[5]);listE.addOptions(LSS,LS[5]);listF.addOptions(LSS,LS[5]);
listA.addOptions(LSS,LS[6]);listB.addOptions(LSS,LS[6]);listC.addOptions(LSS,LS[6]);listD.addOptions(LSS,LS[6]);listE.addOptions(LSS,LS[6]);listF.addOptions(LSS,LS[6]);
listA.addOptions(LSS,LS[7]);listB.addOptions(LSS,LS[7]);listC.addOptions(LSS,LS[7]);listD.addOptions(LSS,LS[7]);listE.addOptions(LSS,LS[7]);listF.addOptions(LSS,LS[7]);
listA.addOptions(LSS,LS[8]);listB.addOptions(LSS,LS[8]);listC.addOptions(LSS,LS[8]);listD.addOptions(LSS,LS[8]);listE.addOptions(LSS,LS[8]);listF.addOptions(LSS,LS[8]);
listA.addOptions(LSS,LS[9]);listB.addOptions(LSS,LS[9]);listC.addOptions(LSS,LS[9]);listD.addOptions(LSS,LS[9]);listE.addOptions(LSS,LS[9]);listF.addOptions(LSS,LS[9]);
listA.addOptions(LSS,LS[10]);listB.addOptions(LSS,LS[10]);listC.addOptions(LSS,LS[10]);listD.addOptions(LSS,LS[10]);listE.addOptions(LSS,LS[10]);listF.addOptions(LSS,LS[10]);
listA.addOptions(LSS,LS[11]);listB.addOptions(LSS,LS[11]);listC.addOptions(LSS,LS[11]);listD.addOptions(LSS,LS[11]);listE.addOptions(LSS,LS[11]);listF.addOptions(LSS,LS[11]);
listA.addOptions(LSS,LS[12]);listB.addOptions(LSS,LS[12]);listC.addOptions(LSS,LS[12]);listD.addOptions(LSS,LS[12]);listE.addOptions(LSS,LS[12]);listF.addOptions(LSS,LS[12]);
listA.addOptions(LSS,LS[13]);listB.addOptions(LSS,LS[13]);listC.addOptions(LSS,LS[13]);listD.addOptions(LSS,LS[13]);listE.addOptions(LSS,LS[13]);listF.addOptions(LSS,LS[13]);
listA.addOptions(LSS,LS[14]);listB.addOptions(LSS,LS[14]);listC.addOptions(LSS,LS[14]);listD.addOptions(LSS,LS[14]);listE.addOptions(LSS,LS[14]);listF.addOptions(LSS,LS[14]);

listA.addOptions(SWS,'Select Shirt','All'); listB.addOptions(SWS,'Select Shirt','All'); listC.addOptions(SWS,'Select Shirt','All'); listD.addOptions(SWS,'Select Shirt','All'); listE.addOptions(SWS,'Select Shirt','All'); listF.addOptions(SWS,'Select Shirt','All'); 
listA.setDefaultOption(SWS, 'All');listB.setDefaultOption(SWS, 'All');listC.setDefaultOption(SWS, 'All');listD.setDefaultOption(SWS, 'All');listE.setDefaultOption(SWS, 'All');listF.setDefaultOption(SWS, 'All');
listA.addOptions(SWS,SW[1]);listB.addOptions(SWS,SW[1]);listC.addOptions(SWS,SW[1]);listD.addOptions(SWS,SW[1]);listE.addOptions(SWS,SW[1]);listF.addOptions(SWS,SW[1]);
listA.addOptions(SWS,SW[2]);listB.addOptions(SWS,SW[2]);listC.addOptions(SWS,SW[2]);listD.addOptions(SWS,SW[2]);listE.addOptions(SWS,SW[2]);listF.addOptions(SWS,SW[2]);
listA.addOptions(SWS,SW[3]);listB.addOptions(SWS,SW[3]);listC.addOptions(SWS,SW[3]);listD.addOptions(SWS,SW[3]);listE.addOptions(SWS,SW[3]);listF.addOptions(SWS,SW[3]);
listA.addOptions(SWS,SW[4]);listB.addOptions(SWS,SW[4]);listC.addOptions(SWS,SW[4]);listD.addOptions(SWS,SW[4]);listE.addOptions(SWS,SW[4]);listF.addOptions(SWS,SW[4]);
listA.addOptions(SWS,SW[5]);listB.addOptions(SWS,SW[5]);listC.addOptions(SWS,SW[5]);listD.addOptions(SWS,SW[5]);listE.addOptions(SWS,SW[5]);listF.addOptions(SWS,SW[5]);
listA.addOptions(SWS,SW[6]);listB.addOptions(SWS,SW[6]);listC.addOptions(SWS,SW[6]);listD.addOptions(SWS,SW[6]);listE.addOptions(SWS,SW[6]);listF.addOptions(SWS,SW[6]);
listA.addOptions(SWS,SW[7]);listB.addOptions(SWS,SW[7]);listC.addOptions(SWS,SW[7]);listD.addOptions(SWS,SW[7]);listE.addOptions(SWS,SW[7]);listF.addOptions(SWS,SW[7]);
listA.addOptions(SWS,SW[8]);listB.addOptions(SWS,SW[8]);listC.addOptions(SWS,SW[8]);listD.addOptions(SWS,SW[8]);listE.addOptions(SWS,SW[8]);listF.addOptions(SWS,SW[8]);
listA.addOptions(SWS,SW[9]);listB.addOptions(SWS,SW[9]);listC.addOptions(SWS,SW[9]);listD.addOptions(SWS,SW[9]);listE.addOptions(SWS,SW[9]);listF.addOptions(SWS,SW[9]);
listA.addOptions(SWS,SW[10]);listB.addOptions(SWS,SW[10]);listC.addOptions(SWS,SW[10]);listD.addOptions(SWS,SW[10]);listE.addOptions(SWS,SW[10]);listF.addOptions(SWS,SW[10]);
listA.addOptions(SWS,SW[11]);listB.addOptions(SWS,SW[11]);listC.addOptions(SWS,SW[11]);listD.addOptions(SWS,SW[11]);listE.addOptions(SWS,SW[11]);listF.addOptions(SWS,SW[11]);

listA.addOptions(BGS,'Select Bag','All'); listB.addOptions(BGS,'Select Bag','All'); listC.addOptions(BGS,'Select Bag','All'); listD.addOptions(BGS,'Select Bag','All'); listE.addOptions(BGS,'Select Bag','All'); listF.addOptions(BGS,'Select Bag','All'); 
listA.setDefaultOption(BGS, 'All');listB.setDefaultOption(BGS, 'All');listC.setDefaultOption(BGS, 'All');listD.setDefaultOption(BGS, 'All');listE.setDefaultOption(BGS, 'All');listF.setDefaultOption(BGS, 'All');
listA.addOptions(BGS,BG[1]);listB.addOptions(BGS,BG[1]);listC.addOptions(BGS,BG[1]);listD.addOptions(BGS,BG[1]);listE.addOptions(BGS,BG[1]);listF.addOptions(BGS,BG[1]);
listA.addOptions(BGS,BG[2]);listB.addOptions(BGS,BG[2]);listC.addOptions(BGS,BG[2]);listD.addOptions(BGS,BG[2]);listE.addOptions(BGS,BG[2]);listF.addOptions(BGS,BG[2]);
listA.addOptions(BGS,BG[3]);listB.addOptions(BGS,BG[3]);listC.addOptions(BGS,BG[3]);listD.addOptions(BGS,BG[3]);listE.addOptions(BGS,BG[3]);listF.addOptions(BGS,BG[3]);
listA.addOptions(BGS,BG[4]);listB.addOptions(BGS,BG[4]);listC.addOptions(BGS,BG[4]);listD.addOptions(BGS,BG[4]);listE.addOptions(BGS,BG[4]);listF.addOptions(BGS,BG[4]);
listA.addOptions(BGS,BG[5]);listB.addOptions(BGS,BG[5]);listC.addOptions(BGS,BG[5]);listD.addOptions(BGS,BG[5]);listE.addOptions(BGS,BG[5]);listF.addOptions(BGS,BG[5]);
listA.addOptions(BGS,BG[6]);listB.addOptions(BGS,BG[6]);listC.addOptions(BGS,BG[6]);listD.addOptions(BGS,BG[6]);listE.addOptions(BGS,BG[6]);listF.addOptions(BGS,BG[6]);
listA.addOptions(BGS,BG[7]);listB.addOptions(BGS,BG[7]);listC.addOptions(BGS,BG[7]);listD.addOptions(BGS,BG[7]);listE.addOptions(BGS,BG[7]);listF.addOptions(BGS,BG[7]);
listA.addOptions(BGS,BG[8]);listB.addOptions(BGS,BG[8]);listC.addOptions(BGS,BG[8]);listD.addOptions(BGS,BG[8]);listE.addOptions(BGS,BG[8]);listF.addOptions(BGS,BG[8]);
listA.addOptions(BGS,BG[9]);listB.addOptions(BGS,BG[9]);listC.addOptions(BGS,BG[9]);listD.addOptions(BGS,BG[9]);listE.addOptions(BGS,BG[9]);listF.addOptions(BGS,BG[9]);
listA.addOptions(BGS,BG[10]);listB.addOptions(BGS,BG[10]);listC.addOptions(BGS,BG[10]);listD.addOptions(BGS,BG[10]);listE.addOptions(BGS,BG[10]);listF.addOptions(BGS,BG[10]);
listA.addOptions(BGS,BG[11]);listB.addOptions(BGS,BG[11]);listC.addOptions(BGS,BG[11]);listD.addOptions(BGS,BG[11]);listE.addOptions(BGS,BG[11]);listF.addOptions(BGS,BG[11]);

listA.addOptions(APS,'Select Apron','All'); listB.addOptions(APS,'Select Apron','All'); listC.addOptions(APS,'Select Apron','All'); listD.addOptions(APS,'Apron','All'); listE.addOptions(APS,'Select Apron','All'); listF.addOptions(APS,'Select Apron','All'); 
listA.setDefaultOption(APS, 'All');listB.setDefaultOption(APS, 'All');listC.setDefaultOption(APS, 'All');listD.setDefaultOption(APS, 'All');listE.setDefaultOption(APS, 'All');listF.setDefaultOption(APS, 'All');
listA.addOptions(APS,AP[1]);listB.addOptions(APS,AP[1]);listC.addOptions(APS,AP[1]);listD.addOptions(APS,AP[1]);listE.addOptions(APS,AP[1]);listF.addOptions(APS,AP[1]);
listA.addOptions(APS,AP[2]);listB.addOptions(APS,AP[2]);listC.addOptions(APS,AP[2]);listD.addOptions(APS,AP[2]);listE.addOptions(APS,AP[2]);listF.addOptions(APS,AP[2]);
listA.addOptions(APS,AP[3]);listB.addOptions(APS,AP[3]);listC.addOptions(APS,AP[3]);listD.addOptions(APS,AP[3]);listE.addOptions(APS,AP[3]);listF.addOptions(APS,AP[3]);
listA.addOptions(APS,AP[4]);listB.addOptions(APS,AP[4]);listC.addOptions(APS,AP[4]);listD.addOptions(APS,AP[4]);listE.addOptions(APS,AP[4]);listF.addOptions(APS,AP[4]);

listA.addOptions(JKS,'Select Jacket','All'); listB.addOptions(JKS,'Select Jacket','All'); listC.addOptions(JKS,'Select Jacket','All'); listD.addOptions(JKS,'Select Jacket','All'); listE.addOptions(JKS,'Select Jacket','All'); listF.addOptions(JKS,'Select Jacket','All'); 
listA.setDefaultOption(JKS, 'All');listB.setDefaultOption(JKS, 'All');listC.setDefaultOption(JKS, 'All');listD.setDefaultOption(JKS, 'All');listE.setDefaultOption(JKS, 'All');listF.setDefaultOption(JKS, 'All');
listA.addOptions(JKS,JK[1]);listB.addOptions(JKS,JK[1]);listC.addOptions(JKS,JK[1]);listD.addOptions(JKS,JK[1]);listE.addOptions(JKS,JK[1]);listF.addOptions(JKS,JK[1]);
listA.addOptions(JKS,JK[2]);listB.addOptions(JKS,JK[2]);listC.addOptions(JKS,JK[2]);listD.addOptions(JKS,JK[2]);listE.addOptions(JKS,JK[2]);listF.addOptions(JKS,JK[2]);

listA.addOptions(CPS,'Select Shirt','All'); listB.addOptions(CPS,'Select Shirt','All'); listC.addOptions(CPS,'Select Shirt','All'); listD.addOptions(CPS,'Select Shirt','All'); listE.addOptions(CPS,'Select Shirt','All'); listF.addOptions(CPS,'Select Shirt','All'); 
listA.setDefaultOption(CPS, 'All');listB.setDefaultOption(CPS, 'All');listC.setDefaultOption(CPS, 'All');listD.setDefaultOption(CPS, 'All');listE.setDefaultOption(CPS, 'All');listF.setDefaultOption(CPS, 'All');
listA.addOptions(CPS,CP[1]);listB.addOptions(CPS,CP[1]);listC.addOptions(CPS,CP[1]);listD.addOptions(CPS,CP[1]);listE.addOptions(CPS,CP[1]);listF.addOptions(CPS,CP[1]);
listA.addOptions(CPS,CP[2]);listB.addOptions(CPS,CP[2]);listC.addOptions(CPS,CP[2]);listD.addOptions(CPS,CP[2]);listE.addOptions(CPS,CP[2]);listF.addOptions(CPS,CP[2]);
listA.addOptions(CPS,CP[3]);listB.addOptions(CPS,CP[3]);listC.addOptions(CPS,CP[3]);listD.addOptions(CPS,CP[3]);listE.addOptions(CPS,CP[3]);listF.addOptions(CPS,CP[3]);
listA.addOptions(CPS,CP[4]);listB.addOptions(CPS,CP[4]);listC.addOptions(CPS,CP[4]);listD.addOptions(CPS,CP[4]);listE.addOptions(CPS,CP[4]);listF.addOptions(CPS,CP[4]);
listA.addOptions(CPS,CP[5]);listB.addOptions(CPS,CP[5]);listC.addOptions(CPS,CP[5]);listD.addOptions(CPS,CP[5]);listE.addOptions(CPS,CP[5]);listF.addOptions(CPS,CP[5]);
listA.addOptions(CPS,CP[6]);listB.addOptions(CPS,CP[6]);listC.addOptions(CPS,CP[6]);listD.addOptions(CPS,CP[6]);listE.addOptions(CPS,CP[6]);listF.addOptions(CPS,CP[6]);
listA.addOptions(CPS,CP[7]);listB.addOptions(CPS,CP[7]);listC.addOptions(CPS,CP[7]);listD.addOptions(CPS,CP[7]);listE.addOptions(CPS,CP[7]);listF.addOptions(CPS,CP[7]);
listA.addOptions(CPS,CP[8]);listB.addOptions(CPS,CP[8]);listC.addOptions(CPS,CP[8]);listD.addOptions(CPS,CP[8]);listE.addOptions(CPS,CP[8]);listF.addOptions(CPS,CP[8]);


listA.addOptions(UWS,'Select Undergarment','All'); listB.addOptions(UWS,'Select Undergarment','All'); listC.addOptions(UWS,'Select Undergarment','All'); listD.addOptions(UWS,'Select Undergarment','All'); listE.addOptions(UWS,'Select Undergarment','All'); listF.addOptions(UWS,'Select Undergarment','All'); 
listA.setDefaultOption(UWS, 'All');listB.setDefaultOption(UWS, 'All');listC.setDefaultOption(UWS, 'All');listD.setDefaultOption(UWS, 'All');listE.setDefaultOption(UWS, 'All');listF.setDefaultOption(UWS, 'All');
listA.addOptions(UWS,UW[1]);listB.addOptions(UWS,UW[1]);listC.addOptions(UWS,UW[1]);listD.addOptions(UWS,UW[1]);listE.addOptions(UWS,UW[1]);listF.addOptions(UWS,UW[1]);
listA.addOptions(UWS,UW[2]);listB.addOptions(UWS,UW[2]);listC.addOptions(UWS,UW[2]);listD.addOptions(UWS,UW[2]);listE.addOptions(UWS,UW[2]);listF.addOptions(UWS,UW[2]);
listA.addOptions(UWS,UW[3]);listB.addOptions(UWS,UW[3]);listC.addOptions(UWS,UW[3]);listD.addOptions(UWS,UW[3]);listE.addOptions(UWS,UW[3]);listF.addOptions(UWS,UW[3]);
listA.addOptions(UWS,UW[4]);listB.addOptions(UWS,UW[4]);listC.addOptions(UWS,UW[4]);listD.addOptions(UWS,UW[4]);listE.addOptions(UWS,UW[4]);listF.addOptions(UWS,UW[4]);
listA.addOptions(UWS,UW[5]);listB.addOptions(UWS,UW[5]);listC.addOptions(UWS,UW[5]);listD.addOptions(UWS,UW[5]);listE.addOptions(UWS,UW[5]);listF.addOptions(UWS,UW[5]);
listA.addOptions(UWS,UW[6]);listB.addOptions(UWS,UW[6]);listC.addOptions(UWS,UW[6]);listD.addOptions(UWS,UW[6]);listE.addOptions(UWS,UW[6]);listF.addOptions(UWS,UW[6]);
listA.addOptions(UWS,UW[7]);listB.addOptions(UWS,UW[7]);listC.addOptions(UWS,UW[7]);listD.addOptions(UWS,UW[7]);listE.addOptions(UWS,UW[7]);listF.addOptions(UWS,UW[7]);
listA.addOptions(UWS,UW[8]);listB.addOptions(UWS,UW[8]);listC.addOptions(UWS,UW[8]);listD.addOptions(UWS,UW[8]);listE.addOptions(UWS,UW[8]);listF.addOptions(UWS,UW[8]);


listA.addOptions(CSS,'Select Type','All'); listB.addOptions(CSS,'Select Type','All'); listC.addOptions(CSS,'Select Type','All'); listD.addOptions(CSS,'Select Type','All'); listE.addOptions(CSS,'Select Type','All'); listF.addOptions(CSS,'Select Type','All'); listA.setDefaultOption(CSS, 'All');listB.setDefaultOption(CSS,'All'); listC.setDefaultOption(CSS, 'All'); listD.setDefaultOption(CSS, 'All'); listE.setDefaultOption(CSS, 'All');listF.setDefaultOption(CSS, 'All');
listA.addOptions(CSS,CS[1]);listB.addOptions(CSS,CS[1]);listC.addOptions(CSS,CS[1]);listD.addOptions(CSS,CS[1]);listE.addOptions(CSS,CS[1]);listF.addOptions(CSS,CS[1]);

function DynamicOptionList() {
	if (arguments.length < 2) { alert("Not enough arguments in DynamicOptionList()"); }
	// Name of the list containing dynamic values
	this.target = arguments[0];
	// Set the lists that this dynamic list depends on
	this.dependencies = new Array();
	for (var i=1; i<arguments.length; i++) {
		this.dependencies[this.dependencies.length] = arguments[i];
		}
	// The form this list belongs to
	this.form = null;
	// Place-holder for currently-selected values of dependent select lists
	this.dependentValues = new Object();
	// Hold default values to be selected for conditions
	this.defaultValues = new Object();
	// Storage for the dynamic values
	this.options = new Object();
	// Delimiter between dependent values
	this.delimiter = "|";
	// Logest string currently a potential options (for Netscape)
	this.longestString = "";
	// The total number of options that might be displayed, to build dummy options (for Netscape)
	this.numberOfOptions = 0;
	// Method mappings
	this.addOptions = DynamicOptionList_addOptions;
	this.populate = DynamicOptionList_populate;
	this.setDelimiter = DynamicOptionList_setDelimiter;
	this.setDefaultOption = DynamicOptionList_setDefaultOption;
	this.printOptions = DynamicOptionList_printOptions;
	this.init = DynamicOptionList_init;
	}

// Set the delimiter to something other than | when defining condition values
function DynamicOptionList_setDelimiter(val) {
	this.delimiter = val;
	}

// Set the default option to be selected when the list is painted
function DynamicOptionList_setDefaultOption(condition, val) {
	this.defaultValues[condition] = val;
	}

// Init call to map the form to the object and populate it
function DynamicOptionList_init(theform) {
	this.form = theform;
	this.populate();
	}

// Add options to the list.
// Pass the condition string, then the list of text/value pairs that populate the list	
function DynamicOptionList_addOptions(dependentValue) {
	if (typeof this.options[dependentValue] != "object") { this.options[dependentValue] = new Array(); }
	for (var i=1; i<arguments.length; i+=2) {
		// Keep track of the longest potential string, to draw the option list
		if (arguments[i].length > this.longestString.length) {
			this.longestString = arguments[i];
			}
		this.numberOfOptions++;
		this.options[dependentValue][this.options[dependentValue].length] = arguments[i];
		this.options[dependentValue][this.options[dependentValue].length] = arguments[i+1];
		}
	}

// Print dummy options so Netscape behaves nicely
function DynamicOptionList_printOptions() {
	// Only need to write out "dummy" options for Netscape
    if ((navigator.appName == 'Netscape') && (parseInt(navigator.appVersion) <= 4)){
		var ret = "";
		for (var i=0; i<this.numberOfOptions; i++) { 
			ret += "<OPTION>";
			}
		ret += "<OPTION>"
		for (var i=0; i<this.longestString.length; i++) {
			ret += "_";
			}
		document.writeln(ret);
		}
	}

// Populate the list
function DynamicOptionList_populate() {
	var theform = this.form;
	var i,j,obj,obj2;
	// Get the current value(s) of all select lists this list depends on
	this.dependentValues = new Object;
	var dependentValuesInitialized = false;
	for (i=0; i<this.dependencies.length;i++) {
		var sel = theform[this.dependencies[i]];
		var selName = sel.name;
		// If this is the first dependent list, just fill in the dependentValues
		if (!dependentValuesInitialized) {
			dependentValuesInitialized = true;
			for (j=0; j<sel.options.length; j++) {
				if (sel.options[j].selected) {
					this.dependentValues[sel.options[j].value] = true;
					}
				}
			}
		// Otherwise, add new options for every existing option
		else {
			var tmpList = new Object();
			var newList = new Object();
			for (j=0; j<sel.options.length; j++) {
				if (sel.options[j].selected) {
					tmpList[sel.options[j].value] = true;
					}
				}
			for (obj in this.dependentValues) {
				for (obj2 in tmpList) {
					newList[obj + this.delimiter + obj2] = true;
					}
				}
			this.dependentValues = newList;
			}
		}

	var targetSel = theform[this.target];
		
	// Store the currently-selected values of the target list to maintain them (in case of multiple select lists)
	var targetSelected = new Object();
	for (i=0; i<targetSel.options.length; i++) {
		if (targetSel.options[i].selected) {
			targetSelected[targetSel.options[i].value] = true;
			}
		}

	targetSel.options.length = 0; // Clear all target options
		
	for (i in this.dependentValues) {
		if (typeof this.options[i] == "object") {
			var o = this.options[i];
			for (j=0; j<o.length; j+=2) {
				var text = o[j];
				var val = o[j+1];
				targetSel.options[targetSel.options.length] = new Option(text, val, false, false);
				if (this.defaultValues[i] == val) {
					targetSelected[val] = true;
					}
				}
			}
		}
	targetSel.selectedIndex=-1;
	
	// Select the options that were selected before
	for (i=0; i<targetSel.options.length; i++) {
		if (targetSelected[targetSel.options[i].value] != null && targetSelected[targetSel.options[i].value]==true) {
			targetSel.options[i].selected = true;
			}
		}
	}