jQuery(document).ready(function(){
jQuery("#input-688TAG-OB19SSI").change(function(){
if(jQuery("#input-688TAG-OB19SSI").prop("checked"))
{
// if this is overwrite_group-1 we need to take into account some things
// the visitor should still be able to select other engines
// disable the includes and checks it
jQuery("[id^=input-609]").each(function(){
if(jQuery(this).is(":visible") && jQuery(this).attr("color_rule_applied") != 1 && jQuery(this).attr("canvas_rule_applied") != 1 )
{
jQuery(this).prop("disabled", true);
jQuery(this).prop("included_option", true);
if(!jQuery(this).prop("checked"))
{
jQuery(this).prop("checked", true).change();
}
}
});
// add a note to the disable option to tell why this is disabled but included
//alert("
(Included in 688TAG-OB19SSI - Trailer Upgrade - Aluminum Tandem Axle with Brakes and Galvanized Wheels)
");
jQuery("[id^=note-609]").html("
(Included in 688TAG-OB19SSI - Trailer Upgrade - Aluminum Tandem Axle with Brakes and Galvanized Wheels)");
jQuery("[id^=input-609]").parent().parent().addClass("byb_option_green");
}
// here we reverse out everything from above
else
{
// if this is not a radio group
if(jQuery("#input-688TAG-OB19SSI").prop("type") == "checkbox")
{
// this was removed 3/2019 by rusty due to it not un disableing checkboxes. not sure why it was here in the first place?
// enables the includes
//jQuery("[id^=input-609]").prop("disabled",false);
}
// enables the includes
jQuery("[id^=input-609]").prop("disabled",false);
jQuery("[id^=input-609]").prop("included_option", false);
//if(!jQuery("#input-609").prop("checked"))
//{
//alert("i fire now");
//jQuery("#input-609").parent().parent().removeClass("byb_option_green");
//}
jQuery("#input-609").parent().parent().removeClass("byb_option_green");
// add a note to the disable option to tell why this is disabled but included
jQuery("#note-single-include-688TAG-OB19SSI-609").remove();
}
}); // end click listener
jQuery("#input-688TBG-OB19SSI").change(function(){
if(jQuery("#input-688TBG-OB19SSI").prop("checked"))
{
// if this is overwrite_group-1 we need to take into account some things
// the visitor should still be able to select other engines
// disable the includes and checks it
jQuery("[id^=input-609]").each(function(){
if(jQuery(this).is(":visible") && jQuery(this).attr("color_rule_applied") != 1 && jQuery(this).attr("canvas_rule_applied") != 1 )
{
jQuery(this).prop("disabled", true);
jQuery(this).prop("included_option", true);
if(!jQuery(this).prop("checked"))
{
jQuery(this).prop("checked", true).change();
}
}
});
// add a note to the disable option to tell why this is disabled but included
//alert("
(Included in 688TBG-OB19SSI - Trailer Upgrade - Black Tandem Axle with Brakes and Galvanized Wheels)
");
jQuery("[id^=note-609]").html("
(Included in 688TBG-OB19SSI - Trailer Upgrade - Black Tandem Axle with Brakes and Galvanized Wheels)");
jQuery("[id^=input-609]").parent().parent().addClass("byb_option_green");
}
// here we reverse out everything from above
else
{
// if this is not a radio group
if(jQuery("#input-688TBG-OB19SSI").prop("type") == "checkbox")
{
// this was removed 3/2019 by rusty due to it not un disableing checkboxes. not sure why it was here in the first place?
// enables the includes
//jQuery("[id^=input-609]").prop("disabled",false);
}
// enables the includes
jQuery("[id^=input-609]").prop("disabled",false);
jQuery("[id^=input-609]").prop("included_option", false);
//if(!jQuery("#input-609").prop("checked"))
//{
//alert("i fire now");
//jQuery("#input-609").parent().parent().removeClass("byb_option_green");
//}
jQuery("#input-609").parent().parent().removeClass("byb_option_green");
// add a note to the disable option to tell why this is disabled but included
jQuery("#note-single-include-688TBG-OB19SSI-609").remove();
}
}); // end click listener
}); // end of document ready
jQuery(document).ready(function(){
jQuery("#input-619NWT-OB19SSI").change(function(){
if(jQuery("#input-619NWT-OB19SSI").prop("checked"))
{
//alert("na_with here");
//alert("[id^=input-760]");
//alert(jQuery("[id^=input-760]").attr("title"));
// disable the includes and unchecks it
jQuery("[id^=input-760]").prop("disabled", true);
// determine if already checked
if(jQuery("[id^=input-760]").prop("checked"))
{
jQuery("[id^=input-760]").prop("checked",false).change();
}
// add a note to the disable option to tell why this is disabled and not available
if(jQuery("[id^=note-single-na_with-760-619NWT-OB19SSI]").length === 0)
{
jQuery("[id^=note-760]").append("
(N/A with 619NWT-OB19SSI - Mooring Cover)");
}
jQuery("[id^=input-760]").parent().parent().addClass("byb_option_red");
}
// here we reverse out everything from above
else
{
// enable the na with
jQuery("[id^=input-760]").prop("disabled",false);
// remove the option note
jQuery("[id^=note-single-na_with-760-619NWT-OB19SSI]").remove();
jQuery("[id^=input-760]").parent().parent().removeClass("byb_option_red");
}
}); // end click listener
// reverse
jQuery("[id^=input-760]").change(function(){
if(jQuery(this).prop("checked"))
{
//alert("input-619NWT-OB19SSI");
//alert(jQuery("[id^=input-619NWT-OB19SSI]").attr("title"));
//alert(jQuery("[id^=input-619NWT-OB19SSI]").is(":checked"));
// disable the includes and unchecks it
jQuery("#input-619NWT-OB19SSI").prop("disabled", true);
// determine if checked
if(jQuery("#input-619NWT-OB19SSI").prop("checked"))
{
jQuery("#input-619NWT-OB19SSI").removeAttr("checked").change();
}
//console.log("if of reverse input-619NWT-OB19SSI");
//alert("shoudl be disabled");
// add a note to the disable option to tell why this is disabled and not available
if(jQuery("[id^=note-single-na_with-619NWT-OB19SSI-760]").length === 0)
{
jQuery("#note-619NWT-OB19SSI").append("
(N/A with 760 )");
}
jQuery("[id^=input-619NWT-OB19SSI]").parent().parent().addClass("byb_option_red");
}
// here we reverse out everything from above
else
{
// enable the na with
jQuery("#input-619NWT-OB19SSI").prop("disabled",false);
// remove the option note
jQuery("[id^=note-single-na_with-619NWT-OB19SSI-760]").remove();
jQuery("[id^=input-619NWT-OB19SSI]").parent().parent().removeClass("byb_option_red");
}
}); // end click listener
jQuery("#input-686-OB19SSIBLK").change(function(){
if(jQuery("#input-686-OB19SSIBLK").prop("checked"))
{
//alert("na_with here");
//alert("[id^=input-688]");
//alert(jQuery("[id^=input-688]").attr("title"));
// disable the includes and unchecks it
jQuery("[id^=input-688]").prop("disabled", true);
// determine if already checked
if(jQuery("[id^=input-688]").prop("checked"))
{
jQuery("[id^=input-688]").prop("checked",false).change();
}
// add a note to the disable option to tell why this is disabled and not available
if(jQuery("[id^=note-single-na_with-688-686-OB19SSIBLK]").length === 0)
{
jQuery("[id^=note-688]").append("
(N/A with 686-OB19SSIBLK - Spare Tire Kit - Galvanized Wheel)");
}
jQuery("[id^=input-688]").parent().parent().addClass("byb_option_red");
}
// here we reverse out everything from above
else
{
// enable the na with
jQuery("[id^=input-688]").prop("disabled",false);
// remove the option note
jQuery("[id^=note-single-na_with-688-686-OB19SSIBLK]").remove();
jQuery("[id^=input-688]").parent().parent().removeClass("byb_option_red");
}
}); // end click listener
// reverse
jQuery("[id^=input-688]").change(function(){
if(jQuery(this).prop("checked"))
{
//alert("input-686-OB19SSIBLK");
//alert(jQuery("[id^=input-686-OB19SSIBLK]").attr("title"));
//alert(jQuery("[id^=input-686-OB19SSIBLK]").is(":checked"));
// disable the includes and unchecks it
jQuery("#input-686-OB19SSIBLK").prop("disabled", true);
// determine if checked
if(jQuery("#input-686-OB19SSIBLK").prop("checked"))
{
jQuery("#input-686-OB19SSIBLK").removeAttr("checked").change();
}
//console.log("if of reverse input-686-OB19SSIBLK");
//alert("shoudl be disabled");
// add a note to the disable option to tell why this is disabled and not available
if(jQuery("[id^=note-single-na_with-686-OB19SSIBLK-688]").length === 0)
{
jQuery("#note-686-OB19SSIBLK").append("
(N/A with 688 )");
}
jQuery("[id^=input-686-OB19SSIBLK]").parent().parent().addClass("byb_option_red");
}
// here we reverse out everything from above
else
{
// enable the na with
jQuery("#input-686-OB19SSIBLK").prop("disabled",false);
// remove the option note
jQuery("[id^=note-single-na_with-686-OB19SSIBLK-688]").remove();
jQuery("[id^=input-686-OB19SSIBLK]").parent().parent().removeClass("byb_option_red");
}
}); // end click listener
}); // end of document ready
jQuery(document).ready(function(){ jQuery("#input-800-OB19SSI").change(function(){
if(jQuery("#input-800-OB19SSI").prop("checked"))
{
// set a note for this option that other options are required
jQuery("[id^=note-single-requires-800-OB19SSI]").show();
// set the parent div to the yellow class
jQuery(this).parent().parent().addClass("byb_option_yellow");
// add a statement that only exists if this is a single require
// lets make sure this option isnt already required.
// this is a hack against two options requiring each other resulting in an infinite loop
if(jQuery("[id^=note-single-required-by-688D-800-OB19SSI]").length === 0)
{
// check the required item
// if this is not in an overwrite group
//if(jQuery("[id^=input-688D]").prop("type") != "radio")
if(jQuery("[id^=input-688D]").prop("type") != "radio" && !jQuery(this).prop("single_selection_group")){
jQuery("[id^=input-688D]").prop("disabled", true);
}
else if(jQuery("[id^=input-688D]").prop("type") == "radio"){
// here we have a radio group
// disable the entire group
//jQuery("input[name=jQuery("input[id^=input-688D]").attr("name")]").attr("disabled",true);
var temp_name = "";
temp_name = jQuery("input[id^=input-688D]").attr("name");
console.log(temp_name);
jQuery("input[name="+temp_name+"]").attr("disabled",true);
// enable this option
jQuery("[id^=input-688D]").prop("disabled", false);
}
if(!jQuery("[id^=input-688D]").prop("checked")){
jQuery("[id^=input-688D]").prop("checked", true).change();
}
// run a price tally - wasnt calculating proper cost 2/6/13 - rusty
checked_boxes_price_tally();
// set the parent div of the required option the yellow class
jQuery("[id^=input-688D]").parent().parent().addClass("byb_option_yellow");
// add a note stating why this option is checked
jQuery("[id^=note-688D]").append("
(Required By: 800-OB19SSI-CE Package)");
}
}
// here we reverse out everything from above
else
{
// set the parent div to the normal class
jQuery(this).parent().parent().removeClass("byb_option_yellow");
// remove the requires note
jQuery("[id^=note-single-requires-800-OB19SSI]").hide();
jQuery("[id^=note-single-required-by-800-OB19SSI]").hide();
// add a statement that only exists if this was a single require and it reverses the notes and colors above
// set the parent div of the required option the yellow class
jQuery("[id^=input-688D]").parent().parent().removeClass("byb_option_yellow");
jQuery("[id^=input-688D]").prop("disabled", false);
// add a note stating why this option is checked
jQuery("[id^=note-single-required-by-688D-800-OB19SSI]").remove();
// if this is a radio group we need to re-enable it
if(jQuery("[id^=input-688D]").prop("type") == "radio"){
// enable the entire group
var temp_name = "";
temp_name = jQuery("input[id^=input-688D]").attr("name");
console.log("z-"+temp_name);
jQuery("input[name="+temp_name+"]").attr("disabled",false);
}
}
}); // end click listener
}); // end of document ready
jQuery(document).ready(function(){ option_group_data["325-OB19SSI"] = {}; option_group_data["325-OB19SSI"]["part_groups"] = new Array();
option_group_data["325-OB19SSI"]["part_groups"].push("71");
option_group_data["327-OB19SSI"] = {}; option_group_data["327-OB19SSI"]["part_groups"] = new Array();
option_group_data["327-OB19SSI"]["part_groups"].push("72");
option_group_data["633-OB19SSI"] = {}; option_group_data["633-OB19SSI"]["available_with"] = new Array();
option_group_data["633-OB19SSI"]["available_with_compound"] = new Array();
option_group_data["633-OB19SSI"]["available_with"].push("71");
option_group_data["635-OB19SSI"] = {}; option_group_data["635-OB19SSI"]["available_with"] = new Array();
option_group_data["635-OB19SSI"]["available_with_compound"] = new Array();
option_group_data["635-OB19SSI"]["available_with"].push("72");
option_group_data["619ST-OB19SSI"] = {}; option_group_data["619ST-OB19SSI"]["available_with"] = new Array();
option_group_data["619ST-OB19SSI"]["available_with_compound"] = new Array();
option_group_data["619ST-OB19SSI"]["available_with"].push("4");
option_group_data["760W-OB19SSI"] = {}; option_group_data["760W-OB19SSI"]["part_groups"] = new Array();
option_group_data["760W-OB19SSI"]["part_groups"].push("4");
option_group_data["688SAG-OB19SSI"] = {}; option_group_data["688SAG-OB19SSI"]["part_groups"] = new Array();
option_group_data["688SAG-OB19SSI"]["part_groups"].push("92");
option_group_data["688TAG-OB19SSI"] = {}; option_group_data["688TAG-OB19SSI"]["part_groups"] = new Array();
option_group_data["688TAG-OB19SSI"]["part_groups"].push("91");
option_group_data["688TBG-OB19SSI"] = {}; option_group_data["688TBG-OB19SSI"]["part_groups"] = new Array();
option_group_data["688TBG-OB19SSI"]["part_groups"].push("93");
option_group_data["686-OB19SSIALM"] = {}; option_group_data["686-OB19SSIALM"]["available_with"] = new Array();
option_group_data["686-OB19SSIALM"]["available_with_compound"] = new Array();
option_group_data["686-OB19SSIALM"]["available_with"].push("92");
option_group_data["686T-OB19SSIALM"] = {}; option_group_data["686T-OB19SSIALM"]["available_with"] = new Array();
option_group_data["686T-OB19SSIALM"]["available_with_compound"] = new Array();
option_group_data["686T-OB19SSIALM"]["available_with"].push("91");
option_group_data["686T-OB19SSIBLK"] = {}; option_group_data["686T-OB19SSIBLK"]["available_with"] = new Array();
option_group_data["686T-OB19SSIBLK"]["available_with_compound"] = new Array();
option_group_data["686T-OB19SSIBLK"]["available_with"].push("93");
}); // end of document ready
jQuery(document).ready(function(){
jQuery("#boat_build_form").validate({
rules: {
name: {
required: true,
minlength: 2
},
email: {
required: true,
email: true
},
zip: {
required: true,
minlength: 3
}
},
messages: {
name: " -Name Required ",
email: " -Please enter a valid email address",
zip: " -Zip/Postal Required"
}
}); // end validate
});// end doc ready
jQuery(document).ready(function(){
checked_boxes_price_tally();
checked_boxes_list_tally();
jQuery(".byb_checkbox:input").change(function(){
// if this is a single selection and if this option is checked
if(jQuery(this).attr("single_selection_group") && jQuery(this).prop("checked"))
{
// loop thorugh all options and remove checks from this single selection group
var single_selection_group = jQuery(this).attr("single_selection_group");
var single_selection_checked_option = jQuery(this).val();
jQuery("#boat_build_form input:checked").each(function(){
// if this option is in the single selection group AND it is NOT the same part number as selected above
if(jQuery(this).attr("single_selection_group") == single_selection_group && jQuery(this).val() != single_selection_checked_option)
{
jQuery(this).prop("checked",false).change();
}
});
}
//includes();
apply_part_groups();
apply_graphics();
checked_boxes_price_tally();
checked_boxes_list_tally();
setCanvasColor();
setXtremeArchGraphics();
//alert(overwrite_group_total["msrp"]);
});
});
function checked_boxes_price_tally(){
// here we get the volume discount to be used in the final tally price
// these boats do NOT get volume discount applied to them
///////// !!!!!!!!!!! Volume discount has been moved to the line item !!!!!!!!!!!!!!!!!!!!/////////
//if(item_id != "342" && item_id != "345")
// {
// var volume_discount = (100 - parseFloat(jQuery("#volume_discount-holder").val()-0))/100;
// }
//else
// {
// var volume_discount = 1;
// }
var dealer_installed_option_total = 0;
// get msrp of dealer installed options
jQuery(".dealer_installed_option_price").each(function(){
if(jQuery(this).val())
{
dealer_installed_option_total = dealer_installed_option_total+parseFloat(jQuery(this).val());
}
});
var checked_boxes_total = new Array();
checked_boxes_total["msrp"] = 0;
checked_boxes_total["msrp_base"] = 0;
checked_boxes_total["dealer_price"] = 0;
checked_boxes_total["dealer_margin"] = 0;
base_multiplier
jQuery("#boat_build_form input:checked").each(function(){
//alert(this.id);
//alert(jQuery("input").attr("disabled"));
// if the checkbox is not disabled
// this first line weeds out tbd pricing of 999999
//if(!jQuery(this).prop("disabled") && jQuery(this).attr("msrp") && jQuery(this).attr("is_tbd") != 1 && jQuery(this).attr("is_tbd") != "1")
//if((!jQuery(this).prop("disabled") || jQuery(this).attr("is_required")) && jQuery(this).attr("msrp") && jQuery(this).val() != "NPPNPRICE22S" )
if(!jQuery(this).prop("included_option") && jQuery(this).attr("msrp"))
{
//alert(jQuery(this).attr("dealer_margin"));
//alert(jQuery(this).attr("id"));
// we have base
if(jQuery(this).attr("overwrite_group") == 1){
checked_boxes_total["msrp_base"] = checked_boxes_total["msrp_base"] + (parseFloat(jQuery(this).attr("msrp"))*base_multiplier);
}
// we have option
else{
checked_boxes_total["msrp_base"] = checked_boxes_total["msrp_base"] + (parseFloat(jQuery(this).attr("msrp"))*option_multiplier);
}
checked_boxes_total["msrp"] = checked_boxes_total["msrp"] + parseFloat(jQuery(this).attr("msrp"));
checked_boxes_total["dealer_price"] = checked_boxes_total["dealer_price"] + parseFloat(jQuery(this).attr("dealer_cost"));
checked_boxes_total["dealer_margin"] = checked_boxes_total["dealer_margin"] + parseFloat(jQuery(this).attr("dealer_margin"));
}
}); // end checked each
// cycle through
//alert(checked_boxes_total["msrp"]);
// here we format the price
// here we send the price to the page
jQuery(".msrp_holder").html(checked_boxes_total["msrp_base"]+dealer_installed_option_total).formatCurrency({ roundToDecimalPlace:0 });
jQuery(".msrp_container").html(checked_boxes_total["msrp"]+dealer_installed_option_total).formatCurrency({ roundToDecimalPlace:0 });
jQuery(".dealer_price_container").html(checked_boxes_total["dealer_price"]).formatCurrency({ roundToDecimalPlace:0 });
jQuery(".dealer_margin_price_container").html(checked_boxes_total["dealer_margin"]+dealer_installed_option_total).formatCurrency({ roundToDecimalPlace:0 });
} function apply_graphics(){
// hide all the graphic overlays
jQuery(".boat_builder_graphic_overlay").css("display","none");
jQuery(".byb_checkbox").each(function() {
// if this option has an overlay
if(jQuery(this).attr("graphic_id") !== 0)
{
// if this option is checked
if(this.checked)
{
// possibly put overlays in csv to show more than one overlay per option..?
jQuery("#boat_builder_graphic_overlay_"+jQuery(this).attr("graphic_id")).css("display","block");
//alert("#boat_builder_graphic_overlay_"+jQuery(this).attr("graphic_id"));
}
}// end if
});
} function checked_boxes_list_tally(){
// empty the list container
jQuery("#option_list_tally_table").empty();
jQuery("input:checked").each(function(){
//alert(this.id);
//jQuery("#option_list_tally").append(this.next().child());
if(jQuery(this).attr("title") && jQuery(this).attr("option_group") != 16)
{
var price_msrp = jQuery(this).attr("msrp").replace(/(\d)(?=(\d\d\d)+(?!\d))/g, "$1,");
if(country == 226 || country == 138)
{
if ((jQuery(this).prop("included_option")))
{
jQuery("#option_list_tally_table").append(''+jQuery(this).attr("title")+' | $0 |
');
}
else
{
jQuery("#option_list_tally_table").append(''+jQuery(this).attr("title")+' | $'+price_msrp+' |
');
}
}
else
{
jQuery("#option_list_tally_table").append(''+jQuery(this).attr("title")+' | |
');
}
}
}); // end checked each
//
}
function selectDefaultEngine(){
//alert('firing');
var min_price_engine = 999999999999999;
var min_price_engine_id;
jQuery('input:radio[name=overwrite_group-1]').each(function(){
var temp_msrp = parseInt(jQuery(this).attr('msrp'));
// if this engine is less than the previous one we set it as the sel no
if(temp_msrp < min_price_engine)
{
min_price_engine_id = jQuery(this).attr('id');
min_price_engine = temp_msrp;
}
});
// check the cheapest engine
//alert(min_price_engine_id);
jQuery('#'+min_price_engine_id).prop('checked',true).change();
}
jQuery(document).ready(function(){
// click the package that is selected
//jQuery('input:radio[name=overwrite_group-7]:checked').change();
//alert('here2');
// engine
if(!jQuery('input:radio[name=overwrite_group-1]:checked').val())
{
//alert('here');
selectDefaultEngine();
}
else
{
//alert('here2');
jQuery('input:radio[name=overwrite_group-1]:checked').change();
}
// kicker brand
//jQuery('input:radio[name=overwrite_group-58]:checked').change();
//trailer brand
//jQuery('input:radio[name=overwrite_group-60]:checked').change();
//accent color
//jQuery('input:radio[name=overwrite_group-37]:checked').change();
//hull color
//jQuery('input:radio[name=overwrite_group-11]:checked').change();
//canvas color
//jQuery('input:radio[name=overwrite_group-12]:checked').change();
//jQuery('input:radio[name=overwrite_group-65]:checked').change();
jQuery('#boat_build_form input:checked').each(function(){
jQuery(this).change();
});
setXtremeArchGraphics()
});