// Newletter subscription form $(document).on('click', '#newsletter-subscribe-submit', function(e) { e.preventDefault(); var error = false; var _this = $(this); var current_button_text = _this.text(); //var form = $(this).closest('form'); var form = $(this).closest('#newsletter_form'); form.find('div.error').empty(); form.find('.alert .message').html(''); form.find('.alert').hide(); var page_id = form.data('pageid'); var page_url = form.data('pageurl'); var full_name = form.find('.js-full_name').val().trim(); var email_address = form.find('.js-email_address').val().trim(); var form_field = form.find('.js-form_field').val().trim(); var error_message_text = ""; if (full_name === '') { error = true; error_message_text += 'Please enter your name
\n'; } if (email_address === '') { error = true; ; error_message_text += 'Please enter your email address
\n'; } if (form_field !== '') { error = true; error_message_text += 'Please enter your email address
\n'; } if (error === true) { form.find('.alert.alert-danger .message').html(error_message_text); form.find('.alert.alert-danger').show(); $('html, body').animate({ scrollTop: $('.alert.alert-danger').offset().top }, 1000); } else { _this.text('Please wait...'); $.ajax({ type: "POST", url: "/ajax/newsletter.subscription.form.php", cache: false, dataType: "json", data: { Full_Name:full_name, Email_Address:email_address, Page_Id:page_id, Page_URL:page_url, Form_Field: form_field} }).done(function(response) { _this.text(current_button_text); if (response.success === true) { form.find('.js-full_name').val(''); form.find('.js-email_address').val(''); if (response.redirect_url == '') { form.find('.alert.alert-success .message').html(response.message); form.find('.alert.alert-success').show(); $('html, body').animate({ scrollTop: $('.alert.alert-success').offset().top }, 1000); } else { window.location.href = response.redirect_url; } } else { form.find('.alert.alert-danger .message').html(response.message); form.find('.alert.alert-danger').show(); $('html, body').animate({ scrollTop: $('.alert.alert-danger').offset().top }, 1000); } }).error(function(jqxhr, status, err) { _this.text(current_button_text); /*if (grecaptcha != undefined) { grecaptcha.reset(); }*/ form.find('.alert.alert-danger .message').html(status + ' : ' + err); form.find('.alert.alert-danger').show(); $('html, body').animate({ scrollTop: $('.alert.alert-danger').offset().top }, 1000); }); } }); // Enquiry form $(document).on('click', '#enquiry-form-submit', function(e) { e.preventDefault(); var error = false; var _this = $(this); var current_button_text = _this.text(); //var form = $(this).closest('form'); var form = $(this).closest('#form_enquiry'); form.find('div.error').empty(); form.find('.alert .message').html(''); form.find('.alert').hide(); var page_id = form.data('pageid'); var page_url = form.data('pageurl'); var email_subject = form.data('email_subject'); var full_name = form.find('.js-full_name').val().trim(); var email_address = form.find('.js-email_address').val().trim(); var enquiry = form.find('.js-enquiry').val().trim(); var tel_no = form.find('.js-phone').val().trim(); var location = form.find('.js-location').val().trim(); var subscribe_to_newsletter = (form.find('.js-subscribe_to_newsletter').prop('checked')) ? 'Y': 'N'; var form_field = form.find('.js-form_field').val().trim(); //console.log("page_id " + page_id); //console.log("page_url " + page_url); //console.log("email_subject " + email_subject); //console.log("full_name " + full_name); //console.log("email_address " + email_address); //console.log("enquiry " + enquiry); //console.log("subscribe_to_newsletter " + subscribe_to_newsletter); //console.log("form_field " + form_field); var error_message_text = ""; var captchacode = $('#g-recaptcha-response').val(); if (captchacode.length > 0) { captchacode = captchacode; } else { var captcha_object = form.find('#g-recaptcha-response-1'); captcha_val = captcha_object.val(); if (captcha_val !== undefined && captcha_val.length > 0) { captchacode = captcha_val; } } console.log("captchacode " + captchacode); if (full_name === '') { error = true; form.find('.js-full_name').after('
Please enter your name
'); //error_message_text += 'Please enter your name
\n'; } if (email_address === '') { error = true; form.find('.js-email_address').after('
Please enter your email address
'); //error_message_text += 'Please enter your email address
\n'; } if (enquiry === '') { error = true; form.find('.js-enquiry').after('
Please enter an enquiry
'); //error_message_text += 'Please enter your email address
\n'; } if (form_field !== '') { error = true; form.find('.js-form_field').after('
You are not a human
'); //error_message_text += 'Please enter your email address
\n'; } if (captchacode === '') { error = true; form.find('.g-recaptcha').after('
Please tick to show you\'re not a robot
'); } if (error === true) { $('html, body').animate({ scrollTop: $('.error:visible:first').closest('.form-group').offset().top }, 1000); if (error_message_text !== '') { form.find('.alert.alert-danger .message').html(error_message_text); form.find('.alert.alert-danger').show(); $('html, body').animate({ scrollTop: $('.alert.alert-danger').offset().top }, 1000); } } else { _this.text('Please wait...'); $.ajax({ type: "POST", url: "/ajax/enquiry.form.php", cache: false, dataType: "json", data: { Full_Name:full_name, Email_Address:email_address, Enquiry:enquiry, Tel_No:tel_no, Location:location, Subscribe_To_Newsletter:subscribe_to_newsletter, Email_Subject:email_subject, Page_Id:page_id, Page_URL:page_url, Form_Field: form_field} }).done(function(response) { _this.text(current_button_text); if (response.success === true) { form.find('.js-full_name').val(''); form.find('.js-email_address').val(''); form.find('.js-enquiry').val(''); form.find('.js-subscribe_to_newsletter').prop('checked', false); if (grecaptcha != undefined) { grecaptcha.reset(); } if (response.redirect_url == '') { form.find('.alert.alert-success .message').html(response.message); form.find('.alert.alert-success').show(); $('html, body').animate({ scrollTop: $('.alert.alert-success').offset().top }, 1000); } else { window.location.href = response.redirect_url; } } else { form.find('.alert.alert-danger .message').html(response.message); form.find('.alert.alert-danger').show(); $('html, body').animate({ scrollTop: $('.alert.alert-danger').offset().top }, 1000); } }).error(function(jqxhr, status, err) { _this.text(current_button_text); if (grecaptcha != undefined) { grecaptcha.reset(); } console.log("Error Returned "); form.find('.alert.alert-danger .message').html(status + ' : ' + err); form.find('.alert.alert-danger').show(); $('html, body').animate({ scrollTop: $('.alert.alert-danger').offset().top }, 1000); }); } }); // Enquiry form $(document).on('click', '#enquiry-form-submit-more-detail', function(e) { e.preventDefault(); var error = false; var _this = $(this); var current_button_text = _this.text(); //var form = $(this).closest('form'); var form = $(this).closest('#form_enquiry_more_detail'); form.find('div.error').empty(); form.find('.alert .message').html(''); form.find('.alert').hide(); var page_id = form.data('pageid'); var page_url = form.data('pageurl'); var email_subject = form.data('email_subject'); var full_name = form.find('.js-full_name').val().trim(); var email_address = form.find('.js-email_address').val().trim(); var enquiry = form.find('.js-enquiry').val().trim(); var telephone = form.find('.js-telephone').val().trim(); var location = form.find('.js-location').val().trim(); var subscribe_to_newsletter = (form.find('.js-subscribe_to_newsletter').prop('checked')) ? 'Y': 'N'; var form_field = form.find('.js-form_field').val().trim(); //console.log("page_id " + page_id); //console.log("page_url " + page_url); //console.log("email_subject " + email_subject); //console.log("full_name " + full_name); //console.log("email_address " + email_address); //console.log("enquiry " + enquiry); //console.log("subscribe_to_newsletter " + subscribe_to_newsletter); //console.log("form_field " + form_field); var error_message_text = ""; var captchacode = ""; var captchacode_el = form.find('#g-recaptcha-response'); if (captchacode_el.length > 0) { captchacode = captchacode_el.val(); } else { captchacode_el = form.find('#g-recaptcha-response-1'); if (captchacode_el.length > 0) { captchacode = captchacode_el.val(); } } console.log("form_enquiry_more_detail captchacode = " + captchacode); if (full_name === '') { error = true; form.find('.js-full_name').after('
Please enter your name
'); //error_message_text += 'Please enter your name
\n'; } if (email_address === '') { error = true; form.find('.js-email_address').after('
Please enter your email address
'); //error_message_text += 'Please enter your email address
\n'; } if (enquiry === '') { error = true; form.find('.js-enquiry').after('
Please enter an enquiry
'); //error_message_text += 'Please enter an enquiry
\n'; } if (telephone === '') { error = true; form.find('.js-telephone').after('
Please enter your telephone number
'); //error_message_text += 'Please enter your telephone number
\n'; } if (location === '') { error = true; form.find('.js-location').after('
Please enter your location
'); //error_message_text += 'Please enter your location
\n'; } if (form_field !== '') { error = true; form.find('.js-form_field').after('
You are not a human
'); //error_message_text += 'Please enter your email address
\n'; } if (captchacode === '') { error = true; form.find('.g-recaptcha').after('
Please tick to show you\'re not a robot
'); } if (error === true) { $('html, body').animate({ scrollTop: $('.error:visible:first').closest('.form-group').offset().top }, 1000); if (error_message_text !== '') { form.find('.alert.alert-danger .message').html(error_message_text); form.find('.alert.alert-danger').show(); $('html, body').animate({ scrollTop: $('.alert.alert-danger').offset().top }, 1000); } } else { _this.text('Please wait...'); $.ajax({ type: "POST", url: "/ajax/enquiry.form.more.detail.php", cache: false, dataType: "json", data: { Full_Name:full_name, Email_Address:email_address, Enquiry:enquiry, Subscribe_To_Newsletter:subscribe_to_newsletter, Email_Subject:email_subject, Location:location, Telephone:telephone, Page_Id:page_id, Page_URL:page_url, Form_Field: form_field} }).done(function(response) { _this.text(current_button_text); if (response.success === true) { form.find('.js-full_name').val(''); form.find('.js-email_address').val(''); form.find('.js-enquiry').val(''); form.find('.js-location').val(''); form.find('.js-telephone').val(''); form.find('.js-subscribe_to_newsletter').prop('checked', false); if (grecaptcha != undefined) { grecaptcha.reset(); } if (response.redirect_url == '') { form.find('.alert.alert-success .message').html(response.message); form.find('.alert.alert-success').show(); $('html, body').animate({ scrollTop: $('.alert.alert-success').offset().top }, 1000); } else { window.location.href = response.redirect_url; } } else { form.find('.alert.alert-danger .message').html(response.message); form.find('.alert.alert-danger').show(); $('html, body').animate({ scrollTop: $('.alert.alert-danger').offset().top }, 1000); } }).error(function(jqxhr, status, err) { _this.text(current_button_text); if (grecaptcha != undefined) { grecaptcha.reset(); } form.find('.alert.alert-danger .message').html(status + ' : ' + err); form.find('.alert.alert-danger').show(); $('html, body').animate({ scrollTop: $('.alert.alert-danger').offset().top }, 1000); }); } }); // Request A Sample form $(document).on('click', '#request-sample-submit', function(e) { e.preventDefault(); var error = false; var _this = $(this); var current_button_text = _this.text(); var form = $(this).closest('form'); form.find('div.error').empty(); form.find('.alert .message').html(''); form.find('.alert').hide(); var page_id = form.data('pageid'); var page_url = form.data('pageurl'); var forename = form.find('.js-forename').val().trim(); var surname = form.find('.js-surname').val().trim(); var email_address = form.find('.js-email_address').val().trim(); var telephone = form.find('.js-telephone').val().trim(); var house_name_no = form.find('.js-house_name_no').val().trim(); var address_line_1 = form.find('.js-address_line_1').val().trim(); var address_line_2 = form.find('.js-address_line_2').val().trim(); var town = form.find('.js-town').val().trim(); var county = form.find('.js-county').val().trim(); var postcode = form.find('.js-postcode').val().trim(); var quantity = form.find('.js-quantity').val().trim(); var form_field = form.find('.js-form_field').val().trim(); //console.log("page_id " + page_id); //console.log("page_url " + page_url); //console.log("forename " + forename); //console.log("surname " + surname); //console.log("email_address " + email_address); //console.log("house_name_no " + house_name_no); //console.log("address_line_1 " + address_line_1); //console.log("address_line_2 " + address_line_2); //console.log("town " + town); //console.log("county " + county); //console.log("postcode " + postcode); //console.log("quantity " + quantity); var error_message_text = ""; var captchacode = $('#g-recaptcha-response').val(); console.log("request-sample captchacode = " + captchacode); if (forename === '') { error = true; $('.js-forename').after('
Please enter your forename
'); } if (surname === '') { error = true; $('.js-surname').after('
Please enter your surname
'); } if (email_address === '') { error = true; $('.js-email_address').after('
Please enter your email address
'); } if (house_name_no === '') { error = true; $('.js-house_name_no').after('
Please enter your building/house name/no
'); } if (address_line_1 === '') { error = true; $('.js-address_line_1').after('
Please enter the first line of your address
'); } if (town === '') { error = true; $('.js-town').after('
Please enter your town
'); } if (postcode === '') { error = true; $('.js-postcode').after('
Please enter your postcode
'); } if (form_field !== '') { error = true; $('.js-form_field').after('
You are not a human
'); } if (captchacode === '') { error = true; form.find('.g-recaptcha').after('
Please tick to show you\'re not a robot
'); } if (error === true) { $('html, body').animate({ scrollTop: $('.error:visible:first').closest('.form-group').offset().top }, 1000); if (error_message_text !== '') { form.find('.alert.alert-danger .message').html(error_message_text); form.find('.alert.alert-danger').show(); $('html, body').animate({ scrollTop: $('.alert.alert-danger').offset().top }, 1000); } } else { _this.text('Please wait...'); $.ajax({ type: "POST", url: "/ajax/request.sample.form.php", cache: false, dataType: "json", data: { Forename:forename, Surname:surname, Email_Address:email_address, Telephone:telephone, House_Name_No:house_name_no, Address_Line_1:address_line_1, Address_Line_2:address_line_2, Town:town, County:county, Postcode:postcode, Quantity:quantity, Page_Id:page_id, Page_URL:page_url , Form_Field: form_field} }).done(function(response) { _this.text(current_button_text); if (response.success === true) { form.find('.js-forename').val(''); form.find('.js-surname').val(''); form.find('.js-email_address').val(''); form.find('.js-telephone').val(''); form.find('.js-house_name_no').val(''); form.find('.js-address_line_1').val(''); form.find('.js-address_line_2').val(''); form.find('.js-town').val(''); form.find('.js-county').val(''); form.find('.js-postcode').val(''); form.find('.js-quantity').val(''); if (grecaptcha != undefined) { grecaptcha.reset(); } if (response.redirect_url == '') { form.find('.alert.alert-success .message').html(response.message); form.find('.alert.alert-success').show(); $('html, body').animate({ scrollTop: $('.alert.alert-success').offset().top }, 1000); } else { window.location.href = response.redirect_url; } } else { form.find('.alert.alert-danger .message').html(response.message); form.find('.alert.alert-danger').show(); $('html, body').animate({ scrollTop: $('.alert.alert-danger').offset().top }, 1000); } }).error(function(jqxhr, status, err) { _this.text(current_button_text); if (grecaptcha != undefined) { grecaptcha.reset(); } form.find('.alert.alert-danger .message').html(status + ' : ' + err); form.find('.alert.alert-danger').show(); $('html, body').animate({ scrollTop: $('.alert.alert-danger').offset().top }, 1000); }); } }); $(document).on('click', '#vacancy-form-submit', function(e) { e.preventDefault(); var error = false; var _this = $(this); var current_button_text = _this.text(); var form = $(this).closest('form'); form.find('div.error').empty(); form.find('.alert .message').html(''); form.find('.alert').hide(); var page_id = form.data('pageid'); var page_url = form.data('pageurl'); var email_subject = form.data('email_subject'); var forename = form.find('.js-forename').val().trim(); var surname = form.find('.js-surname').val().trim(); var email_address = form.find('.js-email_address').val().trim(); var telephone = form.find('.js-telephone').val().trim(); var cover_letter_filename = form.find('.js-cover_letter_filename').val().trim(); var cv_filename = form.find('.js-cv_filename').val().trim(); var captchacode = $('#g-recaptcha-response').val(); var form_field = form.find('.js-form_field').val().trim(); //console.log("page_id " + page_id); //console.log("page_url " + page_url); //console.log("forename " + forename); //console.log("surname " + surname); //console.log("email_address " + email_address); //console.log("telephone " + telephone); //console.log("cover_letter_filename " + cover_letter_filename); //console.log("cv_filename " + cv_filename); var error_message_text = ""; if (forename === '') { error = true; $('.js-forename').after('
Please enter your forename
'); } if (surname === '') { error = true; $('.js-surname').after('
Please enter your surname
'); } if (email_address === '') { error = true; $('.js-email_address').after('
Please enter your email address
'); } if (telephone === '') { error = true; $('.js-telephone').after('
Please enter your telephone
'); } if (cv_filename === '') { error = true; $('.js-cv_filename').after('
Please upload a cv
'); } if (form_field !== '') { error = true; $('.js-form_field').after('
You are not a human
'); } if (captchacode === '') { error = true; form.find('.g-recaptcha').after('
Please tick to show you\'re not a robot
'); } if (error === true) { $('html, body').animate({ scrollTop: $('.error:visible:first').closest('.form-group').offset().top }, 1000); if (error_message_text !== '') { form.find('.alert.alert-danger .message').html(error_message_text); form.find('.alert.alert-danger').show(); $('html, body').animate({ scrollTop: $('.alert.alert-danger').offset().top }, 1000); } } else { _this.text('Please wait...'); $.ajax({ type: "POST", url: "/ajax/vacancy.form.php", cache: false, dataType: "json", data: { Forename:forename, Surname:surname, Email_Address:email_address, Telephone:telephone, Cover_Letter_Filename:cover_letter_filename, CV_Filename:cv_filename, Page_Id:page_id, Page_URL:page_url , Form_Field: form_field} }).done(function(response) { _this.text(current_button_text); if (response.success === true) { form.find('.js-forename').val(''); form.find('.js-surname').val(''); form.find('.js-email_address').val(''); form.find('.js-telephone').val(''); if (grecaptcha != undefined) { grecaptcha.reset(); } if (response.redirect_url == '') { form.find('.alert.alert-success .message').html(response.message); form.find('.alert.alert-success').show(); $('html, body').animate({ scrollTop: $('.alert.alert-success').offset().top }, 1000); } else { window.location.href = response.redirect_url; } } else { form.find('.alert.alert-danger .message').html(response.message); form.find('.alert.alert-danger').show(); $('html, body').animate({ scrollTop: $('.alert.alert-danger').offset().top }, 1000); } }).error(function(jqxhr, status, err) { _this.text(current_button_text); if (grecaptcha != undefined) { grecaptcha.reset(); } form.find('.alert.alert-danger .message').html(status + ' : ' + err); form.find('.alert.alert-danger').show(); $('html, body').animate({ scrollTop: $('.alert.alert-danger').offset().top }, 1000); }); } }); // Estimator form $(document).on('click', '#estimator-submit', function(e) { e.preventDefault(); var error = false; var error_message_text = ""; var _this = $(this); var current_button_text = _this.text(); var form = $(this).closest('form'); form.find('div.error').empty(); form.find('.alert .message').html(''); form.find('.alert').hide(); var page_id = form.data('pageid'); var page_url = form.data('pageurl'); console.log('Estimator Form'); var forename = form.find('.js-forename').val().trim(); var surname = form.find('.js-surname').val().trim(); var email_address = form.find('.js-email_address').val().trim(); var telephone = form.find('.js-telephone').val().trim(); var house_name_no = form.find('.js-house_name_no').val().trim(); var address_line_1 = form.find('.js-address_line_1').val().trim(); var town = form.find('.js-town').val().trim(); var county = form.find('.js-county').val().trim(); var postcode = form.find('.js-postcode').val().trim(); var room_width = form.find('.js-room_width').val().trim(); var room_length = form.find('.js-room_length').val().trim(); var room_height = form.find('.js-room_height').val().trim(); var wall_finish = form.find('.js-wall_finish').val().trim(); var floor_finish = form.find('.js-floor_finish').val().trim(); var ceiling_finish = form.find('.js-ceiling_finish').val().trim(); var no_of_doors = form.find('.js-no_of_doors').val().trim(); var window_area = form.find('.js-window_area').val().trim(); var estimator_filename_1 = form.find('.js-estimator_filename_1').val().trim(); var estimator_filename_2 = form.find('.js-estimator_filename_2').val().trim(); var estimator_filename_3 = form.find('.js-estimator_filename_3').val().trim(); var estimator_filename_4 = form.find('.js-estimator_filename_4').val().trim(); var additional_comments = form.find('.js-additional_comments').val().trim(); var form_field = form.find('.js-form_field').val().trim(); //console.log("forename " + forename); //console.log("surname " + surname); //console.log("email_address " + email_address); //console.log("telephone " + telephone); //console.log("house_name_no " + house_name_no); //console.log("address_line_1 " + address_line_1); //console.log("town " + town); //console.log("county " + county); //console.log("postcode " + postcode); //console.log("room_width " + room_width); //console.log("room_length " + room_length); //console.log("room_height " + room_height); //console.log("wall_finish " + wall_finish); //console.log("floor_finish " + floor_finish); //console.log("ceiling_finish " + ceiling_finish); //console.log("no_of_doors " + no_of_doors); //console.log("window_area " + window_area); var error_message_text = ""; var captchacode = $('#g-recaptcha-response').val(); if (forename === '') { error = true; $('.js-forename').after('
Please enter your forename
'); error_message_text += "Please enter your forename
\n"; } if (surname === '') { error = true; $('.js-surname').after('
Please enter your surname
'); error_message_text += "Please enter your surname
\n"; } if (email_address === '') { error = true; $('.js-email_address').after('
Please enter your email address
'); error_message_text += "Please enter your email address
\n"; } if (telephone === '') { error = true; $('.js-telephone').after('
Please enter your telephone no
'); error_message_text += "Please enter your telephone no
\n"; } if (house_name_no === '') { error = true; $('.js-house_name_no').after('
Please enter your building/house name/no
'); error_message_text += "Please enter your building/house name/no
\n"; } if (address_line_1 === '') { error = true; $('.js-address_line_1').after('
Please enter the first line of your address
'); error_message_text += "Please enter the first line of your address
\n"; } if (town === '') { error = true; $('.js-town').after('
Please enter your town
'); error_message_text += "Please enter your town
\n"; } if (county === '') { error = true; $('.js-county').after('
Please enter your county
'); error_message_text += "Please enter your county
\n"; } if (postcode === '') { error = true; $('.js-postcode').after('
Please enter your postcode
'); error_message_text += "Please enter your postcode
\n"; } if (room_width === '') { error = true; $('.js-room_width').after('
Please enter the room width
'); error_message_text += "Please enter the room width
\n"; } if (room_length === '') { error = true; $('.js-room_length').after('
Please enter the room length
'); error_message_text += "Please enter the room length
\n"; } if (room_height === '') { error = true; $('.js-room_height').after('
Please enter the room height
'); error_message_text += "Please enter the room height
\n"; } if (wall_finish === '') { error = true; $('.js-wall_finish').after('
Please enter the wall finish
'); error_message_text += "Please enter the wall finish
\n"; } if (floor_finish === '') { error = true; $('.js-floor_finish').after('
Please enter the floor finish
'); error_message_text += "Please enter the floor finish
\n"; } if (ceiling_finish === '') { error = true; $('.js-ceiling_finish').after('
Please enter the ceiling finish
'); error_message_text += "Please enter the ceiling finish
\n"; } if (no_of_doors === '') { error = true; $('.js-no_of_doors').after('
Please enter the number of doors
'); error_message_text += "Please enter the number of doors
\n"; } if (window_area === '') { error = true; $('.js-window_area').after('
Please enter the area of the windows
'); error_message_text += "Please enter the area of the windows
\n"; } if ((estimator_filename_1 === '') && (estimator_filename_2 === '') && (estimator_filename_3 === '') && (estimator_filename_4 === '')) { error = true; $('.js-estimator_filename_1').after('
You must upload at least one image
'); error_message_text += "You must upload at least one image
\n"; } if (form_field !== '') { error = true; $('.js-form_field').after('
You are not a human
'); error_message_text += "You are not a human
\n"; } if (captchacode === '') { error = true; form.find('.g-recaptcha').after('
Please tick to show you\'re not a robot
'); error_message_text += "Please tick to show you\'re not a robot
\n"; } if (error === true) { /* $('html, body').animate({ scrollTop: $('.error:visible:first').closest('.form-group').offset().top }, 1000); */ if (error_message_text !== '') { form.find('.alert.alert-danger .message').html(error_message_text); form.find('.alert.alert-danger').show(); $('html, body').animate({ scrollTop: $('.alert.alert-danger').offset().top }, 1000); } } else { _this.text('Please wait...'); $.ajax({ type: "POST", url: "/ajax/estimator.form.php", cache: false, dataType: "json", data: { Forename:forename, Surname:surname, Email_Address:email_address, Telephone:telephone, House_Name_No:house_name_no, Address_Line_1:address_line_1, Town:town, County:county, Postcode:postcode, Room_Width:room_width, Room_Length:room_length, Room_Height:room_height, Wall_Finish:wall_finish, Floor_Finish:floor_finish, Ceiling_Finish:ceiling_finish, No_Of_Doors:no_of_doors, Window_Area:window_area, Filename_1:estimator_filename_1, Filename_2:estimator_filename_2, Filename_3:estimator_filename_3, Filename_4:estimator_filename_4, Additional_Comments: additional_comments, Page_Id:page_id, Page_URL:page_url , Form_Field: form_field} }).done(function(response) { _this.text(current_button_text); if (response.success === true) { form.find('.js-forename').val(''); form.find('.js-surname').val(''); form.find('.js-email_address').val(''); form.find('.js-telephone').val(''); form.find('.js-house_name_no').val(''); form.find('.js-address_line_1').val(''); form.find('.js-town').val(''); form.find('.js-county').val(''); form.find('.js-postcode').val(''); form.find('.js-room_width').val(''); form.find('.js-room_length').val(''); form.find('.js-room_height').val(''); form.find('.js-wall_finish').val(''); form.find('.js-floor_finish').val(''); form.find('.js-ceiling_finish').val(''); form.find('.js-no_of_doors').val(''); form.find('.js-window_area').val(''); form.find('.js-estimator_filename_1').val(''); form.find('.js-estimator_filename_2').val(''); form.find('.js-estimator_filename_3').val(''); form.find('.js-estimator_filename_4').val(''); form.find('.js-additional_comments').val(''); if (grecaptcha != undefined) { grecaptcha.reset(); } if (response.redirect_url == '') { form.find('.alert.alert-success .message').html(response.message); form.find('.alert.alert-success').show(); $('html, body').animate({ scrollTop: $('.alert.alert-success').offset().top }, 1000); } else { window.location.href = response.redirect_url; } } else { form.find('.alert.alert-danger .message').html(response.message); form.find('.alert.alert-danger').show(); $('html, body').animate({ scrollTop: $('.alert.alert-danger').offset().top }, 1000); } }).error(function(jqxhr, status, err) { _this.text(current_button_text); if (grecaptcha != undefined) { grecaptcha.reset(); } form.find('.alert.alert-danger .message').html(status + ' : ' + err); form.find('.alert.alert-danger').show(); $('html, body').animate({ scrollTop: $('.alert.alert-danger').offset().top }, 1000); }); } }); // Quote Form $(document).on('click', '#quote-form-submit', function(e) { e.preventDefault(); var error = false; var error_message_text = ""; var _this = $(this); var current_button_text = _this.text(); var form = $(this).closest('form'); form.find('div.error').remove(); form.find('.alert .message').html(''); form.find('.alert:not(.alert-info)').hide(); var Page_Id = form.data('pageid'); var Page_URL = form.data('pageurl'); var Data_Block_Id = form.data('datablock_id'); var Data_Block_Template_Id = form.data('datablock_template_id'); console.log('Quote Form'); var Insulation_Type = (form.find('input[name=Insulation_Type]').length > 0) ? form.find('input[name=Insulation_Type]:checked').val() : ''; var Insulation_Type_Other = (form.find('.js-Insulation_Type_Other').length > 0) ? form.find('.js-Insulation_Type_Other').val().trim() : ''; var Existing_Construction = (form.find('.js-Existing_Construction').length > 0) ? form.find('.js-Existing_Construction').val().trim() : ''; var Noise_Issues = (form.find('.js-Noise_Issues').length > 0) ? form.find('.js-Noise_Issues').val().trim() : ''; var Area_Measurements = form.find('.js-Area_Measurements').val().trim(); var Name = form.find('.js-Name').val().trim(); var Address = form.find('.js-Address').val().trim(); var Email_Address = form.find('.js-Email_Address').val().trim(); var Telephone = form.find('.js-Telephone').val().trim(); var Product = form.find('.js-Product').val().trim(); var Comments = form.find('.js-further-comments').val().trim(); var Form_Field = form.find('.js-form_field').val().trim(); var error_message_text = ""; if (form.find('input[name=Insulation_Type]').length > 0 && typeof(Insulation_Type) === 'undefined') { error = true; $('.js-Insulation_Type').after('
Please select what you want to sound insulate
'); error_message_text += "Please select what you want to sound insulate
\n"; } if (Insulation_Type === 'Other' && Insulation_Type_Other === '') { error = true; $('.js-Insulation_Type_Other').after('
Please select which other sound insulation you require
'); error_message_text += "Please select which other sound insulation you require
\n"; } /* if (Existing_Construction === '') { error = true; $('.js-Existing_Construction').after('
Please state the existing construction of this element
'); error_message_text += "Please state the existing construction of this element
\n"; }*/ if (form.find('.js-Noise_Issues').length > 0 && Noise_Issues === '') { error = true; $('.js-Noise_Issues').after('
Please provide a brief description of the noise issues experienced
'); error_message_text += "Please provide a brief description of the noise issues experienced
\n"; } if (Area_Measurements === '') { error = true; $('.js-Area_Measurements').after('
Please enter the measurements of the area to be treated
'); error_message_text += "Please enter the measurements of the area to be treated
\n"; } if (Name === '') { error = true; $('.js-Name').after('
Please enter your name
'); error_message_text += "Please enter your name
\n"; } if (Address === '') { error = true; $('.js-Address').after('
Please enter your location
'); error_message_text += "Please enter your name
\n"; } if (Email_Address === '') { error = true; $('.js-Email_Address').after('
Please enter your email address
'); error_message_text += "Please enter your email address
\n"; } if (Form_Field !== '') { error = true; $('.js-form_field').after('
You are not a human
'); error_message_text += "You are not a human
\n"; } var image_files_array = new Array(); if ($('#files').children().length > 0) { $('.quote_file_upload').each(function(){ image_files_array.push($(this).text()); }); } if (error === true) { $('html, body').animate({ scrollTop: $('.error:visible:first').closest('.form-group').offset().top }, 1000); /*if (error_message_text !== '') { form.find('.alert.alert-danger .message').html(error_message_text); form.find('.alert.alert-danger').show(); $('html, body').animate({ scrollTop: $('.alert.alert-danger').offset().top }, 1000); }*/ } else { _this.text('Please wait...'); $.ajax({ type: "POST", url: "/ajax/quote.form.php", cache: false, dataType: "json", data: { Insulation_Type : Insulation_Type, Insulation_Type_Other : Insulation_Type_Other, Existing_Construction : Existing_Construction, Noise_Issues : Noise_Issues, Area_Measurements : Area_Measurements, Name : Name, Address : Address, Telephone : Telephone, Email_Address : Email_Address, Product : Product, Comments : Comments, image_files_array : image_files_array, Page_Id : Page_Id, Page_URL : Page_URL, Data_Block_Id : Data_Block_Id, Data_Block_Template_Id : Data_Block_Template_Id, Form_Field : Form_Field} }).done(function(response) { _this.text(current_button_text); if (response.success === true) { form.find('.js-Insulation_Type_Other').val(''); form.find('.js-Existing_Construction').val(''); form.find('.js-Noise_Issues').val(''); form.find('.js-Area_Measurements').val(''); form.find('.js-Name').val(''); form.find('.js-Address').val(''); form.find('.js-Email_Address').val(''); form.find('.js-Telephone').val(''); form.find('.js-further-comments').val(''); image_files_array = new Array(); if (response.redirect_url == '') { form.find('.alert.alert-success .message').html(response.message); form.find('.alert.alert-success').show(); $('html, body').animate({ scrollTop: $('.alert.alert-success').offset().top }, 1000); } else { window.location.href = response.redirect_url; } form.find('#files .alert-dismissable').remove(); } else { form.find('.alert.alert-danger .message').html(response.message); form.find('.alert.alert-danger').show(); $('html, body').animate({ scrollTop: $('.alert.alert-danger').offset().top }, 1000); } }).error(function(jqxhr, status, err) { _this.text(current_button_text); form.find('.alert.alert-danger .message').html(status + ' : ' + err); form.find('.alert.alert-danger').show(); $('html, body').animate({ scrollTop: $('.alert.alert-danger').offset().top }, 1000); }); } }); function upload_file(css_class, type) { var upload_button_class = '.js-' + css_class + '_upload'; var filename_field_class = '.js-' + css_class; //console.log('upload_file - ' + upload_button_class); //console.log('filename_field_class - ' + filename_field_class); $(upload_button_class).fileupload({ dataType: 'json', url: '/ajax/file-upload.php?type=' + type, autoUpload: true, acceptFileTypes: /(\.|\/)(gif|jpe?g|png)$/i, maxNumberOfFiles: 1, maxFileSize: 8000000, // 8 MB done: function (e, data) { //{"success":false,"message":"This type of file can not be uploaded.","filename":""} if (data.result.success === false) { $(this).parent().append('
Error! '+data.result.message+'
'); } else { $(this).parent().find(filename_field_class).val(data.result.filename); $(this).parent().find('.file-upload-progress-bar').remove(); if (data.result.url === '') { $(this).parent().append('
'+data.result.filename+' uploaded successfully.
'); } else { $(this).parent().append('
'+data.result.filename+' uploaded successfully.
'); } } }, progress: function (e, data) { var progress = parseInt(data.loaded / data.total * 100, 10); $(this).parent().find('.file-upload-progress-bar').css('width', progress + '%').html(progress + '%'); }, start: function (e, data) { $(this).parent().find(filename_field_class).val(''); $(this).parent().find('.file-upload-list').remove(); $(this).parent().find('.alert').remove(); if ($(this).parent().find('.file-upload-progress-bar').length === 0) { $(this).parent().append('
 
