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 = 'Gray:Gray|Fuchsia:Fuchsia|Aqua:Aqua|Green:Green|Grape:Grape|Black:Black|Shagwire:Shagwire';	}	else if ( thissize == '2' ) {		choices = 'Fuchsia:Fuchsia|Indigo:Indigo|Green:Green|Grape:Grape|Shagwire:Shagwire';	}	else if ( thissize == '3' ) {		choices = 'Gray:Gray|Fuchsia:Fuchsia|Green:Green|Grape:Grape|Black:Black|Shagwire:Shagwire';	}	else if ( thissize == '4' ) {		choices = 'Fuchsia:Fuchsia|Indigo:Indigo|Green:Green|Grape:Grape|Shagwire:Shagwire';	}    else if ( thissize == '5' ) {		choices = 'Gray:Gray|Fuchsia:Fuchsia|Indigo:Indigo|Green:Green|Grape:Grape|Black:Black';	}	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 ( thiscolor == 'Gray' )  {  	if (thissize == '1') { inform.ProdId.value = '13521'; }  	if (thissize == '2') { inform.ProdId.value = '13523'; }	if (thissize == '3') { inform.ProdId.value = '13525'; }	if (thissize == '4') { inform.ProdId.value = '13584'; }    if (thissize == '5') { inform.ProdId.value = '13548'; }  }     if ( thiscolor == 'Aqua' )  {  	if (thissize == '1') { inform.ProdId.value = '13522'; }  }    if ( thiscolor == 'Fuchsia' )  {  	if (thissize == '1') { inform.ProdId.value = '13560'; }	if (thissize == '2') { inform.ProdId.value = '13532'; }  	if (thissize == '3') { inform.ProdId.value = '13527'; }  	if (thissize == '4') { inform.ProdId.value = '13585'; }    if (thissize == '5') { inform.ProdId.value = '13549'; }  }   if ( thiscolor == 'Indigo' )  {  	if (thissize == '2') { inform.ProdId.value = '13524'; }  	if (thissize == '3') { inform.ProdId.value = '13526'; }  	if (thissize == '4') { inform.ProdId.value = '13586'; }    if (thissize == '5') { inform.ProdId.value = '13569'; }  }  if ( thiscolor == 'Green' )  {  	if (thissize == '1') { inform.ProdId.value = '13561'; }	if (thissize == '2') { inform.ProdId.value = '13533'; }  	if (thissize == '3') { inform.ProdId.value = '13528'; }  	if (thissize == '4') { inform.ProdId.value = '13587'; }    if (thissize == '5') { inform.ProdId.value = '13703'; }  }  if ( thiscolor == 'Grape' )  {  	if (thissize == '1') { inform.ProdId.value = '13562'; }	if (thissize == '2') { inform.ProdId.value = '13534'; }  	if (thissize == '3') { inform.ProdId.value = '13529'; }  	if (thissize == '4') { inform.ProdId.value = '13588'; }    if (thissize == '5') { inform.ProdId.value = '13704'; }  }  if ( thiscolor == 'Black' )  {  	if (thissize == '1') { inform.ProdId.value = '13563'; }	if (thissize == '2') { inform.ProdId.value = '13535'; }  	if (thissize == '3') { inform.ProdId.value = '13530'; }  	if (thissize == '4') { inform.ProdId.value = '13589'; }    if (thissize == '5') { inform.ProdId.value = '13705'; }  }  if ( thiscolor == 'Shagwire' )  {  	if (thissize == '1') { inform.ProdId.value = '13564'; }	if (thissize == '2') { inform.ProdId.value = '13536'; }  	if (thissize == '3') { inform.ProdId.value = '13531'; }  	if (thissize == '4') { inform.ProdId.value = '13590'; }    if (thissize == '5') { inform.ProdId.value = '13706'; }  }}function handleform ( inform ) { var errmsg = '';  if ( inform.sizepick.selectedIndex < 1 ) { errmsg += '\n   - Size'; } if ( inform.colorpick.selectedIndex < 1 ) { errmsg += '\n   - Color'; }// NB: secondary conditional statements below are due to NN 4.x hack if ( errmsg ) { alert ('Please choose the following before purchasing:' + errmsg); return false; } else { generate_fields( inform ); return true; }}
