"); sWin.close(); } function searchType(fom,row,lar,rest,cur){ count = 0; prodTypeInfo = fom; var match = false; tWin = parent.frames[2].document tWin.open(); tWin.write(" "+ prodTypeInfo + " "); tWin.write("

"); tWin.write("
Welcome to our shop

"); tWin.write(""); tWin.write("

"); if (row!=0){ tWin.write("You can shop more products for this category by selecting index within this selection box: "); tWin.write(""); tWin.write("There are total "+rest+" items in category "+fom+"."); } tWin.write("
"); prodID=parent.frames[1].prodID; for (var i = 1; i <= prodID.length; i++){ if(prodTypeInfo == prodID[i].type){ indexNum = i; prodID[i].show(tWin,i); match = true; } } tWin.write("



"); tWin.close(); } function product (name,description,image,price,type,link,url){ this.name = name; this.description = description; this.image = image this.price = price; this.type = type; this.show = show; if(url != ""){ this.link = "

" + link + "

"; }else{ this.link = "

"+link+"

"; } } function show(w,prodIndexNum){ w.write("
" + this.name + "
"); w.write("
" + this.description + "
"); if(this.image.length > 1){ w.write(""); } if(this.link != ""){ w.write(this.link); } w.write("
"); //alert(prodIndexNum); orderProd(this,w,prodIndexNum); w.write("


"); // w.write("     "); } function orderProd(obj,win,index){ win.write("
Price per single unit: $" + obj.price); win.write("
Enter quantity: " + ""); win.write("     Total:" + " $      " + ""); win.write("

") count++; } function add(id, oIndex){ var theForm = parent.frames[2].document.forms[id]; productName = prodID[oIndex].name; totalSum =parent.frames[2].document.forms[id].subTotal.value; totalQuanity = parent.frames[2].document.forms[id].q.value; if(totalQuanity == 0){ alert("You entered a quantity of 0!\n We cannot process this order"); parent.frames[2].document.forms[id].q.value = 1; reTotal(id,prodID[oIndex].price); }else{ if( confirm("You are adding " + totalQuanity + " order/s of " + productName + " \n Subtotal: " + totalSum + " to your shopping cart.")){ store(oIndex,totalSum,totalQuanity); }else{ alert("\n\nThis order was not placed in your shopping cart."); } } } function store(o,ts,tq){ orderNum++; order[orderNum] = new cartGoods(o,ts,tq); showTotal = 0; for(var i = 1; i <= orderNum;i++){ showTotal += parseFloat(order[i].totSum); } parent.frames[3].document.forms[0].runningTotal.value = currency(showTotal); } function cartGoods(Indx, totSum, totQ){ this.Indx = prodID[Indx].name; this.totSum = totSum; this.totQ = totQ; } function view(){ vWin = parent.frames[2].document; vWin.open(); vWin.write("

"); if(orderNum != 0){ vWin.write("" + "You Shopping Basket Contents

"); vWin.write("

"); vWin.write(""); for(var i = 1; i <= orderNum; i++){ vWin.write(""); vWin.write(""); vWin.write(""); vWin.write(""); } vWin.write("
Quantity"); vWin.write("Product"); vWin.write("Price"); vWin.write("
"+order[i].totQ+""+order[i].Indx+""+order[i].totSum+""); vWin.write("To remove, please check the box
"); }else{ vWin.write("
" + "
Your shopping cart is empty!
"); if(navigator.appName.indexOf("Netscape") != -1){ vWin.write("
"); } } vWin.write("



"); vWin.close(); } function remove(item){ var newSum = 0; for(var i = item+1; i <= orderNum; i++){ if(item == orderNum){ order[i].Indx = ""; order[i].totSum = 0 ; order[i].totQ = ""; break; }else{ order[i-1].Indx = order[i].Indx; order[i-1].totSum = order[i].totSum; order[i-1].totQ = order[i].totQ; } } orderNum--; for(var i = 1; i <= orderNum;i++){ newSum += parseFloat(order[i].totSum); } parent.frames[3].document.forms[0].runningTotal.value = currency(newSum); view(); } function checkOut(){ if(orderNum != 0){ cWin = parent.frames[2].document; cWin.open(); cWin.write("