'); } } }).prop('disabled', !$.support.fileInput).parent().addClass($.support.fileInput ? undefined : 'disabled'); } if ($('.js-cv_filename_upload').length > 0) { //console.log('File Upload cv_filename'); upload_file('cv_filename', 'job-vancancy'); } if ($('.js-cover_letter_filename_upload').length > 0) { //console.log('File Upload cover_letter_filename'); upload_file('cover_letter_filename', 'job-vancancy'); } if ($('.js-estimator_filename_1_upload').length > 0) { //console.log('File Upload estimator_filename_1'); upload_file('estimator_filename_1', 'estimator'); } if ($('.js-estimator_filename_2_upload').length > 0) { //console.log('File Upload estimator_filename_2'); upload_file('estimator_filename_2', 'estimator'); } if ($('.js-estimator_filename_3_upload').length > 0) { //console.log('File Upload estimator_filename_3'); upload_file('estimator_filename_3', 'estimator'); } if ($('.js-estimator_filename_4_upload').length > 0) { //console.log('File Upload estimator_filename_4'); upload_file('estimator_filename_4', 'estimator'); } if ($('.js-image_files_upload').length > 0) { var type = 'quote'; // Change this to the location of your server-side upload handler: var url = '/ajax/file-upload.php?type=' + type; $('#fileupload').fileupload({ url: url, autoUpload: true, acceptFileTypes: /(\.|\/)(gif|jpe?g|png)$/i, maxNumberOfFiles: 1, maxFileSize: 8000000, // 8 MB dataType: 'json', done: function (e, data) { if (data.result.success === false) { $(this).parent().append('
Error! '+data.result.message+'
'); } else { $('#quote_file_error').remove(); $.each(data.result.files, function (index, file) { //$('

