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 == '1c' ) {		choices = 'Gray:Gray - iMac Logo|Aqua:Aqua - iMac Logo';	}	else if ( thissize == '1a' ) {		choices = 'Gray:Gray - iMac Logo|Aqua:Aqua - iMac Logo|Shagwire:Shagwire';	}	else if ( thissize == '1b' ) {		choices = 'Gray:Gray - iMac Logo|Aqua:Aqua - iMac Logo';	}	else if (thissize == '2a' ) {		choices = 'Gray:Gray|Aqua:Aqua|Shagwire:Shagwire';	}	else if (thissize == '2b' ) {		choices = 'Gray:Gray|Fuchsia:Fuchsia|Indigo:Indigo|Green:Green|Grape:Grape|Black:Black|Shagwire:Shagwire';	}	else if (thissize == '2c' ) {		choices = 'Gray:Gray|Fuchsia:Fuchsia|Indigo:Indigo|Green:Green|Grape:Grape|Black:Black|Shagwire:Shagwire';	}	else if (thissize == '2d' ) {		choices = 'Gray:Gray|Fuchsia:Fuchsia|Indigo:Indigo|Green:Green|Grape:Grape|Black:Black|Shagwire:Shagwire';	}	else if (thissize == '2e' ) {		choices = 'Gray:Gray|Fuchsia:Fuchsia|Indigo:Indigo|Green:Green|Grape:Grape|Black:Black|Shagwire:Shagwire';	}
    else if (thissize == '2f' ) {
		choices = 'Gray:Gray|Fuchsia:Fuchsia|Indigo:Indigo|Green:Green|Grape:Grape|Black:Black|Shagwire:Shagwire';
	}
    else if (thissize == '2g' ) {
		choices = 'Gray:Gray|Fuchsia:Fuchsia|Indigo:Indigo|Green:Green|Grape:Grape|Black:Black|Shagwire:Shagwire';
	}	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 == '1a') { inform.ProdId.value = '13501'; }  	if (thissize == '1b') { inform.ProdId.value = '13502'; }	if (thissize == '1c') { inform.ProdId.value = '13507'; }		if (thissize == '2a') { inform.ProdId.value = '13511'; }	if (thissize == '2b') { inform.ProdId.value = '13512'; }	if (thissize == '2c') { inform.ProdId.value = '13541'; }	if (thissize == '2d') { inform.ProdId.value = '13570'; }	if (thissize == '2e') { inform.ProdId.value = '13577'; }
    if (thissize == '2f') { inform.ProdId.value = '13510'; }
    if (thissize == '2g') { inform.ProdId.value = '13539'; }  }     if ( thiscolor == 'Aqua' )  {  	if (thissize == '1a') { inform.ProdId.value = '13503'; }  	if (thissize == '1b') { inform.ProdId.value = '13504'; }	if (thissize == '1c') { inform.ProdId.value = '13508'; }		if (thissize == '2a') { inform.ProdId.value = '13513'; }  }	   if ( thiscolor == 'Shagwire' )  {  	if (thissize == '1a') { inform.ProdId.value = '13505'; }  	if (thissize == '1c') { inform.ProdId.value = '13509'; }		if (thissize == '2a') { inform.ProdId.value = '13515'; }	if (thissize == '2b') { inform.ProdId.value = '13516'; }	if (thissize == '2c') { inform.ProdId.value = '13547'; }	if (thissize == '2d') { inform.ProdId.value = '13576'; }	if (thissize == '2e') { inform.ProdId.value = '13583'; }
    if (thissize == '2f') { inform.ProdId.value = '13538'; }
    if (thissize == '2g') { inform.ProdId.value = '13595'; }  }    if ( thiscolor == 'Black' )  {  	if (thissize == '2b') { inform.ProdId.value = '13568'; }	if (thissize == '2c') { inform.ProdId.value = '13546'; }	if (thissize == '2d') { inform.ProdId.value = '13575'; }	if (thissize == '2e') { inform.ProdId.value = '13582'; }
    if (thissize == '2f') { inform.ProdId.value = '13537'; }
    if (thissize == '2g') { inform.ProdId.value = '13594'; }  }    	if ( thiscolor == 'Indigo' )  {	if (thissize == '2b') { inform.ProdId.value = '13514'; }  	if (thissize == '2c') { inform.ProdId.value = '13543'; }	if (thissize == '2d') { inform.ProdId.value = '13572'; }	if (thissize == '2e') { inform.ProdId.value = '13579'; }
    if (thissize == '2f') { inform.ProdId.value = '13518'; }
    if (thissize == '2g') { inform.ProdId.value = '13591'; }  }    	if ( thiscolor == 'Green' )  {	if (thissize == '2b') { inform.ProdId.value = '13566'; }  	if (thissize == '2c') { inform.ProdId.value = '13544'; }	if (thissize == '2d') { inform.ProdId.value = '13573'; }	if (thissize == '2e') { inform.ProdId.value = '13580'; }
    if (thissize == '2f') { inform.ProdId.value = '13519'; }
    if (thissize == '2g') { inform.ProdId.value = '13592'; }  }    	if ( thiscolor == 'Grape' )  {	if (thissize == '2b') { inform.ProdId.value = '13567'; }  	if (thissize == '2c') { inform.ProdId.value = '13545'; }	if (thissize == '2d') { inform.ProdId.value = '13574'; }	if (thissize == '2e') { inform.ProdId.value = '13581'; }
    if (thissize == '2f') { inform.ProdId.value = '13520'; }
    if (thissize == '2g') { inform.ProdId.value = '13593'; }  }    	if ( thiscolor == 'Fuchsia' )  {	if (thissize == '2b') { inform.ProdId.value = '13565'; }  	if (thissize == '2c') { inform.ProdId.value = '13542'; }	if (thissize == '2d') { inform.ProdId.value = '13571'; }	if (thissize == '2e') { inform.ProdId.value = '13578'; }
    if (thissize == '2f') { inform.ProdId.value = '13517'; }
    if (thissize == '2g') { inform.ProdId.value = '13540'; }  }}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; }}