var total_entries = 0; var total_ccost = 0; var total_kcost = 0; var total_bcost = 0; var total_rcost = 0; var total_wcost = 0; var total_cars = 0; var total_cars_kits = 0; var total_racers = 0; var total_wheels = 0; var total_books = 0; var total_cars_dsply = 0; var total_cars_kits_dsply = 0; var total_racers_dsply = 0; var total_wheels_dsply = 0; var total_books_dsply = 0; var curAcc = 0; var chsprice = 10; var fullname = ""; var fulladdress = ""; var emailaddr = ""; var slctn = new Array(100); var prop1 = new Array(100); var cnt = new Array(100); var cost = new Array(100); var chs = new Array(100); var rcr = new Array(100); var prcof = new Array(100); var compactform = new String(); var mailtoindex = -1; var cksw = false; skipcoloradj = "false"; function ConfirmEmail() { if (document.order.emailtxt.value <= ">") { alert ("Email address required to e-mail form."); return false; } return true; } function SetScreenAsp(cardesc) { StartOffRemote(cardesc); AdjustPropsRemote(); cartext = GetCarText(cardesc); document.order.namex.value = cartext.substring(5,cartext.length); } function SetScreenAspSpec(cardesc) { StartOffRemote(cardesc); AdjustPropsRemote(); } function AdJustSubButtonType(sw) { document.order.subswitch.value = sw; } function SetScreen_not_used(sw) { param = unescape(window.location.href); chkchar = 0; while ((param.substring(chkchar,chkchar+1) != "?") && (chkchar<= param.length)) { chkchar++; } chkchar++; comma = 0; atcomma = false; selpic = ""; if (chkchar<= param.length) { bld = param.substring(chkchar,chkchar+1); } // car#,wheelbase,TO clearance, while (chkchar<= param.length) { if ((comma == 1) && (atcomma == true)) { if (sw == '2') { document.images[0].src = "images/Cars/mv"+bld+"f.jpg"; document.images[1].src = "images/Cars/mv"+bld+"b.jpg"; } else { document.images[0].src = "images/Cars/mv"+bld+".jpg"; } selpic = bld; atcomma = false; bld = ""; } if ((comma == 2) && (atcomma == true)) { if (bld == "L") { document.order.whlbsx.value = "LONG"; } else { document.order.whlbsx.value = "SHORT"; } atcomma = false; bld = ""; } chkchar++ if (param.substring(chkchar,chkchar+1)==",") { comma++; atcomma = true; } else { if (chkchar<= param.length) { bld += param.substring(chkchar,chkchar+1); } } } if ((bld == "N") || (bld == "n")) { document.order.tuffx.value = "NO"; } if ((bld == "Y") || (bld == "y")) { document.order.tuffx.value = "YES"; } if (selpic > " ") { if ((selpic == '20a') || (selpic == '20c')) { selpic = '20y'; } StartOffRemote(selpic); cartext = GetCarText(selpic); document.order.namex.value = cartext.substring(5,cartext.length); AdjustProps(); AdjustColors(); } } function UpdatePriceRemote(){ UpdatePrice(); AdjustColors(); } function UpdatePrice(){ chsaddon=0; carprice=0; rcraddon=0; selindxch = document.order.accsry.selectedIndex; selectionch = document.order.accsry.options[selindxch].text.substring(0,1); checkcartext = document.order.cars.options[document.order.cars.selectedIndex].text; if ((selectionch == "A") && ((checkcartext.substring(1,2)=="C") || (checkcartext.substring(1,2)=="R"))) { chsaddon = chsprice; } if ((selectionch != "C") && (checkcartext.substring(1,2)=="R") && (checkcartext.substring(1,4) != "XXX")) { rcraddon = 3; } selindx = document.order.cars.selectedIndex; carprice=3; if (checkcartext.substring(1,4) == "XXX"){ carprice=0; } if (checkcartext.substring(1,4) == "Rcr"){ carprice=15; } if (checkcartext.substring(1,4) == "Bok"){ carprice=16; } if (((checkcartext.substring(1,4) == "Cpu") || (checkcartext.substring(1,4) == "Cwg") || (checkcartext.substring(1,4) == "Ca5") || (checkcartext.substring(1,4) == "Ca6") || (checkcartext.substring(1,4) == "Cmu")) && (selectionch == "C")) { carprice=15; } if (((checkcartext.substring(1,4) == "Cst") || (checkcartext.substring(1,4) == "Cdr")) && (selectionch == "C")) { carprice=20; } if (((checkcartext.substring(1,4) == "Cpu") || (checkcartext.substring(1,4) == "Cwg") || (checkcartext.substring(1,4) == "Ca5") || (checkcartext.substring(1,4) == "Ca6") || (checkcartext.substring(1,4) == "Cmu")) && ((selectionch == "A") || (selectionch == "B"))) { carprice=44; } if ((checkcartext.substring(1,4) == "Cyk") || (checkcartext.substring(1,4) == "Cus")) { carprice=54; } if (((checkcartext.substring(1,4) == "Cst") || (checkcartext.substring(1,4) == "Cdr") || (checkcartext.substring(1,4) == "Ctt") || (checkcartext.substring(1,4) == "Ctl")) && ((selectionch == "A") || (selectionch == "B"))) { carprice=56; } carprice+=chsaddon+rcraddon; document.order.price.value = "$"+carprice; } function AdjustPropsRemote(){ AdjStandard(); AdjustProps(); AdjustColors(); UpdatePrice(); } function StartOffRemote(selcar){ ClearArray(); Initialize(false); PreSetSelection(selcar); PreSetPaint(selcar); PreSetOption(); FindEmailLink(); ReadCookie(); UnCompressform(); AdjustTotals(); UpdatePrice(); } function ClearArray() { for (i=1; i<=100; i++) { slctn[i] = ""; prop1[i] = ""; cnt[i] = 0; cost[i] = 0; chs[i] = 0; rcr[i] = 0; prcof[i] = 0; } total_entries = 0; } function FindEmailLink(){ for (i=0; i"; } gtotal = total_ccost+total_kcost+total_rcost+total_wcost+total_bcost+total_dcost; gcount = total_cars + total_cars_kits + total_racers + total_wheels + total_books + total_decals; bodyout += "
"; bodyout += " **** TOTAL American Cars/Amount "+total_cars+"/$"+total_ccost+"
"; bodyout += " **** TOTAL American Kits/Amount "+total_cars_kits+"/$"+total_kcost+"
"; bodyout += " **** TOTAL GT Racers/Amount "+total_racers+"/$"+total_rcost +"
"; bodyout += " **** TOTAL Wheels/Amount "+total_wheels+"/$"+total_wcost+"
"; bodyout += " **** TOTAL Decals/Amount "+total_decals+"/$"+total_dcost+"
"; bodyout += " **** TOTAL Books/Amount "+total_books+"/$"+total_bcost+"
"; bodyout += " ****** GRAND TOTAL $"+gtotal+"

"; bodyout += 'E-mail: '+''+ emailaddr +'

'; bodyout += "Name: "+fullname+"

"; bodyout += "Address:
"+fulladdress+"

"; // bodyout += "To reply .. use: "+"mev@tjets.com"+"

"; document.order.bodycount.value = unescape(gcount); document.order.bodyemail.value = unescape(bodyout); } } function StartOff(){ ClearArray(); PreSetSelection(); PreSetPaint('X'); Initialize(false); FindEmailLink(); ReadCookie(); UnCompressform(); AdjustTotals(); PrepareToMailThisForm(); OutToGrid(); } function ResetList(){ ClearArray(); AdjustTotals(); OutToGrid(); Compressform(); PrepareToMailThisForm(); WriteCookie(); Initialize(false); } function Initialize(skip){ document.order.cars.focus(); document.order.count.value="1"; } function ReadCookie(){ compactform = unescape(document.cookie); } function WriteCookie(){ var expirex = new Date(); expirex.setTime(expirex.getTime() + (1000 * 60 * 60 * 24 * 30)); if (cksw != true) { document.cookie = "MEV="+escape(compactform) + "; expires=" + expirex.toGMTString(); } } function Compressform(){ if (fullname <= " ") { fullname = ">"; } if (fulladdress <= " ") { fulladdress = ">"; } if (emailaddr <= " ") { emailaddr = ">"; } compactform="vv"+AdjustText(fullname)+"!"+AdjustText(fulladdress)+"!"+AdjustText(emailaddr)+"!"; for (i=1; i<=total_entries; i++) { compactform += slctn[i] + "~" + prop1[i] + "~" + cnt[i] + "~" + cost[i] + "~" + chs[i] + "~" + rcr[i] + "~" + prcof[i] +"~$"; } compactform += "^^"; } function AdjustText(str) { var newstring = ""; if (str > "") { for (i=0; i " ") { while ((compactform.substring(ci,ci+2)!="vv") && (ci < compactform.length-2)) { ci++; } ci++; ci++; saveci = ci; // while ((compactform.substring(ci,ci+2)!="vv") && (ci < compactform.length-2)) { // ci++; // } // ci++; // ci++; // if (ci == compactform.length) { // ci = saveci; // } while ((compactform.substring(ci,ci+1)!="!") && (ci < compactform.length-2)) { sliver += compactform.substring(ci,ci+1); ci++; } fullname=sliver; if (fullname==">") { fullname=""; } sliver=""; ci++; while ((compactform.substring(ci,ci+1)!="!") && (ci < compactform.length-2)) { sliver += compactform.substring(ci,ci+1); ci++; } fulladdress=sliver; if (fulladdress==">") { fulladdress=""; } sliver=""; ci++; while ((compactform.substring(ci,ci+1)!="!") && (ci < compactform.length-2)) { sliver += compactform.substring(ci,ci+1); ci++; } emailaddr=sliver; if (emailaddr==">") { emailaddr=""; } sliver=""; ci++; if (ci >= compactform.length-2) { sameform=false; } while ((sameform==true) && (ci<=somethingwrong)) { element=1; sliver =""; sameline=true; while ((sameline==true) && (ci<=somethingwrong)){ if (compactform.substring(ci,ci+1) == "~"){ if (element==1) { total_entries++; slctn[total_entries] = sliver; } if (element==2) { prop1[total_entries] = sliver; } if (element==3) { cnt[total_entries] = sliver; } if (element==4) { cost[total_entries] = sliver * 1; } if (element==5) { chs[total_entries] = sliver * 1; } if (element==6) { rcr[total_entries] = sliver * 1; } if (element==7) { prcof[total_entries] = sliver * 1; } element++; sliver =""; } if ((compactform.substring(ci,ci+1) == "$") || (compactform.substring(ci,ci+1) == "^")) { sameline=false; } if (compactform.substring(ci,ci+1) == "^") { sameform=false; } if ((compactform.substring(ci,ci+1) != "~") && (compactform.substring(ci,ci+1) != "$") && (compactform.substring(ci,ci+1) != "^")) { sliver += compactform.substring(ci,ci+1); } ci++; if (ci > compactform.length) { sameline=false; sameform=false; } } } } } function AdjWheelsMEVDesc(){ document.order.accsry.options.length=3; document.order.accsry.options[0] = new Option("5 Lug Style (4std)","0", false, false); document.order.accsry.options[0].selected = "selected"; document.order.accsry.options[1].text="5 Lug Style (4tuf)"; document.order.accsry.options[1].value="1"; document.order.accsry.options[2].text="5 Lug Style (2std/2tuf)"; document.order.accsry.options[2].value="2"; } function AdjWheelsVinDesc(){ document.order.accsry.options.length=25; document.order.accsry.options[0] = new Option("Alpina 4B Chr","0", false, false); document.order.accsry.options[0].selected = "selected"; document.order.accsry.options[1].text="Alpina 2B/2E Chr"; document.order.accsry.options[1].value="1"; document.order.accsry.options[2].text="Alufelge 4A Alum"; document.order.accsry.options[2].value=""; document.order.accsry.options[3].text="Alufelge 2A/2E Alum"; document.order.accsry.options[3].value=""; document.order.accsry.options[4].text="ATS 4B Alum"; document.order.accsry.options[4].value=""; document.order.accsry.options[5].text="ATS 2B/2E Alum"; document.order.accsry.options[5].value=""; document.order.accsry.options[6].text="BBS 2B Alum/Silver"; document.order.accsry.options[6].value=""; document.order.accsry.options[7].text="BBS 2E Alum/Silver"; document.order.accsry.options[7].value=""; document.order.accsry.options[8].text="BBS 2B Alum/Gold"; document.order.accsry.options[8].value=""; document.order.accsry.options[9].text="BBS 2E Alum/Gold"; document.order.accsry.options[9].value=""; document.order.accsry.options[10].text="Corvette 4A Chr"; document.order.accsry.options[10].value=""; document.order.accsry.options[11].text="Corvette 2A/2E Chr"; document.order.accsry.options[11].value=""; document.order.accsry.options[12].text="Cromoda 4B Alum"; document.order.accsry.options[12].value=""; document.order.accsry.options[13].text="Cromoda 2B/2E Alum"; document.order.accsry.options[13].value=""; document.order.accsry.options[14].text="Fuchsfelge 4A Chr"; document.order.accsry.options[14].value=""; document.order.accsry.options[15].text="Fuchsfelge 2A/2E Chr"; document.order.accsry.options[15].value=""; document.order.accsry.options[16].text="L. Stahl 4A Chr"; document.order.accsry.options[16].value=""; document.order.accsry.options[17].text="L. Stahl 4A Black"; document.order.accsry.options[17].value=""; document.order.accsry.options[18].text="L. Stahl 2A/2E Chr"; document.order.accsry.options[18].value=""; document.order.accsry.options[19].text="Lotus 4A Chr"; document.order.accsry.options[19].value=""; document.order.accsry.options[20].text="Lotus 2A/2E Chr"; document.order.accsry.options[20].value=""; document.order.accsry.options[21].text="Halibrand 4B Alum"; document.order.accsry.options[21].value=""; document.order.accsry.options[22].text="Halibrand 2B/2E Alum"; document.order.accsry.options[22].value=""; document.order.accsry.options[23].text="Porsche 4B Chr"; document.order.accsry.options[23].value=""; document.order.accsry.options[24].text="4 A/B Tires"; document.order.accsry.options[24].value=""; } function AdjAccsry0() { document.order.accsry.options.length = 1; document.order.accsry.options[0] = new Option("D) Decals only", "D", false, false); document.order.accsry.options[0].selected = "selected"; } function AdjAccsry1() { document.order.accsry.options.length = 2; // document.order.accsry.options[0] = new Option("A) Finished Body w/chs", "A", false, false); document.order.accsry.options[0] = new Option("B) Finished Body only", "B", false, false); // document.order.accsry.options[1].text = "B) Finished Body in box only"; // document.order.accsry.options[1].value = "B"; document.order.accsry.options[1].text = "C) -ColoredKit- Body only"; document.order.accsry.options[1].value = "C"; document.order.accsry.options[0].selected = "selected"; } function AdjAccsry2() { document.order.accsry.options.length = 2; // document.order.accsry.options[0] = new Option("A) Finished Body in box w/chs", "A", false, false); document.order.accsry.options[0] = new Option("B) Finished Body in box only", "B", false, false); // document.order.accsry.options[1].text = "B) Finished Body in box only"; // document.order.accsry.options[1].value = "B"; document.order.accsry.options[1].text="C) -Kit- Body only"; document.order.accsry.options[1].value="C"; document.order.accsry.options[0].selected = "selected"; } function AdjAccsry3() { document.order.accsry.options.length = 2; // document.order.accsry.options[0] = new Option("A) Finished Body in box w/chs", "A", false, false); document.order.accsry.options[0] = new Option("B) Finished Body in box only", "B", false, false); // document.order.accsry.options[1].text = "B) Finished Body in box only"; // document.order.accsry.options[1].value = "B"; document.order.accsry.options[1].text = "D) Decals only"; document.order.accsry.options[1].value = "D"; document.order.accsry.options[0].selected = "selected"; } function AdjAccsry4() { document.order.accsry.options.length = 1; // document.order.accsry.options[0] = new Option("A) Finished Body in box w/chs", "A", false, false); document.order.accsry.options[0] = new Option("B) Finished Body in box only", "B", false, false); document.order.accsry.options[0].selected = "selected"; } function AdjKit(){ document.order.colors.options.length=1; document.order.colors.options[0] = new Option("-Trans White-","FFFFFF", false, false); document.order.colors.options[0].selected = "selected"; } function AdjCorvair(){ document.order.colors.options.length=4; document.order.colors.options[0].selected = "selected"; document.order.colors.options[0].text="-1st Avail-"; document.order.colors.options[0].value="FFFFFF"; document.order.colors.options[1].text="White w/blue"; document.order.colors.options[1].value="FFF7FF"; document.order.colors.options[2].text="Red w/black"; document.order.colors.options[2].value="FF0000"; document.order.colors.options[3].text="Drk Blue w/white"; document.order.colors.options[3].value="0800FB"; } function AdjFairlane(){ document.order.colors.options.length=5; document.order.colors.options[0].selected = "selected"; document.order.colors.options[0].text="-1st Avail-"; document.order.colors.options[0].value="FFFFFF"; document.order.colors.options[1].text="Black w/white"; document.order.colors.options[1].value="000000"; document.order.colors.options[2].text="White w/black"; document.order.colors.options[2].value="FFF7FF"; document.order.colors.options[3].text="Drk Blue w/white"; document.order.colors.options[3].value="0800FB"; document.order.colors.options[4].text="Red w/white (fire)"; document.order.colors.options[4].value="FF0000"; } function AdjPaddy(){ document.order.colors.options.length=4; document.order.colors.options[0].selected = "selected"; document.order.colors.options[0].text="-1st Avail-"; document.order.colors.options[0].value="FFFFFF"; document.order.colors.options[1].text="Black w/white"; document.order.colors.options[1].value="000000"; document.order.colors.options[2].text="White w/black"; document.order.colors.options[2].value="FFF7FF"; document.order.colors.options[3].text="Drk Blue w/white"; document.order.colors.options[3].value="0800FB"; } function AdjTaxi(){ document.order.colors.options.length=2; document.order.colors.options[0].selected = "selected"; document.order.colors.options[0].text="-1st Avail-"; document.order.colors.options[0].value="FFFFFF"; document.order.colors.options[1].text="Lemon"; document.order.colors.options[1].value="FFEF10"; } function AdjCaddy(){ document.order.colors.options.length=4; document.order.colors.options[0].text="-1st Avail-"; document.order.colors.options[0].value="FFFFFF"; document.order.colors.options[0].selected = "selected"; document.order.colors.options[1].text="Black Hearse"; document.order.colors.options[1].value="000000"; document.order.colors.options[2].text="White Ambulance"; document.order.colors.options[2].value="FFF7FF"; document.order.colors.options[3].text="Red Rescue"; document.order.colors.options[3].value="FF0000"; } function AdjChevelle(){ document.order.colors.options.length=4; document.order.colors.options[0].text="-1st Avail-"; document.order.colors.options[0].value="FFFFFF"; document.order.colors.options[0].selected = "selected"; document.order.colors.options[1].text="White w/black"; document.order.colors.options[1].value="FFF7FF"; document.order.colors.options[2].text="Red w/white"; document.order.colors.options[2].value="FF0000"; document.order.colors.options[3].text="Gold w/black"; document.order.colors.options[3].value="9C7B4E"; } function AdjStandard(){ document.order.colors.options.length=21; document.order.colors.options[0] = new Option("-1st Avail-","FFFFFF", false, false); document.order.colors.options[0].selected = "selected"; document.order.colors.options[1].text="White(tjet)"; document.order.colors.options[1].value="FFF7FF"; document.order.colors.options[2].text="Lemon(tjet)"; document.order.colors.options[2].value="FFEF10"; document.order.colors.options[3].text="Btr-stch(tjet)"; document.order.colors.options[3].value="EEAF26"; document.order.colors.options[4].text="Lt Org(tjet)"; document.order.colors.options[4].value="FF7B42"; document.order.colors.options[5].text="Pink(tjet)"; document.order.colors.options[5].value="F96F9C"; document.order.colors.options[6].text="Red(tjet)"; document.order.colors.options[6].value="FF0000"; document.order.colors.options[7].text="Drk Mrn(tjet)"; document.order.colors.options[7].value="763003"; document.order.colors.options[8].text="Purple(tjet)"; document.order.colors.options[8].value="8C008C"; document.order.colors.options[9].text="Drk Blue(tjet)"; document.order.colors.options[9].value="0800FB"; document.order.colors.options[10].text="Lime(tjet)"; document.order.colors.options[10].value="18F708"; document.order.colors.options[11].text="Drk Grn(tjet)"; document.order.colors.options[11].value="057E0F"; document.order.colors.options[12].text="Gray(tjet)"; document.order.colors.options[12].value="ADADC6"; document.order.colors.options[13].text="Black(tjet)"; document.order.colors.options[13].value="000000"; document.order.colors.options[14].text="Pale Yellow"; document.order.colors.options[14].value="F8FF9B"; document.order.colors.options[15].text="Sandstone"; document.order.colors.options[15].value="D7BF9C"; document.order.colors.options[16].text="Lavender"; document.order.colors.options[16].value="D3BDDD"; document.order.colors.options[17].text="Carmine"; document.order.colors.options[17].value="940610"; document.order.colors.options[18].text="Dynasty Grn"; document.order.colors.options[18].value="56FCBE"; document.order.colors.options[19].text="Sky Blue"; document.order.colors.options[19].value="82F3F7"; document.order.colors.options[20].text="Teal"; document.order.colors.options[20].value="057870"; } function AdjWheels(){ document.order.colors.options.length=23; document.order.colors.options[0].text="-1st Avail-"; document.order.colors.options[0].value="FFFFFF"; document.order.colors.options[0].selected = "selected"; document.order.colors.options[1].text="White(tjet)"; document.order.colors.options[1].value="FFF7FF"; document.order.colors.options[2].text="Lemon(tjet)"; document.order.colors.options[2].value="FFEF10"; document.order.colors.options[3].text="Btr-stch(tjet)"; document.order.colors.options[3].value="EEAF26"; document.order.colors.options[4].text="Lt Org(tjet)"; document.order.colors.options[4].value="FF7B42"; document.order.colors.options[5].text="Pink(tjet)"; document.order.colors.options[5].value="F96F9C"; document.order.colors.options[6].text="Red(tjet)"; document.order.colors.options[6].value="FF0000"; document.order.colors.options[7].text="Drk Mrn(tjet)"; document.order.colors.options[7].value="763003"; document.order.colors.options[8].text="Purple(tjet)"; document.order.colors.options[8].value="8C008C"; document.order.colors.options[9].text="Drk Blue(tjet)"; document.order.colors.options[9].value="0800FB"; document.order.colors.options[10].text="Lime(tjet)"; document.order.colors.options[10].value="18F708"; document.order.colors.options[11].text="Drk Grn(tjet)"; document.order.colors.options[11].value="057E0F"; document.order.colors.options[12].text="Gray(tjet)"; document.order.colors.options[12].value="ADADC6"; document.order.colors.options[13].text="Black(tjet)"; document.order.colors.options[13].value="000000"; document.order.colors.options[14].text="Pale Yellow"; document.order.colors.options[14].value="F8FF9B"; document.order.colors.options[15].text="Sandstone"; document.order.colors.options[15].value="D7BF9C"; document.order.colors.options[16].text="Lavender"; document.order.colors.options[16].value="D3BDDD"; document.order.colors.options[17].text="Carmine"; document.order.colors.options[17].value="940610"; document.order.colors.options[18].text="Dynasty Grn"; document.order.colors.options[18].value="56FCBE"; document.order.colors.options[19].text="Sky Blue"; document.order.colors.options[19].value="82F3F7"; document.order.colors.options[20].text="Teal"; document.order.colors.options[20].value="057870"; document.order.colors.options[21].text="Gold Flake"; document.order.colors.options[21].value="9C7B4E"; document.order.colors.options[22].text="Chrome"; document.order.colors.options[22].value="C0C0C0"; } function EmptyPaint(){ document.order.paintcolors.options.length=1; document.order.paintcolors.options[0] = new Option("-Skip-","0", false, false); document.order.paintcolors.options[0].selected = "selected"; } function PreSetPaint(selpp){ if (selpp != 'W3') { document.order.paintcolors.options.length=8; document.order.paintcolors.options[1].text="Black"; document.order.paintcolors.options[1].value="1"; document.order.paintcolors.options[2].text="White"; document.order.paintcolors.options[2].value="2"; document.order.paintcolors.options[3].text="Red"; document.order.paintcolors.options[3].value="3"; document.order.paintcolors.options[4].text="Blue"; document.order.paintcolors.options[4].value="4"; document.order.paintcolors.options[5].text="Silver"; document.order.paintcolors.options[5].value="5"; document.order.paintcolors.options[6].text="Gold"; document.order.paintcolors.options[6].value="6"; document.order.paintcolors.options[7].text="-none-"; document.order.paintcolors.options[7].value="7"; } } function PreSetSelection(sele) { carcount = document.order.cars.options.length; if (sele > ' ') { for (i=0; i " ") { for (i=0; i0) { for (i=buttn; i<=total_entries; i++) { if (i 0) { displaycount = total_entries+1 } document.order.gcarsx.size = displaycount; document.order.gcolorsx.size = displaycount; document.order.gcountx.size = displaycount; document.order.gcostx.size = displaycount; } function Validate(){ var valid = true; if (document.order.cars.selectedIndex <=0) { alert("Please choose a -selection-"); document.order.cars.focus(); valid = false; } if (document.order.count.value.substring(0,1) == "O"){ document.order.count.value = "0" + document.order.count.value.substring(1,2); } if (document.order.count.value.substring(1,2) == "O"){ document.order.count.value = document.order.count.value.substring(0,1) + "0"; } if ((document.order.count.value.substring(0,1) <= "0") || (document.order.count.value.substring(0,1) > "9")) { document.order.count.value = "1" + document.order.count.value.substring(1,2); } if ((document.order.count.value.substring(1,2) <= "0") || (document.order.count.value.substring(1,2) > "9")) { document.order.count.value = document.order.count.value.substring(0,1); } return valid; } function UpdateNameAddress (){ fullname = document.order.fname.value; fulladdress = document.order.addr.value; emailaddr = document.order.emailtxt.value; Compressform(); PrepareToMailThisForm(); WriteCookie(); } function NeedToAdd() { var nadd = true; i = 1; Mcardesc = ""; Mcarprep = ""; selindx = document.order.cars.selectedIndex; AddToIndArray(0, selindx, true); // sets Mcardesc, Mcarprep if (total_entries > 0) { while (i <= total_entries) { if ((Mcardesc==slctn[i]) && (Mcarprep==prop1[i])) { nadd = false; // alter count here cnt[i] = (cnt[i]*1) + (document.order.count.value * 1); i = total_entries+1; } i++ } } return nadd; } function AddToIndArray(pos, indx, chkdup) { accsindx = document.order.accsry.selectedIndex; accsval = document.order.accsry.options[accsindx].value; accstext = document.order.accsry.options[accsindx].text; slctnhld = ""; prop1hld = ""; cnthld = 0; costhld = 0; chshld = 0; rcrhld = 0; prcofhld = 0; slctnhld = document.order.cars.options[indx].text; propindx = document.order.colors.selectedIndex; prop1hld = document.order.colors.options[propindx].text; paintindx = document.order.paintcolors.selectedIndex; painttext = document.order.paintcolors.options[paintindx].text; cnthld = document.order.count.value; if ((accsval == "A") && ((slctnhld.substring(1, 2) == "C") || (slctnhld.substring(1, 2) == "R"))) { slctnhld += " w/chs"; chshld = chsprice; } if (slctnhld.substring(1, 2) == "W") { slctnhld += " " + accstext; } if (accsval == "D") { slctnhld = "[Decals]" + slctnhld; } if ((accsval == "A") && (slctnhld.substring(1, 2) == "R")) { slctnhld += " (fin)"; rcrhld = 18; } if ((accsval == "B") && (slctnhld.substring(1, 2) == "R")) { slctnhld += " (fin)"; rcrhld = 18; } if ((accsval == "C") && (slctnhld.substring(1, 2) == "R")) { slctnhld += " (unf)"; rcrhld = 15; } if ((accsval == "B") && (slctnhld.substring(1, 2) == "C")) { slctnhld += " (fin)"; } if ((accsval == "C") && (slctnhld.substring(1, 2) == "C")) { slctnhld = "[Kit]" + slctnhld; } if ((painttext > " ") && (painttext != "-Skip-")) { prop1hld += " w/" + painttext; } if ((slctnhld.substring(2, 4) == "yk") || (slctnhld.substring(2, 4) == "us")) { prcofhld = 10; } if ((slctnhld.substring(2, 4) == "em") || (slctnhld.substring(2, 4) == "st") || (slctnhld.substring(2, 4) == "dr") || (slctnhld.substring(2, 4) == "tt")) { prcofhld = 12; } if (chkdup==true) { Mcardesc = slctnhld; Mcarprep = prop1hld; } else { slctn[pos] = slctnhld; prop1[pos] = prop1hld; cnt[pos] = cnthld; cost[pos] = costhld; chs[pos] = chshld; rcr[pos] = rcrhld; prcof[pos] = prcofhld; } } function AddToArray() { if (Validate() == true) { catmatch = false; selindx = document.order.cars.selectedIndex; sel3cmpr = document.order.cars.options[selindx].text.substring(1, 4); seltext = document.order.cars.options[selindx].text; hit = false; if (NeedToAdd() == true) { if (total_entries == 0) { AddToIndArray(1, selindx, false); } i = 1; while (i <= total_entries) { slc3cmpr = slctn[i].substring(1, 4); if ((slctn[i] > seltext) && (hit == false)) { h_slctn = slctn[i]; h_prop1 = prop1[i]; h_cnt = cnt[i]; h_cost = cost[i]; h_chs = chs[i]; h_rcr = rcr[i]; h_prcof = prcof[i]; AddToIndArray(i, selindx, false); hit = true; } if ((i + 1 <= total_entries) && (hit == true)) { n_slctn = slctn[i + 1]; n_prop1 = prop1[i + 1]; n_cnt = cnt[i + 1]; n_cost = cost[i + 1]; n_chs = chs[i + 1]; n_rcr = rcr[i + 1]; n_prcof = prcof[i + 1]; slctn[i + 1] = h_slctn; prop1[i + 1] = h_prop1; cnt[i + 1] = h_cnt; cost[i + 1] = h_cost; chs[i + 1] = h_chs; rcr[i + 1] = h_rcr; prcof[i + 1] = h_prcof; h_slctn = n_slctn; h_prop1 = n_prop1; h_cnt = n_cnt; h_cost = n_cost; h_chs = n_chs; h_rcr = n_rcr; h_prcof = n_prcof; } if ((i + 1 > total_entries) && (hit == true)) { slctn[i + 1] = h_slctn; prop1[i + 1] = h_prop1; cnt[i + 1] = h_cnt; cost[i + 1] = h_cost; chs[i + 1] = h_chs; rcr[i + 1] = h_rcr; prcof[i + 1] = h_prcof; } // if i++; } // while if (hit == false) { AddToIndArray(total_entries + 1, selindx, false); } total_entries++; } // if need to add } // if valid } function AddToList(){ selindx = document.order.cars.selectedIndex; selection1 = document.order.cars.options[selindx].text.substring(1,4); if (selection1=="XXX") { alert("Vehicle Discontinued"); } else { AddToArray(); AdjustTotals(); OutToGrid(); Compressform(); PrepareToMailThisForm(); WriteCookie(); Initialize(false); } } function AddToListRemote(){ selindx = document.order.cars.selectedIndex; selection1 = document.order.cars.options[selindx].text.substring(1,4); if (selection1=="XXX") { alert("Vehicle Discontinued"); } else { AddToArray(); AdjustTotals(); Compressform(); WriteCookie(); Initialize(true); } } function AdjustTotals(){ cursel = new String(); priceoffset = 0; price = 44; total_ccost = 0; total_kcost = 0; total_bcost = 0; total_rcost = 0; total_wcost = 0; total_dcost = 0; total_cars = 0; total_cars_kits = 0; total_racers = 0; total_books = 0; total_wheels = 0; total_decals = 0; for (i=1; i<=total_entries; i++) { cursel = slctn[i]; if (cursel != null) { if (cursel.substring(1,2) == "C"){ total_cars += cnt[i] * 1; } if (cursel.substring(1,2) == "K"){ total_cars_kits += cnt[i] * 1; } if (cursel.substring(1,2) == "W"){ total_wheels += cnt[i] * 1; } if (cursel.substring(1,2) == "R"){ total_racers += cnt[i] * 1; } if (cursel.substring(1,2) == "B"){ total_books += cnt[i] * 1; } if (cursel.substring(1,2) == "D"){ total_decals += cnt[i] * 1; } } } if (total_cars >= 10) { price = 28; } if (total_cars >= 20) { price = 25; } if (total_cars >= 50) { price = 22; } if (total_cars >= 100) { price = 20; } for (i=1; i<=total_entries; i++) { if (cnt[i] > 0) { cursel = slctn[i]; if ((total_cars >= 10) && (prcof[i] > 0)) { priceoffset = prcof[i] - 4; } else { priceoffset = prcof[i]; } if (cursel.substring(1,2)=="R") { cost[i] = cnt[i] * (rcr[i] + chs[i]); total_rcost += cost[i]; } if (cursel.substring(1,2)=="C"){ cost[i] = cnt[i] * (price + priceoffset + chs[i]); total_ccost += cost[i]; } if (cursel.substring(1,2)=="K"){ cost[i] = cnt[i] * 15; total_kcost += cost[i]; } if (cursel.substring(1,2)=="W"){ cost[i] = cnt[i] * 3; total_wcost += cost[i]; } if (cursel.substring(1,2)=="D"){ cost[i] = cnt[i] * 3; total_dcost += cost[i]; } if (cursel.substring(1,2)=="B"){ if (total_cars + total_racers + total_wheels == 0){ cost[i] = (cnt[i] * 12) + 4; total_bcost += cost[i]; } else { cost[i] = cnt[i] * 12; total_bcost += cost[i]; } } } } }