var editInd = ""; var selectedDeliveryOptions = []; function writeToLayer(lyr, txt) { $("#" + lyr).html(txt); } function initialiseOrderPage() { //display prices for options $("#spanHivizPrice").html(hivizPrice); $("#spanYforkPrice").html(yforkPrice); $("#spanZipPrice").html(zipPrice); $("#spanLockingPrice").html(lockingPrice); //populate listboxes populateListbox("manufacturerID", manufacturers, false); populateListbox("delivery", pricePostages, true); populateListbox("finName", finNames, true); populateListbox("printingmanufacturerID", printingManufacturers, true); populateListbox("printingstockimageID", stockImages, true); populateListbox("printingcolourtype", printingColours, true); populateListbox("printingcolourmain", coloursMain, true); populateListbox("printingcoloursecondary", coloursSecondary, true); populateListbox("printingcolourmain2", coloursMain, true); populateListbox("printingcoloursecondary2", coloursSecondary, true); populateListbox("printingdecalcolour", decalColours, true); populateListbox("printingdecalcolour2", decalColours, true); //quantity box populateListbox("quantity", [["1", "1"],["2", "2"],["3", "3"],["4", "4"],["5", "5"],["6", "6"],["7", "7"],["8", "8"],["9", "9"],["10", "10"],["11", "11"],["12", "12"],["13", "13"],["14", "14"],["15", "15"],["16", "16"],["17", "17"],["18", "18"],["19", "19"],["20", "20"],["21", "21"],["22", "22"],["23", "23"],["24", "24"],["25", "25"],["26", "26"],["27", "27"],["28", "28"],["29", "29"],["30", "30"],["31", "31"],["32", "32"],["33", "33"],["34", "34"],["35", "35"],["36", "36"],["37", "37"],["38", "38"],["39", "39"],["40", "40"],["41", "41"],["42", "42"],["43", "43"],["44", "44"],["45", "45"],["46", "46"],["47", "47"],["48", "48"],["49", "49"],["50", "50"]], false); //bind events $("#manufacturerID").change(function() {updateStrokes();}); $("#stroke").change(function() {updateHps();}); $("#hp").change(function() {updateYears();updateTillerPrice();}); $("#year").change(function() {updateModels();}); $("#model").change(function() {updateLegs();hideMotorImage();displayMotorImage();updateCovers();}); $("#cover").change(function() {resetFieldsForCover();calculate();setPrintingCovers();displayOptions1();doColour2();}); $("#fin").change(function() {if ($("#fin").val() == "1") { displayFin(); } else { hideFin() } calculate();}); $("#finName").change(function() {showFinPhoto();}); $("#printing").change(function() {hideOptions2(); if ($("#printing").val() != "0") { displayOptions2(); } else { hideOptions2() } calculate();}); $("#printhp").change(function() {calculate();}); $("#printingmanufacturerID").change(function() {$('.divML').css('visibility', 'hidden');$('.divML').css('height', '0px');$('#divML' + $(this).val()).css('visibility', 'visible');$('#divML' + $(this).val()).css('height', '');calculate();}); $("#printingstockimageID").change(function() {showStockImage();calculate();}); $("#printingcovers").change(function() {calculate();}); $("#printingcolourtype").change(function() {calculate();}); $("#printingcolourmain").change(function() {previewColour(this, 'pcm1');calculate();}); $("#printingcoloursecondary").change(function() {previewColour(this, 'pcs1');calculate();}); $("#printingcolourmain2").change(function() {previewColour(this, 'pcm2');calculate();}); $("#printingcoloursecondary2").change(function() {previewColour(this, 'pcs2');calculate();}); $("#printingdecalcolour").change(function() {previewDecalColour(this, 'pdc');calculate();}); $("#printingdecalcolour2").change(function() {previewDecalColour(this, 'pdc2');calculate();}); $("#hiviz").change(function() {calculate();}); $("#yfork").change(function() {calculate();}); $("#zip").change(function() {calculate();}); $("#tiller").change(function() {calculate();}); $("#locking").change(function() {calculate();}); $("#delivery").change(function() {calculate();}); $("#quantity").change(function() {if ($("#discountValue").length > 0 && $("#code").val() != "" && $("#discountValue").val() != "") { applyDiscount(); } else { calculate(); } }); updateStrokes(); } function populateListbox(lstID, vals, keep) { var html = ""; if (keep) html = $("#" + lstID).html(); for (var i = 0; i < vals.length; i++) html += ""; $("#" + lstID).html(html); } function resetFieldsForCover() { $("#leg").val(""); $("#legHeight").val(""); $("#trim").val(""); $("#pullStart").val(""); $("#electricStart").val(""); $("#internalFuel").val(""); $("#fin").val(""); $("#finName").val(""); $("#finA").val(""); $("#finB").val(""); $("#finC").val(""); $("#finD").val(""); $("#finE").val(""); $("#finF").val(""); $("#printing").val("3"); $("#printingname").val(""); $("#printingfont").val(""); $("#printingfontcolour").val(""); $("#printingfontcolourother").val(""); $("#printingmanufacturerID").val("10"); $("#dealershipname").val(""); $("#printhp").val("1"); $("#printingcovers").val(""); $("#printingcolourtype").val(""); $("#printingcolourmain").val(""); $("#printingcoloursecondary").val(""); $("#printingcolourmain2").val(""); $("#printingcoloursecondary2").val(""); $("#printingdecalcolour").val(""); $("#printingdecalcolour2").val(""); $("#hiviz").val(""); $("#yfork").val(""); $("#zip").val(""); $("#tiller").val(""); $("#locking").val(""); previewColour($("#printingcolourmain"), 'pcm1'); previewColour($("#printingcoloursecondary"), 'pcs1'); previewColour($("#printingcolourmain2"), 'pcm2'); previewColour($("#printingcoloursecondary2"), 'pcs2'); previewDecalColour($("#printingdecalcolour"), 'pdc'); previewDecalColour($("#printingdecalcolour2"), 'pdc2'); } var imageColoursMain = []; var pantoneColoursMain = []; var coloursMain = []; var imageColoursSecondary = []; var pantoneColoursSecondary = []; var coloursSecondary = []; imageColoursMain[imageColoursMain.length] = ""; pantoneColoursMain[pantoneColoursMain.length] = "000000"; coloursMain[coloursMain.length] = ["17", "Black"]; imageColoursMain[imageColoursMain.length] = ""; pantoneColoursMain[pantoneColoursMain.length] = "FFFFFF"; coloursMain[coloursMain.length] = ["22", "White P2 (Read Disclaimer)"]; imageColoursSecondary[imageColoursSecondary.length] = ""; pantoneColoursSecondary[pantoneColoursSecondary.length] = "000000"; coloursSecondary[coloursSecondary.length] = ["17", "Black"]; imageColoursSecondary[imageColoursSecondary.length] = ""; pantoneColoursSecondary[pantoneColoursSecondary.length] = "0066CC"; coloursSecondary[coloursSecondary.length] = ["2", "Caribbean Blue"]; imageColoursSecondary[imageColoursSecondary.length] = ""; pantoneColoursSecondary[pantoneColoursSecondary.length] = "5b5c5e"; coloursSecondary[coloursSecondary.length] = ["6", "Charcoal/ Yamaha colour (P2)"]; imageColoursSecondary[imageColoursSecondary.length] = ""; pantoneColoursSecondary[pantoneColoursSecondary.length] = "DC1C13"; coloursSecondary[coloursSecondary.length] = ["25", "Red (P2)"]; imageColoursSecondary[imageColoursSecondary.length] = ""; pantoneColoursSecondary[pantoneColoursSecondary.length] = "CCCCCC"; coloursSecondary[coloursSecondary.length] = ["7", "Silver Light Grey/ Honda Colour (P2)"]; imageColoursSecondary[imageColoursSecondary.length] = ""; pantoneColoursSecondary[pantoneColoursSecondary.length] = "FFFFFF"; coloursSecondary[coloursSecondary.length] = ["22", "White P2 (Read Disclaimer)"]; function previewColour(lst, cdiv) { var colourToShow = "#FFFFFF"; var imageToShow = ""; if (lst.selectedIndex > 0) { if (cdiv == 'pcm1' || cdiv == 'pcm2') colourToShow = "#" + pantoneColoursMain[lst.selectedIndex - 1]; else colourToShow = "#" + pantoneColoursSecondary[lst.selectedIndex - 1]; } if (lst.selectedIndex > 0) { if (cdiv == 'pcm1' || cdiv == 'pcm2') imageToShow = imageColoursMain[lst.selectedIndex - 1]; else imageToShow = imageColoursSecondary[lst.selectedIndex - 1]; } // // var ccdiv = document.getElementById(cdiv); // // ccdiv.style.background = colourToShow; $("#" + cdiv).css("width", "200px"); $("#" + cdiv).css("height", "60px"); if (imageToShow != "") { $("#" + cdiv).css("background-repeat", "no-repeat"); $("#" + cdiv).css("background-image", "url(/saved/" + imageToShow + ")"); $("#" + cdiv).css("background-color", ""); } else { $("#" + cdiv).css("background-image", ""); $("#" + cdiv).css("background-color", colourToShow); } } function previewDecalColour(lst, cdiv) { var colourToShow = "#FFFFFF"; var imageToShow = ""; if (lst.selectedIndex > 0) imageToShow = imageDecalColours[lst.selectedIndex - 1]; // // var ccdiv = document.getElementById(cdiv); // // ccdiv.style.background = colourToShow; //$("#" + cdiv).css("width", "200px"); //$("#" + cdiv).css("height", "200px"); //if (imageToShow != "") //{ //$("#" + cdiv).css("background-repeat", "no-repeat"); //$("#" + cdiv).css("background-image", "url('/saved/" + imageToShow + "')"); //$("#" + cdiv).css("background-color", ""); //} //else //{ //$("#" + cdiv).css("background-image", ""); //$("#" + cdiv).css("background-color", colourToShow); //} var imgLink = document.getElementById("imgDecalLink"); var img = document.getElementById("img" + cdiv); if (imageToShow != "") { img.src = "/saved/" + escape(imageToShow); imgLink.href = img.src; //hasPhoto = true; $("#" + cdiv).css("height", "200px"); $("#" + cdiv).css("visibility", "visible"); } } var printingColours = []; printingColours[printingColours.length] = ["1", "Black OR White"]; printingColours[printingColours.length] = ["2", "Colour Printing"]; var printingManufacturers = []; printingManufacturers[printingManufacturers.length] = ["7", "Mariner"]; var fins = []; var finNames = []; fins[fins.length] = ["", 0.00]; finNames[finNames.length] = ["*NOT LISTED - add measurements below.", "*NOT LISTED - add measurements below."]; fins[fins.length] = ["Davis Whale Tail XL.jpg", 40.00]; finNames[finNames.length] = ["Davis Whale Tail (USA usually only)", "Davis Whale Tail (USA usually only)"]; fins[fins.length] = ["Fast Tail Med 40-125hp2.jpg", 50.00]; finNames[finNames.length] = ["Fast Tail Medium 40-125hp W 400mm L 475mm", "Fast Tail Medium 40-125hp W 400mm L 475mm"]; fins[fins.length] = ["LZ Hydrofoil Small.jpg", 40.00]; finNames[finNames.length] = ["Lalizas LZ , Does or Maritime Hydrofoils
Small (up to 50hp)", "Lalizas LZ , Does or Maritime Hydrofoils
Small (up to 50hp)"]; fins[fins.length] = ["LZ Hydrofoil.jpg", 40.00]; finNames[finNames.length] = ["Lalizas LZ Hydrofoils (Gull Winged Version)", "Lalizas LZ Hydrofoils (Gull Winged Version)"]; fins[fins.length] = ["LZ Hydrofoil Large.jpg", 40.00]; finNames[finNames.length] = ["Lalizas LZ or Maritime Hydrofoils
Large (over 50hp)", "Lalizas LZ or Maritime Hydrofoils
Large (over 50hp)"]; fins[fins.length] = ["Macs prop saver.jpg", 65.00]; finNames[finNames.length] = ["Mac's Prop Saver", "Mac's Prop Saver"]; fins[fins.length] = ["permatrim fins.jpg", 0.00]; finNames[finNames.length] = ["Permatrim", "Permatrim"]; fins[fins.length] = ["Pguard.jpg", 110.00]; finNames[finNames.length] = ["Prop Guards", "Prop Guards"]; fins[fins.length] = ["SE Sports 200.jpg", 40.00]; finNames[finNames.length] = ["SE Sports 200 - Part No. 2008-10
(Smaller Motors 8 - 40hp)", "SE Sports 200 - Part No. 2008-10
(Smaller Motors 8 - 40hp)"]; fins[fins.length] = ["SE Sports 300.jpg", 40.00]; finNames[finNames.length] = ["SE Sports 300 - Part No. 200812-16
(For motors 40hp up)", "SE Sports 300 - Part No. 200812-16
(For motors 40hp up)"]; fins[fins.length] = ["SE Sport 400.png", 40.00]; finNames[finNames.length] = ["SE Sports 400 - 40hp Onwards", "SE Sports 400 - 40hp Onwards"]; fins[fins.length] = ["Stingray Large.jpg", 40.00]; finNames[finNames.length] = ["Stingray Large", "Stingray Large"]; fins[fins.length] = ["Stingray Junior0.jpg", 40.00]; finNames[finNames.length] = ["Stingray Small (Junior)", "Stingray Small (Junior)"]; fins[fins.length] = ["XRIII.jpg", 40.00]; finNames[finNames.length] = ["Stingray XRIII", "Stingray XRIII"]; fins[fins.length] = ["Stingray Small - XRIII.jpg", 40.00]; finNames[finNames.length] = ["Stingray XRIII Jnr", "Stingray XRIII Jnr"]; fins[fins.length] = ["Trollamatic or Baffle measurements.jpg", 65.00]; finNames[finNames.length] = ["Trolling Baffles", "Trolling Baffles"]; var stockImages = []; var imageDecalColours = []; var decalColours = []; imageDecalColours[imageDecalColours.length] = "Blue.png"; decalColours[decalColours.length] = ["Blue - V6/V8/V10 model option", "Blue - V6/V8/V10 model option"]; imageDecalColours[imageDecalColours.length] = "Neon.png"; decalColours[decalColours.length] = ["Neon - V6/V8/V10 model option", "Neon - V6/V8/V10 model option"]; imageDecalColours[imageDecalColours.length] = "Orange.png"; decalColours[decalColours.length] = ["Orange - V6/V8/V10 model option", "Orange - V6/V8/V10 model option"]; function showFinPhoto() { var frm = window.document.frmOrder; var div = document.getElementById("finimage"); var img = document.getElementById("imgFin"); var hasPhoto = false; if (frm.finName.selectedIndex > 0 && fins[frm.finName.selectedIndex - 1][0] != "") hasPhoto = true; if (hasPhoto) { img.src = "/saved/" + fins[frm.finName.selectedIndex - 1][0]; div.style.height = "200px"; div.style.visibility = "visible"; } else { hideFinPhoto(); } calculate(); } function hideFinPhoto() { var div = document.getElementById("finimage"); div.style.height = "0px"; div.style.visibility = "hidden"; } function showStockImage() { var frm = window.document.frmOrder; var div = document.getElementById("stockImageimage"); var img = document.getElementById("imgStockImage"); var hasPhoto = false; if (frm.printingstockimageID.selectedIndex > 0 && stockImages[frm.printingstockimageID.selectedIndex - 1][1] != "") hasPhoto = true; if (hasPhoto) { img.src = "/saved/" + stockImages[frm.printingstockimageID.selectedIndex - 1][1]; div.style.height = "200px"; div.style.visibility = "visible"; } else { hideStockImage(); } calculate(); } function hideStockImage() { var div = document.getElementById("stockImageimage"); div.style.height = "0px"; div.style.visibility = "hidden"; } var manufacturers = []; manufacturers[manufacturers.length] = ["10", "Mercury"]; var pricePostages = []; var pricePostage1 = 0; var pricePostage2 = 0; var postageFirst = false; var postageSecond = false; var pricePostageCaption1 = ""; var pricePostageCaption2 = ""; pricePostage1 = 35.00; pricePostage2 = 17.50; pricePostageCaption1 = "Standard Tracked Shipping within USA. No PO Boxes US$35.00"; pricePostageCaption2 = "Standard Tracked Shipping within USA. No PO Boxes US$17.50"; for (var i = 0; i < selectedDeliveryOptions.length; i++) { if (selectedDeliveryOptions[i] == "29") { if (editInd == "") { postageSecond = true; } else { if (!postageFirst) { postageFirst = true; } else if (i <= parseInt(editInd)) { postageSecond = true; } } } } if (postageSecond) { if (pricePostage2 != 0) { pricePostage1 = pricePostage2; pricePostageCaption1 = pricePostageCaption2; } } pricePostages[pricePostages.length] = [29, pricePostageCaption1, postageSecond]; pricePostage1 = 35.00; pricePostage2 = 17.50; pricePostageCaption1 = "Canada via DHL (duties and taxes may be payable) No PO boxes US$35.00"; pricePostageCaption2 = "Canada via DHL (duties and taxes may be payable) No PO boxes US$17.50"; for (var i = 0; i < selectedDeliveryOptions.length; i++) { if (selectedDeliveryOptions[i] == "90") { if (editInd == "") { postageSecond = true; } else { if (!postageFirst) { postageFirst = true; } else if (i <= parseInt(editInd)) { postageSecond = true; } } } } if (postageSecond) { if (pricePostage2 != 0) { pricePostage1 = pricePostage2; pricePostageCaption1 = pricePostageCaption2; } } pricePostages[pricePostages.length] = [90, pricePostageCaption1, postageSecond]; pricePostage1 = 50.00; pricePostage2 = 25.00; pricePostageCaption1 = "Standard shipping USA outlying islands. US$50.00"; pricePostageCaption2 = "Standard shipping USA outlying islands. US$25.00"; for (var i = 0; i < selectedDeliveryOptions.length; i++) { if (selectedDeliveryOptions[i] == "86") { if (editInd == "") { postageSecond = true; } else { if (!postageFirst) { postageFirst = true; } else if (i <= parseInt(editInd)) { postageSecond = true; } } } } if (postageSecond) { if (pricePostage2 != 0) { pricePostage1 = pricePostage2; pricePostageCaption1 = pricePostageCaption2; } } pricePostages[pricePostages.length] = [86, pricePostageCaption1, postageSecond]; var hivizPrice = "20.00"; var yforkPrice = "20.00"; var zipPrice = "20.00"; var lockingPrice = "20.00"; var cylinders = 0; var motors = []; motors[motors.length] = [445, 'MR450-4', 10, 4, 2019, 2024, 8, 0, 0, 0, 1, [ ['250hp Racing 4.6L V8 Black',250,'300R B1.png', 13124, ['20\'\' (Long)','25\'\' (XL) ','30\'\' (Ultra Long) ','Unsure - use overall height','20 inch Leg - Mercury Verado 5.44 inch Gearbox','25 inch Leg - Mercury Verado 5.44 inch Gearbox','30 inch Leg - Mercury Verado 5.44 inch Gearbox'] ] , ['300hp Racing 4.6L V8 Black',300,'300R.jpg', 13123, ['20\'\' (Long)','25\'\' (XL) ','30\'\' (Ultra Long) ','Unsure - use overall height','20 inch Leg - Mercury Verado 5.44 inch Gearbox','25 inch Leg - Mercury Verado 5.44 inch Gearbox','30 inch Leg - Mercury Verado 5.44 inch Gearbox'] ] , ['300hp Racing 4.6L V8 White',300,'300R white1.png', 13125, ['20\'\' (Long)','25\'\' (XL) ','30\'\' (Ultra Long) ','Unsure - use overall height','20 inch Leg - Mercury Verado 5.44 inch Gearbox','25 inch Leg - Mercury Verado 5.44 inch Gearbox','30 inch Leg - Mercury Verado 5.44 inch Gearbox'] ] , ['Racing 450R 4.6L V8 Black without steering harness',450,'M450-4 19.jpg', 13120, ['20\'\' (Long)','25\'\' (XL) ','30\'\' (Ultra Long) ','Unsure - use overall height','20 inch Leg - Mercury Verado 5.44 inch Gearbox','25 inch Leg - Mercury Verado 5.44 inch Gearbox','30 inch Leg - Mercury Verado 5.44 inch Gearbox'] ] , ['Racing 450R 4.6L V8 White without steering harness',450,'M450-4 190.jpg', 13121, ['20\'\' (Long)','25\'\' (XL) ','30\'\' (Ultra Long) ','Unsure - use overall height','20 inch Leg - Mercury Verado 5.44 inch Gearbox','25 inch Leg - Mercury Verado 5.44 inch Gearbox','30 inch Leg - Mercury Verado 5.44 inch Gearbox'] ] , ['MOTORS with STEERING HARNESS ONLY SPLASH COVERS',450,'Mercury450R-black.png', 13122, ['Unsure - use overall height'] ] , ['500hp Racing 4.6L V8 White',500,'500R White.jpg', 13127, ['20\'\' (Long)','25\'\' (XL) ','30\'\' (Ultra Long) ','Unsure - use overall height','20 inch Leg - Mercury Verado 5.44 inch Gearbox','25 inch Leg - Mercury Verado 5.44 inch Gearbox','30 inch Leg - Mercury Verado 5.44 inch Gearbox'] ] , ['500hp Racing 4.6L V8 Black',500,'500R Black.jpg', 13126, ['20\'\' (Long)','25\'\' (XL) ','30\'\' (Ultra Long) ','Unsure - use overall height','20 inch Leg - Mercury Verado 5.44 inch Gearbox','25 inch Leg - Mercury Verado 5.44 inch Gearbox','30 inch Leg - Mercury Verado 5.44 inch Gearbox'] ] ], 0, '', 1, 0, 0, 0, 0, 0 ] motors[motors.length] = [475, 'MR500-4', 10, 4, 2023, 2024, 10, 0, 0, 0, 1, [ ['400R 5.7L V10 - White with Red Accent',400,'V10 400R white.png', 13189, ['20\'\' (Long)','25\'\' (XL) ','30\'\' (Ultra Long) ','Unsure - use overall height','35\'\' (Ultra Ultra Long)'] ] , ['400R 5.7L V10 - Black with Red Accent',400,'V10 400R Black.png', 13188, ['20\'\' (Long)','25\'\' (XL) ','30\'\' (Ultra Long) ','Unsure - use overall height','35\'\' (Ultra Ultra Long)'] ] ], 0, '', 1, 0, 0, 0, 0, 0 ] motors[motors.length] = [476, 'MR60-4V', 10, 4, 2007, 2024, 4, 0, 1, 1, 1, [ ['60R - Racing Decals, High Thrust leg',60,'60R.png', 13130, ['High Thrust 15\'\' (Short)','Unsure - use overall height'] ] ], 0, '', 1, 1, 0, 0, 0, 0 ] motors[motors.length] = [477, 'MR400-4V', 10, 4, 2015, 2024, 6, 0, 0, 1, 1, [ ['400R (2.6L L6 Racing) Black with Red graphics (Standard)',400,'L6 400R0.png', 13119, ['20\'\' (Long)','25\'\' (XL) ','30\'\' (Ultra Long) ','Unsure - use overall height','20 inch Leg - Mercury Verado 5.44 inch Gearbox'] ] , ['400R (2.6L L6 Racing) Black - custom colour, please advise',400,'L6 400R.png', 13118, ['20\'\' (Long)','25\'\' (XL) ','30\'\' (Ultra Long) ','Unsure - use overall height','20 inch Leg - Mercury Verado 5.44 inch Gearbox'] ] , ['400R (2.6L L6 Racing) White - custom colour, please advise',400,'L6 400R White custom.png', 13117, ['20\'\' (Long)','25\'\' (XL) ','30\'\' (Ultra Long) ','Unsure - use overall height','20 inch Leg - Mercury Verado 5.44 inch Gearbox'] ] , ['400R (2.6L L6 Racing) White with Red graphics (Standard)',400,'400R White.jpg', 13116, ['20\'\' (Long)','25\'\' (XL) ','30\'\' (Ultra Long) ','Unsure - use overall height','20 inch Leg - Mercury Verado 5.44 inch Gearbox'] ] ], 0, '', 1, 0, 0, 0, 0, 0 ] function emptyList(lst) { lst.options.length = 1; hideOptions1(); hideOptions2(); if (lst == window.document.frmOrder.model) hideMotorImage(); } function emptyLists(lsts) { for (var i = 0; i < lsts.length; i++) emptyList(lsts[i]); } function addListItem(lst, val, txt) { var opt = document.createElement("option"); lst.options.add(opt); opt.text = txt; opt.value = val; } function getModels(manufacturerID) { var mots = []; for (var i = 0; i < motors.length; i++) { if (motors[i][2] == manufacturerID) mots[mots.length] = motors[i]; } return mots; } function getStrokes() { var frm = window.document.frmOrder; var manufacturerID = frm.manufacturerID.options[frm.manufacturerID.selectedIndex].value; var strokes = []; var mots = getModels(manufacturerID); for (var i = 0; i < mots.length; i++) { var exists = false; for (var j = 0; j < strokes.length; j++) { if (strokes[j] == mots[i][3]) exists = true; } if (!exists) strokes[strokes.length] = mots[i][3]; } return strokes; } function updateStrokes() { var frm = window.document.frmOrder; var lst = frm.stroke; emptyList(lst); var strokes = getStrokes(); for (var i = 0; i < strokes.length; i++) addListItem(lst, strokes[i], strokes[i] + " Stroke"); emptyLists([frm.hp, frm.year, frm.model, frm.leg]); } function getHps() { var frm = window.document.frmOrder; var manufacturerID = frm.manufacturerID.options[frm.manufacturerID.selectedIndex].value; var stroke = frm.stroke.options[frm.stroke.selectedIndex].value; var hps = []; var mots = getModels(manufacturerID); for (var i = 0; i < mots.length; i++) { var models = mots[i][11]; if (mots[i][3] == stroke) { for (var j = 0; j < models.length; j++) { var exists = false; for (k = 0; k < hps.length; k++) { if (hps[k] == models[j][1]) exists = true; } if (!exists) hps[hps.length] = models[j][1]; } } } hps.sort(function(a,b){return a - b}); return hps; } function updateHps() { var frm = window.document.frmOrder; var lst = frm.hp; emptyList(lst); var hps = getHps(); for (var i = 0; i < hps.length; i++) addListItem(lst, hps[i], hps[i]); emptyLists([frm.year, frm.model, frm.leg]); } function getYears() { var frm = window.document.frmOrder; var manufacturerID = frm.manufacturerID.options[frm.manufacturerID.selectedIndex].value; var stroke = frm.stroke.options[frm.stroke.selectedIndex].value; var hp = frm.hp.options[frm.hp.selectedIndex].value; var years = []; var mots = getModels(manufacturerID); for (var i = 0; i < mots.length; i++) { var models = mots[i][11]; if (mots[i][3] == stroke) { for (var j = 0; j < models.length; j++) { if (hp == models[j][1]) { var startYear = mots[i][4]; var endYear = mots[i][5]; if (endYear == 0) endYear = 2024; if (startYear > endYear) endYear = startYear; for (var k = endYear; k > startYear - 1; k--) { var exists = false; for (var l = 0; l < years.length; l++) { if (years[l] == k) exists = true; } if (!exists) years[years.length] = k; } } } } } //sort years array in descending years years.sort(function(a,b){return b - a}); return years; } function updateYears() { var frm = window.document.frmOrder; var lst = frm.year; emptyList(lst); var years = getYears(); for (var i = 0; i < years.length; i++) addListItem(lst, years[i], years[i]); emptyLists([frm.model, frm.leg]); } function getMods() { var frm = window.document.frmOrder; var manufacturerID = frm.manufacturerID.options[frm.manufacturerID.selectedIndex].value; var stroke = frm.stroke.options[frm.stroke.selectedIndex].value; var hp = frm.hp.options[frm.hp.selectedIndex].value; var year = frm.year.options[frm.year.selectedIndex].value; var mods = []; var mots = getModels(manufacturerID); for (var i = 0; i < mots.length; i++) { var models = mots[i][11]; if (mots[i][3] == stroke) { for (var j = 0; j < models.length; j++) { if (hp == models[j][1]) { var startYear = mots[i][4]; var endYear = mots[i][5]; if (endYear == 0) endYear = 2024; if (startYear > endYear) endYear = startYear; if (parseInt(year) >= startYear && parseInt(year) <= endYear) { mods[mods.length] = [models[j][3], models[j][0], models[j][2]]; } } } } } return mods; } function updateModels() { var frm = window.document.frmOrder; var lst = frm.model; emptyList(lst); var models = getMods(); for (var i = 0; i < models.length; i++) addListItem(lst, models[i][0], models[i][1]); emptyLists([frm.leg]); } function getLegs() { var frm = window.document.frmOrder; var manufacturerID = frm.manufacturerID.options[frm.manufacturerID.selectedIndex].value; var stroke = frm.stroke.options[frm.stroke.selectedIndex].value; var hp = frm.hp.options[frm.hp.selectedIndex].value; var year = frm.year.options[frm.year.selectedIndex].value; var model = frm.model.options[frm.model.selectedIndex].value; var legs = []; var mots = getModels(manufacturerID); for (var i = 0; i < mots.length; i++) { var models = mots[i][11]; if (mots[i][3] == stroke) { for (var j = 0; j < models.length; j++) { if (hp == models[j][1]) { var startYear = mots[i][4]; var endYear = mots[i][5]; if (endYear == 0) endYear = 2024; if (startYear > endYear) endYear = startYear; if (parseInt(year) >= startYear && parseInt(year) <= endYear && models[j][3] == model) { var modelLegs = models[j][4]; for (var k = 0; k < modelLegs.length; k++) legs[legs.length] = modelLegs[k]; //set cylinders variable cylinders = mots[i][6]; } } } } } return legs; } function updateLegs() { var lst = window.document.frmOrder.leg; emptyList(lst); var legs = getLegs(); for (var i = 0; i < legs.length; i++) addListItem(lst, legs[i], legs[i]); } function displayOptions1() { var div = document.getElementById("options1"); div.style.height = ""; div.style.visibility = "visible"; //determine to show divElectricStart, divPullStart, divTrimTilt var lst = window.document.frmOrder.model; var models = getMods(); var hasElectricStart = false; var hasPullStart = false; var hasInternalFuel = false; var hasTrimTilt = false; for (var i = 0; i < models.length; i++) { if (models[i][0] == lst.options[lst.selectedIndex].value) { //7 = pull, 8 = electric, 12 = internal fuel tank var motor = getMotorFromModel(models[i][0]); if (motor[7] == 1) hasPullStart = true; if (motor[8] == 1) hasElectricStart = true; if (motor[12] == 1) hasInternalFuel = true; if (motor[15] == 1) hasTrimTilt = true; break; } } //show/hide pull start and electric start divs if (hasElectricStart) { if (hasPullStart) { var div = document.getElementById("divElectricStart"); div.style.height = ""; div.style.visibility = "visible"; window.document.frmOrder.electricStart.selectedIndex = 0; } else { //set to yes window.document.frmOrder.electricStart.selectedIndex = 1; } } else { var div = document.getElementById("divElectricStart"); div.style.height = "0px"; div.style.visibility = "hidden"; } if (hasPullStart) { if (hasElectricStart) { var div = document.getElementById("divPullStart"); div.style.height = ""; div.style.visibility = "visible"; window.document.frmOrder.pullStart.selectedIndex = 0; } else { //set to yes window.document.frmOrder.pullStart.selectedIndex = 1; } } else { var div = document.getElementById("divPullStart"); div.style.height = "0px"; div.style.visibility = "hidden"; } if (hasInternalFuel) { var div = document.getElementById("divInternalFuel"); div.style.height = ""; div.style.visibility = "visible"; } else { var div = document.getElementById("divInternalFuel"); div.style.height = "0px"; div.style.visibility = "hidden"; } if (hasTrimTilt) { var div = document.getElementById("divTrimTilt"); div.style.height = ""; div.style.visibility = "visible"; } else { var div = document.getElementById("divTrimTilt"); div.style.height = "0px"; div.style.visibility = "hidden"; } if (window.document.frmOrder.printing.selectedIndex != 0) { displayOptions2(); } else { hideOptions2() } } function hideOptions1() { var div = document.getElementById("options1"); div.style.height = "0px"; div.style.visibility = "hidden"; var div = document.getElementById("divElectricStart"); div.style.height = "0px"; div.style.visibility = "hidden"; var div = document.getElementById("divPullStart"); div.style.height = "0px"; div.style.visibility = "hidden"; } function displayOptions2() { var div = document.getElementById("options2"); div.style.height = ""; div.style.visibility = "visible"; $('.divML').css('visibility', 'hidden'); $('.divML').css('height', '0px'); var frm = window.document.frmOrder; var cover = frm.cover; if (cover.options[cover.selectedIndex].value != "" && cover.options[cover.selectedIndex].value == "1") { var div = document.getElementById("divPrintingCovers"); div.style.height = ""; div.style.visibility = "visible"; } if (window.document.frmOrder.printing.selectedIndex != 3 && window.document.frmOrder.printing.selectedIndex != 4) { div = document.getElementById("divPrintingColour"); div.style.height = ""; div.style.visibility = "visible"; } if (window.document.frmOrder.printing.selectedIndex != 4) { div = document.getElementById("divStockImage"); div.style.height = "0px"; div.style.visibility = "hidden"; $("#printingstockimageID").val(""); $("#printingstockimageID").focus(); $("#printingstockimageID").change(); $("#printingstockimagetext").val(""); } if (window.document.frmOrder.printing.selectedIndex == 1) { div = document.getElementById("divPrintingName"); div.style.height = ""; div.style.visibility = "visible"; } if (window.document.frmOrder.printing.selectedIndex == 2) { div = document.getElementById("divPrintingLogo"); div.style.height = ""; div.style.visibility = "visible"; } if (window.document.frmOrder.printing.selectedIndex == 3) { div = document.getElementById("divManufacturerLogo"); div.style.height = ""; div.style.visibility = "visible"; $('#divML' + $('#printingmanufacturerID').val()).css('visibility', 'visible'); $('#divML' + $('#printingmanufacturerID').val()).css('height', ''); } if (window.document.frmOrder.printing.selectedIndex == 4) { div = document.getElementById("divStockImage"); div.style.height = ""; div.style.visibility = "visible"; } } function hideOptions2() { $('.divML').css('visibility', 'hidden'); $('.divML').css('height', '0px'); var div = document.getElementById("options2"); div.style.height = "0px"; div.style.visibility = "hidden"; div = document.getElementById("divPrintingCovers"); div.style.height = "0px"; div.style.visibility = "hidden"; div = document.getElementById("divPrintingColour"); div.style.height = "0px"; div.style.visibility = "hidden"; div = document.getElementById("divPrintingName"); div.style.height = "0px"; div.style.visibility = "hidden"; div = document.getElementById("divPrintingLogo"); div.style.height = "0px"; div.style.visibility = "hidden"; div = document.getElementById("divManufacturerLogo"); div.style.height = "0px"; div.style.visibility = "hidden"; div = document.getElementById("divStockImage"); div.style.height = "0px"; div.style.visibility = "hidden"; } function displayFinOption() { var div = document.getElementById("divFinOption"); div.style.height = ""; div.style.visibility = "visible"; } function hideFinOption() { var div = document.getElementById("divFinOption"); div.style.height = "0px"; div.style.visibility = "hidden"; window.document.frmOrder.fin.selectedIndex = 0; } function displayFin() { var div = document.getElementById("divFin"); div.style.height = ""; div.style.visibility = "visible"; } function hideFin() { var div = document.getElementById("divFin"); div.style.height = "0px"; div.style.visibility = "hidden"; var frm = window.document.frmOrder; frm.finName.selectedIndex = 0; hideFinPhoto(); calculate(); } function displayFullOptions() { var div = document.getElementById("divFullOptions"); div.style.height = ""; div.style.visibility = "visible"; } function hideFullOptions() { var div = document.getElementById("divFullOptions"); div.style.height = "0px"; div.style.visibility = "hidden"; } function displayMotorImage() { var lst = window.document.frmOrder.model; var div = document.getElementById("motorimage"); var img = document.getElementById("imgMotor"); var imgLink = document.getElementById("imgMotorLink"); var hasPhoto = false; var models = getMods(); for (var i = 0; i < models.length; i++) { if (models[i][0] == lst.options[lst.selectedIndex].value && models[i][2] != "") { img.src = "/saved/" + escape(models[i][2]); imgLink.href = img.src; hasPhoto = true; } } if (hasPhoto) { div.style.height = "200px"; div.style.visibility = "visible"; } $("#divStep1Buttons").css("display", "inline"); } function hideMotorImage() { var div = document.getElementById("motorimage"); div.style.height = "0px"; div.style.visibility = "hidden"; } function displayPlateImage() { var lst = window.document.frmOrder.model; var div = document.getElementById("plateimage"); var img = document.getElementById("imgPlate"); var hasPhoto = false; var models = getMods(); for (var i = 0; i < models.length; i++) { if (models[i][0] == lst.options[lst.selectedIndex].value && getMotorFromModel(models[i][0])[13] != "") { img.src = "/saved/" + getMotorFromModel(models[i][0])[13]; hasPhoto = true; } } if (hasPhoto) { div.style.height = "200px"; div.style.visibility = "visible"; } } function hidePlateImage() { var div = document.getElementById("plateimage"); div.style.height = "0px"; div.style.visibility = "hidden"; } function getMotorFromModel(modelID) { var frm = window.document.frmOrder; var manufacturerID = frm.manufacturerID.options[frm.manufacturerID.selectedIndex].value; var model = frm.model.options[frm.model.selectedIndex].value; var motor = []; var mots = getModels(manufacturerID); for (var i = 0; i < mots.length; i++) { var models = mots[i][11]; for (var j = 0; j < models.length; j++) { if (models[j][3] == model) motor = mots[i]; } } return motor; } function updateCovers() { var frm = window.document.frmOrder; var model = frm.model.options[frm.model.selectedIndex].value; var motor = getMotorFromModel(model); //determine if full cover and/or splash cover is ticked and display cover options... var coverFull = motor[9]; var coverSplash = motor[10]; var coverMooring = motor[14]; var coverCombo = 0; if (coverFull == 1 && coverSplash == 1) coverCombo = 1; frm.cover.options.length = 1; frm.printingcovers.options.length = 1; if (coverCombo == 1) { addListItem(frm.cover, "1", "Combo Covers (Full & Splash)"); addListItem(frm.printingcovers, "1", "Combo Covers (Full & Splash)"); } if (coverFull == 1) { addListItem(frm.cover, "2", "Full Cover Only"); addListItem(frm.printingcovers, "2", "Full Cover Only"); } if (coverSplash == 1) { addListItem(frm.cover, "3", "Splash Cover only (Cowling Cover)"); addListItem(frm.printingcovers, "3", "Splash Cover only (Cowling Cover)"); } if (coverMooring == 1) { addListItem(frm.cover, "4", "Mooring/ Tow & Stow Cover only"); addListItem(frm.printingcovers, "4", "Mooring /Tow & Stow Cover only"); } } function validate() { var frm = window.document.frmOrder; var missing = ""; //standard //if (frm.manufacturerID.selectedIndex == 0) //missing += "Make of Outboard\n"; if (frm.stroke.selectedIndex == 0) missing += "Stroke\n"; if (frm.hp.selectedIndex == 0) missing += "Horse Power\n"; if (frm.year.selectedIndex == 0) missing += "Year\n"; if (frm.model.selectedIndex == 0) missing += "Model\n"; if (frm.cover.selectedIndex == 0) missing += "Cover(s) Required\n"; if (frm.leg.selectedIndex == 0 && frm.cover.options[frm.cover.selectedIndex].value != "3" && frm.cover.options[frm.cover.selectedIndex].value != "4") missing += "Leg Length\n"; if (frm.printingcolourmain.selectedIndex == 0) missing += "Main Colour\n"; if (frm.tiller.selectedIndex == 1 && frm.tillerGear.selectedIndex == 0) missing += "Gear change on tiller\n"; if (frm.delivery.selectedIndex == 0) missing += "Delivery Method\n"; //if printing has selectedIndex of 1 if (frm.printing.selectedIndex == 1 && frm.printingname.value == "" && $("#printhp").val() != "1") missing += "Name to be printed\n"; //if printing has selectedIndex of 2 if (frm.printing.selectedIndex == 2 && frm.printinglogo.value == "" && $("#printhp").val() != "1") { missing += "Logo to be printed\n"; } //if printing has selectedIndex of 3 //if (frm.printing.selectedIndex == 3 && frm.dealershipname.value == "" && $("#printhp").val() != "1") //missing += "Dealership name\n"; if (frm.printing.selectedIndex == 4 && frm.printingstockimageID.selectedIndex == 0) missing += "OCA stock image\n"; //if printing has selectedIndex > 0 if (frm.printing.selectedIndex > 0) { if (frm.printingcovers.selectedIndex == 0) missing += "Covers to print on\n"; if (frm.printingcolourtype.selectedIndex == 0 && frm.printing.selectedIndex != 3 && frm.printing.selectedIndex != 4) missing += "Printing colour type\n"; } //if fin has selectedIndex of 1 if (frm.fin.selectedIndex == 1 && ((frm.finA.value == "" || frm.finB.value == "" || frm.finC.value == "" || frm.finD.value == "" || frm.finE.value == "") && frm.finName.selectedIndex == 0)) missing += "Fin measurements or fin name\n"; if (!frm.terms.checked) missing += "Agreeing to the terms and conditions\n"; if (missing != "") window.alert("Please specify the following:\n\n" + missing); return (missing == ""); } function calculate() { var frm = window.document.frmOrder; var price = 0; //cover price var priceCover = []; priceCover[priceCover.length] = [2, 200, 500, 4, 488.00, 8, 8]; priceCover[priceCover.length] = [3, 200, 500, 4, 374.00, 8, 8]; priceCover[priceCover.length] = [4, 200, 500, 4, 342.00, 8, 8]; priceCover[priceCover.length] = [3, 40, 60, 4, 234.00, 0, 0]; priceCover[priceCover.length] = [3, 75, 115, 4, 268.00, 0, 0]; priceCover[priceCover.length] = [3, 135, 200, 4, 279.00, 0, 4]; priceCover[priceCover.length] = [3, 40, 60, 2, 184.00, 0, 0]; priceCover[priceCover.length] = [3, 75, 90, 2, 219.00, 3, 3]; priceCover[priceCover.length] = [3, 115, 200, 2, 258.00, 0, 0]; priceCover[priceCover.length] = [3, 225, 300, 2, 304.00, 0, 0]; priceCover[priceCover.length] = [3, 75, 125, 2, 244.00, 4, 4]; priceCover[priceCover.length] = [2, 40, 60, 4, 372.00, 0, 0]; priceCover[priceCover.length] = [1, 40, 60, 4, 449.00, 0, 0]; priceCover[priceCover.length] = [1, 40, 60, 2, 360.00, 0, 0]; priceCover[priceCover.length] = [1, 75, 90, 2, 412.00, 3, 3]; priceCover[priceCover.length] = [1, 115, 200, 2, 486.00, 0, 6]; priceCover[priceCover.length] = [1, 225, 300, 2, 539.00, 0, 0]; priceCover[priceCover.length] = [1, 75, 125, 2, 441.00, 4, 4]; priceCover[priceCover.length] = [2, 40, 60, 2, 301.00, 0, 0]; priceCover[priceCover.length] = [2, 75, 90, 2, 336.00, 3, 3]; priceCover[priceCover.length] = [2, 115, 200, 2, 398.00, 0, 6]; priceCover[priceCover.length] = [2, 225, 300, 2, 423.00, 0, 0]; priceCover[priceCover.length] = [2, 75, 125, 2, 351.00, 4, 4]; priceCover[priceCover.length] = [1, 75, 115, 4, 502.00, 0, 0]; priceCover[priceCover.length] = [1, 135, 200, 4, 533.00, 0, 4]; priceCover[priceCover.length] = [2, 75, 115, 4, 409.00, 0, 0]; priceCover[priceCover.length] = [2, 135, 200, 4, 440.00, 0, 4]; priceCover[priceCover.length] = [3, 2, 15, 2, 130.00, 0, 0]; priceCover[priceCover.length] = [3, 21, 39, 4, 211.00, 0, 0]; priceCover[priceCover.length] = [1, 16, 39, 2, 295.00, 0, 0]; priceCover[priceCover.length] = [2, 16, 39, 2, 239.00, 0, 0]; priceCover[priceCover.length] = [1, 11, 20, 4, 338.00, 0, 0]; priceCover[priceCover.length] = [2, 21, 39, 4, 339.00, 0, 0]; priceCover[priceCover.length] = [3, 16, 39, 2, 159.00, 0, 0]; priceCover[priceCover.length] = [1, 2, 15, 2, 246.00, 0, 0]; priceCover[priceCover.length] = [2, 2, 15, 2, 201.00, 0, 0]; priceCover[priceCover.length] = [1, 2, 10, 4, 258.00, 0, 0]; priceCover[priceCover.length] = [1, 21, 39, 4, 408.00, 0, 0]; priceCover[priceCover.length] = [2, 2, 10, 4, 194.00, 0, 0]; priceCover[priceCover.length] = [2, 11, 20, 4, 273.00, 0, 0]; priceCover[priceCover.length] = [3, 2, 10, 4, 153.00, 0, 0]; priceCover[priceCover.length] = [3, 11, 20, 4, 182.00, 0, 0]; priceCover[priceCover.length] = [1, 200, 500, 4, 595.00, 8, 8]; priceCover[priceCover.length] = [4, 301, 400, 4, 330.00, 6, 7]; priceCover[priceCover.length] = [3, 175, 300, 4, 335.00, 6, 6]; priceCover[priceCover.length] = [3, 301, 400, 4, 352.00, 6, 6]; priceCover[priceCover.length] = [2, 301, 400, 4, 471.00, 6, 6]; priceCover[priceCover.length] = [2, 175, 300, 4, 454.00, 6, 7]; priceCover[priceCover.length] = [1, 175, 300, 4, 564.00, 6, 6]; priceCover[priceCover.length] = [1, 301, 400, 4, 588.00, 6, 6]; priceCover[priceCover.length] = [4, 2, 10, 4, 136.00, 0, 0]; priceCover[priceCover.length] = [4, 11, 20, 4, 192.00, 0, 0]; priceCover[priceCover.length] = [4, 21, 39, 4, 238.00, 0, 0]; priceCover[priceCover.length] = [4, 40, 60, 4, 261.00, 0, 0]; priceCover[priceCover.length] = [4, 75, 115, 4, 287.00, 0, 0]; priceCover[priceCover.length] = [4, 135, 200, 4, 308.00, 0, 4]; priceCover[priceCover.length] = [4, 175, 300, 4, 381.00, 6, 6]; priceCover[priceCover.length] = [4, 2, 15, 2, 141.00, 0, 0]; priceCover[priceCover.length] = [4, 16, 39, 2, 168.00, 0, 0]; priceCover[priceCover.length] = [4, 40, 60, 2, 211.00, 0, 0]; priceCover[priceCover.length] = [4, 75, 90, 2, 236.00, 3, 3]; priceCover[priceCover.length] = [4, 75, 125, 2, 246.00, 4, 4]; priceCover[priceCover.length] = [4, 115, 200, 2, 279.00, 0, 6]; priceCover[priceCover.length] = [4, 225, 300, 2, 297.00, 0, 0]; priceCover[priceCover.length] = [4, 500, 600, 4, 534.00, 12, 12]; priceCover[priceCover.length] = [1, 350, 500, 4, 714.00, 10, 10]; priceCover[priceCover.length] = [3, 350, 500, 4, 449.00, 10, 10]; priceCover[priceCover.length] = [4, 350, 500, 4, 411.00, 10, 10]; priceCover[priceCover.length] = [3, 500, 600, 4, 583.00, 12, 12]; priceCover[priceCover.length] = [1, 500, 600, 4, 850.00, 12, 12]; //postage price var pricePostage = []; var pricePostage1 = 0; var pricePostage2 = 0; var postageFirst = false; var postageSecond = false; pricePostage1 = 35.00; pricePostage2 = 17.50; for (var i = 0; i < selectedDeliveryOptions.length; i++) { if (selectedDeliveryOptions[i] == "29") { if (editInd == "") { postageSecond = true; } else { if (!postageFirst) { postageFirst = true; } else if (i <= parseInt(editInd)) { postageSecond = true; } } } } if (postageSecond) { if (pricePostage2 != 0) { pricePostage1 = pricePostage2; } } pricePostage[pricePostage.length] = [29, pricePostage1]; pricePostage1 = 35.00; pricePostage2 = 17.50; for (var i = 0; i < selectedDeliveryOptions.length; i++) { if (selectedDeliveryOptions[i] == "90") { if (editInd == "") { postageSecond = true; } else { if (!postageFirst) { postageFirst = true; } else if (i <= parseInt(editInd)) { postageSecond = true; } } } } if (postageSecond) { if (pricePostage2 != 0) { pricePostage1 = pricePostage2; } } pricePostage[pricePostage.length] = [90, pricePostage1]; pricePostage1 = 50.00; pricePostage2 = 25.00; for (var i = 0; i < selectedDeliveryOptions.length; i++) { if (selectedDeliveryOptions[i] == "86") { if (editInd == "") { postageSecond = true; } else { if (!postageFirst) { postageFirst = true; } else if (i <= parseInt(editInd)) { postageSecond = true; } } } } if (postageSecond) { if (pricePostage2 != 0) { pricePostage1 = pricePostage2; } } pricePostage[pricePostage.length] = [86, pricePostage1]; if (postageSecond) { $("#postage2").val("1"); } else { $("#postage2").val(""); } //manufacturer logo price var priceLogoManufacturer = []; priceLogoManufacturer[priceLogoManufacturer.length] = [1, 2, 0.00]; priceLogoManufacturer[priceLogoManufacturer.length] = [1, 5, 0.00]; priceLogoManufacturer[priceLogoManufacturer.length] = [2, 5, 0.00]; priceLogoManufacturer[priceLogoManufacturer.length] = [3, 5, 0.00]; priceLogoManufacturer[priceLogoManufacturer.length] = [1, 4, 0.00]; priceLogoManufacturer[priceLogoManufacturer.length] = [2, 4, 0.00]; priceLogoManufacturer[priceLogoManufacturer.length] = [3, 4, 0.00]; priceLogoManufacturer[priceLogoManufacturer.length] = [1, 8, 0.00]; priceLogoManufacturer[priceLogoManufacturer.length] = [2, 8, 0.00]; priceLogoManufacturer[priceLogoManufacturer.length] = [3, 8, 0.00]; priceLogoManufacturer[priceLogoManufacturer.length] = [1, 10, 0.00]; priceLogoManufacturer[priceLogoManufacturer.length] = [2, 10, 0.00]; priceLogoManufacturer[priceLogoManufacturer.length] = [3, 10, 0.00]; priceLogoManufacturer[priceLogoManufacturer.length] = [2, 7, 0.00]; priceLogoManufacturer[priceLogoManufacturer.length] = [1, 7, 0.00]; priceLogoManufacturer[priceLogoManufacturer.length] = [3, 7, 0.01]; priceLogoManufacturer[priceLogoManufacturer.length] = [1, 3, 0.00]; priceLogoManufacturer[priceLogoManufacturer.length] = [2, 3, 0.00]; priceLogoManufacturer[priceLogoManufacturer.length] = [3, 3, 0.00]; priceLogoManufacturer[priceLogoManufacturer.length] = [1, 1, 0.00]; priceLogoManufacturer[priceLogoManufacturer.length] = [2, 1, 0.00]; priceLogoManufacturer[priceLogoManufacturer.length] = [3, 1, 0.00]; priceLogoManufacturer[priceLogoManufacturer.length] = [4, 7, 0.00]; priceLogoManufacturer[priceLogoManufacturer.length] = [4, 10, 0.00]; priceLogoManufacturer[priceLogoManufacturer.length] = [4, 1, 0.00]; priceLogoManufacturer[priceLogoManufacturer.length] = [4, 3, 0.00]; priceLogoManufacturer[priceLogoManufacturer.length] = [4, 4, 0.00]; priceLogoManufacturer[priceLogoManufacturer.length] = [4, 8, 0.00]; priceLogoManufacturer[priceLogoManufacturer.length] = [4, 2, 0.00]; priceLogoManufacturer[priceLogoManufacturer.length] = [4, 5, 0.00]; priceLogoManufacturer[priceLogoManufacturer.length] = [3, 2, 0.00]; priceLogoManufacturer[priceLogoManufacturer.length] = [1, 14, 0.00]; priceLogoManufacturer[priceLogoManufacturer.length] = [2, 14, 0.00]; priceLogoManufacturer[priceLogoManufacturer.length] = [3, 14, 0.00]; priceLogoManufacturer[priceLogoManufacturer.length] = [4, 14, 0.00]; priceLogoManufacturer[priceLogoManufacturer.length] = [2, 2, 0.00]; priceLogoManufacturer[priceLogoManufacturer.length] = [1, 21, 0.00]; priceLogoManufacturer[priceLogoManufacturer.length] = [2, 21, 0.00]; priceLogoManufacturer[priceLogoManufacturer.length] = [3, 21, 0.00]; priceLogoManufacturer[priceLogoManufacturer.length] = [4, 21, 0.00]; //hp print price var priceLogo = []; priceLogo[priceLogo.length] = [2, 0.00]; priceLogo[priceLogo.length] = [3, 0.00]; priceLogo[priceLogo.length] = [4, 0.00]; priceLogo[priceLogo.length] = [1, 0.00]; //update price for hp print on rear if ($("#printhp").length == 1) { var hpPrintPrice = "0.00"; if ($("#cover").val() == "2") hpPrintPrice = "0.00"; if ($("#cover").val() == "3") hpPrintPrice = "0.00"; if ($("#cover").val() == "4") hpPrintPrice = "0.00"; if ($("#cover").val() == "1") hpPrintPrice = "0.00"; $("#spanHPPrice").html(hpPrintPrice); } //secondary colour price var priceSecondary = []; priceSecondary[priceSecondary.length] = [2, 30.00]; priceSecondary[priceSecondary.length] = [3, 20.00]; priceSecondary[priceSecondary.length] = [4, 25.00]; priceSecondary[priceSecondary.length] = [1, 50.00]; //update price for secondary colour if ($("#printingcolourmain").length == 1 && $("#printingcoloursecondary").val() != "") { var secondaryPrintPrice = "0.00"; if (($("#cover").val() == "1" && $("#cover").val() != "1") || ($("#cover").val() == "1" && "1" == "2")) { secondaryPrintPrice = "50.00"; price = price + 50.00; } if (($("#cover").val() == "2" && $("#cover").val() != "1") || ($("#cover").val() == "1" && "2" == "2")) { secondaryPrintPrice = "30.00"; price = price + 30.00; } if (($("#cover").val() == "3" && $("#cover").val() != "1") || ($("#cover").val() == "1" && "3" == "2")) { secondaryPrintPrice = "20.00"; price = price + 20.00; } if (($("#cover").val() == "4" && $("#cover").val() != "1") || ($("#cover").val() == "1" && "4" == "2")) { secondaryPrintPrice = "25.00"; price = price + 25.00; } $("#spanSecondaryPrice1").html(secondaryPrintPrice); } else { $("#spanSecondaryPrice1").html("0.00"); } //update price for secondary colour 2 if ($("#printingcolourmain2").length == 1 && $("#cover").val() == "1" && $("#printingcoloursecondary2").val() != "") { var secondaryPrintPrice = "0.00"; if ($("#cover").val() == "1" && "1" == "3") { secondaryPrintPrice = "50.00"; price = price + 50.00; } if ($("#cover").val() == "1" && "2" == "3") { secondaryPrintPrice = "30.00"; price = price + 30.00; } if ($("#cover").val() == "1" && "3" == "3") { secondaryPrintPrice = "20.00"; price = price + 20.00; } if ($("#cover").val() == "1" && "4" == "3") { secondaryPrintPrice = "25.00"; price = price + 25.00; } $("#spanSecondaryPrice2").html(secondaryPrintPrice); } else { $("#spanSecondaryPrice2").html("0.00"); } //colour price var priceColour = []; priceColour[priceColour.length] = [1, 1, 0.00]; priceColour[priceColour.length] = [2, 1, 0.00]; priceColour[priceColour.length] = [3, 1, 0.00]; priceColour[priceColour.length] = [1, 2, 0.00]; priceColour[priceColour.length] = [2, 2, 0.00]; priceColour[priceColour.length] = [3, 2, 0.00]; priceColour[priceColour.length] = [4, 1, 0.00]; priceColour[priceColour.length] = [4, 2, 0.00]; //fabric colour (main) price var priceFabricMain = []; priceFabricMain[priceFabricMain.length] = [17, 0.00]; priceFabricMain[priceFabricMain.length] = [22, 10.00]; //calculate total price of options //go through priceCover var coverID = frm.cover.options[frm.cover.selectedIndex].value; var hp = frm.hp.options[frm.hp.selectedIndex].value; var stroke = frm.stroke.options[frm.stroke.selectedIndex].value; if (coverID != "" && hp != "" && stroke != "") { for (var i = 0; i < priceCover.length; i++) { //if (priceCover[i][0] == parseInt(coverID) && priceCover[i][1] <= parseInt(hp) && priceCover[i][2] >= parseInt(hp) && priceCover[i][3] == parseInt(stroke) && (cylinders >= priceCover[i][5] || priceCover[i][5] == 0 || priceCover[i][1] < parseInt(hp)) && (cylinders <= priceCover[i][6] || priceCover[i][6] == 0 || priceCover[i][2] > parseInt(hp))) if (priceCover[i][0] == parseInt(coverID) && priceCover[i][1] <= parseInt(hp) && priceCover[i][2] >= parseInt(hp) && priceCover[i][3] == parseInt(stroke) && (cylinders >= priceCover[i][5] || priceCover[i][5] == 0) && (cylinders <= priceCover[i][6] || priceCover[i][6] == 0)) { price = price + priceCover[i][4]; frm.coverPrice.value = priceCover[i][4]; break; } } } //go through pricePostage var deliveryID = frm.delivery.options[frm.delivery.selectedIndex].value; if (deliveryID != "") { for (var i = 0; i < pricePostage.length; i++) { if (pricePostage[i][0] == parseInt(deliveryID)) { price = price + pricePostage[i][1]; break; } } } //go through priceLogoManufacturer var printingmanufacturerID = "10"; var printing = $("#printing").val(); var printingcoversID = frm.printingcovers.options[frm.printingcovers.selectedIndex].value; if (printingmanufacturerID != "" && printingcoversID != "" && printing == "3") { for (var i = 0; i < priceLogoManufacturer.length; i++) { if (priceLogoManufacturer[i][0] == parseInt(printingcoversID) && priceLogoManufacturer[i][1] == parseInt(printingmanufacturerID)) { price = price + priceLogoManufacturer[i][2]; break; } } } //go through priceLogo (hp print price) if ($("#printhp").length == 1 && $("#printhp").val() == "1") { var hpPrintPrice = 0; if ($("#cover").val() == "2") hpPrintPrice = 0.00; if ($("#cover").val() == "3") hpPrintPrice = 0.00; if ($("#cover").val() == "4") hpPrintPrice = 0.00; if ($("#cover").val() == "1") hpPrintPrice = 0.00; price = price + hpPrintPrice; } //go through priceColour var pcolourID = frm.printingcolourtype.options[frm.printingcolourtype.selectedIndex].value; if (coverID != "" && pcolourID != "" && (printing == "1" || printing == "2")) { for (var i = 0; i < priceColour.length; i++) { if (priceColour[i][0] == parseInt(printingcoversID) && priceColour[i][1] == parseInt(pcolourID)) { price = price + priceColour[i][2]; break; } } } //go through priceFabricMain var pfabricMainID = frm.printingcolourmain.options[frm.printingcolourmain.selectedIndex].value; for (var i = 0; i < priceFabricMain.length; i++) { if (priceFabricMain[i][0] == parseInt(pfabricMainID)) { price = price + priceFabricMain[i][1]; break; } } //go through priceFabricMain for secondary if ($("#printingcolourmain2").length == 1 && $("#cover").val() == "1") { var pfabricMainID2 = frm.printingcolourmain2.options[frm.printingcolourmain2.selectedIndex].value; for (var i = 0; i < priceFabricMain.length; i++) { if (priceFabricMain[i][0] == parseInt(pfabricMainID2)) { price = price + priceFabricMain[i][1]; break; } } } //if fin has been selected then add on appropriate price if (frm.finName.selectedIndex > 0) price = price + fins[frm.finName.selectedIndex - 1][1]; else if ($("#fin").val() == "1") price = price + 0; //if stock image has been selected then add on appropriate price if (printing == "4" && frm.printingstockimageID.selectedIndex > 0) { if (printingcoversID == "1") price = price + (stockImages[frm.printingstockimageID.selectedIndex - 1][2] * 2); else price = price + stockImages[frm.printingstockimageID.selectedIndex - 1][2]; } //if hiviz has been selected then add on 20.00 var hiviz = frm.hiviz.options[frm.hiviz.selectedIndex].value; if (hiviz == "1") price = price + 20.00; //if tiller has been selected then add on js:tillerPrice var tiller = frm.tiller.options[frm.tiller.selectedIndex].value; if (tiller == "1") { price = price + tillerPrice; $("#divTillerGear").show(); } else { $("#divTillerGear").hide(); } //if yfork has been selected then add on 20.00 var yfork = frm.yfork.options[frm.yfork.selectedIndex].value; if (yfork == "1") price = price + 20.00; //if zip has been selected then add on 20.00 var zip = frm.zip.options[frm.zip.selectedIndex].value; if (zip == "1") price = price + 20.00; //if zip has been selected then add on 20.00 var locking = frm.locking.options[frm.locking.selectedIndex].value; if (locking == "1") price = price + 20.00; //multiply by quantity var quantity = frm.quantity.options[frm.quantity.selectedIndex].value; price = price * parseFloat(quantity); //discount postage if quantity is > 1 if (parseInt(quantity) > 1) { //postage price var pricePostage1Selected = 0; var pricePostage2Selected = 0; if ($("#delivery").val() == "29") { pricePostage1Selected = 35.00; pricePostage2Selected = 17.50; } if ($("#delivery").val() == "90") { pricePostage1Selected = 35.00; pricePostage2Selected = 17.50; } if ($("#delivery").val() == "86") { pricePostage1Selected = 50.00; pricePostage2Selected = 25.00; } price = price - ((parseFloat(quantity) - 1) * (pricePostage1Selected - pricePostage2Selected)); } //if discount value is specified, subtract it var priceSpan = price; if ($("#discountValue").length > 0 && $("#discountValue").val() != "") priceSpan = priceSpan - parseFloat($("#discountValue").val()); //priceSpan = priceSpan * parseFloat(quantity); writeToLayer("spanPrice", priceSpan.toFixed(2)); frm.price.value = "" + price.toFixed(2); } function addItem() { var frm = window.document.frmOrder; frm.action = "orderRacing.jsp"; frm.instruction.value = ""; if (validate()) frm.submit(); } function addProduct() { var frm = window.document.frmOrder; frm.action = "orderRacing.jsp"; frm.instruction.value = "product"; if (validate()) frm.submit(); } function stepProducts() { var spUrl = window.document.location.href; spUrl = spUrl.substring(0, spUrl.lastIndexOf("/") + 1); window.document.location.href = spUrl + "order-product.jsp?regionID=13&dt=" + (new Date()).toString(); } function stepCovers() { var spUrl = window.document.location.href; spUrl = spUrl.substring(0, spUrl.lastIndexOf("/") + 1); window.document.location.href = spUrl + "orderRacing.jsp?dt=" + (new Date()).toString(); } function addItemStep2() { var frm = window.document.frmOrder; frm.action = "orderRacing.jsp"; frm.instruction.value = "addItemStep2"; if (validate()) frm.submit(); } function step2() { var frm = window.document.frmOrder; frm.action = "orderRacing2.jsp"; frm.instruction.value = ""; frm.submit(); } function deleteItem(index) { var frm = window.document.frmOrder; frm.action = "orderRacing.jsp"; frm.instruction.value = "delete"; frm.ind.value = index; frm.submit(); } function setPrintingCovers() { var frm = window.document.frmOrder; var cover = frm.cover; var printingcovers = frm.printingcovers; if (cover.options[cover.selectedIndex].value != "") { $("#printingcovers").val($("#cover").val()); } else { var div = document.getElementById("divPrintingCovers"); div.style.height = ""; div.style.visibility = "visible"; } if (cover.options[cover.selectedIndex].value != "3" && cover.options[cover.selectedIndex].value != "4") { //display divLeg var div = document.getElementById("divLeg"); div.style.height = ""; div.style.visibility = "visible"; hidePlateImage(); displayPlateImage(); displayFinOption(); displayFullOptions(); } else { //hide divLeg var div = document.getElementById("divLeg"); div.style.height = "0px"; div.style.visibility = "hidden"; hidePlateImage(); hideFinOption(); hideFin(); hideFullOptions(); hideLockingEyeOption(); } //display locking eye option if full, mooring or combo has been selected if (cover.options[cover.selectedIndex].value != "" && cover.options[cover.selectedIndex].value != "3") { showLockingEyeOption(); } } function showLockingEyeOption() { if (false) return; var div = document.getElementById("divLocking"); div.style.height = ""; div.style.visibility = "visible"; } function hideLockingEyeOption() { var div = document.getElementById("divLocking"); div.style.height = "0px"; div.style.visibility = "hidden"; var frm = window.document.frmOrder; frm.locking.selectedIndex = 0; } function doColour2() { var frm = window.document.frmOrder; var div = document.getElementById("divColour2"); if (frm.cover.options[frm.cover.selectedIndex].value == "1") { div.style.height = ""; div.style.visibility = "visible"; } else { div.style.height = "0px"; div.style.visibility = "hidden"; } } var tillerPrice = 0.00; function updateTillerPrice() { var tillerPrices = []; tillerPrices[tillerPrices.length] = [0, 20, 35.00]; tillerPrices[tillerPrices.length] = [21, 60, 45.00]; tillerPrices[tillerPrices.length] = [61, 100, 55.00]; tillerPrices[tillerPrices.length] = [101, 999, 75.00]; var frm = window.document.frmOrder; var hp = parseFloat(frm.hp.options[frm.hp.selectedIndex].value); for (var i = 0; i < tillerPrices.length; i++) { if (hp >= tillerPrices[i][0] && hp <= tillerPrices[i][1]) tillerPrice = tillerPrices[i][2]; } writeToLayer("spanTillerPrice", tillerPrice.toFixed(2)); var div = document.getElementById("divTiller"); if (tillerPrice != "0.00") { div.style.height = ""; div.style.visibility = "visible"; } else { div.style.height = "0px"; div.style.visibility = "hidden"; } }