/* ------------------------------------------------------------- // Application : JavaScript for the Availability Checker and Broadband Pages // Written by : Russ Jones // Email : russell.jones@zeninternet.co.uk // Created : 14/03/2013 // Last Updated : 23/04/2014 by RJ // Last Updated : 03/02/2016 by KW // capitalise postcodes and return to fire go on availability checker ** Notes ** Need to be careful with IDs because of .NET3.5 webforms naming policy - use $([id*=elementID]) as the selector, wildcard will select any element ending with elementID. Classes work normally. ------------------------------------------------------------- */ $(document).ready(function () { $(".showADSL").live('click', function(){ $(this).parents(".pointer-block").height("450px").children(".pointer").show(); $('.ADSLProducts').css("margin-top","20px;").slideDown(); }); $(".zen-button.adsl").live('click', function(){ $(".pointer").hide(); $(this).parents(".pointer-block").height("450px").children(".pointer").show(); $(this).parents(".columns-4 .pointer-block").height("487px").children(".pointer").show(); $('.row.adsl').show(); $('.row.leased-lines').hide(); $('.row.fibre').hide(); $('div.productBBSection').show(); $('div.ADSLProducts').css("margin-top","20px;").slideDown(); }); $(".zen-button.leased-lines").live('click', function(){ $(".pointer").hide(); $(this).parents(".pointer-block").height("450px").children(".pointer").show(); $('.row.adsl').hide(); $('.row.leased-lines').show(); $('.row.fibre').hide(); }); $(".zen-button.fibre").live('click', function(){ $(".pointer").hide(); $(this).parents(".pointer-block").height("450px").children(".pointer").show(); $(this).parents(".columns-4 .pointer-block").height("487px").children(".pointer").show(); $('.row.adsl').hide(); $('.row.leased-lines').hide(); $('.row.fibre').show(); }); //#region "Availability Checker" /* ------------------------------------------------------------- Availability Checker ------------------------------------------------------------- */ /* This section does some basic validation, getting and setting the default values of the buttons. I can be superseded by HTML5 input placeholder, but we can't switch to this yet if ($('.phone_number').val() == "Enter Your Phone Number...") { $('.phone_number').css('color', '#999999'); } else { $('.phone_number').css('color', '#333333'); } if ($('.post_code').val() == "Enter Your Postcode...") { $('.post_code').css('color', '#999999'); } else { $('.post_code').css('color', '#333333'); } */ $('.speed_check_button').live('click', function () { if (($('.post_code').val() != "") && ($('.phone_number').val() != "")) { $("[id*=pnlErrorBox]").hide(); $("[id*=pnlInputArea]").hide(); $('.ajax_loader').show(); return true; } else{ $("span[id*=lblError]").text("Please enter both a valid telephone number and post code"); var errorOffset = $("[id$=btnCheckSpeed]").offset(); $("[id*=pnlErrorBox]").css('top', (errorOffset.top -190) + "px").show(); return false; } }); $("[id*=pnlErrorBox] div.close").live('click', function(){ $("[id*=pnlErrorBox]").hide(); }); if (($('.post_code').val() != "") && ($('.phone_number').val() != "")) { $('.speed_check_button').trigger('click'); } $(".speed_check_trigger").live('click', function(){ $('.speed_check_button').trigger('click'); }); $("[id*=pnlsuperConnected]").live('click', function(){ $(".superConnected").show(); }); $(".superConnected-close").live('click', function(){ $(".superConnected").hide(); }); /* $('.phone_number').live('focus', function () { if ($('.phone_number').val() == "Enter Your Phone Number...") { $('.phone_number').attr('value', ''); $('.phone_number').css('color', '#333333'); } }); $('.phone_number').live('blur', function () { if ($('.phone_number').val() == "") { $('.phone_number').attr('value', 'Enter Your Phone Number...'); $('.phone_number').css('color', '#999999'); } }); $('.post_code').live('focus', function () { if ($('.post_code').val() == "Enter Your Postcode...") { $('.post_code').attr('value', ''); $('.post_code').css('color', '#333333'); } }); $('.post_code').live('blur', function () { if ($('.post_code').val() == "") { $('.post_code').attr('value', 'Enter Your Postcode...'); $('.post_code').css('color', '#999999'); } }); */ $("[id*=pnlFOSuperConnected]").live('click', function () { $(".superConnectedFibreOffice").show(); }); $(".superConnectedFibreOffice-close").live('click', function (e) { $(".superConnectedFibreOffice").hide(); e.stopPropagation(); }); //Capitalise postcodes $("input.post_code").keypress(function () {$(this).val($(this).val().toUpperCase()); }); $("input.post_code").blur(function () { $(this).val($(this).val().toUpperCase()); }); //"Go" button to fire checked $(".btn_availability-checker").parent("div.form").first().keydown(function (event) { if (event.keyCode == 13) { debugger; if ($(this).children("a.btn_availability-checker").trigger('click')) { var _el = $(this).children("a.btn_availability-checker"); eval(_el.attr('onclick')); eval(_el.attr('href')); } return false; } else { return true; } }); /* ------------------------------------------------------------- End of Availability Checker ------------------------------------------------------------- */ //#endregion "Availability Checker" /* --------------------------------------------- Broadband Pages (sliders need to be in pageLoad to function correctly) --------------------------------------------- */ /* Function to show/hide the learn more section */ $('#fibre_info_link').live('click', function () { $('#fibre_link_image').toggleClass('hide_div'); $('#fibre_info').slideToggle('fast', function () { }); }); $('#broadband_info_link').live('click', function () { $('#broadband_link_image').toggleClass('hide_div'); $('#broadband_info').slideToggle('fast', function () { }); }); $('#fibre_info_link_on').live('click', function () { $('#fibre_link_image_on').toggleClass('hide_div'); $('#fibre_info_on').slideToggle('fast', function () { }); }); $('#broadband_info_link_on').live('click', function () { $('#broadband_link_image_on').toggleClass('hide_div'); $('#broadband_info_on').slideToggle('fast', function () { }); }); }); function pageLoad(sender, args) { /* -------------------- Function to create the slider object and functionality for fibre optic broadband -------------------- */ $(function () { var slide_options = 5; var picker_width = $("div.usage_picker").width(); var option_size = picker_width / slide_options; var level_size = $("div.scale").width() / (slide_options - 1); $("#fibre_level").css("width", level_size + "px"); $("#fibre_slider").slider({ range: "min", value: 2, min: 1, max: slide_options, step: 1, slide: function (event, ui) { if (ui.value == 1) { $("input.fibre_product_choice").val("Lite"); $("span.fibre_product_choice").html("Lite"); $("[id*=lblFibrePrice] h2").html("£23.00/month"); $("[id*=pnlFibreSelector] li.upload_speed").html('Upto 1.9Mbps Estimated Upload'); $("[id*=hypOrderFibre]").attr("href", "http://zen.co.uk/ordering-redirect.aspx?opp=553"); $("#fibre_level").css("width", "0"); } else if (ui.value == 2) { $("input.fibre_product_choice").val("Active"); $("span.fibre_product_choice").html("Active"); $("[id*=lblFibrePrice] h2").html("£29.50/month"); $("#fibre_level").css("width", level_size); if ($('[id*=lblMaxFibreUpload]').html() != null) { $("[id*=pnlFibreSelector] li.upload_speed").html('Upto ' + $('[id*=lblMaxFibreUpload]').html() + ' Estimated Upload'); } else { $("[id*=pnlFibreSelector] li.upload_speed").html('Upto 19Mbps Estimated Upload'); } $("[id*=hypOrderFibre]").attr("href", "http://zen.co.uk/ordering-redirect.aspx?opp=506"); } else if (ui.value == 3) { $("input.fibre_product_choice").val("Pro"); $("span.fibre_product_choice").html("Pro"); $("[id*=lblFibrePrice] h2").html("£38.00/month"); $("#fibre_level").css("width", level_size * 2); if ($('[id*=lblMaxFibreUpload]').html() != null) { $("[id*=pnlFibreSelector] li.upload_speed").html('Upto ' + $('[id*=lblMaxFibreUpload]').html() + ' Estimated Upload'); } else { $("[id*=pnlFibreSelector] li.upload_speed").html('Upto 19Mbps Estimated Upload'); } $("[id*=hypOrderFibre]").attr("href", "http://zen.co.uk/ordering-redirect.aspx?opp=507"); } else if (ui.value == 4) { $("input.fibre_product_choice").val("Office"); $("span.fibre_product_choice").html("Office"); $("[id*=lblFibrePrice] h2").html("£55.00/month"); $("#fibre_level").css("width", level_size * 3); if ($('[id*=lblMaxFibreUpload]').html() != null) { $("[id*=pnlFibreSelector] li.upload_speed").html('Upto ' + $('[id*=lblMaxFibreUpload]').html() + ' Estimated Upload'); } else { $("[id*=pnlFibreSelector] li.upload_speed").html('Upto 19Mbps Estimated Upload'); } $("[id*=hypOrderFibre]").attr("href", "http://zen.co.uk/ordering-redirect.aspx?opp=508"); } else if (ui.value == 5) { $("input.fibre_product_choice").val("Office Plus"); $("span.fibre_product_choice").html("Office Plus"); $("[id*=lblFibrePrice] h2").html("£65.00/month"); $("#fibre_level").css("width", level_size * 4); if ($('[id*=lblMaxFibreUpload]').html() != null) { $("[id*=pnlFibreSelector] li.upload_speed").html('Upto ' + $('[id*=lblMaxFibreUpload]').html() + ' Estimated Upload'); } else { $("[id*=pnlFibreSelector] li.upload_speed").html('Upto 19Mbps Estimated Upload'); } $("[id*=hypOrderFibre]").attr("href", "http://zen.co.uk/ordering-redirect.aspx?opp=509"); } } }); $("input.fibre_product_choice").val("Active"); $("span.fibre_product_choice").html("Active"); /* -------------------- The Legend of the Slider™ -------------------- */ var options = ["20GB", "100GB", "200GB", "400GB", "1000GB"]; var option_width = $('#fibre_slider').width() / 5; //alert(option_width); $('#fibre_slider').after('
'); for (var i = 0; i < options.length; i++) { $('[id*=pnlFibreSelector] .ui-slider-legend').append('

' + options[i] + '

'); } $('.ui-widget-cap').click(function () { $(this).parent().children('.ui-slider').slider({ value: '5' }); $("input.fibre_product_choice").val("Office Plus"); $("span.fibre_product_choice").html("Office Plus"); $("[id*=lblFibrePrice] h2").html("£65.00/month"); $("#fibre_level").css("width", level_size * 4); if ($('[id*=lblMaxFibreUpload]').html() != null) { $("[id*=pnlFibreSelector] li.upload_speed").html('Upto ' + $('[id*=lblMaxFibreUpload]').html() + ' Estimated Upload'); } else { $("[id*=pnlFibreSelector] li.upload_speed").html('Upto 19Mbps Estimated Upload'); } $("[id*=hypOrderFibre]").attr("href", "http://zen.co.uk/ordering-redirect.aspx?opp=509"); }); /* -------------------- End of the Legend of the Slider™ -------------------- */ }); /* -------------------- End of Function to create the slider object and functionality for fibre optic broadband -------------------- */ /* -------------------- Function to create the slider object and functionality for business broadband -------------------- */ $(function () { var slide_options = 5; var picker_width = $("div.usage_picker").width(); var option_size = picker_width / slide_options; var level_size = $("div.scale").width() / (slide_options - 1); $("#broadband_level").css("width", level_size + "px"); $("#broadband_slider").slider({ range: "min", value: 2, min: 1, max: slide_options, step: 1, slide: function (event, ui) { if (ui.value == 1) { $("input.broadband_product_choice").val("Lite"); $("span.broadband_product_choice").html("Lite"); $("span.broadband_price h2").html("£18.37/month"); $("[id*=hypOrderBroadband]").attr("href", "http://zen.co.uk/ordering-redirect.aspx?opp=3"); $("#broadband_level").css("width", "0"); } else if (ui.value == 2) { $("input.broadband_product_choice").val("Active"); $("span.broadband_product_choice").html("Active"); $(".broadband_price h2").html("£25.52/month"); $("[id*=hypOrderBroadband]").attr("href", "http://zen.co.uk/ordering-redirect.aspx?opp=1"); $("#broadband_level").css("width", level_size); } else if (ui.value == 3) { $("input.broadband_product_choice").val("Pro"); $("span.broadband_product_choice").html("Pro"); $(".broadband_price h2").html("£35.74/month"); $("[id*=hypOrderBroadband]").attr("href", "http://zen.co.uk/ordering-redirect.aspx?opp=2"); $("#broadband_level").css("width", level_size * 2); } else if (ui.value == 4) { $("input.broadband_product_choice").val("Office"); $("span.broadband_product_choice").html("Office"); $(".broadband_price h2").html("£45.00/month"); $("[id*=hypOrderBroadband]").attr("href", "http://zen.co.uk/ordering-redirect.aspx?opp=5"); $("#broadband_level").css("width", level_size * 3); } else if (ui.value == 5) { $("input.broadband_product_choice").val("Office Max"); $("span.broadband_product_choice").html("Office Max"); $(".broadband_price h2").html("£79.00/month"); $("[id*=hypOrderBroadband]").attr("href", "http://zen.co.uk/ordering-redirect.aspx?opp=4"); $("#broadband_level").css("width", level_size * 4); } } }); $("input.broadband_product_choice").val("Active"); $("span.broadband_product_choice").html("Active"); /* -------------------- The Legend of the Slider™ -------------------- */ var options = ["20GB", "100GB", "200GB", "400GB", "2000GB"]; var option_width = $('#broadband_slider').width() / slide_options; $('#broadband_slider').after('
'); for (var i = 0; i < options.length; i++) { $('[id*=pnlBroadbandSelector] .ui-slider-legend').append('

' + options[i] + '

'); } $('.ui-widget-cap').click(function () { $(this).parent().children('.ui-slider').slider({ value: '5' }); $("input.broadband_product_choice").val("Office Max"); $("span.broadband_product_choice").html("Office Max"); $(".broadband_price h2").html("£79.00/month"); $("[id*=hypOrderBroadband]").attr("href", "http://zen.co.uk/ordering-redirect.aspx?opp=4"); $("#broadband_level").css("width", level_size * 4); }); /* -------------------- End of the Legend of the Slider™ -------------------- */ }); /* -------------------- End of Function to create the slider object and functionality for business broadband -------------------- */ /* -------------------- Function to create the slider object and functionality for fibre optic broadband On Net-------------------- */ $(function () { var slide_options = 5; var picker_width = $("div.usage_picker").width(); var option_size = picker_width / slide_options; var level_size = $("div.scale").width() / (slide_options - 1); $("#fibre_level_on").css("width", level_size + "px"); $("#fibre_slider_on").slider({ range: "min", value: 2, min: 1, max: slide_options, step: 1, slide: function (event, ui) { if (ui.value == 1) { $("input.fibre_product_choice").val("Lite"); $("span.fibre_product_choice").html("Lite"); $("[id*=lblFibrePriceOn] h2").html("£23.00/month"); $("[id*=pnlFibreSelectorOn] li.upload_speed").html('Upto 1.9Mbps Estimated Upload'); $("[id*=hypOrderFibreOn]").attr("href", "http://zen.co.uk/ordering-redirect.aspx?opp=553"); $("#fibre_level_on").css("width", "0"); } else if (ui.value == 2) { $("input.fibre_product_choice").val("Active"); $("span.fibre_product_choice").html("Active"); $("[id*=lblFibrePriceOn] h2").html("£29.50/month"); $("#fibre_level_on").css("width", level_size); if ($('[id*=lblMaxFibreUpload]').html() != null) { $("[id*=pnlFibreSelectorOn] li.upload_speed").html('Upto ' + $('[id*=lblMaxFibreUpload]').html() + ' Estimated Upload'); } else { $("[id*=pnlFibreSelectorOn] li.upload_speed").html('Upto 19Mbps Estimated Upload'); } $("[id*=hypOrderFibreOn]").attr("href", "http://zen.co.uk/ordering-redirect.aspx?opp=506"); } else if (ui.value == 3) { $("input.fibre_product_choice").val("Pro"); $("span.fibre_product_choice").html("Pro"); $("[id*=lblFibrePriceOn] h2").html("£38.00/month"); $("#fibre_level_on").css("width", level_size * 2); if ($('[id*=lblMaxFibreUpload]').html() != null) { $("[id*=pnlFibreSelectorOn] li.upload_speed").html('Upto ' + $('[id*=lblMaxFibreUpload]').html() + ' Estimated Upload'); } else { $("[id*=pnlFibreSelectorOn] li.upload_speed").html('Upto 19Mbps Estimated Upload'); } $("[id*=hypOrderFibreOn]").attr("href", "http://zen.co.uk/ordering-redirect.aspx?opp=507"); } else if (ui.value == 4) { $("input.fibre_product_choice").val("Office"); $("span.fibre_product_choice").html("Office"); $("[id*=lblFibrePriceOn] h2").html("£55.00/month"); $("#fibre_level_on").css("width", level_size * 3); if ($('[id*=lblMaxFibreUpload]').html() != null) { $("[id*=pnlFibreSelectorOn] li.upload_speed").html('Upto ' + $('[id*=lblMaxFibreUpload]').html() + ' Estimated Upload'); } else { $("[id*=pnlFibreSelectorOn] li.upload_speed").html('Upto 19Mbps Estimated Upload'); } $("[id*=hypOrderFibreOn]").attr("href", "http://zen.co.uk/ordering-redirect.aspx?opp=508"); } else if (ui.value == 5) { $("input.fibre_product_choice").val("Office Plus"); $("span.fibre_product_choice").html("Office Plus"); $("[id*=lblFibrePriceOn] h2").html("£65.00/month"); $("#fibre_level_on").css("width", level_size * 4); if ($('[id*=lblMaxFibreUpload]').html() != null) { $("[id*=pnlFibreSelectorOn] li.upload_speed").html('Upto ' + $('[id*=lblMaxFibreUpload]').html() + ' Estimated Upload'); } else { $("[id*=pnlFibreSelectorOn] li.upload_speed").html('Upto 19Mbps Estimated Upload'); } $("[id*=hypOrderFibreOn]").attr("href", "http://zen.co.uk/ordering-redirect.aspx?opp=509"); } } }); $("input.fibre_product_choice").val("Active"); $("span.fibre_product_choice").html("Active"); /* -------------------- The Legend of the Slider™ -------------------- */ var options = ["20GB", "100GB", "200GB", "400GB", "1000GB"]; var option_width = $('.usage_picker').width() / 5; $('#fibre_slider_on').after('
'); for (var i = 0; i < options.length; i++) { $('[id*=pnlFibreSelectorOn] .ui-slider-legend').append('

' + options[i] + '

'); } /* -------------------- End of the Legend of the Slider™ -------------------- */ $('.ui-widget-cap').click(function () { $(this).parent().children('.ui-slider').slider({ value: '5' }); $("input.fibre_product_choice").val("Office Plus"); $("span.fibre_product_choice").html("Office Plus"); $("[id*=lblFibrePriceOn] h2").html("£65.00/month"); $("#fibre_level_on").css("width", level_size * 4); if ($('[id*=lblMaxFibreUpload]').html() != null) { $("[id*=pnlFibreSelectorOn] li.upload_speed").html('Upto ' + $('[id*=lblMaxFibreUpload]').html() + ' Estimated Upload'); } else { $("[id*=pnlFibreSelectorOn] li.upload_speed").html('Upto 19Mbps Estimated Upload'); } $("[id*=hypOrderFibreOn]").attr("href", "http://zen.co.uk/ordering-redirect.aspx?opp=509"); }); }); /* -------------------- End of Function to create the slider object and functionality for fibre optic broadband On Net-------------------- */ /* -------------------- Function to create the slider object and functionality for business broadband On Net-------------------- */ $(function () { var slide_options = 5; var picker_width = $("div.usage_picker").width(); var option_size = picker_width / slide_options; var level_size = $("div.scale").width() / (slide_options - 1); $("#broadband_level_on").css("width", level_size + "px"); $("#broadband_slider_on").slider({ range: "min", value: 2, min: 1, max: slide_options, step: 1, slide: function (event, ui) { if (ui.value == 1) { $("input.broadband_product_choice").val("Lite"); $("span.broadband_product_choice").html("Lite"); $("span.broadband_price h2").html("£18.37/month"); $("[id*=hypOrderBroadbandOn]").attr("href", "http://zen.co.uk/ordering-redirect.aspx?opp=3"); $("#broadband_level_on").css("width", "0"); } else if (ui.value == 2) { $("input.broadband_product_choice").val("Active"); $("span.broadband_product_choice").html("Active"); $(".broadband_price h2").html("£25.52/month"); $("[id*=hypOrderBroadbandOn]").attr("href", "http://zen.co.uk/ordering-redirect.aspx?opp=1"); $("#broadband_level_on").css("width", level_size); } else if (ui.value == 3) { $("input.broadband_product_choice").val("Pro"); $("span.broadband_product_choice").html("Pro"); $(".broadband_price h2").html("£35.74/month"); $("[id*=hypOrderBroadbandOn]").attr("href", "http://zen.co.uk/ordering-redirect.aspx?opp=2"); $("#broadband_level_on").css("width", level_size * 2); } else if (ui.value == 4) { $("input.broadband_product_choice").val("Office"); $("span.broadband_product_choice").html("Office"); $(".broadband_price h2").html("£45.00/month"); $("[id*=hypOrderBroadbandOn]").attr("href", "http://zen.co.uk/ordering-redirect.aspx?opp=5"); $("#broadband_level_on").css("width", level_size * 3); } else if (ui.value == 5) { $("input.broadband_product_choice").val("Office Max"); $("span.broadband_product_choice").html("Office Max"); $(".broadband_price h2").html("£79.00/month"); $("[id*=hypOrderBroadbandOn]").attr("href", "http://zen.co.uk/ordering-redirect.aspx?opp=4"); $("#broadband_level_on").css("width", level_size * 4); } } }); $("input.broadband_product_choice").val("Active"); $("span.broadband_product_choice").html("Active"); /* -------------------- The Legend of the Slider™ -------------------- */ var options = ["20GB", "100GB", "200GB", "400GB", "2000GB"]; var option_width = $('.usage_picker').width() / slide_options; $('#broadband_slider_on').after('
'); for (var i = 0; i < options.length; i++) { $('[id*=pnlBroadbandSelectorOn] .ui-slider-legend').append('

' + options[i] + '

'); } /* -------------------- End of the Legend of the Slider™ -------------------- */ $('.ui-widget-cap').click(function () { $(this).parent().children('.ui-slider').slider({ value: '5' }); $("input.broadband_product_choice").val("Office Max"); $("span.broadband_product_choice").html("Office Max"); $(".broadband_price h2").html("£79.00/month"); $("[id*=hypOrderBroadbandOn]").attr("href", "http://zen.co.uk/ordering-redirect.aspx?opp=4"); $("#broadband_level_on").css("width", level_size * 4); }); }); /* -------------------- End of Function to create the slider object and functionality for business broadband On Net-------------------- */ /* -------------------- Overlays -------------------- */ /* -------------------- Video Overlay -------------------- $('.banner .fibre-video, .page-graphic .fibre-video').click(function () { $('.overlay-video').html('
'); $('.overlay-speeds').hide(); $('.overlay-minutes').hide(); $('.overlay-content-broadband').hide(); $('.overlay-content-fibre').hide(); //show required elements $('.overlay-video').show(); $('#overlay-panel').show(); }); -------------------- End of Video Overlay-------------------- */ /* -------------------- Content Overlay -------------------- */ $('#product_panel [id$=pnlFibreSelector] table td ul.ilist li, #product_panel [id$=pnlPartnerFibre] table td ul.ilist li').click(function () { $('.overlay-video').hide(); $('.overlay-speeds').hide(); $('.overlay-minutes').hide(); $('.overlay-content-broadband').hide(); $('.overlay-content-fibre-office').hide(); //show required elements overlay = '.overlay-content-fibre'; $(overlay + ' ul.info-rotator').css("marginLeft", (0-540*$(this).index())); $('.overlay-content-fibre').show(); $('#overlay-panel').show(); }); $('#product_panel [id$=pnlBroadbandSelector] table td ul.ilist li').click(function () { $('.overlay-video').hide(); $('.overlay-speeds').hide(); $('.overlay-minutes').hide(); $('.overlay-content-fibre').hide(); $('.overlay-content-fibre-office').hide(); //show required elements overlay = '.overlay-content-broadband'; $(overlay + ' ul.info-rotator').css("marginLeft", (0-540*$(this).index())); $('.overlay-content-broadband').show(); $('#overlay-panel').show(); }); $('#product_panel [id$=pnlFibreSelector] table td [id$=pnlFibreOfficeInfo] ul.ilist li, #product_panel [id$=pnlPartnerFibre] table td [id$=pnlFibreOfficeOnlyInfo] ul.ilist li').click(function () { $('.overlay-video').hide(); $('.overlay-speeds').hide(); $('.overlay-minutes').hide(); $('.overlay-content-fibre').hide(); $('.overlay-content-broadband').hide(); //show required elements overlay = '.overlay-content-fibre-office'; $(overlay + ' ul.info-rotator').css("marginLeft", (0-540*$(this).index())); $('.overlay-content-fibre-office').show(); $('#overlay-panel').show(); }); /* -------------------- End of Content Overlay-------------------- */ /* -------------------- Speeds Overlay -------------------- */ $('#product_panel table td span, #broadband_availability_checker .speed_results span').click(function () { $('.overlay-video').hide(); $('.overlay-content-broadband').hide(); $('.overlay-minutes').hide(); $('.overlay-content-fibre').hide(); //show required elements $('.overlay-speeds').show(); $('#overlay-panel').show(); }); /* -------------------- End of Speeds Overlay-------------------- */ /* -------------------- Minutes Overlay -------------------- */ $('#product_panel .selector_panel table tr td div[id$="Calls"] a').click(function () { $('.overlay-video').hide(); $('.overlay-content-broadband').hide(); $('.overlay-speeds').hide(); $('.overlay-content-fibre').hide(); //show required elements $('.overlay-minutes').show(); $('#overlay-panel').show(); }); /* -------------------- End of Minutes Overlay-------------------- */ $('.overlay-close').live('click', function () { $('.overlay-video').html(''); $('#overlay-panel').hide(); }); /* -------------------- End of Overlays-------------------- */ /* -------------------- FAQs -------------------- */ $('#faqs h3').click(function () { $(this).toggleClass('open'); $('.' + $(this).attr('id')).slideToggle('fast', function () { }); }); /* $('h3#fibre-faq').click(function () { $('h3#fibre-faq').toggleClass('open'); $('.fibre-faq').slideToggle('fast', function () { }); console.log($(this).attr('id')); }); $('h3#phone-faq').click(function () { $('h3#phone-faq').toggleClass('open'); $('.phone-faq').slideToggle('fast', function () { }); }); */ $('h3#legal-terms').click(function () { $('h3#legal-terms').toggleClass('open'); $('.legal-terms').slideToggle('fast', function () { }); }); /* -------------------- End of FAQs -------------------- */ /* -------------------- Show/Hide BB -------------------- */ $('.standard-broadband').click(function () { var txt = $("[id$=pnlBroadbandSelector]").is(':visible') ? 'Show Broadband Products' : 'Hide Broadband Products'; $('.standard-broadband').text(txt); $('[id$=pnlBroadbandSelector]').slideToggle('slow', function () { }); }); /* -------------------- End of Show/Hide BB -------------------- */ /* -------------------- Info Rotator -------------------- */ nextSlide = function () { if ($(overlay + ' ul.info-rotator').css("marginLeft").replace("px", "") > 0 - ($(overlay + ' ul.info-rotator li').size() - 1) * 500) { $(overlay + ' ul.info-rotator li .prev').die('click'); $(overlay + ' ul.info-rotator li .next').die('click'); $(overlay + ' ul.info-rotator').animate({ marginLeft: '-=540px' }, 500, function () { $(overlay + ' ul.info-rotator li .prev').live('click', prevSlide); $(overlay + ' ul.info-rotator li .next').live('click', nextSlide); }); } } prevSlide = function () { if ($(overlay + ' ul.info-rotator').css("marginLeft").replace("px", "") < 0) { $(overlay + ' ul.info-rotator li .prev').die('click'); $(overlay + ' ul.info-rotator li .next').die('click'); $(overlay + ' ul.info-rotator').animate({ marginLeft: '+=540px' }, 500, function () { $(overlay + ' ul.info-rotator li .prev').live('click', prevSlide); $(overlay + ' ul.info-rotator li .next').live('click', nextSlide); }); } } $('.overlay-content-fibre ul.info-rotator li .prev').die('click'); $('.overlay-content-fibre ul.info-rotator li .next').die('click'); $('.overlay-content-fibre ul.info-rotator li .prev').live('click', prevSlide); $('.overlay-content-fibre ul.info-rotator li .next').live('click', nextSlide); $('.overlay-content-fibre-office ul.info-rotator li .prev').die('click'); $('.overlay-content-fibre-office ul.info-rotator li .next').die('click'); $('.overlay-content-fibre-office ul.info-rotator li .prev').live('click', prevSlide); $('.overlay-content-fibre-office ul.info-rotator li .next').live('click', nextSlide); $('.overlay-content-broadband ul.info-rotator li .prev').die('click'); $('.overlay-content-broadband ul.info-rotator li .next').die('click'); $('.overlay-content-broadband ul.info-rotator li .prev').live('click', prevSlide); $('.overlay-content-broadband ul.info-rotator li .next').live('click', nextSlide); var overlay = '.overlay-content-fibre'; /* -------------------- End of Info Rotator -------------------- */ } /* ------------------------------------------------------------- End of Broadband Pages ------------------------------------------------------------- */