function resetfields (  ) {  document.whatamess.modelpick.selectedIndex = 0;  document.whatamess.colorpick.selectedIndex = 0;// BEG: hack for NN 4.x  obliterate( document.whatamess.colorpick );// END: hack for NN 4.x}function buildlist ( inselect, optionlist ) { var cloc, cloc2 = 0; var portion     = ''; while ( optionlist.length > 0 ) {  cloc = optionlist.indexOf( '|' );  if ( cloc == -1 ) { cloc = optionlist.length; }  portion = optionlist.substring( 0, cloc );  cloc2   = portion.indexOf( ':' );  var foo = new Option( portion.substring( (cloc2 + 1), portion.length ), portion.substring( 0, cloc2 ) );  inselect.options[inselect.options.length] = foo;  if ( optionlist.indexOf ( '|' ) != -1 ) { optionlist = optionlist.substring( ( cloc + 1 ), optionlist.length ); }  else { optionlist = ''; }} }function obliterate ( inselect ) { if ( inselect.options.length > 1 ) {  while ( inselect.length > 1 ) { inselect.options[1] = null; }  inselect.selectedIndex = 0;} }function generateColors ( inselect ) {	obliterate( document.whatamess.colorpick );	var thismodel = inselect.options[inselect.selectedIndex].value;	var choices = '';	if( thismodel == '1' ) {		choices = 'Bundle:All 6 Colors (Bundle) - Only $30|Black:Black|Grey:Gray|Indigo:Indigo|Grape:Grape|UltraViolet:UltraViolet|Red:Red';	} else if( thismodel == '2') {		choices = 'Bundle:All 6 Colors (Bundle) - Only $30|Black:Black|Grey:Gray|Indigo:Indigo|Grape:Grape|UltraViolet:UltraViolet|Red:Red';	}		buildlist( document.whatamess.colorpick , choices);}	function generate_fields ( inform ) {  var thismodel = inform.modelpick.options[inform.modelpick.selectedIndex].value;  var thiscolor = inform.colorpick.options[inform.colorpick.selectedIndex].value;  var sku       = '';  // a conditional H*A*C*K - array not worth the effort   if( thismodel == '1') {	if (thiscolor == 'Black') { sku = '13897:1,'; }	else if (thiscolor == 'Grey') { sku = '13891:1,'; }	else if (thiscolor == 'Indigo') { sku = '13893:1,'; }	else if (thiscolor == 'Grape') { sku = '13895:1,'; }	else if (thiscolor == 'UltraViolet') { sku = '13894:1,'; }	else if (thiscolor == 'Red') { sku = '13892:1,'; }		else if (thiscolor == 'Bundle') { sku = '15555:1,'; }	   } else if ( thismodel == '2') {	if (thiscolor == 'Black') { sku = '13877:1,'; }	else if (thiscolor == 'Grey') { sku = '13871:1,'; }	else if (thiscolor == 'Indigo') { sku = '13873:1,'; }	else if (thiscolor == 'Grape') { sku = '13875:1,'; }	else if (thiscolor == 'UltraViolet') { sku = '13874:1,'; }	else if (thiscolor == 'Red') { sku = '13872:1,'; }		else if (thiscolor == 'Bundle') { sku = '15554:1,'; }   }		if (inform.add_portectorz.checked == true) {		sku += '13616:1,';	}  inform.ProdList.value = sku;}function handleform ( inform ) { var errmsg = '';// NB: secondary conditional statements below are due to NN 4.x hack if ( inform.colorpick.options[inform.colorpick.selectedIndex].value == '') { errmsg += 'Please Select a color before trying to purchase.'; } if ( errmsg ) { alert (errmsg); return false; } else { generate_fields( inform ); return true; }}