// ****Note: Roy; Begin shopping cart functions.**** // ** global variables for the shopping cart.** var itemNum = new Array(); var itemDescr = new Array(); var itemCost = new Array(); var itemQt=new Array(); var extCst=new Array(); // **Function to parse the cookie and extract the ordered ** // **items from the string. This in turn triggers the ** // **writeCart() function to display the shopping cart. ** function itemsOrdered() { if (getCookieData("Scart")) { substr0 = getCookieData("Scart") cLen = substr0.length offset0 = substr0.indexOf("@") counter = substr0.substring(0,offset0) j = 0 for (i=1; i<=counter; i++) { offsetq = eval('offset' + j + ''); substrq = eval('substr' + j + ''); eval('ind' + i + ' = offsetq + 1'); eval('substr' + i + ' = substrq.substring(ind' + i + ',cLen)'); eval('offset' + i + ' = substr' + i + '.indexOf("^")'); eval('item' + i + ' = substr' + i + '.substring(0,offset' + i + ')'); eval('catInd' + i + ' = item' + i + '.indexOf("`")'); eval('itemCat' + i + ' = item' + i + '.substring(0,catInd' + i + ')'); eval('catqt' + i + ' = item' + i + '.indexOf("*")'); eval('qtcat' + i + ' = item' + i + '.substring((catInd'+i+'+1),catqt' + i + ')'); eval('descrInd' + i + ' = item' + i + '.indexOf("~")'); eval('itemDes' + i + ' = item' + i + '.substring((catqt' + i + ' + 1),descrInd' + i + ')'); eval('itemPr' + i + ' = item' + i + '.substring((descrInd' + i + ' + 2),offset' + i + ')'); eval('orderDetail(i,itemCat' + i + ',qtcat' + i + ',itemDes' + i + ',itemPr' + i + ')'); j++ } writeCart(); } } // **Builds an array of the items to load the cart.** function orderDetail(seq,num,qt,descr,cost) { itemNum[seq] = num itemQt[seq] = qt itemDescr[seq] = descr itemCost[seq] = cost } // ** Function to write the shopping cart details ** // ** into the table on the shopping cart page and** // ** create the buyer details input form.** function writeCart() { var ordFrm = '
' // **comment out or delete the next line when formmail.cgi, yform.pl is installed // ordFrm += '