"); cWin.write("
Your Shopping Basket
"); grandTotal = 0;parent.frames[3].document.forms[0].elements[2].value=''; // cWin.write(""); cWin.write(""); cWin.write(""); cWin.write(""); cWin.write(""); for(var i = 1; i <= orderNum; i++){ cWin.write(""); cWin.write(""); cWin.write(""); cWin.write(""); grandTotal += parseFloat(order[i].totSum); parent.frames[3].document.forms[0].elements[2].value += "Quantity:" + order[i].totQ; parent.frames[3].document.forms[0].elements[2].value += " " + order[i].Indx;parent.frames[3].document.forms[0].elements[2].value += " at " + currency(order[i].totSum/order[i].totQ) + " |"; } bbq=0; finalSum = currency((grandTotal * 0) + grandTotal); if (finalSum<=0) {alert('The minimun order must be more than $ 0');history.go(-1);bbq=1;} cWin.write(""); cWin.write(""); cWin.write("
QuantityProductPriceTotal Price
"+order[i].totQ+""+order[i].Indx+""+parent.currency(order[i].totSum/order[i].totQ)+""+parent.currency(order[i].totSum)+"
Total:$ " + finalSum + "
"); // cWin.write("

Total: $" + finalSum + " (includes CA tax)"); cWin.write("");//

If this is correct please fill out and submit the form below.
"); cWin.write("If there is an error in your order or something you wish" + " to change, click \"View Cart\" to make the changes.
"); cWin.write("
"); cWin.write("Email:

"); cWin.write("Billing Address :
"); cWin.write("NAME:
"); cWin.write("Street Address:
"); cWin.write("City:
"); cWin.write("State:    "); cWin.write("Zip Code:

"); cWin.write("Telephone:
"); cWin.write("Fax:

"); cWin.write("Shipping Address(Optional) :
"); cWin.write("NAME:
"); cWin.write("Street Address:
"); cWin.write("City:
"); cWin.write("State:    "); cWin.write("Zip Code:

"); cWin.write("Telephone:
"); cWin.write("Fax:
"); cWin.write("Shipping Method:

"); //

"); cWin.write("  "); cWin.write(""); cWin.write("

Download Netscape Here




"); if (bbq==1) {cin.window.close();} else {cWin.close();}; }else{ alert("\n\nYour shopping cart is empty!\n\n"); } } function formData(form){ var formElems = form.elements.length; formSave = new makeArray(formElems-3); for(var i = 1; i <= formElems; i++){ formSave[i] = form.elements[i-1].value; } for(var i = 1; i <= orderNum; i++){ form.elements[21].value += "Quantity:" + order[i].totQ form.elements[21].value += " " + order[i].Indx form.elements[21].value += " at " + order[i].totSum/order[i].totQ + " |" } form.submit(); } function reTotal(c,totalPrice){ if (parent.frames[2].document.forms[c].q.value>=1){ totalPrice = totalPrice * parent.frames[2].document.forms[c].q.value; newTotal = currency(totalPrice) parent.frames[2].document.forms[c].subTotal.value = newTotal;} else {alert('Quantity must be more than 1');parent.frames[2].document.forms[c].q.value=1;} } function shipping(form, fSum){ shipCost = form.shipSelection.options[form.shipSelection.selectedIndex].value; form.finalTot.value =currency( parseFloat(shipCost) + parseFloat(fSum)); } function empty(){ if(orderNum == 0){ alert("\n\nYour cart is already empty!\n\n"); }else{ orderNum = 0; alert("\nYour cart has been emptied!\n"); } } //Insert database file here! //-->