var lists = new Array();
// First set of text and values
lists['Satin']    = new Array();
lists['Satin'][0] = new Array(
'Aubergine',
'Berry',
'Black',
'Bordeaux Wine',
'Burgundy',
'Café',
'Celadon',
'Claret',
'Crème',
'Dark Chocolate',
'Ivory',
'Fall Lilac',
'Grape',
'Navy',
'Pastel Violet',
'Pewter',
'Rose',
'Victorian Rose',
'Wheat',
'White'
);
lists['Satin'][1] = new Array(
'Aubergine',
'Berry',
'Black',
'Bordeaux Wine',
'Burgundy',
'Café',
'Celadon',
'Claret',
'Crème',
'Dark Chocolate',
'Ivory',
'Fall Lilac',
'Grape',
'Navy',
'Pastel Violet',
'Pewter',
'Rose',
'Victorian Rose',
'Wheat',
'White'
);

// Second set of text and values
lists['MW Satin']    = new Array();
lists['MW Satin'][0] = new Array(
'Amethyst',
'Black',
'Burgundy',
'Butter',
'Chocolate',
'China Rose',
'Dark Hunter',
'Ecru',
'Grey',
'Ivory',
'Navy',
'Nude',
'Victorian Grape',
'Wine',
'White'
);
lists['MW Satin'][1] = new Array(
'Amethyst',
'Black',
'Burgundy',
'Butter',
'Chocolate',
'China Rose',
'Dark Hunter',
'Ecru',
'Grey',
'Ivory',
'Navy',
'Nude',
'Victorian Grape',
'Wine',
'White'
);


lists['Silk Shantung']    = new Array();
lists['Silk Shantung'][0] = new Array(
'Amethyst',
'Bay',
'Black',
'Celery',
'Chocolate',
'Cloud',
'Ether',
'Fuchsia',
'Garnet',
'Lemonade',
'Mauve',
'Off-White',
'Peacock',
'Petunia',
'Pink',
'Pistachio',
'Poppy',
'Raspberry',
'Riviera',
'Ruby',
'Salmon',
'Storm',
'Strawberry',
'Vermillion',
'Wheat',
'White'
);
lists['Silk Shantung'][1] = new Array(
'Amethyst',
'Bay',
'Black',
'Celery',
'Chocolate',
'Cloud',
'Ether',
'Fuchsia',
'Garnet',
'Lemonade',
'Mauve',
'Off-White',
'Peacock',
'Petunia',
'Pink',
'Pistachio',
'Poppy',
'Raspberry',
'Riviera',
'Ruby',
'Salmon',
'Storm',
'Strawberry',
'Vermillion',
'Wheat',
'White'
);


lists['Silk Dupioni']    = new Array();
lists['Silk Dupioni'][0] = new Array(
'Amethyst',
'Cloud',
'Lemonade',
'Melon',
'Night',
'Off-White',
'Peacock',
'Petunia',
'Phantom',
'Pistachio',
'Poppy',
'Riviera',
'Rose',
'Ruby',
'Salmon',
'Sea',
'Strawberry',
'Tomato',
'Violet',
'Wheat',
'White'
);
lists['Silk Dupioni'][1] = new Array(
'Amethyst',
'Cloud',
'Lemonade',
'Melon',
'Night',
'Off-White',
'Peacock',
'Petunia',
'Phantom',
'Pistachio',
'Poppy',
'Riviera',
'Rose',
'Ruby',
'Salmon',
'Sea',
'Strawberry',
'Tomato',
'Violet',
'Wheat',
'White'
);

lists['Silk Charmeuse/Chiffon/Organza']    = new Array();
lists['Silk Charmeuse/Chiffon/Organza'][0] = new Array(
'Black',
'Buttermilk',
'Charcoal',
'Chartreuse',
'Chocolate',
'Claret',
'Dark Chocolate',
'Dusty Pink',
'Eggplant',
'Fiesta Pink',
'Ivory',
'Lilac',
'Merlot',
'Navy',
'Orchid',
'Raspberry',
'Rose',
'Victorian Teal',
'Wine',
'White'
);
lists['Silk Charmeuse/Chiffon/Organza'][1] = new Array(
'Black',
'Buttermilk',
'Charcoal',
'Chartreuse',
'Chocolate',
'Claret',
'Dark Chocolate',
'Dusty Pink',
'Eggplant',
'Fiesta Pink',
'Ivory',
'Lilac',
'Merlot',
'Navy',
'Orchid',
'Raspberry',
'Rose',
'Victorian Teal',
'Wine',
'White'
);