').text(file).appendTo('#files'); var appendHTML = ''; appendHTML = '

'; appendHTML += '× '+file+' Success'; appendHTML += '
'; $('#files').append(appendHTML); }); } }, progressall: function (e, data) { var progress = parseInt(data.loaded / data.total * 100, 10); $('#progress .progress-bar').css( 'width', progress + '%' ); } }).prop('disabled', !$.support.fileInput) .parent().addClass($.support.fileInput ? undefined : 'disabled'); } var pages = ["3SE" , "A Design For Life!" , "About Us" , "Accessories" , "Acoustic Foams" , "Acoustic Membranes" , "Acoustic Problem Solved at 4th Ashby Scouts | SRS Ltd." , "Acoustic Problem Solved at Brigsteer Village Hall." , "Acoustic Problem Solved within Cote Brasserie" , "Acoustic Socket Boxes" , "Acoustic Solution for School Sports Hall." , "Acoustic Treatment at Brownhill Primary School" , "Acoustic Vertical Cavity Barriers" , "Acoustics for Community Halls and Places of Worship" , "Acoustics for Schools" , "Acoustics for Schools Initiative." , "Acoustics to Match the Quality of the Food at The French Table" , "Acoustilay 15 above Lath and Plaster Ceiling" , "Acoustilay 8 above Maxi 60 Ceiling" , "Acoustilay Acoustic Flooring Underlay System" , "Acoustilay Tilemat Acoustic Underlay for Floor Tiles" , "Advice" , "Aldwyn School choose Sonata for Reverberant Hall." , "All Quiet at All Saints Primary." , "Architects" , "Architectural CAD Drawings" , "Arresting Acoustics at Old Police Station" , "Astounding Acoustics at Scottish Community Hall." , "Back to school, back to the noise?" , "Bassenthwaite Parish Room – Acoustic Treatment" , "Building Regulations" , "Butterknowle Primary School" , "Case Studies" , "Ceiling Soundproofing" , "Church Partnership calls on SRS Ltd to solve Acoustic issues in café and hall" , "Code for Sustainable Homes" , "Colourful Solution to Acoustic Problem at Bryn Coch School" , "Commercial" , "Considerations when choosing acoustic absorbers" , "Contact" , "Continuing Professional Development" , "Cookies Policy" , "Copy and Paste Specifications" , "Coustifoam Acoustic Foam" , "CPD Presentations" , "Customers Enjoy Improved Acoustics at Arbuckles Restaurant & Bar" , "Design Led Acoustic Solution at Cranleigh Village Hall" , "Diners Enjoy Improved Acoustics at Vasco & Piero's Restaurant" , "DIY SRS! Acoustic Insulation for BBC Children In Need Project." , "Domestic" , "Domestic" , "Education" , "Educational Acoustics at The Albany Pupil Referral Unit" , "Effective & Colourful Acoustic Solution for Drakes Broughton Village Hall" , "Effective Wall Soundproofing Methods" , "Entertainment" , "Factory Soundproofing" , "Floor Soundproofing" , "Full Marks for Sound Reduction Systems at the Hayfield School in Doncaster" , "Gaming Room Soundproofing" , "Garage Soundproofing" , "Gym Soundproofing" , "Hazeltots Pre-School" , "Historic Church Hall Cures Acoustic Problem" , "Home" , "Home Cinema Soundproofing" , "Home Office" , "Home Soundproofing" , "Home Studio Soundproofing" , "Hotel Soundproofing" , "How to Buy Domestic Soundproofing Products" , "How to Get Your Soundproofing Quote" , "How to improve the sound insulation performance of a ceiling" , "How to improve the sound insulation performance of a party wall" , "Impactafoam Acoustic Foam" , "Improved Acoustics at Marton Methodist Church Hall" , "Improved Acoustics at Rudford & Highleadon Village Hall:" , "Improved Acoustics At Westhill Community Church." , "Improved Acoustics at Woolwich Evangelical Church" , "Improved Acoustics for Grindleton Pavilion" , "Improved Acoustics for Lancaster 53rd Scouts" , "Improved Acoustics for Sutton Under Whitestonecliffe Village Hall" , "Improved Acoustics in the Heart of the Lake District" , "Industrial" , "Isolayte OS Over Screed Acoustic Layer" , "Isolayte US Under Screed Acoustic Layer" , "Job 1" , "Knightwood Primary School Hall" , "Legal Information" , "Leisure" , "Llanfynydd and Ffrith Community Centre, North Wales" , "Maxi 60 Ceiling System delivers dependable fire rated soundproofing solution" , "Maxi Resilient Bars" , "Maxi Screws" , "Maxi Slab" , "Maxiboard - Independent Wall Lining" , "Maxiboard - Masonry Wall Specification" , "Maxiboard - Maxi 60 Ceiling" , "Maxiboard - Maxi Beam and Block Ceiling" , "Maxiboard - Maxi Dropped Ceiling" , "Maxiboard - Maxi MF Ceiling" , "Maxiboard - Timber Stud Partition" , "Maxiboard and Maxideck installed at Exclusive Seaside Hotel & Restaurant" , "Maxideck Above Resiliently Fixed Plasterboard Ceiling" , "Maxideck Above Rigidly Fixed Plasterboard Ceiling" , "Maxideck Acoustic Flooring" , "Maxipanel 28" , "MLV75" , "Morpeth All Saints – Church of England Aided First School" , "Music Room Soundproofing" , "NBS Page" , "NBS Source" , "New £3m government fund could help deliver village hall acoustics upgrades in England" , "News" , "Nightclub Soundproofing" , "No more Noisy Neighbours!" , "Noise is off the menu for a Northumbrian School" , "Noise Problem Cured Efficiently at Bierton Jubilee Hall" , "Noise Problem Solved at St. Marys Church Hall" , "Noise Problem Solved at Village School" , "Noisy Call Centres - Sonata The Solution for U-Switch and Ford." , "Office Noise Reduced at Bromley Council" , "Office Soundproofing" , "Optimising domestic soundproofing with Maxiboard" , "Oxford University Challenge" , "Part E" , "Part E Building Regulations (England and Wales)" , "Part E Solutions for Ceilings" , "Part E Solutions for Floors" , "Part E Solutions for Walls" , "Pioneering Acoustilay sets the quality standard for soundproofing floors" , "Pipe Lagging" , "Privacy Policy" , "Product Brochure and Datasheets" , "Products" , "Public sector" , "Public Sector Buildings" , "Quality Acoustics in the Styx" , "Quote" , "Raincheck" , "Reducing airborne noise coming up from the property below" , "Reducing Noise Pollution - Some Sound Advice" , "Replacing a carpet with timber or laminate flooring?" , "Reverberation" , "Reverberation Reduced at Maybury Primary School" , "Reverberation Reduced with Chorlton Scout Hut" , "Ring Out those Bells! Or Not! With Sound Reduction Systems" , "Safeguarding Acoustics: DBS Certificates for SRS Staff" , "School In A Quiet Village Gets A Hall To Match" , "Sectors" , "Shipton Community Centre" , "Simply Fantastic Acoustic Solution at Thackley Primary School, Bradford" , "Sitemap" , "Solve The Acoustic Problem In Your Noisy Hall" , "Solve The Acoustic Problem In Your Noisy School Hall" , "Solve The Acoustic Problem In Your Noisy Scout or Guide Hut" , "Sonalag AF" , "Sonaslat" , "Sonata Absorbers Improve Quality of Life for 7th Warrington West Scouts" , "Sonata Absorbers Installed at Burlington House School" , "Sonata Absorbers Provide ‘Amazing ‘Difference’ at Carreghofa School" , "Sonata Acoustic Absorbers offer Salvation" , "Sonata Aurio Acoustic Panel" , "Sonata Aurio Trilogy Fabric Colours" , "Sonata Baffle" , "Sonata Memo Innovative Acoustic Notice Board" , "Sonata Memo Acoustic Noticeboard" , "Sonata Memo Facing Colours" , "Sonata Panels installed at 5th Newbold Scout Group" , "Sonata Panels make a Tremendous Difference at Village Hall" , "Sonata Panels Solve Acoustic Issues at Guiseley Methodist Church" , "Sonata Panels Used at Llanfaelog Community Centre, Anglesey" , "Sonata Products Installed at St Nicholas School in Chippenham" , "Sonata Rhino Acoustic Panel" , "Sonata Studio Absorbers used at Canon Slade School, Bolton" , "Sonata Treatment Improves the Dining Experience at Temple Street Resource Centre" , "Sonata Vario Acoustic Panel" , "Sonata Vario Acoustic Panels installed at The Parish Centre, Narborough" , "Sonata Vario installed at Menai Bridge Scout and Guide Community Hall" , "Sonata Vario Panels Installed at Westgate Primary School, Morecombe" , "Sonata Vario Trilogy Fabric Colours" , "Sonatac Adhesive" , "Sonatect Acoustic Foam" , "Sound Absorption for All Saints Church Community Centre" , "Sound Absorption Solutions" , "Sound Advice for Improving Student Wellbeing" , "Sound Reduction Systems Ltd Celebrates 40 Years in the Acoustics Industry" , "SoundBar Acoustic Vertical Cavity Barrier" , "SoundBar Overcomes Taxing Soundproofing Problem." , "Soundblocker" , "Soundblocker delivers effective privacy solution for partitioned offices" , "SoundBlocker Premier at new Olympic Vue Cinema" , "SoundBlocker – Acoustic Ceiling System for Suspended Ceilings" , "Soundbreaker Acoustic Cavity Barrier" , "Soundproof Foam- Useful advice for home studio design" , "Soundproofing for Ceilings" , "Soundproofing for Floors" , "Soundproofing for Walls" , "Soundproofing Machinery, Pumps, and Equipment" , "Soundproofing Offices and Conference Rooms" , "Soundproofing Products Advice" , "Soundproofing your property type" , "Soundseal" , "Soundstop 5" , "Soundstop Acoustic Vertical Cavity Barrier" , "Special School Receives Special Acoustic Treatment" , "Specification Generator" , "Specifier" , "SRS Acoustic Sealant" , "SRS Ainstable Church Institute Case Study" , "SRS Blog - Absorbers Solve Reverberation at Baptist Church" , "SRS Blog - Delamere Primary Gets The Sonata Treatment" , "SRS can assist with Noisy Neighbours Solutions" , "SRS can help with Noisy Neighbour Solutions" , "SRS Copy and Paste Specifications" , "SRS Expertise to the Rescue at Colney Heath Village Hall" , "SRS Gripfix" , "SRS Launch 3 Step Acoustic Absorption Estimator." , "SRS Launches Sonalag AF High-Performance Acoustic Lagging Product" , "SRS Ltd, Sound Insulation for the Stars!" , "SRS Maxiboard Used Extensively in State of the Art Wedding Venue" , "SRS Maxideck - High Performance Acoustic Floor" , "SRS Merchant Training" , "SRS Operations During Covid 19 Outbreak" , "SRS Products Installed at Samsung's New Sound Room facility" , "SRS Receive SafeContractor Accreditation" , "SRS Solve Acoustic Problem at Marshfield Village Hall" , "SRS Solve Acoustic Problem in Church Hall - Fife." , "SRS Solve Acoustic Problem in Sports Hall" , "SRS Sonata Aurio and Vario Solve Acoustic Problems Within Call Centre" , "SRS Sonata Aurio Panels Solve Acoustic Problem at Watling View School" , "SRS Sonata Duo and Aurio Absorbers used at Manorfield Primary School" , "SRS Sonata Vario Absorbers Improve Acoustics at St Georgeƒ??s Primary School" , "SRS Sonata Vario Absorbers Used Extensively at Hesketh Bank Christian Centre" , "SRS Sonata Vario installed at Park Central, York Science Park" , "SRS Sonata Vario Installed within Bishop Wilton Hall" , "SRS Sonata Vario Installed within Kirkby Lonsdale Methodist Church" , "SRS use Rainbow to Solve Acoustic Problem in School" , "St Matthews School in Bolton gets the Sonata Treatment" , "Subprimo Timber Flooring Underlay" , "Superb Results at Socketts Heath Baptist Church" , "Teddington Scouts Get the Sonata Treatment" , "Terms & Conditions" , "The 'Cream'of the Acoustics Industry." , "The Problem of Noise Created by Rainfall on Profiled Metal Roofing Systems" , "The Ten Classic Soundproofing Slip-ups" , "The Top Ten Noise-Reduction Methods" , "Threlkeld Village Hall Cafe Receives the Sonata Treatment" , "Tiddington Community Centre Improves Acoustics With SRS's Sonata Vario Panels" , "Tonge Moor Primary School Gets the Sonata Treatment" , "Total Party Floor Solution" , "Tudhoe Moor Nursery School" , "UK Schools Opting for SRS Sonata Acoustic Absorbers" , "Understandable Confusion in the Acoustic Marketplace?" , "Unique Acoustic Challenge Posed by Two Halls at Whittle Le Woods" , "Wall Soundproofing" , "WallArmour dB" , "Why Choose SRS Ltd as your Soundproofing and Absorption company?" , "Workshop Soundproofing" , "​‘Unbelievable’ Acoustic Treatment Benefits Users of Community Centre" ]; $('#typeahead-search .typeahead_all').typeahead({ hint: true, highlight: true, minLength: 1 }, { name: 'pages', displayKey: 'value', source: substringMatcher(pages) }); var advice = ["Acoustics for Community Halls and Places of Worship" , "Ceiling Soundproofing" , "Copy and Paste Specifications" , "CPD Presentations" , "Factory Soundproofing" , "Floor Soundproofing" , "Gaming Room Soundproofing" , "Garage Soundproofing" , "Gym Soundproofing" , "Home Cinema Soundproofing" , "Home Office" , "Home Soundproofing" , "Home Studio Soundproofing" , "Hotel Soundproofing" , "How to improve the sound insulation performance of a ceiling" , "How to improve the sound insulation performance of a party wall" , "Music Room Soundproofing" , "Nightclub Soundproofing" , "Office Soundproofing" , "Part E Building Regulations (England and Wales)" , "Public Sector Buildings" , "Reducing airborne noise coming up from the property below" , "Soundproofing Machinery, Pumps, and Equipment" , "Soundproofing Offices and Conference Rooms" , "Specification Generator" , "Wall Soundproofing" , "Workshop Soundproofing" ]; $('#typeahead-search .typeahead_advice').typeahead({ hint: true, highlight: true, minLength: 1 }, { name: 'advice', displayKey: 'value', source: substringMatcher(advice) }); $(document).ready(function(e) { if (window.location.hash !== '') { var hash = window.location.hash.replace("#ST-",""); hash = "#"+hash; var Target = $('[href='+hash+']'); // TabLink if (typeof(Target) == 'undefined') { Target = $(hash); // Id } if (typeof(Target) !== 'undefined' && Target.length > 0) { Target.click(); $('html, body').animate({ scrollTop: Target.offset().top}, 1500); } } });