<HTML> //Shopping cart library functions //Suzanne Stagel //Foothill College-Summer 1999 //COIN 70-JavaScript //----------------- //Global Variables //----------------- var today = new Date(); var exp = new Date(); //Define cookie expiration exp.setTime(today.getTime() + 1000*60*60*24*365); //--------- //getCookie //--------- // //Parameters: name of the cookie to retrieve //Functionality: returns the value of the cookie with the specified name // function getCookie(Name) { var search = Name + "="; if (document.cookie.length > 0) { //if there are any cookies offset = document.cookie.indexOf(search) if (offset != -1) { // if cookie exists offset += search.length; //set index of beginning of value end = document.cookie.indexOf(";", offset); // set index of end of cookie value if (end == -1) end = document.cookie.length; return unescape(document.cookie.substring(offset, end)); } } } //------------------ //initializeCookies //------------------ // //Parameters: None //Functionality: initializes cookie value for each product to 0 and sets the cookies // on the user's machine // //Note: A maximum of 20 distinct products can be accomodated in the shopping cart // because this implementation is limited by the number of cookies that a // browser will allow a domain to set (this includes items added and later deleted // from the cart) // // Alert statements that are commented out are for debugging purposes only. // function initializeCookies() { //Variables var cookieValue = -1; var defaultQty = 0; //Define cookie expiration var today = new Date(); var exp = new Date(); exp.setTime(today.getTime() + 1000*60*60*24*365); // //Set initial cookies for Tomatoes // cookieValue = getCookie("brandywine"); if ( cookieValue != null ) { // alert("Cookie brandywine exists, original value: " + cookieValue); } else { setCookie("brandywine",defaultQty,exp); // alert("New cookie brandywine added with value of value: " + getCookie("brandywine")); } cookieValue = getCookie("earlyGirl"); if ( cookieValue != null ) { // alert("Cookie earlyGirl exists, original value: " + cookieValue); } else { setCookie("earlyGirl",defaultQty,exp); // alert("New cookie earlyGirl added with value of value: " + getCookie("earlyGirl")); } cookieValue = getCookie("cherokeePurple"); if ( cookieValue != null ) { // alert("Cookie cherokeePurple exists, original value: " + cookieValue); } else { setCookie("cherokeePurple",defaultQty,exp); // alert("New cookie cherokeePurple added with value of value: " + getCookie("cherokeePurple")); } cookieValue = getCookie("chadwickCherry"); if ( cookieValue != null ) { // alert("Cookie chadwickCherry exists, original value: " + cookieValue); } else { setCookie("chadwickCherry",defaultQty,exp); // alert("New cookie chadwickCherry added with value of value: " + getCookie("chadwickCherry")); } // //Set initial cookies for Watermelons // cookieValue = getCookie("yellowMoon"); if ( cookieValue != null ) { // alert("Cookie yellowMoon exists, original value: " + cookieValue); } else { setCookie("yellowMoon",defaultQty,exp); // alert("New cookie yellowMoon added with value of value: " + getCookie("yellowMoon")); } cookieValue = getCookie("moonbeam"); if ( cookieValue != null ) { // alert("Cookie moonbeam exists, original value: " + cookieValue); } else { setCookie("moonbeam",defaultQty,exp); // alert("New cookie moonbeam added with value of value: " + getCookie("moonbeam")); } // //Set initial cookies for Veggies // cookieValue = getCookie("carrot"); if ( cookieValue != null ) { // alert("Cookie carrot exists, original value: " + cookieValue); } else { setCookie("carrot",defaultQty,exp); // alert("New cookie carrot added with value of value: " + getCookie("carrot")); } cookieValue = getCookie("fourLettuce"); if ( cookieValue != null ) { // alert("Cookie fourLettuce exists, original value: " + cookieValue); } else { setCookie("fourLettuce",defaultQty,exp); // alert("New cookie fourLettuce added with value of value: " + getCookie("fourLettuce")); } cookieValue = getCookie("redLettuce"); if ( cookieValue != null ) { // alert("Cookie redLettuce exists, original value: " + cookieValue); } else { setCookie("redLettuce",defaultQty,exp); // alert("New cookie redLettuce added with value of value: " + getCookie("redLettuce")); } cookieValue = getCookie("peas"); if ( cookieValue != null ) { // alert("Cookie peas exists, original value: " + cookieValue); } else { setCookie("peas",defaultQty,exp); // alert("New cookie peas added with value of value: " + getCookie("peas")); } cookieValue = getCookie("peas"); if ( cookieValue != null ) { // alert("Cookie peas exists, original value: " + cookieValue); } else { setCookie("peas",defaultQty,exp); // alert("New cookie peas added with value of value: " + getCookie("peas")); } cookieValue = getCookie("corn"); if ( cookieValue != null ) { // alert("Cookie corn exists, original value: " + cookieValue); } else { setCookie("corn",defaultQty,exp); // alert("New cookie corn added with value of value: " + getCookie("corn")); } } //end initializeCookies //----------- //listCookies //----------- // //Parameters: None //Functionality: lists the values of all the cookies set by the site (in the form of dialog alert boxes) // //Note: This function is used for debugging purposes only. // function listCookies() { //Tomatoes alert("earlyGirl: " + getCookie("earlyGirl")); alert("brandywine: " + getCookie("brandywine")); alert("cherokeePurple: " + getCookie("cherokeePurple")); alert("chadwickCherry: " + getCookie("chadwickCherry")); //Watermelons alert("yellowMoon: " + getCookie("yellowMoon")); alert("moonbeam: " + getCookie("moonbeam")); //Veggies alert("carrot: " + getCookie("carrot")); alert("fourLettuce: " + getCookie("fourLettuce")); alert("redLettuce: " + getCookie("redLettuce")); alert("peas: " + getCookie("peas")); alert("corn: " + getCookie("corn")); alert("listCookies completed"); } //end listCookies //--------- //setCookie //--------- // //Parameters: name (of the cookie), value (of the cookie), expiration date of the cookie (optional) //Functionality: Sets a cookie on the user's machine. // function setCookie(name, value, expire) { document.cookie = name + "=" + escape(value) + ((expire == null) ? "" : ("; expires=" + expire.toGMTString())) } //setCookie //--------- //addToCart //--------- // //Parameters: item (name of the cookie) //Functionality: "adds" the item to the shopping cart by incrementing the value of the cookie // by 1 and calling the updateCart() function to dynamically update the cartFrame's HTML // //Note: Alert statements that are commented out are for debugging purposes only. // function addToCart(item) { var cookieName = item; var cookieValue = -1; var newQuantity = 0; //check for existing cookie for this item //if exists, overwrite (adding 1), otherwise create cookie with value of 1 cookieValue = getCookie(item); if ( cookieValue != null ) { // alert(item + "cookie exists, original value: " + cookieValue); newQuantity = Number(cookieValue) + 1; } else { newQuantity = 1; } setCookie(item,newQuantity,exp); //For debugging only // cookieValue = getCookie(item); // alert("New cookie value for " + item + " is: " + cookieValue); //update shopping cart display updateCart(); } //addToCart //---------- //deleteItem //---------- // //Parameters: item (name of the cookie) //Functionality: "deletes" the item from the shopping cart by setting the value of the cookie // to 0 and calling the updateCart() function to dynamically update the cartFrame's HTML // //Note: Alert statements that are commented out are for debugging purposes only. // function deleteItem(item) { var cookieName = item; var cookieValue = -1; var newQuantity = 0; cookieValue = getCookie(item); if ( cookieValue != null ) { //For debugging only // alert("Deleting existing item " + item + " with a quantity of " + cookieValue + " from cart"); } else { alert("Error in deleteItem(): Trying to delete an item not in the shopping cart"); } setCookie(item,newQuantity,exp); //update shopping cart display updateCart(); //For debugging only // alert(item + " value is now " + getCookie(item)); } //deleteItem //----------- //subtractOne //----------- // //Parameters: item (name of the cookie) //Functionality: subtracts one "item" from the shopping cart by decrementing the value of the cookie // by 1 and calling the updateCart() function to dynamically update the cartFrame's HTML // //Note: Alert statements that are commented out are for debugging purposes only. // function subtractOne(item) { var cookieName = item; var cookieValue = 0; var newQuantity = 0; //check for existing cookie for this item //if exists, overwrite (subtracting 1), otherwise display error alert cookieValue = getCookie(item); if ( cookieValue != null ) { if (cookieValue > 0) { // alert(item + "cookie exists, original value: " + cookieValue); //For debugging only newQuantity = Number(cookieValue) - 1; setCookie(item,newQuantity,exp); } else { alert("Error in subtractOne(): Trying to subtract from an item with a quantity <= 0"); } } else { alert("Error in subtractOne(): Trying to subtract from an item not in the shopping cart"); } //For debugging only // cookieValue = getCookie(item); // alert("New cookie value for " + item + " is: " + cookieValue); //update shopping cart display updateCart(); } //subtractOne //--------------- //updateQuantity //--------------- // //Parameters: item (name of the cookie), quantity (new quantity in shopping cart) //Functionality: updates the quantity of "item" in the shopping cart by setting // its value to "quantity" and calling the updateCart() function to dynamically update the cartFrame's HTML // //Note: Alert statements that are commented out are for debugging purposes only. // function updateQuantity(item,quantity) { var cookieName = item; var cookieValue = 0; //check for existing cookie for this item //if exists, overwrite (with quantity passed in), otherwise display error alert cookieValue = getCookie(item); if ( cookieValue != null ) { // alert(item + "cookie exists, original value: " + cookieValue); //For debugging only newQuantity = quantity; setCookie(item,quantity,exp); } else { alert("Error in updateQuantity(): Trying to update from an item not in the shopping cart"); } //For debugging only // cookieValue = getCookie(item); // alert("New cookie value for " + item + " is: " + cookieValue); //update shopping cart display updateCart(); } //updateQuantity //---------- //updateCart //---------- // //Parameters: None //Functionality: dynamically creates new HTML for cartFrame based on the cookie values set // for each product. // //Note: Alert statements that are commented out are for debugging purposes only. // function updateCart() { var cartHTML="<H1>Error in updateCart()</H1>"; var beginCartHTML; //contains the initial section of HTML for the cart frame var endCartHTML; //contains the initial section of HTML for the cart frame var midCartHTML = ""; //contains the HTML with the individual products and quantites var s1 = "<SCRIPT language='JavaScript' src='javascript/cart.js'>"; //used to try to overcome the var s2 = "</SCRIPT>"; //problem with the SCRIPT tags being stripped out var rowHTML = ""; var cookieValue = 0; var totalHTML = "$0.00"; var orderTotal = 0.00; beginCartHTML = "<HTML>" + s1 + s2 + " <!-- ARCHIVE by FORTUNECITY.ws --> <HEAD> \ <TITLE>Shopping Cart \ </TITLE>" + s1 + s2 + "<LINK rel='stylesheet' type='text/css' href='style.css'>\ <STYLE></STYLE>\ </HEAD>\ <BODY text='yellow' link='#215E21' vlink='black'><script> (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){ (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o), m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m) })(window,document,'script','//www.google-analytics.com/analytics.js','ga'); ga('create', 'UA-47423994-1', 'fortunecity.ws'); ga('send', 'pageview'); </script> <center> <br> <div> <script language="javascript" type="text/javascript" src="http://ad.broadcaststation.net/ads/show_ad.php?width=728&height=90"></script> </div> </center> <center> <br> <div style="height:5px"></div> </center> \ <CENTER><H3>Shopping Cart</H3></CENTER>\ <FORM name='cart' method='POST' action='http://www.best.com/~fmrfreek/CGI/synergSeeds.cgi' onSubmit='return validate(cart)'>\ <TABLE cols=5>"; endCartHTML= "<CENTER><INPUT type=submit value='Checkout'></CENTER>\ </FORM>\ </BODY>\ <!-- ARCHIVE by FORTUNECITY.ws --> <center> <div> <br> <script language="javascript" type="text/javascript" src="http://ad.broadcaststation.net/ads/show_ad.php?width=300&height=250&cache=0"></script> <script language="javascript" type="text/javascript" src="http://ad.broadcaststation.net/ads/show_ad.php?width=300&height=250"></script> </div> <br> <br> </center> </HTML>"; // //Tomatoes // //brandywine cookieValue = getCookie("brandywine"); orderTotal = orderTotal + (cookieValue * 1.79); name = "brandywine"; if ( (cookieValue != null) && (cookieValue > 0) ) { rowHTML = "<TR><TD><INPUT type=text name='brandywine' value=" + cookieValue + " size=3 onChange='parent.frames[1].updateQuantity(this.name,this.value)'></TD>\ <TD>Brandywine tomatoes</TD>\ <TD>$1.79 each</TD>\ <TD><INPUT type=button value=' + ' onClick='parent.frames[1].addToCart(\"brandywine\")'></TD>\ <TD><INPUT type=button value=' - ' onClick='parent.frames[1].subtractOne(\"brandywine\")'></TD>\ <TD><A HREF='javascript:parent.frames[1].deleteItem(\"brandywine\");'><IMAGE SRC='trash.gif'</A></TD>\ </TR>" midCartHTML = rowHTML; } //end if //earlyGirl cookieValue = getCookie("earlyGirl"); orderTotal = orderTotal + (cookieValue * .99); name = "earlyGirl"; if ( (cookieValue != null) && (cookieValue > 0) ) { rowHTML = "<TR><TD><INPUT type=text name='earlyGirl' value=" + cookieValue + " size=3 onChange='parent.frames[1].updateQuantity(this.name,this.value)'></TD>\ <TD>Early Girl tomatoes</TD>\ <TD>$.99 each</TD>\ <TD><INPUT type=button name='plus' value=' + ' onClick='parent.frames[1].addToCart(\"earlyGirl\")'></TD>\ <TD><INPUT type=button name='minus' value=' - ' onClick='parent.frames[1].subtractOne(\"earlyGirl\")'></TD>\ <TD><A HREF='javascript:parent.frames[1].deleteItem(\"earlyGirl\");'><IMAGE SRC='trash.gif'</A></TD>\ </TR>" midCartHTML = midCartHTML + rowHTML; } //end if //cherokeePurple cookieValue = getCookie("cherokeePurple"); orderTotal = orderTotal + (cookieValue * 1.99); name = "cherokeePurple"; if ( (cookieValue != null) && (cookieValue > 0) ) { rowHTML = "<TR><TD><INPUT type=text name='cherokeePurple' value=" + cookieValue + " size=3 onChange='parent.frames[1].updateQuantity(this.name,this.value)'></TD>\ <TD>Cherokee Purple tomatoes</TD>\ <TD>$1.99 each</TD>\ <TD><INPUT type=button name= 'plus' value=' + ' onClick='parent.frames[1].addToCart(\"cherokeePurple\")'></TD>\ <TD><INPUT type=button name='minus' value=' - ' onClick='parent.frames[1].subtractOne(\"cherokeePurple\")'></TD>\ <TD><A HREF='javascript:parent.frames[1].deleteItem(\"cherokeePurple\");'><IMAGE SRC='trash.gif'</A></TD>\ </TR>" midCartHTML = midCartHTML + rowHTML; } //end if //chadwickCherry cookieValue = getCookie("chadwickCherry"); orderTotal = orderTotal + (cookieValue * 1.29); name = "chadwickCherry"; if ( (cookieValue != null) && (cookieValue > 0) ) { rowHTML = "<TR><TD><INPUT type=text name='chadwickCherry' value=" + cookieValue + " size=3 onChange='parent.frames[1].updateQuantity(this.name,this.value)'></TD>\ <TD>Chadwick Cherry tomatoes</TD>\ <TD>$1.29 each</TD>\ <TD><INPUT type=button name='plus' value=' + ' onClick='parent.frames[1].addToCart(\"chadwickCherry\")'></TD>\ <TD><INPUT type=button name='minus' value=' - ' onClick='parent.frames[1].subtractOne(\"chadwickCherry\")'></TD>\ <TD><A HREF='javascript:parent.frames[1].deleteItem(\"chadwickCherry\");'><IMAGE SRC='trash.gif'</A></TD>\ </TR>" midCartHTML = midCartHTML + rowHTML; } //end if // //Watermelons // //yellowMoon cookieValue = getCookie("yellowMoon"); orderTotal = orderTotal + (cookieValue * 1.89); name = "yellowMoon"; if ( (cookieValue != null) && (cookieValue > 0) ) { rowHTML = "<TR><TD><INPUT type=text name='yellowMoon' value=" + cookieValue + " size=3 onChange='parent.frames[1].updateQuantity(this.name,this.value)'></TD>\ <TD>Yellow Moon watermelons</TD>\ <TD>$1.89 each</TD>\ <TD><INPUT type=button name='plus' value=' + ' onClick='parent.frames[1].addToCart(\"yellowMoon\")'></TD>\ <TD><INPUT type=button name='minus' value=' - ' onClick='parent.frames[1].subtractOne(\"yellowMoon\")'></TD>\ <TD><A HREF='javascript:parent.frames[1].deleteItem(\"yellowMoon\");'><IMAGE SRC='trash.gif'</A></TD>\ </TR>" midCartHTML = midCartHTML + rowHTML; } //end if //moonbeam cookieValue = getCookie("moonbeam"); orderTotal = orderTotal + (cookieValue * 1.19); name = "moonbeam"; if ( (cookieValue != null) && (cookieValue > 0) ) { rowHTML = "<TR><TD><INPUT type=text name='moonbeam' value=" + cookieValue + " size=3 onChange='parent.frames[1].updateQuantity(this.name,this.value)'></TD>\ <TD>Moonbeam watermelons</TD>\ <TD>$1.19 each</TD>\ <TD><INPUT type=button name='plus' value=' + ' onClick='parent.frames[1].addToCart(\"moonbeam\")'></TD>\ <TD><INPUT type=button name='minus' value=' - ' onClick='parent.frames[1].subtractOne(\"moonbeam\")'></TD>\ <TD><A HREF='javascript:parent.frames[1].deleteItem(\"moonbeam\");'><IMAGE SRC='trash.gif'</A></TD>\ </TR>" midCartHTML = midCartHTML + rowHTML; } //end if // //Vegetables // //carrot cookieValue = getCookie("carrot"); orderTotal = orderTotal + (cookieValue * .79); name = "carrot"; if ( (cookieValue != null) && (cookieValue > 0) ) { rowHTML = "<TR><TD><INPUT type=text name='carrot' value=" + cookieValue + " size=3 onChange='parent.frames[1].updateQuantity(this.name,this.value)'></TD>\ <TD>Scarlet Nantes carrots</TD>\ <TD>$.79 each</TD>\ <TD><INPUT type=button name='plus' value=' + ' onClick='parent.frames[1].addToCart(\"carrot\")'></TD>\ <TD><INPUT type=button name='minus' value=' - ' onClick='parent.frames[1].subtractOne(\"carrot\")'></TD>\ <TD><A HREF='javascript:parent.frames[1].deleteItem(\"carrot\");'><IMAGE SRC='trash.gif'</A></TD>\ </TR>" midCartHTML = midCartHTML + rowHTML; } //end if //fourLettuce cookieValue = getCookie("fourLettuce"); orderTotal = orderTotal + (cookieValue * 1.49); name = "fourLettuce"; if ( (cookieValue != null) && (cookieValue > 0) ) { rowHTML = "<TR><TD><INPUT type=text name='fourLettuce' value=" + cookieValue + " size=3 onChange='parent.frames[1].updateQuantity(this.name,this.value)'></TD>\ <TD>Four Seasons lettuce</TD>\ <TD>$1.49 each</TD>\ <TD><INPUT type=button name='plus' value=' + ' onClick='parent.frames[1].addToCart(\"fourLettuce\")'></TD>\ <TD><INPUT type=button name='minus' value=' - ' onClick='parent.frames[1].subtractOne(\"fourLettuce\")'></TD>\ <TD><A HREF='javascript:parent.frames[1].deleteItem(\"fourLettuce\");'><IMAGE SRC='trash.gif'</A></TD>\ </TR>" midCartHTML = midCartHTML + rowHTML; } //end if //redLettuce cookieValue = getCookie("redLettuce"); orderTotal = orderTotal + (cookieValue * 1.89); name = "redLettuce"; if ( (cookieValue != null) && (cookieValue > 0) ) { rowHTML = "<TR><TD><INPUT type=text name='redLettuce' value=" + cookieValue + " size=3 onChange='parent.frames[1].updateQuantity(this.name,this.value)'></TD>\ <TD>Ruben's Red lettuce</TD>\ <TD>$1.89 each</TD>\ <TD><INPUT type=button name='plus' value=' + ' onClick='parent.frames[1].addToCart(\"redLettuce\")'></TD>\ <TD><INPUT type=button name='minus' value=' - ' onClick='parent.frames[1].subtractOne(\"redLettuce\")'></TD>\ <TD><A HREF='javascript:parent.frames[1].deleteItem(\"redLettuce\");'><IMAGE SRC='trash.gif'</A></TD>\ </TR>" midCartHTML = midCartHTML + rowHTML; } //end if //peas cookieValue = getCookie("peas"); orderTotal = orderTotal + (cookieValue * 1.29); name = "peas"; if ( (cookieValue != null) && (cookieValue > 0) ) { rowHTML = "<TR><TD><INPUT type=text name='peas' value=" + cookieValue + " size=3 onChange='parent.frames[1].updateQuantity(this.name,this.value)'></TD>\ <TD>unSnap peas</TD>\ <TD>$1.29 each</TD>\ <TD><INPUT type=button name='plus' value=' + ' onClick='parent.frames[1].addToCart(\"peas\")'></TD>\ <TD><INPUT type=button name='minus' value=' - ' onClick='parent.frames[1].subtractOne(\"peas\")'></TD>\ <TD><A HREF='javascript:parent.frames[1].deleteItem(\"peas\");'><IMAGE SRC='trash.gif'</A></TD>\ </TR>" midCartHTML = midCartHTML + rowHTML; } //end if //corn cookieValue = getCookie("corn"); orderTotal = orderTotal + (cookieValue * .69); name = "corn"; if ( (cookieValue != null) && (cookieValue > 0) ) { rowHTML = "<TR><TD><INPUT type=text name='corn' value=" + cookieValue + " size=3 onChange='parent.frames[1].updateQuantity(this.name,this.value)'></TD>\ <TD>Golden Bantam corn</TD>\ <TD>$.69 each</TD>\ <TD><INPUT type=button name='plus' value=' + ' onClick='parent.frames[1].addToCart(\"corn\")'></TD>\ <TD><INPUT type=button name='minus' value=' - ' onClick='parent.frames[1].subtractOne(\"corn\")'></TD>\ <TD><A HREF='javascript:parent.frames[1].deleteItem(\"corn\");'><IMAGE SRC='trash.gif'</A></TD>\ </TR>" midCartHTML = midCartHTML + rowHTML; } //end if "<CENTER>Total $<INPUT type=text value=formatNumber(orderTotal,2)></CENTER>" totalHTML = "<BR><CENTER>Total $" + formatNumber(orderTotal,2) + "</CENTER><BR>"; // //Define the full contents of the shopping cart HTML frame and reload the frame // cartHTML = beginCartHTML + midCartHTML + "</TABLE>" + totalHTML + endCartHTML; //For debugging only // alert(cartHTML); parent.frames.cartFrame.document.writeln(cartHTML); parent.frames.cartFrame.document.close(); parent.frames.frames[1].focus(); } //updateCart //------------ //formatNumber //------------ // //Parameters: expr (floating point number), decplaces (number of decimal places to display) //Functionality: returns the specified floating point with the specified number of decimal places // function formatNumber(expr,decplaces) { var str = "" + Math.round(eval(expr) * Math.pow(10,decplaces)); while (str.length <= decplaces) { str = "0" + str; } var decpoint = str.length - decplaces; return str.substring(0,decpoint) + "." + str.substring(decpoint,str.length); } //formatNumber //-------- //checkout //-------- // //Parameters: None. //Functionality: opens the payments page (customer.html) // //Note: This function is not used. // function checkout() { } //checkout //------------ //resetCookies //------------ // //Parameters: None. //Functionality: resets cookie values for each product to 0 // function resetCookies() { var defaultQty = 0; //Define cookie expiration var today = new Date(); var exp = new Date(); exp.setTime(today.getTime() + 1000*60*60*24*365); setCookie("brandywine",defaultQty,exp); setCookie("earlyGirl",defaultQty,exp); setCookie("cherokeePurple",defaultQty,exp); setCookie("chadwickCherry",defaultQty,exp); setCookie("yellowMoon",defaultQty,exp); setCookie("moonbeam",defaultQty,exp); setCookie("carrot",defaultQty,exp); setCookie("fourLettuce",defaultQty,exp); setCookie("redLettuce",defaultQty,exp); setCookie("peas",defaultQty,exp); setCookie("peas",defaultQty,exp); setCookie("corn",defaultQty,exp); } //resetCookies <!-- ARCHIVE by FORTUNECITY.ws --> <center> <div> <br> <script language="javascript" type="text/javascript" src="http://ad.broadcaststation.net/ads/show_ad.php?width=300&height=250&cache=0"></script> <script language="javascript" type="text/javascript" src="http://ad.broadcaststation.net/ads/show_ad.php?width=300&height=250"></script> </div> <br> <br> </center> </HTML>