function obliterate ( inselect ) { if ( inselect.options.length > 1 ) {  while ( inselect.length > 1 ) { inselect.options[1] = null; }  inselect.selectedIndex = 0;} }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 handlesize ( inselect ) {	obliterate( document.whatamess.colorpick );	var thissize = inselect.options[inselect.selectedIndex].value;	var choices = '';	if ( thissize == '1' ) {		choices = '1:Black + Gray';	} else if ( thissize == '2' ) {		choices = '3:Brown + Pink';	}		buildlist( document.whatamess.colorpick,choices);} function resetfields (  ) {  document.whatamess.sizepick.selectedIndex = 0;  document.whatamess.colorpick.selectedIndex = 0;}function generate_fields ( inform ) {  var thiscolor = inform.colorpick.options[inform.colorpick.selectedIndex].value;  var thissize  = inform.sizepick.options[inform.sizepick.selectedIndex].value;  var sku       = '';  // a conditional H*A*C*K - array not worth the effort	if(thissize == '2'){		if(thiscolor == '2'){ sku = '13-786';} // Red+Red		if(thiscolor == '3'){ sku = '13-782';} // Brown+Pink			}else if(thissize == '1'){		if(thiscolor == '1'){ sku = '13-787';} // Black+Gray		else if(thiscolor == '2'){ sku = '13-792';} // Red+Red		else if(thiscolor == '3'){ sku = '13-788';} // Brown+Pink	}  inform.ProdId.value = sku;}function handleform ( inform ) { var errmsg = ''; if ( inform.colorpick.selectedIndex < 1 ) { errmsg += '\n   - Color'; }// NB: secondary conditional statements below are due to NN 4.x hack if ( ( inform.sizepick.selectedIndex < 1 ) || ( inform.colorpick.options[inform.colorpick.selectedIndex].value == '' ) ) { errmsg += '\n   - Size'; } if ( errmsg ) { alert ('Please choose the following before purchasing:' + errmsg); return false; } else { generate_fields( inform ); return true; }}