lists['Silk Taffeta']    = new Array();
lists['Silk Taffeta'][0] = new Array(
'Black',
'Ivory',
'Red',
'Wine',
'White'
);
lists['Silk Taffeta'][1] = new Array(
'Black',
'Ivory',
'Red',
'Wine',
'White'
);

function changeList( box ) {
	list = lists[box.options[box.selectedIndex].value];
	emptyList( box.form.slave );
	fillList( box.form.slave, list );
}


function emptyList( box ) {
	while ( box.options.length ) box.options[0] = null;
}
function fillList( box, arr ) {
	if (arr) {
	for ( i = 0; i < arr[0].length; i++ ) {
		option = new Option( arr[0][i], arr[1][i] );
		box.options[box.length] = option;
	}
	box.selectedIndex=0;
	}
}

function changeList2( box2 ) {
	list2 = lists[box2.options[box2.selectedIndex].value];
	emptyList2( box2.form.slave2 );
	fillList2( box2.form.slave2, list2 );
}

function emptyList2( box2 ) {
	while ( box2.options.length ) box2.options[0] = null;
}
function fillList2( box2, arr2 ) {
	if (arr2) {
	for ( i = 0; i < arr2[0].length; i++ ) {
		option = new Option( arr2[0][i], arr2[1][i] );
		box2.options[box2.length] = option;
	}
	box2.selectedIndex=0;
	}
}


function changeList3( box3 ) {
	list3 = lists[box3.options[box3.selectedIndex].value];
	emptyList3( box3.form.slave3 );
	fillList3( box3.form.slave3, list3 );
}

function emptyList3( box3 ) {
	while ( box3.options.length ) box3.options[0] = null;
}
function fillList3( box3, arr3 ) {
	if (arr3) {
	for ( i = 0; i < arr3[0].length; i++ ) {
		option = new Option( arr3[0][i], arr3[1][i] );
		box3.options[box3.length] = option;
	}
	box3.selectedIndex=0;
	}
}


function checkForm() 
{
	swatchform = document.eform1;
	var errcheck = 0;
	
	  	if (swatchform.textfield.value.length == 0)
		{
			alert("Please Enter Your Name");
			swatchform.textfield.focus();
			errcheck = 1;
		}
	  	if (swatchform.ADDRESS1.value.length == 0)
		{
			alert("Please Enter Your Address");
			swatchform.ADDRESS1.focus();
			errcheck = 1;
		}
	  	if (swatchform.CITY.value.length == 0)
		{
			alert("Please Enter Your City");
			swatchform.CITY.focus();
			errcheck = 1;
		}
	  	if (swatchform.STATE.value ==  "")
		{
			alert("Please Enter Your State");
			swatchform.STATE.focus();
			errcheck = 1;
		}
	  	if (swatchform.ZIP.value.length == 0)
		{
			alert("Please Enter Your Zip Code");
			swatchform.ZIP.focus();
			errcheck = 1;
		}

	  	if (swatchform.PHONE.value.length == 0)
		{
			alert("Please Enter Your Phone Number");
			swatchform.PHONE.focus();
			errcheck = 1;
		}
		var remail
                remail=swatchform.PHONE2.value;

	          if ((remail.indexOf(".")==-1 ) || (remail.indexOf("@")==-1 ))
	          {
	             alert("You must enter a valid email address");
				 swatchform.PHONE2.focus();
	             errcheck = 1;
	          }

	  	if (swatchform.master1.value == "None")
		{
			alert("Please Select a Swatch");
			swatchform.master1.focus();
			errcheck = 1;
		}
	  	if (swatchform.slave.value == "Select One")
		{
			alert("Please Select a Color For swatch Request #1");
			swatchform.slave.focus();
			errcheck = 1;
		}
		
		if (errcheck == 0) {
			alert("thank you");
			swatchform.action.value = "process_request2.asp";
			swatchform.submit();
		} else {
			return false;
		}
}	


