								var
									updateTimer = 0,
									maxK = 1;

								function form_onSubmit() {
									for (k = 0; k < maxK; k++) {
										counter = eval("parseInt(productForm.input" + k + "count.value)");

										if (counter > 0) {
											return true;
										}
									}

									alert("Please select quantity for products to add.");

									return false;
								}
								
								function formUpdate() {
									var
										freeK = -1;

									for (k = 0; k < maxK; k++) {
										counter = eval("parseInt(productForm.input" + k + "count.value)");

										if ((freeK == -1) && !(counter > 0)) {
											freeK = k;
										}

									}

									for (k = 0; k < maxK; k++) {
										if (k != freeK) {
											counter = eval("parseInt(productForm.input" + k + "count.value)");

											if (eval("optionRow" + k + ".style.display") != (counter > 0 ? "block" : "none")) {
												eval("optionRow" + k + '.style.display = "' + (counter > 0 ? "block" : "none") + '";');
											}
										}
									}

									if (freeK != -1) {
										if (eval("optionRow" + freeK + ".style.display") != "block") {
											eval("optionRow" + freeK + '.style.display = "block";');
										}
									}

									updateTimer = 0;
								}
                                                                
								function optionCount_onkeypress() {
									if (updateTimer != 0) {
//										window.clearTimeout(updateTimer);
									}

//									updateTimer = window.setTimeout("formUpdate()", 500)
								}

								if (options.length < 1) {
									maxK = 1;
								}

								for (k = 0; k < maxK; k++) {
									document.write("<tr><td><table awidth=100% border=0 cellspacing=1 cellpadding=0 id=optionRow" + k + (k > 0 ? ' style="display:none"' : "") + ">");

									for (i = 0; i < options.length; i++) {
										option = options[i];

										if (i > 0) {
											document.write("<tr><td colspan=2 height=1><img src=images/common/pixel-blank.gif width=1 height=1></td></tr>");
										}
										document.write("<tr><td valign=top><nobr>" + option[0] + ":&nbsp;&nbsp;</nobr></td><td width=100% valign=top>");
						
										if (option[1] == 2) {
											for (j = 0; j < option[2].length; j++) {
												optionValue = option[2][j];
												//document.write("<div><input type=checkbox value=1 name=option" + k + "_" + optionValue[0] + " id=option" + k + "_" + i + "_" + j + "><label for=option" + k + "_" + i + "_" + j + "> " + optionValue[1] + "</label></div>");
												document.write('<DIV><INPUT type="checkbox" value="1" name="option' + k + '_' + i + '_' + optionValue[0] + '" id="option' + k + '_' + i + '_' + j + '"><LABEL for="option' + k + '_' + i + '_' + j + '"> ' + optionValue[1] + '</LABEL></DIV>');
											}
										} else {
											document.write("<select size=1 name=option" + k + "_" + i + ">" + (option[1] == 0 ? '<option value="" selected> </option>' : ""));

											for (j = 0; j < option[2].length; j++) {
												optionValue = option[2][j];
												document.write("<option value=" + optionValue[0] + ">&nbsp;" + optionValue[1] + " &nbsp;</option>");
											}

											document.write("</select>");
										}

										document.write("</td></tr>");
									}

									document.write("<tr><td colspan=2 height=1><img src=images/common/pixel-blank.gif width=1 height=1></td></tr>");
									document.write("<!--<tr><td><nobr>Special Instructions: &nbsp;</nobr></td><td width=100%><input type=text size=15 name=option" + k + "special></td></tr>--><tr><td colspan=2 height=1><img src=images/common/pixel-blank.gif width=1 height=1></td></tr><tr><td>Quantity: &nbsp;</td><td><input name=input" + k + "count id=input" + k + "count onkeyup=\"optionCount_onkeypress()\" type=text size=3 maxlength=4 value=1></td></tr></table></td></tr>");
								}

