', { 'src': "https://www.youtube.com/embed/" + $(this).attr("id") + "?rel=0;&autoplay=1", "allowfullscreen": "allowfullscreen", "allow": "autoplay; encrypted-media" }); $(this).replaceWith(iframe); }); function setSelected(id, sec) { if (sec == "combo-options") { $("#shell-options input[name*='Selected']").val(false); $("#cabinet-options input[name*='Selected']").val(false); $("#shell-options .step_combo.selected").removeClass("selected"); $("#cabinet-options .step_combo.selected").removeClass("selected"); var configID = $("#" + id + "__Value").val(); $.ajax({ type: "POST", url: "https://www.premierhottubs.co.uk/store/updateselectedcombo?id=" + configID, dataType: "html", success: function (data) { $('#updateprice').html(data); $('#h-configuration-id').val(configID); setTotals(); $('html, body').animate({ scrollTop: $('#totalcost').offset().top }, 1000); } }); $("#" + id + "__Selected").val(true); } else { $("#combo-options input").attr("checked", false); $("#combo-options input[name*='Selected']").val(false); $("#combo-options .step_combo.selected").removeClass("selected"); var configID = $("#ShellList_0__Value").val(); if (sec == "cabinet-options") { $("#cabinet-options input[name*='Selected']").val(false); $("#CabinetList_" + id + "__Selected").val(true); } else { $("#shell-options input[name*='Selected']").val(false); $("#ShellList_" + id + "__Selected").val(true); } $.ajax({ type: "POST", url: "https://www.premierhottubs.co.uk/store/updateselectedcolour", data: $("#add-ht-basket-form").serialize() + "&id=" + configID, dataType: "html", success: function (data) { $('#updateprice').html(data); $('#h-configuration-id').val(configID); setTotals(); } }); } } function setTotals() { console.log("totals set"); $('.hottubtotal').html($('#topprice').html()); $('.deposittotal').html($('#depositamount').html()); var deposit = parseFloat($('#depositamount').html().replace('£', '').replace(',', '')); var price = parseFloat($('#topprice').html().replace('£', '').replace(',', '')); var creditAmount = price - deposit; var monthlyPay = creditAmount / 48; $("#creditpay").html("£" + creditAmount.toFixed(2)); $("#monthlypay").html("£" + (monthlyPay).toFixed(2)); $('#depositpaymenttoday').html($('#reservedeposit').html()); } var owl = $('.owl-carousel'); owl.owlCarousel({ items: 1, loop: true, dots: false, nav: true, navText: ["", ""], margin: 20, autoplay: true, autoplayTimeout: 5000, autoplayHoverPause: true, stagePadding: 19, responsive: { 581: { items: 2, stagePadding: 14, margin: 15, }, 991: { items: 3, stagePadding: 14, margin: 15, }, 1229: { items: 4, stagePadding: 14, margin: 15, } } }); $('.play').on('click', function () { owl.trigger('play.owl.autoplay', [1000]); }); $('.stop').on('click', function () { owl.trigger('stop.owl.autoplay'); }); function checkReturnUrl() { if (window.location.href.indexOf("auth=true") > -1) { askQuest(3, 'true'); } } function redraw() { altprodslider.redrawSlider(); }