Please enter a location

Please enter a location

Please enter an occasion

Passengers

Please enter number of passengers

Please add a date

Please add a time

Please add a date

Please add a time

back

Please enter your first name

Please enter your last name

Please enter a valid phone number

Please enter a valid email address

back

  Heads up!
Booking an individual seat?

If you are looking to book individual seats rather than hire a vehicle visit nationalexpress.com for great value coach fares.

Back to top

window.addEventListener('DOMContentLoaded', function () { // NEW CODE $( "#form_hire_traveldate" ).datepicker({ dateFormat: "dd/mm/yy", minDate: 0, }); $( "#form_hire_returndate" ).datepicker({ dateFormat: "dd/mm/yy", minDate: 0, }); $('#form_hire_traveldate').change(function() { var startDate = $(this).datepicker('getDate'); $("#form_hire_returndate").datepicker("option", "minDate", startDate ); }) // Stops form submitting on enter key $(window).keydown(function(event){ if(event.keyCode == 13) { event.preventDefault(); return false; } }); // STEP 1 // Select dropdown // const select_occasion = document.querySelector('#occasion'); // const select_arrow = document.querySelector('.select-arrow'); // select_occasion.addEventListener('click', () => { // select_arrow.classList.toggle('select-toggle'); // }) // Number of passengers step counter const minus_btn = document.querySelector('.minus_btn'); const plus_btn = document.querySelector('.plus_btn'); let passenger_value = document.querySelector('#form_hire_passengers'); let discourage = document.querySelector('#discourage-div'); let minus_btn_handler = () => { let num_passenger_value = parseInt(passenger_value.value); passenger_value.value = num_passenger_value - 1; console.log(passenger_value.value + ' minus'); if (passenger_value.value <= 1) { passenger_value.value = 1; } if (passenger_value.value < 8) { discourage.style.display = "block"; } else if (passenger_value.value >= 8) { discourage.style.display = "none"; } } let plus_btn_handler = () => { let num_passenger_value = parseInt(passenger_value.value); passenger_value.value = ++num_passenger_value; console.log(passenger_value.value + ' plus'); if (passenger_value.value < 8) { discourage.style.display = "block"; } else if (passenger_value.value >= 8) { discourage.style.display = "none"; } } passenger_value.addEventListener('keyup', () => { let entered_value = passenger_value.value; entered_value.replace(/[^a-zA-Z] /g, ""); entered_value = +entered_value; console.log(entered_value + ' keyup'); if(entered_value < 8) { passenger_value.value = entered_value; discourage.style.display = "block"; } else if(entered_value >= 8) { passenger_value.value = entered_value; discourage.style.display = "none"; } if (entered_value === 0) { passenger_value.value = null; } }) minus_btn.addEventListener('click', minus_btn_handler) plus_btn.addEventListener('click', plus_btn_handler) // STEP 2 // Single section on/off const single_radio_btn = document.getElementById('single'); /* Return section on/off */ const return_radio_btn = document.getElementById('return'); const return_field_inputs = document.querySelectorAll('.return-field'); const return_field_container = document.querySelector('.return_travel_fields'); const return_input = document.getElementById("form_hire_returndate"); const vehicle_checkbox_container = document.querySelector('.vehicle_checkbox_container'); const vehicle_checkbox = document.getElementById('form_hire_need_stay'); const return_switch_on = () => { var single_return_value = 'return'; console.log('SWITCH ON: ' + single_return_value); return_field_inputs.forEach((field) => { field.removeAttribute('disabled'); field.classList.remove('field_disabled'); field.removeAttribute('disabled') }); return_field_container.classList.remove('field_disabled'); vehicle_checkbox_container.classList.remove('field_disabled'); vehicle_checkbox.classList.remove('field_disabled'); vehicle_checkbox.removeAttribute('disabled'); return_input.removeAttribute('disabled'); single_radio_btn.checked = false; } const return_switch_off = () => { var single_return_value = 'single'; console.log('SWITCH OFF: ' + single_return_value); return_field_inputs.forEach((field) => { field.setAttribute('disabled', ''); field.classList.add('field_disabled'); field.setAttribute('disabled', '') }); return_field_container.classList.add('field_disabled'); vehicle_checkbox_container.classList.add('field_disabled'); vehicle_checkbox.classList.add('field_disabled'); vehicle_checkbox.setAttribute('disabled', ''); return_input.setAttribute('disabled', ''); return_radio_btn.checked = false; } return_radio_btn.addEventListener('click', return_switch_on); single_radio_btn.addEventListener('click', return_switch_off); // STEP 3 //Modal let step3Modal_btn = document.querySelector('#step3Modal_Button'); step3modal_open = () => { $('#step3Modal').modal('show') console.log('step 3 modal open'); } step3Modal_btn.addEventListener('click', step3modal_open); // END OF NEW CODE (function ($) { /*** Add custom JS code here *******************************************************/ var bases = document.getElementsByTagName('base'); var baseHref = null; if (bases.length > 0) { baseHref = bases[0].href; } baseHref = document.location.origin; var pathname = window.location.pathname; var buttonBGColor = '#0055b8'; var activeQuoteTabBGColor = '#0175c0'; var deactiveQuoteTabBGColor = '#12354c'; var navBGColor = ''; var quoteFormBGColor = ''; var hyperlinkTextColor = ''; var contactUsBGColor = ''; var bodyTextColor = ''; var headerTextColor = ''; function create_cookie(name, value, days2expire, hours2expire, path) { var date = new Date(); date.setTime(date.getTime() + (days2expire * hours2expire * 60 * 60 * 1000)); var expires = date.toUTCString(); document.cookie = name + '=' + value + ';' + 'expires=' + expires + ';' + 'path=' + path + ';'; } function read_cookie(name) { var cookie_value = "", current_cookie = "", name_expr = name + "=", all_cookies = document.cookie.split(';'), n = all_cookies.length; for (var i = 0; i < n; i++) { current_cookie = all_cookies[i].trim(); if (current_cookie.indexOf(name_expr) == 0) { cookie_value = current_cookie.substring(name_expr.length, current_cookie.length); break; } } return cookie_value; } function delete_cookie(name) { document.cookie = name + "=; expires=Thu, 01 Jan 1970 00:00:00 GMT; path=/"; } var cookieValue = ''; var cookieName = 'nets_usr_cookie'; var creferurl = document.referrer; var datetime = new Date().toLocaleString(); var cpathname = window.location.pathname; var cparameter = window.location.search; if (cpathname == '/') { cpathname = 'home'; } var oldCookie = read_cookie(cookieName); if (oldCookie) { //got old ck cookieValue = oldCookie + '{"url":"' + cpathname + cparameter + '", "dt":"' + datetime + '"},'; } else {//new cookieValue = '{"url":"' + creferurl + '", "dt":"' + datetime + '"},{"url":"' + cpathname + cparameter + '", "dt":"' + datetime + '"},'; } create_cookie(cookieName, cookieValue, 1, 1, "/"); var utm_source = getUrlParameter('utm_source'); if (utm_source == 'linkedin' || utm_source == 'BusinessTravelNav') { jQuery('.form_selection_hire').css({ 'background-color': deactiveQuoteTabBGColor }); jQuery('.form_selection_commute').css({ 'background-color': deactiveQuoteTabBGColor }); jQuery('.form_selection_enquiry').css({ 'background-color': activeQuoteTabBGColor }); jQuery('.form_hire').hide(); jQuery('.form_commute').hide(); jQuery('.form_corp').show(); } else if (utm_source == 'CommuterEmail') { jQuery('.form_selection_hire').css({ 'background-color': deactiveQuoteTabBGColor }); jQuery('.form_selection_commute').css({ 'background-color': activeQuoteTabBGColor }); jQuery('.form_selection_enquiry').css({ 'background-color': deactiveQuoteTabBGColor }); jQuery('.form_hire').hide(); jQuery('.form_commute').show(); jQuery('.form_corp').hide(); } jQuery("a").hover( function () { var href = jQuery(this).attr('href'); if (href.includes("private-coach-hire")) { jQuery('.et_pb_module_inner').css({ 'background-image': 'url(https://ne-transportsolutions.com/wp-content/uploads/2017/05/xmas-market.gif)' }); } else if (href.includes("private-coach-hire")) { } }, function () { jQuery('.et_pb_module_inner').css({ 'background-image': 'none' }); } ); if (pathname.includes("commuter-services")) { jQuery('.form_selection_hire').hide(); jQuery('.form_selection_commute').hide(); jQuery('.form_selection_enquiry').hide(); jQuery('.form_hire').hide(); jQuery('.form_commute').show(); jQuery('.form_corp').hide(); } if (pathname.includes("business-solutions")) { jQuery('.form_selection_hire').show(); jQuery('.form_selection_commute').hide(); jQuery('.form_selection_enquiry').show(); jQuery('.form_selection_hire').css({ 'background-color': deactiveQuoteTabBGColor }); jQuery('.form_selection_enquiry').css({ 'background-color': activeQuoteTabBGColor }); jQuery('.form_hire').hide(); jQuery('.form_commute').hide(); jQuery('.form_corp').show(); } var is_submiting_privateHire_enquiry = false; var is_submiting_com_enquiry = false; var is_submiting_corp_enquiry = false; jQuery('.form_selection_hire').click(function () { jQuery('.form_selection_hire').css({ 'background-color': activeQuoteTabBGColor }); jQuery('.form_selection_commute').css({ 'background-color': deactiveQuoteTabBGColor }); jQuery('.form_selection_enquiry').css({ 'background-color': deactiveQuoteTabBGColor }); jQuery('.form_hire').show(); jQuery('.form_commute').hide(); jQuery('.form_corp').hide(); }); jQuery('.form_selection_commute').click(function () { jQuery('.form_selection_hire').css({ 'background-color': deactiveQuoteTabBGColor }); jQuery('.form_selection_commute').css({ 'background-color': activeQuoteTabBGColor }); jQuery('.form_selection_enquiry').css({ 'background-color': deactiveQuoteTabBGColor }); jQuery('.form_hire').hide(); jQuery('.form_commute').show(); jQuery('.form_corp').hide(); }); jQuery('.form_selection_enquiry').click(function () { jQuery('.form_selection_hire').css({ 'background-color': deactiveQuoteTabBGColor }); jQuery('.form_selection_commute').css({ 'background-color': deactiveQuoteTabBGColor }); jQuery('.form_selection_enquiry').css({ 'background-color': activeQuoteTabBGColor }); jQuery('.form_hire').hide(); jQuery('.form_commute').hide(); jQuery('.form_corp').show(); }); var pick_date = jQuery("#form_hire_traveldate").datepicker({ dateFormat: 'dd/mm/yy' }).val(); jQuery('#form_hire_traveldate').val(pick_date); var return_date = jQuery("#form_hire_returndate").datepicker({ dateFormat: 'dd/mm/yy' }).val(); jQuery('#form_hire_returndate').val(return_date); var single_return_value = 'single'; jQuery('.form_hire_vehicle_stay').hide(); var vehicle_selection = ''; jQuery('#form_hire_bus').click(function () { vehicle_selection = 'ST'; jQuery('.form_hire_type').css({ 'border': '0' }); jQuery('#form_hire_bus').css({ 'border': '#ffffff solid 5px' }); }); jQuery('#form_hire_coach').click(function () { vehicle_selection = 'ST'; jQuery('.form_hire_type').css({ 'border': '0' }); jQuery('#form_hire_coach').css({ 'border': '#ffffff solid 5px' }); }); jQuery('#form_hire_standard').click(function () { vehicle_selection = 'ST'; jQuery('.form_hire_type').css({ 'border': '0' }); jQuery('#form_hire_standard').css({ 'border': '#ffffff solid 5px' }); }); jQuery('#form_hire_vip').click(function () { vehicle_selection = 'VIP'; jQuery('.form_hire_type').css({ 'border': '0' }); jQuery('#form_hire_vip').css({ 'border': '#ffffff solid 5px' }); }); jQuery('#form_hire_exe').click(function () { vehicle_selection = 'EX'; jQuery('.form_hire_type').css({ 'border': '0' }); jQuery('#form_hire_exe').css({ 'border': '#ffffff solid 5px' }); }); jQuery('#form_hire_single').click(function () { single_return_value = 'single'; jQuery('#form_hire_single').css({ 'background-color': deactiveQuoteTabBGColor }); jQuery('#form_hire_return').css({ 'background-color': '#21638f' }); jQuery('.form_hire_vehicle_stay').hide(); jQuery('#form_hire_returndate').hide(); jQuery('#form_hire_returntime').hide(); }); jQuery('#form_hire_return').click(function () { single_return_value = 'return'; jQuery('#form_hire_single').css({ 'background-color': '#21638f' }); jQuery('#form_hire_return').css({ 'background-color': deactiveQuoteTabBGColor }); jQuery('.form_hire_vehicle_stay').show(); jQuery('#form_hire_returndate').show(); jQuery('#form_hire_returntime').show(); }); jQuery('#step1_next').click(function () { var valid = validateStep1(); console.log("Step 1 is " + valid); if (valid) { // if step 1 is true show the modal $('#step1Modal').modal('show'); let step_1_modal_yes = document.querySelector('#step_1_modal_yes'); step_1_modal_yes.addEventListener('click', () => { $('#step1Modal').modal('hide'); document.querySelector('.step_1').classList.remove('active'); document.querySelector('.step_2').classList.add('active'); }); } else { console.log('Valid doesn\'t appear to be true'); } }); jQuery('#step2_back').click(function () { document.querySelector('.step_2').classList.remove('active'); document.querySelector('.step_1').classList.add('active'); }); jQuery('#step2_next').click(function () { var valid = validateStep2(); console.log("Step 2 is " + valid); if (valid) { document.querySelector('.step_2').classList.remove('active'); document.querySelector('.step_3').classList.add('active'); } else { } $('.lazy').lazy({ bind: "event", delay: 0 }); }); jQuery('#step3_back').click(function () { document.querySelector('.step_3').classList.remove('active'); document.querySelector('.step_2').classList.add('active'); }); jQuery('#step3_submit').click(function (e) { e.preventDefault(); var valid = validateStep3(); if (valid) { if (is_submiting_privateHire_enquiry == false) { submit_privateHire_enquiry_new(); } } }); // jQuery('#step4_back').click(function () { // // jQuery('.form_hire_step4').hide("slide", { direction: "right" }, 250, function () { // // jQuery('.form_hire_step3').show("slide", { direction: "left" }, 250); // // }); // }); // jQuery('#step4_submit').click(function () { // // var valid = validateStep4(); // // if (valid) { // // if (is_submiting_privateHire_enquiry == false) { // // submit_privateHire_enquiry_new(); // // } // // } // }); jQuery('#com_step1_next').click(function () { var valid = validateComForm(); if (valid) { jQuery('.form_com_step1').hide("slide", { direction: "left" }, 250, function () { jQuery('.form_com_step2').show("slide", { direction: "right" }, 250); }); } }); jQuery('#com_step2_back').click(function () { jQuery('.form_com_step2').hide("slide", { direction: "right" }, 250, function () { jQuery('.form_com_step1').show("slide", { direction: "left" }, 250); }); }); jQuery('#com_step2_submit').click(function () { if (is_submiting_com_enquiry == false) { submit_com_enquiry(); } }); jQuery('#corp_step1_next').click(function () { var valid = validateCorpStep1(); if (valid) { jQuery('.form_corp_step1').hide("slide", { direction: "left" }, 250, function () { jQuery('.form_corp_step2').show("slide", { direction: "right" }, 250); }); } }); jQuery('#corp_step2_back').click(function () { jQuery('.form_corp_step2').hide("slide", { direction: "right" }, 250, function () { jQuery('.form_corp_step1').show("slide", { direction: "left" }, 250); }); }); jQuery('#corp_step2_submit').click(function () { if (is_submiting_corp_enquiry == false) { submit_corp_enquiry(); } }); initMap(); function validateStep1() { console.log('validateStep1 start...'); var valid = true; // FROM var form_hire_from = jQuery("#form_hire_from").val(); form_hire_from = form_hire_from.trim(); console.log("form hire from: " + form_hire_from); var destinationCity = jQuery("#destinationCity").val(); destinationCity = destinationCity.trim(); console.log("destinationCounty: " + destinationCity); var destinationPostcode = jQuery("#destinationPostcode").val(); console.log("destinationPostcode: " + destinationPostcode); // TO var form_hire_to = jQuery("#form_hire_to").val(); form_hire_to = form_hire_to.trim(); console.log("form hire to: " + form_hire_to); var pickupCity = jQuery("#pickupCity").val(); pickupCity = pickupCity.trim(); console.log("pickupCity: " + pickupCity); var pickupCounty = jQuery("#pickupCounty").val(); pickupCounty = pickupCounty.trim(); console.log("pickupCounty: " + pickupCounty); var pickupPostcode = jQuery("#pickupPostcode").val(); console.log("pickupPostcode: " + pickupPostcode); // REASON var form_hire_reason = jQuery(".form_hire_reason").val(); console.log("form hire reason : " + form_hire_reason); // PASSENGERS var form_hire_passengers = jQuery("#form_hire_passengers").val(); console.log("form hire passengers : " + form_hire_passengers); var pathname = window.location.pathname; if (true) {// (pathname.includes("testkf")) { // go through each field and test if valid if(!form_hire_from) { console.log('from is empty'); jQuery("#errorlabel_form_hire_from").css({ "display": "inline-block" }); jQuery("#form_hire_from").addClass('error_field'); valid = false; } else { jQuery("#errorlabel_form_hire_from").css({ "display": "none" }); jQuery("#form_hire_from").removeClass('error_field'); } if(!form_hire_to) { console.log('to is empty'); jQuery("#errorlabel_form_hire_to").css({ "display": "inline-block" }); jQuery("#form_hire_to").addClass('error_field'); valid = false; } else { jQuery("#errorlabel_form_hire_to").css({ "display": "none" }); jQuery("#form_hire_to").removeClass('error_field'); } if(!form_hire_reason) { console.log('reason is empty'); jQuery("#errorlabel_form_hire_reason").css({ "display": "inline-block" }); jQuery(".form_hire_reason").addClass('error_field'); valid = false; } else { jQuery("#errorlabel_form_hire_reason").css({ "display": "none" }); jQuery(".form_hire_reason").removeClass('error_field'); } if(!form_hire_passengers) { console.log('passengers is empty'); jQuery("#errorlabel_form_hire_passengers").css({ "display": "inline-block" }); jQuery(".num_of_passengers").addClass('error_field'); valid = false; } else { jQuery("#errorlabel_form_hire_passengers").css({ "display": "none" }); jQuery(".num_of_passengers").removeClass('error_field'); } if (form_hire_from && form_hire_to && form_hire_reason && form_hire_passengers) { console.log('No errors!'); valid = true; } } else { if (form_hire_to == '' || destinationCity == '' || destinationCounty == '' || destinationPostcode == '') { jQuery("#errorlabel_form_hire_to").css({ "visibility": "visible" }); valid = false; } else { jQuery("#errorlabel_form_hire_to").css({ "visibility": "hidden" }); } if (form_hire_from == '' || pickupCity == '' || pickupCounty == '' || pickupPostcode == '') { jQuery("#errorlabel_form_hire_from").css({ "visibility": "visible" }); valid = false; } else { jQuery("#errorlabel_form_hire_from").css({ "visibility": "hidden" }); } } return valid; }//validateStep1 function validateStep2() { console.log('validateStep2 start...'); var valid = true; // SINGLE var form_hire_traveldate = jQuery("#form_hire_traveldate").val(); var form_hire_traveltime = jQuery("#form_hire_traveltime").val(); // RETURN var form_hire_returndate = jQuery("#form_hire_returndate").val(); var form_hire_returntime = jQuery("#form_hire_returntime").val(); // VEHCILE TO STAY IS CHECKED IN THE FORM SUBMIT FUNCTION // TRAVEL (SINGLE) var pick_date = form_hire_traveldate; var pick_time = form_hire_traveltime; if (!pick_date) { console.log('single date empty'); jQuery("#errorlabel_form_hire_traveldate").css({ "display": "inline-block" }); jQuery("#form_hire_traveldate").addClass('error_field'); valid = false; } else { console.log('single date filled'); jQuery("#errorlabel_form_hire_traveldate").css({ "display": "none" }); jQuery("#form_hire_traveldate").removeClass('error_field'); } if (!pick_time) { console.log('single time empty'); jQuery("#errorlabel_form_hire_traveltime").css({ "display": "inline-block" }); jQuery("#form_hire_traveltime").addClass('error_field'); valid = false; } else { console.log('single time filled'); jQuery("#errorlabel_form_hire_traveltime").css({ "display": "none" }); jQuery("#form_hire_traveltime").removeClass('error_field'); } // CHECKS IF SELECTED DATE AND TIME IS BEFORE TODAY // var dateP = pick_date.split("/"); // var timeP = pick_time.split(":"); // var pick_year = parseInt(dateP[2]); // var pick_month = parseInt(dateP[1]); // var pick_day = parseInt(dateP[0]); // var pick_hour = parseInt(timeP[0]); // var pick_minute = parseInt(timeP[1]); // var pick_second = 0; // var pick_timestamp = datetimeToTimestamp(pick_year, pick_month, pick_day, pick_hour, pick_minute, pick_second); // var timestamp_now = Math.floor(Date.now() / 1000); // console.log('timestamp now: ' + timestamp_now, 'pick timestamp: ' + pick_timestamp); // if (timestamp_now > pick_timestamp) { // document.querySelector('#errorlabel_form_hire_traveltime').innerText = 'Pick up time is before today'; // jQuery("#errorlabel_form_hire_traveltime").css({ "display": "inline-block" }); // valid = false; // } else { // jQuery("#errorlabel_form_hire_traveltime").css({ "display": "none" }); // } if (!return_field_container.classList.contains('field_disabled')) { single_return_value == 'return' var return_date = form_hire_returndate; var return_time = form_hire_returntime; if (return_date && return_time) { var dateP = pick_date.split("/"); var timeP = pick_time.split(":"); var pick_year = parseInt(dateP[2]); var pick_month = parseInt(dateP[1]); var pick_day = parseInt(dateP[0]); var pick_hour = parseInt(timeP[0]); var pick_minute = parseInt(timeP[1]); var pick_second = 0; var pick_timestamp = datetimeToTimestamp(pick_year, pick_month, pick_day, pick_hour, pick_minute, pick_second); var dateR = return_date.split("/"); var timeR = return_time.split(":"); var return_year = parseInt(dateR[2]); var return_month = parseInt(dateR[1]); var return_day = parseInt(dateR[0]); var return_hour = parseInt(timeR[0]); var return_minute = parseInt(timeR[1]); var return_second = 0; var return_timestamp = datetimeToTimestamp(return_year, return_month, return_day, return_hour, return_minute, return_second); } if (!return_date) { console.log('return date empty'); jQuery("#errorlabel_form_hire_returndate").css({ "display": "inline-block" }); jQuery("#form_hire_returndate").addClass('error_field'); valid = false; } else { console.log('return date filled'); jQuery("#errorlabel_form_hire_returndate").css({ "display": "none" }); jQuery("#form_hire_returndate").removeClass('error_field'); } if (!return_time) { console.log('return time empty'); jQuery("#errorlabel_form_hire_returntime").css({ "display": "inline-block" }); jQuery("#form_hire_returntime").addClass('error_field'); valid = false; } else if(pick_timestamp >= return_timestamp) { console.log('return time filled but single date is after or equal to return date'); document.querySelector("#errorlabel_form_hire_returntime").innerText = 'Return time is before or equal to pick up time.' jQuery("#errorlabel_form_hire_returntime").css({ "display": "inline-block" }); jQuery("#form_hire_returntime").addClass('error_field'); valid = false; } else if(pick_date && pick_time && return_date && return_time) { console.log('return time filled and no errors'); jQuery("#errorlabel_form_hire_returndate").css({ "display": "none" }); jQuery("#errorlabel_form_hire_returntime").css({ "display": "none" }); jQuery("#form_hire_returndate").removeClass('error_field'); jQuery("#form_hire_returntime").removeClass('error_field'); valid = true; } } console.log('This is the return timestamp: ' + return_timestamp); console.log('This is the single timestamp: ' + pick_timestamp); return valid; }//validateStep2 function validateStep3() { console.log('validateStep3 start...'); var valid = true; // FIRST NAME var form_hire_fname = jQuery("#form_hire_fname").val(); form_hire_fname = form_hire_fname.trim(); console.log("form hire fname: " + form_hire_fname); // LAST NAME var form_hire_lname = jQuery("#form_hire_lname").val(); form_hire_lname = form_hire_lname.trim(); console.log("form hire lname: " + form_hire_lname); // PHONE NUMBER var form_hire_phone = jQuery("#form_hire_phone").val(); form_hire_phone = form_hire_phone.trim(); console.log("form hire phone: " + form_hire_phone); // EMAIL var form_hire_email = jQuery("#form_hire_email").val(); form_hire_email = form_hire_email.trim(); console.log("form hire email: " + form_hire_email); if(!form_hire_fname) { console.log('fname is empty'); jQuery("#errorlabel_form_hire_fname").css({ "display": "inline-block" }); jQuery("#form_hire_fname").addClass('error_field'); valid = false; } else { jQuery("#errorlabel_form_hire_fname").css({ "display": "none" }); jQuery("#form_hire_fname").removeClass('error_field'); } if(!form_hire_lname) { console.log('lname is empty'); jQuery("#errorlabel_form_hire_lname").css({ "display": "inline-block" }); jQuery("#form_hire_lname").addClass('error_field'); valid = false; } else { jQuery("#errorlabel_form_hire_lname").css({ "display": "none" }); jQuery("#form_hire_lname").removeClass('error_field'); } if (!form_hire_phone) { jQuery("#errorlabel_form_hire_phone").css({ "display": "inline-block" }); jQuery("#form_hire_phone").addClass('error_field'); valid = false; } else { var phone = jQuery('#form_hire_phone').val(); phone = phone.replace(/[^0-9]/g, ''); if (phone.length != 11) { jQuery("#errorlabel_form_hire_phone").css({ "display": "inline-block" }); jQuery("#form_hire_phone").addClass('error_field'); valid = false; } else { jQuery("#errorlabel_form_hire_phone").css({ "display": "none" }); jQuery("#form_hire_phone").removeClass('error_field'); } } if (!form_hire_email) { jQuery("#errorlabel_form_hire_email").css({ "display": "inline-block" }); jQuery("#form_hire_email").addClass('error_field'); valid = false; } else { var sEmail = jQuery('#form_hire_email').val(); sEmail = sEmail.replace(/\s/g, ''); if (isEmail(sEmail) == false) { jQuery("#errorlabel_form_hire_email").css({ "display": "inline-block" }); jQuery("#form_hire_email").addClass('error_field'); valid = false; } else { jQuery("#errorlabel_form_hire_email").css({ "display": "none" }); jQuery("#form_hire_email").removeClass('error_field'); } } return valid; }//validateStep3 function validateStep4() { // var valid = true; // if (jQuery("#form_hire_fname").val() == '') { // jQuery("#errorlabel_form_hire_fname").css({ "visibility": "visible" }); // valid = false; // } else { // jQuery("#errorlabel_form_hire_fname").css({ "visibility": "hidden" }); // } // if (jQuery('#form_hire_lname').val() == '') { // jQuery("#errorlabel_form_hire_lname").css({ "visibility": "visible" }); // valid = false; // } else { // jQuery("#errorlabel_form_hire_lname").css({ "visibility": "hidden" }); // } // if (jQuery('#form_hire_phone').val() == '') { // jQuery("#errorlabel_form_hire_phone").css({ "visibility": "visible" }); // valid = false; // } else { // var phone = jQuery('#form_hire_phone').val(); // phone = phone.replace(/[^0-9]/g, ''); // if (phone.length != 11) { // jQuery("#errorlabel_form_hire_phone").css({ "visibility": "visible" }); // valid = false; // } else { // jQuery("#errorlabel_form_hire_phone").css({ "visibility": "hidden" }); // } // } // if (jQuery('#form_hire_email').val() == '') { // jQuery("#errorlabel_form_hire_email").css({ "visibility": "visible" }); // valid = false; // } else { // var sEmail = jQuery('#form_hire_email').val(); // sEmail = sEmail.replace(/\s/g, ''); // if (isEmail(sEmail) == false) { // jQuery("#errorlabel_form_hire_email").css({ "visibility": "visible" }); // valid = false; // } else { // jQuery("#errorlabel_form_hire_email").css({ "visibility": "hidden" }); // } // } // return valid; }//validateStep4 function validateCorpStep1() { var valid = true; if (jQuery("#corp_hire_fname").val() == '') { jQuery("#errorlabel_corp_hire_fname").css({ "visibility": "visible" }); valid = false; } else { jQuery("#errorlabel_corp_hire_fname").css({ "visibility": "hidden" }); } if (jQuery('#corp_hire_lname').val() == '') { jQuery("#errorlabel_corp_hire_lname").css({ "visibility": "visible" }); valid = false; } else { jQuery("#errorlabel_corp_hire_lname").css({ "visibility": "hidden" }); } if (jQuery('#corp_hire_phone').val() == '') { jQuery("#errorlabel_corp_hire_phone").css({ "visibility": "visible" }); valid = false; } else { var phone = jQuery('#corp_hire_phone').val(); phone = phone.replace(/[^0-9]/g, ''); if (phone.length != 11) { jQuery("#errorlabel_corp_hire_phone").css({ "visibility": "visible" }); valid = false; } else { jQuery("#errorlabel_corp_hire_phone").css({ "visibility": "hidden" }); } } if (jQuery('#corp_hire_email').val() == '') { jQuery("#errorlabel_corp_hire_email").css({ "visibility": "visible" }); valid = false; } else { var sEmail = jQuery('#corp_hire_email').val(); sEmail = sEmail.replace(/\s/g, ''); if (isEmail(sEmail) == false) { jQuery("#errorlabel_corp_hire_email").css({ "visibility": "visible" }); valid = false; } else { jQuery("#errorlabel_corp_hire_email").css({ "visibility": "hidden" }); } } return valid; }//validateCorpStep1 function validateComForm() { var valid = true; if (jQuery("#com_hire_fname").val() == '') { jQuery("#errorlabel_com_hire_fname").css({ "visibility": "visible" }); valid = false; } else { jQuery("#errorlabel_com_hire_fname").css({ "visibility": "hidden" }); } if (jQuery('#com_hire_lname').val() == '') { jQuery("#errorlabel_com_hire_lname").css({ "visibility": "visible" }); valid = false; } else { jQuery("#errorlabel_com_hire_lname").css({ "visibility": "hidden" }); } if (jQuery('#com_hire_phone').val() == '') { jQuery("#errorlabel_com_hire_phone").css({ "visibility": "visible" }); valid = false; } else { var phone = jQuery('#com_hire_phone').val(); phone = phone.replace(/[^0-9]/g, ''); if (phone.length != 11) { valid = false; jQuery("#errorlabel_com_hire_phone").css({ "visibility": "visible" }); } else { jQuery("#errorlabel_com_hire_phone").css({ "visibility": "hidden" }); } } if (jQuery('#com_hire_email').val() == '') { jQuery("#errorlabel_com_hire_email").css({ "visibility": "visible" }); valid = false; } else { var sEmail = jQuery('#com_hire_email').val(); sEmail = sEmail.replace(/\s/g, ''); if (isEmail(sEmail) == false) { valid = false; jQuery("#errorlabel_com_hire_email").css({ "visibility": "visible" }); } else { jQuery("#errorlabel_com_hire_email").css({ "visibility": "hidden" }); } } return valid; }//validateComForm function isEmail(sEmail) { var filter = /^([\w-\.]+)@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.)|(([\w-]+\.)+))([a-zA-Z]{2,4}|[0-9]{1,3})(\]?)$/; if (filter.test(sEmail)) { return true; } else { return false; } } function submit_privateHire_enquiry_new() { $("#delay_overlay").show(); is_submiting_privateHire_enquiry = true; var lead_id = false; var lead_id_data = jQuery("#need_return").val(); if (lead_id_data == 1) { lead_id = true; } var first_name = jQuery("#form_hire_fname").val(); var last_name = jQuery("#form_hire_lname").val(); var phone = jQuery("#form_hire_phone").val(); var email = jQuery("#form_hire_email").val(); var passengers = jQuery("#form_hire_passengers").val(); var vehicle = vehicle_selection; var returnOrSingle = single_return_value; var departureDate = jQuery("#form_hire_traveldate").val(); var departureTime = jQuery("#form_hire_traveltime").val(); var returnDate = jQuery("#form_hire_returndate").val(); var returnTime = jQuery("#form_hire_returntime").val(); var departureDateQ = jQuery("#form_hire_traveldate").val(); var returnDateQ = jQuery("#form_hire_returndate").val(); var departureDate_hubspot = ''; var returnDate_hubspot = ''; if(departureDate != ""){ var departureDate_hubspot_array = departureDate.split("/"); var departureDate_d = departureDate_hubspot_array[0]; var departureDate_m = departureDate_hubspot_array[1]; var departureDate_y = departureDate_hubspot_array[2]; departureDate_hubspot = departureDate_y + "-" + departureDate_m + "-" + departureDate_d; } if(returnDate!= ""){ var returnDate_hubspot_array = returnDate.split("/"); var returnDate_d = returnDate_hubspot_array[0]; var returnDate_m = returnDate_hubspot_array[1]; var returnDate_y = returnDate_hubspot_array[2]; returnDate_hubspot = returnDate_y + "-" + returnDate_m + "-" + returnDate_d; } departureDate = toSFDate(departureDate); returnDate = toSFDate(returnDate); departureDateQ = toSFDateQ(departureDateQ); returnDateQ = toSFDateQ(returnDateQ); if (returnDateQ === "null" || returnDateQ === null) { returnDateQ = departureDateQ; } var source_location = jQuery("#form_hire_from").val(); var pickupStreet = jQuery("#pickupStreet").val(); var pickupCity = jQuery("#pickupCity").val(); var pickupCounty = jQuery("#pickupCounty").val(); var pickupCountry = jQuery("#pickupCountry").val(); var pickupPostcode = jQuery("#pickupPostcode").val(); var destination_location = jQuery("#form_hire_to").val(); var destinationStreet = jQuery("#destinationStreet").val(); var destinationCity = jQuery("#destinationCity").val(); var destinationCounty = jQuery("#destinationCounty").val(); var destinationCountry = jQuery("#destinationCountry").val(); var destinationPostcode = jQuery("#destinationPostcode").val(); var company = jQuery("#form_hire_company").val(); var voucherName = jQuery("#form_hire_voucher").val(); var distance = getDistance(source_location, destination_location); var trip_reason = jQuery(".form_hire_reason :selected").val(); var description = "";//jQuery("#description").val(); var brand = getBrand();//jQuery("#brand").val(); //'National Express' var channel = getChannel(); //jQuery("#channel").val(); checkbox_subscribe var vehicleTo_Stay = false; if (jQuery("#form_hire_need_stay").prop("checked") == true) { vehicleTo_Stay = true; } else { vehicleTo_Stay = false; } var optedOutOfEmail = true; if (jQuery("#checkbox_subscribe").prop("checked") == true) { optedOutOfEmail = true; } else { optedOutOfEmail = false; } var referUrl = document.referrer; var submissionUrl = window.location.href; //start track var t_source = ''; var t_medium = 'Referral'; var t_campaign = ''; var ckValue = read_cookie('nets_usr_cookie'); if (ckValue) { ckValue = ckValue.substring(0, ckValue.length - 1); ckValue = "[" + ckValue + "]"; var ckobj = JSON.parse(ckValue); if (ckobj.length >= 1) { var url_0 = ckobj[0].url; var url_1 = ckobj[1].url; t_source = url_0; if (url_0 == "") { t_medium = 'Direct'; } else if (url_0.includes("google") && (url_1.includes("aw.ds"))) { t_medium = 'Paid'; } else if ((url_0.includes("google") && (!url_1.includes("aw.ds"))) || (url_0.includes("bing")) || (url_0.includes("yahoo")) || (url_0.includes("ask")) || (url_0.includes("google"))) { t_medium = 'Organic'; } else if (url_0.includes("Facebook") && (url_1.includes("aw.ds"))) { t_medium = 'Paid Social'; } else if (url_0.includes("Instagram") && (url_1.includes("aw.ds"))) { t_medium = 'Paid Social'; } else if (url_0.includes("LinkedIn") && (url_1.includes("aw.ds"))) { t_medium = 'Paid Social'; } else if ((url_0.includes("Facebook") || url_0.includes("Instagram") || url_0.includes("LinkedIn")) && (!url_1.includes("aw.ds"))) { t_medium = 'Organic Social'; } else if (url_0.includes("ne-transportsolutions")) { t_medium = 'Direct'; } else { t_medium = 'Referral'; } } t_campaign = getUrlParameter(submissionUrl, "utm_campaign"); } var osbr = getOS() + '_' + getMOS() + '_' + getBrowser(); var data_objQ = { Brand__c: brand, FirstName: first_name, LastName: last_name, Phone: phone, Email: email, Passengers__c: passengers, Vehicle_Standard__c: vehicle, R_S__c: returnOrSingle, Pick_Up_Date__c: departureDateQ, Pick_Up_Time__c: departureTime, Return_Leave_Date__c: returnDateQ, Return_Leave_Time__c: returnTime, Source_Location__c: source_location, Pick_Up_Street__c: pickupStreet, Pick_Up_County__c: pickupCounty, Pick_Up_City__c: pickupCity, Pick_up_Country__c: pickupCountry, Pick_Up_Post_Code__c: pickupPostcode, Destination_Location__c: destination_location, Destination_Street__c: destinationStreet, Destination_County__c: destinationCounty, Destination_City__c: destinationCity, Destination_Country__c: destinationCountry, Destination_Postal_Code__c: destinationPostcode, Distance_miles__c: distance, HasOptedOutOfEmail: optedOutOfEmail, Vehicle_To_Stay__c: vehicleTo_Stay, Voucher__c: osbr, Channel__c: channel, Enquiry_Type__c: 'WEB', Company: company, Reason_for_trip__c: trip_reason, Source__c: submissionUrl, KF_Campaign__c: t_campaign, KF_Source__c: t_source, KF_Source2__c: t_medium, Utility__c: osbr }; var data_obj = { Brand__c: brand, FirstName: first_name, LastName: last_name, Phone: phone, Email: email, Passengers__c: passengers, Vehicle_Standard__c: vehicle, R_S__c: returnOrSingle, Pick_Up_Date__c: departureDate, Pick_Up_Time__c: departureTime, Return_Leave_Date__c: returnDate, Return_Leave_Time__c: returnTime, Source_Location__c: source_location, Pick_Up_Street__c: pickupStreet, Pick_Up_County__c: pickupCounty, Pick_Up_City__c: pickupCity, Pick_up_Country__c: pickupCountry, Pick_Up_Post_Code__c: pickupPostcode, Destination_Location__c: destination_location, Destination_Street__c: destinationStreet, Destination_County__c: destinationCounty, Destination_City__c: destinationCity, Destination_Country__c: destinationCountry, Destination_Postal_Code__c: destinationPostcode, Distance_miles__c: distance, HasOptedOutOfEmail: optedOutOfEmail, Vehicle_To_Stay__c: vehicleTo_Stay, Voucher__c: osbr, Channel__c: channel, Enquiry_Type__c: 'WEB', Company: company, Reason_for_trip__c: trip_reason, Source__c: submissionUrl, KF_Campaign__c: t_campaign, KF_Source__c: t_source, KF_Source2__c: t_medium, Utility__c: osbr }; var request_obj_json = JSON.stringify(data_obj); enableLoadingOverlay(); var hubSpotJsonString; var time_date = new Date(); var time_millisec = time_date.getTime(); returnOrSingle = (returnOrSingle == "single") ? "Single" : "Return"; var hubSpotJsonString_time = { submittedAt: time_millisec }; // This millisecond timestamp is optional. Update the value from "1517927174000" to avoid an INVALID_TIMESTAMP error. var hubSpotJsonString_data = { fields: [ { name: "enquiry_type__c", value: "Web" }, { name: "passengers__c", value: passengers }, { name: "firstname", value: first_name }, { name: "lastname", value: last_name }, { name: "phone", value: phone }, { name: "message", value: description }, { name: "email", value: email }, { name: "brand__c", value: brand }, { name: "company", value: company }, { name: "channel__c", value: channel }, { name: "destination_street__c", value: destinationStreet }, { name: "destination_city__c", value: destinationCity }, { name: "destination_county__c", value: destinationCounty }, { name: "destination_country__c", value: pickupCountry }, { name: "destination_postal_code__c", value: destinationPostcode }, { name: "distance_miles__c", value: distance }, { name: "pick_up_street__c", value: pickupStreet }, { name: "pick_up_city__c", value: pickupCity }, { name: "pick_up_county__c", value: pickupCounty }, { name: "pick_up_country__c", value: pickupCountry }, { name: "pick_up_post_code__c", value: pickupPostcode }, { name: "pick_up_date__c", value: departureDate_hubspot }, { name: "pick_up_time__c", value: departureTime }, { name: "reason_for_trip__c", value: trip_reason }, { name: "r_s__c", //return/single value: returnOrSingle }, { name: "return_leave_date__c", value: returnDate_hubspot }, { name: "return_leave_time__c",//return value: returnTime }, { name: "vehicle_to_stay__c", value: vehicleTo_Stay }, { name: "vehicle_standard__c", value: vehicle }, { name: "website_lead__c", value: lead_id }, { name: "kf_source__c", value: referUrl }, { name: "source__c", value: submissionUrl }, { name: "voucher__c", value: voucherName }, { name: "code_1__c", value: "" } ], }; var hutk = document.cookie.replace(/(?:(?:^|.*;\s*)hubspotutk\s*\=\s*([^;]*).*$)|^.*$/, "$1") var hubSpotJsonString_cookie = { context: { hutk: hutk, pageUri: "https://ne-transportsolutions.com/", pageName: "Coach hire enquiry" } };// include this parameter and set it to the hubspotutk cookie value to enable cookie tracking on your submission if (optedOutOfEmail == false) { if (hutk == "") { hubSpotJsonString = { ...hubSpotJsonString_time, ...hubSpotJsonString_data }; } else { hubSpotJsonString = { ...hubSpotJsonString_time, ...hubSpotJsonString_data, ...hubSpotJsonString_cookie }; } } else { var hubSpotJsonString_gdpr = { legalConsentOptions: { consent: { consentToProcess: optedOutOfEmail, text: "I agree to allow Example Company to store and process my personal data.", communications: [ { value: optedOutOfEmail, subscriptionTypeId: 999, text: "I agree to receive marketing communications from Example Company." }] } } };// Include this object when GDPR options are enabled if (hutk == "") { hubSpotJsonString = { ...hubSpotJsonString_time, ...hubSpotJsonString_data, ...hubSpotJsonString_gdpr }; } else { optedOutOfEmail hubSpotJsonString = { ...hubSpotJsonString_time, ...hubSpotJsonString_data, ...hubSpotJsonString_cookie, ...hubSpotJsonString_gdpr }; } } var portalId = "8157425"; var formId = "09e1f37c-1fa6-4126-b47b-88abff632a4a"; var queryString = Object.keys(data_objQ).map(key => key + '=' + data_objQ[key]).join('&'); $.ajax({ url: '/journeyPlanner/salesforce_post_org.aspx?' + queryString, data: request_obj_json, dataType: "json", contentType: "application/json", responseType: "json", cache: false, context: document.body, type: 'POST', success: function (response) { var leadId = response.Ref__c; //alert(leadId); /*ga('send', { hitType: 'event', eventCategory: 'Lead', eventAction: 'submit', eventLabel: leadId }); ga('send', 'event', 'Lead', 'submit', leadId);*/ submitHubSpot(hubSpotJsonString, portalId, formId, leadId); }, error: function (jqXHR, response) { //alert("Error"); submitHubSpot(hubSpotJsonString, portalId, formId, "ph"); } }); }//submit_privateHire_enquiry_new function submit_com_enquiry() { is_submiting_com_enquiry = true; var fname = jQuery("#com_hire_fname").val(); var lname = jQuery('#com_hire_lname').val(); var phone = jQuery('#com_hire_phone').val(); var email = jQuery('#com_hire_email').val(); var live = jQuery('#com_hire_live').val(); var work = jQuery('#com_hire_work').val(); var how = jQuery('#com_hire_how').val(); var brand = getBrand();//jQuery("#brand").val(); //'National Express' var channel = "Commuter"; //jQuery("#channel").val(); var optedOutOfEmail = true; if (jQuery("#com_checkbox_subscribe").prop("checked") == true) { optedOutOfEmail = true; } else { optedOutOfEmail = false; } var referUrl = document.referrer; var submissionUrl = window.location.href; enableLoadingOverlay(); var hubSpotJsonString; var time_date = new Date(); var time_millisec = time_date.getTime(); var hubSpotJsonString_time = { submittedAt: time_millisec }; // This millisecond timestamp is optional. Update the value from "1517927174000" to avoid an INVALID_TIMESTAMP error. var hubSpotJsonString_data = { fields: [ { name: "firstname", value: fname }, { name: "lastname", value: lname }, { name: "email", value: email }, { name: "phone", value: phone }, { name: "enquiry_type__c", value: "Web" }, { name: "kf_source__c", value: referUrl }, { name: "source__c", value: submissionUrl }, { name: "channel__c", value: channel }, { name: "where_do_you_live_", value: live }, { name: "where_do_you_work_", value: work }, { name: "how_do_you_currently_commute_into_london_", value: how }, { name: "code_1__c", value: "" } ], }; var hutk = document.cookie.replace(/(?:(?:^|.*;\s*)hubspotutk\s*\=\s*([^;]*).*$)|^.*$/, "$1") var hubSpotJsonString_cookie = { context: { hutk: hutk, pageUri: "https://ne-transportsolutions.com/", pageName: "Coach hire enquiry" } };// include this parameter and set it to the hubspotutk cookie value to enable cookie tracking on your submission if (optedOutOfEmail == false) { if (hutk == "") { hubSpotJsonString = { ...hubSpotJsonString_time, ...hubSpotJsonString_data }; } else { hubSpotJsonString = { ...hubSpotJsonString_time, ...hubSpotJsonString_data, ...hubSpotJsonString_cookie }; } } else { var hubSpotJsonString_gdpr = { legalConsentOptions: { consent: { consentToProcess: optedOutOfEmail, text: "I agree to allow Example Company to store and process my personal data.", communications: [ { value: optedOutOfEmail, subscriptionTypeId: 999, text: "I agree to receive marketing communications from Example Company." }] } } };// Include this object when GDPR options are enabled if (hutk == "") { hubSpotJsonString = { ...hubSpotJsonString_time, ...hubSpotJsonString_data, ...hubSpotJsonString_gdpr }; } else { hubSpotJsonString = { ...hubSpotJsonString_time, ...hubSpotJsonString_data, ...hubSpotJsonString_cookie, ...hubSpotJsonString_gdpr }; } } var portalId = "8157425"; var formId = "3d42f5ed-9608-4960-bf44-155a73947a46"; jQuery.ajax({ url: "https://webto.salesforce.com/servlet/servlet.WebToLead?encoding=UTF-8", method: "POST", dataType: "txt", data: { 'first_name': fname, 'last_name': lname, 'phone': phone, 'email': email, '00N3W000000Zp36': live, '00N3W000000Zp3B': work, '00N2400000IVlkm': channel,//Channel '00N2400000IX8gR': 'WEB',//Enquiry Type '00N3W000000Zp31': how, 'oid': "00D24000000d9JE", 'recordType': "01224000000kOD4",// "0121o000000sgap", //commuter record '00N1o00000JY8Uj': "KingsFerry", //Company code '00N2400000Gm3df': brand,//brand code '00N2400000IlOZ2': "COMM",//Customer Type '00N2400000HsGTs': submissionUrl//Submission URL }, beforeSend: function () { }, complete: function () { }, }).done(function (response) { submitHubSpot(hubSpotJsonString, portalId, formId, "com"); }).fail(function (jqXHR, response) { submitHubSpot(hubSpotJsonString, portalId, formId, "com"); }); }//submit_com_enquiry function submit_corp_enquiry() { is_submiting_corp_enquiry = true; var fname = jQuery("#corp_hire_fname").val(); var lname = jQuery('#corp_hire_lname').val(); var phone = jQuery('#corp_hire_phone').val(); var email = jQuery('#corp_hire_email').val(); var company = jQuery('#corp_hire_company').val(); var job = jQuery('#corp_hire_job').val(); var desc = jQuery('#corp_step2_desc').val(); var channel = getChannel();//jQuery("#channel").val(); var optedOutOfEmail = true; if (jQuery("#corp_checkbox_subscribe").prop("checked") == true) { optedOutOfEmail = true; } else { optedOutOfEmail = false; } var referUrl = document.referrer; var submissionUrl = window.location.href; var brand = getBrand(); enableLoadingOverlay(); var hubSpotJsonString; var time_date = new Date(); var time_millisec = time_date.getTime(); var hubSpotJsonString_time = { submittedAt: time_millisec }; // This millisecond timestamp is optional. Update the value from "1517927174000" to avoid an INVALID_TIMESTAMP error. var hubSpotJsonString_data = { fields: [ { name: "enquiry_type__c", value: "Web" }, { name: "firstname", value: fname }, { name: "lastname", value: lname }, { name: "phone", value: phone }, { name: "jobtitle", value: job }, { name: "message", value: desc }, { name: "email", value: email }, { name: "company", value: company }, { name: "channel__c", value: channel }, { name: "kf_source__c", value: referUrl }, { name: "source__c", value: submissionUrl }, { name: "code_1__c", value: "" } ], }; var hutk = document.cookie.replace(/(?:(?:^|.*;\s*)hubspotutk\s*\=\s*([^;]*).*$)|^.*$/, "$1") var hubSpotJsonString_cookie = { context: { hutk: hutk, pageUri: "https://ne-transportsolutions.com/", pageName: "Coach hire enquiry" } };// include this parameter and set it to the hubspotutk cookie value to enable cookie tracking on your submission if (optedOutOfEmail == false) { if (hutk == "") { hubSpotJsonString = { ...hubSpotJsonString_time, ...hubSpotJsonString_data }; } else { hubSpotJsonString = { ...hubSpotJsonString_time, ...hubSpotJsonString_data, ...hubSpotJsonString_cookie }; } } else { var hubSpotJsonString_gdpr = { legalConsentOptions: { consent: { consentToProcess: optedOutOfEmail, text: "I agree to allow Example Company to store and process my personal data.", communications: [ { value: optedOutOfEmail, subscriptionTypeId: 999, text: "I agree to receive marketing communications from Example Company." }] } } };// Include this object when GDPR options are enabled if (hutk == "") { hubSpotJsonString = { ...hubSpotJsonString_time, ...hubSpotJsonString_data, ...hubSpotJsonString_gdpr }; } else { optedOutOfEmail hubSpotJsonString = { ...hubSpotJsonString_time, ...hubSpotJsonString_data, ...hubSpotJsonString_cookie, ...hubSpotJsonString_gdpr }; } } var portalId = "8157425"; var formId = "e3af1d57-fcb5-4c2e-8516-6f142435910a"; jQuery.ajax({ //url: "./php/booking.php?c=getmovementbymid", url: "https://webto.salesforce.com/servlet/servlet.WebToLead?encoding=UTF-8", method: "POST", dataType: "txt", data: { 'first_name': fname, 'last_name': lname, 'phone': phone, 'email': email, 'company': company, 'title': job, 'description': desc, 'oid': "00D24000000d9JE", 'recordType': "0121o000000sgap",//corp record '00N2400000IVlkm': channel, //Channel '00N2400000IX8gR': "Webform", //Enquiry Type '00N1o00000JY8Uj': "KingsFerry", //Company code '00N2400000Gm3df': brand,//brand code '00N2400000IlOZ2': "CORP",//Customer Type '00N2400000HsGTs': window.location.href//Submission URL }, beforeSend: function () { }, complete: function () { }, }).done(function (response) { submitHubSpot(hubSpotJsonString, portalId, formId, "corp"); }).fail(function (jqXHR, response) { submitHubSpot(hubSpotJsonString, portalId, formId, "corp"); }); }//submit_corp_enquiry function submitHubSpot(jsonString, portalId, formId, afterAction) { var submitUrl = "https://api.hsforms.com/submissions/v3/integration/submit/" + portalId + "/" + formId; var str_jsonString = JSON.stringify(jsonString); jQuery.ajax({ type: "POST", crossDomain: true, headers: { 'Accept': 'application/json', 'Content-Type': 'application/json' }, dataType: "json", async: true, data: str_jsonString, url: submitUrl, beforeSend: function () { }, complete: function (jqXHR) { if (afterAction == "ph") { window.location.replace("/coach-hire/thank-you?refid=" + afterAction); } else if (afterAction == "com") { window.location.replace("/commuter-services/thank-you"); } else if (afterAction == "corp") { window.location.replace("/business-solutions/thank-you/"); } else { window.location.replace("/coach-hire/thank-you?refid=" + afterAction); } }, }).done(function (done_response) { console.log(JSON.stringify(done_response)); }).fail(function (jqXHR, error_response) { console.log(JSON.stringify(error_response)); }); } function initMap() { //console.log('Got to initMap'); var Inputs_source_location = document.getElementById("form_hire_from"); var Inputs_destination_location = document.getElementById("form_hire_to"); const options = { componentRestrictions: { country: 'uk' }, fields: ['address_components', 'formatted_address', 'geometry', 'name'], //types: ['address'] types: ['geocode'] //types: ['establishment'] }; var source_autocomplete = new google.maps.places.Autocomplete(Inputs_source_location, options); source_autocomplete.addListener('place_changed', fillInSourceAddress); var destination_autocomplete = new google.maps.places.Autocomplete(Inputs_destination_location, options); destination_autocomplete.addListener('place_changed', fillInDestinationAddress); function fillInSourceAddress() { var place = source_autocomplete.getPlace(); var address = place.address_components; var pickupStreetNumber, pickupStreet, pickupLocality, pickupCity, pickupCounty, pickupCountry, pickupPostcode; for (var i = 0; i < address.length; i++) { var types = address[i].types; if (types.includes('street_number')) { pickupStreetNumber = address[i].long_name; } if (types.includes('route')) { pickupStreet = address[i].long_name; } if (types.includes('locality')) { pickupLocality = address[i].long_name; } if (types.includes('postal_town')) { pickupCity = address[i].long_name; } if (types.includes('administrative_area_level_1')) { pickupCounty = address[i].long_name; } if (types.includes('country')) { pickupCountry = address[i].long_name; } if (types.includes('postal_code')) { pickupPostcode = address[i].long_name; } } if (pickupStreetNumber == null) { pickupStreetNumber = ''; } if (pickupStreet == null) { pickupStreet = Inputs_source_location.value; } var pickupCity2 = ''; if (pickupCity == null) { if (pickupLocality == null) { pickupCity2 = ''; } else { pickupCity2 = pickupLocality; } } else { pickupCity2 = pickupCity; } if (pickupCounty == null) { pickupCounty = ''; } if (pickupCountry == null) { pickupCountry = ''; } if (pickupPostcode == null) { pickupPostcode = ''; } document.getElementById("pickupStreet").value = pickupStreetNumber + " " + pickupStreet; document.getElementById("pickupCity").value = pickupCity2; document.getElementById("pickupCounty").value = pickupCounty; document.getElementById("pickupCountry").value = pickupCountry; document.getElementById("pickupPostcode").value = pickupPostcode; } function fillInDestinationAddress() { var place = destination_autocomplete.getPlace(); var address = place.address_components; var destinationStreetNumber, destinationStreet, destinationCityLocality, destinationCity, destinationCounty, destinationCountry, destinationPostcode; for (var i = 0; i < address.length; i++) { var types = address[i].types; if (types.includes('street_number')) { destinationStreetNumber = address[i].long_name; } if (types.includes('route')) { destinationStreet = address[i].long_name; } if (types.includes('locality')) { destinationCityLocality = address[i].long_name; } if (types.includes('postal_town')) { destinationCity = address[i].long_name; } if (types.includes('administrative_area_level_1')) { destinationCounty = address[i].long_name; } if (types.includes('country')) { destinationCountry = address[i].long_name; } if (types.includes('postal_code')) { destinationPostcode = address[i].long_name; } } if (destinationStreetNumber == null) { destinationStreetNumber = ''; } if (destinationStreet == null) { destinationStreet = Inputs_destination_location.value; } var destinationCity2 = ''; if (destinationCity == null) { if (destinationCityLocality == null) { destinationCity2 = ''; } else { destinationCity2 = destinationCityLocality; } } else { destinationCity2 = destinationCity; } if (destinationCounty == null) { destinationCounty = ''; } if (destinationCountry == null) { destinationCountry = ''; } if (destinationPostcode == null) { destinationPostcode = ''; } document.getElementById("destinationStreet").value = destinationStreetNumber + " " + destinationStreet; document.getElementById("destinationCity").value = destinationCity2; document.getElementById("destinationCounty").value = destinationCounty; document.getElementById("destinationCountry").value = destinationCountry; document.getElementById("destinationPostcode").value = destinationPostcode; } } function getChannel() { var pathName = window.location.pathname; var channel = "NETS"; /* if (pathName.includes('get-a-quote')) { channel = "NETS"; }else if (pathName.includes("world")){ channel = "NETS"; }else if( pathName.includes('business-travel')){ channel = "NETS"; }else if( pathName.includes('staff-shuttles')){ channel = "NETS"; }else if( pathName.includes('home-to-school-shuttle')){ channel = "NETS"; }else if( pathName.includes('disaster-recovery')){ channel = "NETS"; }else if( pathName.includes('contingency-planning')){ channel = "NETS"; }else if( pathName.includes('aviation')){ channel = "NETS"; }else if( pathName.includes('local-authority')){ channel = "NETS"; }else if( pathName.includes('rail')){ channel = "NETS"; }else if( pathName.includes('recruitment')){ channel = "NETS"; }else if( pathName.includes('corporate-transport')){ //corp channel = "NETS"; }else if (pathName.includes('why-switch')) { //comm channel = "NETS"; }else if( pathName.includes('berkshire')){ channel = "STEW"; }else if( pathName.includes('bournemouth')){ channel = "SOL"; }else if( pathName.includes('fareham')){ channel = "LUCK"; }else if( pathName.includes('hampshire')){ channel = "CLSM"; }else if( pathName.includes('kent')){ channel = "KF"; }else if( pathName.includes('leicester')){ channel = "WOO"; }else if( pathName.includes('london')){ channel = "COL"; }else if( pathName.includes('reading')){ channel = "STEW"; }else if( pathName.includes('surrey')){ channel = "KF"; }else if( pathName.includes('sussex')){ channel = "WOR"; }else if( pathName.includes('worthing')){ channel = "WOR"; }else if( pathName.includes('european')){ channel = "NETS"; }else if( pathName.includes('european-coach-hire')){ channel = "NETS"; }else if( pathName.includes('uk-coach-hire')){ channel = "NETS"; }else if( pathName.includes('school-coach-hire')){ channel = "NETS"; }else if( pathName.includes('luxury-coach-hire')){ channel = "NETS"; }else if( pathName.includes('events-and-occasions')){ channel = "NETS"; }else if( pathName.includes('sports-coach-hire')){ channel = "NETS"; }else if( pathName.includes('airport-transfers')){ channel = "NETS"; }else if( pathName.includes('family-fun')){ channel = "NETS"; }else if( pathName.includes('culture-and-heritage')){ channel = "NETS"; }else if( pathName.includes('adventure')){ channel = "NETS"; }else if( pathName.includes('city-breaks')){ channel = "NETS"; }else if( pathName.includes('beach-escapes')){ channel = "NETS"; }else if( pathName.includes('wellness-and-relaxation')){ channel = "NETS"; }else if( pathName.includes('weddings-and-occasions')){ channel = "NETS"; }else if( pathName.includes('sports-coach-hire')){ channel = "NETS"; }else if( pathName.includes('parties')){ channel = "NETS"; }else if( pathName.includes('festivals')){ channel = "NETS"; } else if (pathName.includes('stewarts-coaches')){ channel = "STEW"; } else if (pathName.includes('woods-coaches')) { channel = "WOO"; } else if (pathName.includes('clarkes-of-london')) { channel = "COL"; } else if (pathName.includes('the-kings-ferry')) { channel = "KF"; } else if (pathName.includes("private-coach-hire")) { channel = "NETS"; } */ return channel; } function getBrand() { var pathName = window.location.pathname; var brand = "Nets National"; if (pathName.includes('get-a-quote')) { brand = "Nets National"; } else if (pathName.includes("world")) { brand = "Nets National"; } else if (pathName.includes('business-travel')) { brand = "Nets National"; } else if (pathName.includes('staff-shuttles')) { brand = "Nets National"; } else if (pathName.includes('home-to-school-shuttle')) { brand = "Nets National"; } else if (pathName.includes('disaster-recovery')) { brand = "Nets National"; } else if (pathName.includes('contingency-planning')) { brand = "Nets National"; } else if (pathName.includes('aviation')) { brand = "Nets National"; } else if (pathName.includes('local-authority')) { brand = "Nets National"; } else if (pathName.includes('rail')) { brand = "Nets National"; } else if (pathName.includes('recruitment')) { brand = "Nets National"; } else if (pathName.includes('corporate-transport')) { //corp brand = "Nets National"; } else if (pathName.includes('why-switch')) { //comm brand = "Nets National"; } else if (pathName.includes('berkshire')) { brand = "Stewarts"; } else if (pathName.includes('bournemouth')) { brand = "Solent"; } else if (pathName.includes('fareham')) { brand = "Lucketts"; } else if (pathName.includes('hampshire')) { brand = "Coliseum"; } else if (pathName.includes('kent')) { brand = "Kings Ferry"; } else if (pathName.includes('leicester')) { brand = "Woods"; } else if (pathName.includes('london')) { brand = "Clarkes"; } else if (pathName.includes('reading')) { brand = "Stewarts"; } else if (pathName.includes('surrey')) { brand = "Kings Ferry"; } else if (pathName.includes('sussex')) { brand = "Worthing"; } else if (pathName.includes('worthing')) { brand = "Worthing"; } else if (pathName.includes('european')) { brand = "Nets National"; } else if (pathName.includes('european-coach-hire')) { brand = "Nets National"; } else if (pathName.includes('uk-coach-hire')) { brand = "Nets National"; } else if (pathName.includes('school-coach-hire')) { brand = "Nets National"; } else if (pathName.includes('luxury-coach-hire')) { brand = "Nets National"; } else if (pathName.includes('events-and-occasions')) { brand = "Nets National"; } else if (pathName.includes('sports-coach-hire')) { brand = "Nets National"; } else if (pathName.includes('airport-transfers')) { brand = "Nets National"; } else if (pathName.includes('family-fun')) { brand = "Nets National"; } else if (pathName.includes('culture-and-heritage')) { brand = "Nets National"; } else if (pathName.includes('adventure')) { brand = "Nets National"; } else if (pathName.includes('city-breaks')) { brand = "Nets National"; } else if (pathName.includes('beach-escapes')) { brand = "Nets National"; } else if (pathName.includes('wellness-and-relaxation')) { brand = "Nets National"; } else if (pathName.includes('weddings-and-occasions')) { brand = "Nets National"; } else if (pathName.includes('sports-coach-hire')) { brand = "Nets National"; } else if (pathName.includes('parties')) { brand = "Nets National"; } else if (pathName.includes('festivals')) { brand = "Nets National"; } else if (pathName.includes('stewarts-coaches')) { brand = "Stewarts"; } else if (pathName.includes('woods-coaches')) { brand = "Woods"; } else if (pathName.includes('clarkes-of-london')) { brand = "Clarkes"; } else if (pathName.includes('the-kings-ferry')) { brand = "Kings Ferry"; } else if (pathName.includes('lucketts-travel')) { brand = "Lucketts"; } else if (pathName.includes('worthing-coaches')) { brand = "Worthing"; } else if (pathName.includes('coliseum-coaches')) { brand = "Coliseum"; } else if (pathName.includes('solent-coaches')) { brand = "Solent"; } else if (pathName.includes('mortons-travel')) { brand = "Mortons"; } else if (pathName.includes('the-kings-ferry')) { brand = "Kings Ferry"; } else if (pathName.includes('clarkes-of-london')) { brand = "Clarkes"; } else if (pathName.includes("private-coach-hire")) { brand = "Nets National"; } return brand; } function getDistance(source_location, destination_location) { var distance = 0; jQuery.ajax({ type: "POST", crossDomain: true, headers: { 'Access-Control-Allow-Origin': '*' }, dataType: "json", data: { from: source_location, to: destination_location }, url: baseHref + "/wp-content/plugins/1AG-Salesforce-Booking-Step-Form/assets/api/distance.php" }).done(function (response) { var status = response.rows[0].elements[0].status; if (status != "ZERO_RESULTS") { var distanceText = response.rows[0].elements[0].distance.text; //var duration = response.rows[0].elements[0].duration.text; var dis_arr = distanceText.split(" "); distance = dis_arr[0]; } }).fail(function (jqXHR, response) { //alert(response); }); return distance; }//getDistance function recommend_select() { jQuery("#loading span").html("We are just preparing your booking."); jQuery("#loading").show(); var rec_veh_id = jQuery("#recm_vehicle_id").val(); var lead_id = jQuery("#lead_id").val(); window.location.href = baseHref + "/wp-content/plugins/AG-Salesforce-Booking-Form/assets/api/convertLead.php?lead_id=" + lead_id + "&&veh_id=" + rec_veh_id; } function vip_select() { jQuery("#loading span").html("We are just preparing your booking."); jQuery("#loading").show(); var vip_vehicle_id = jQuery("#vip_vehicle_id").val(); var lead_id = jQuery("#lead_id").val(); window.location.href = baseHref + "/wp-content/plugins/AG-Salesforce-Booking-Form/assets/api/convertLead.php?lead_id=" + lead_id + "&&veh_id=" + vip_vehicle_id; } function cheaper_select() { jQuery("#loading span").html("We are just preparing your booking."); jQuery("#loading").show(); var smaller_vehicle_id = jQuery("#cheaper_vehicle_id").val(); var lead_id = jQuery("#lead_id").val(); window.location.href = baseHref + "/wp-content/plugins/AG-Salesforce-Booking-Form/assets/api/convertLead.php?lead_id=" + lead_id + "&&veh_id=" + smaller_vehicle_id; } function smaller_select() { jQuery("#loading span").html("We are just preparing your booking."); jQuery("#loading").show(); var smaller_vehicle_id = jQuery("#smaller_vehicle_id").val(); var lead_id = jQuery("#lead_id").val(); window.location.href = baseHref + "/wp-content/plugins/AG-Salesforce-Booking-Form/assets/api/convertLead.php?lead_id=" + lead_id + "&&veh_id=" + smaller_vehicle_id; } function upsize_select() { jQuery("#loading span").html("We are just preparing your booking."); jQuery("#loading").show(); var smaller_vehicle_id = jQuery("#upsize_vehicle_id").val(); var lead_id = jQuery("#lead_id").val(); window.location.href = baseHref + "/wp-content/plugins/AG-Salesforce-Booking-Form/assets/api/convertLead.php?lead_id=" + lead_id + "&&veh_id=" + smaller_vehicle_id; } function dateConvert(cdate) { var [dd, mm, yyyy] = cdate.split("/"); var revdate = `${mm}/${dd}/${yyyy}`; return revdate; } function days() { var a = new Date(dateConvert(jQuery("#departure_date").val())); b = new Date(dateConvert(jQuery("#return_date").val())); c = 24 * 60 * 60 * 1000, diffDays = Math.round(Math.abs((a - b) / (c))); //jQuery("#totaldays").val(diffDays); //alert(diffDays); return diffDays; } function toSFDate(dateString) { //10/11/2020 var std = null; if (dateString) { var dateArray = dateString.split("/"); var day = dateArray[0]; var month = dateArray[1]; var year = dateArray[2]; var dstring = year + '-' + month + '-' + day; var datum = new Date(dstring); std = datum; //.toLocaleString(); } return std; } function toSFDateQ(dateString) { //10/11/2020 var std = null; if (dateString) { var dateArray = dateString.split("/"); var day = dateArray[0]; var month = dateArray[1]; var year = dateArray[2]; var dstring = year + '-' + month + '-' + day; //var datum = new Date(dstring); std = dstring; //.toLocaleString(); } return std; } if (jQuery(".steps_sec").length) { d = days(); if (jQuery(".nav-return").hasClass("active") && jQuery(".stay_return").hasClass("active") && !jQuery(".nav-oneway").hasClass("active")) { if (d > 1) { jQuery("#voucher_msg_notice").show(); jQuery("#voucher_msg_notice").html("You have requested that your vehicle stays with you for your trip, which may affect the price. Please note that the price does not include Driver Accomodation and Meals."); } } if (jQuery(".nav-return").hasClass("active") && !jQuery(".stay_return").hasClass("active") && !jQuery(".nav-oneway").hasClass("active")) { if (d > 1) { jQuery("#voucher_msg_notice").show(); jQuery("#voucher_msg_notice").html("Please note that your vehicle is not set to stay with you for your trip. If you require this Please change this on your quotation."); } } } jQuery(".modal_open, #hov8").click(function () { jQuery('#specModal').addClass('show');; }); jQuery(".modal.fade .close").click(function () { jQuery('#specModal').removeClass('show');; }); /* jQuery('.danger7').popover({ html: true, content: function () { return jQuery('#popover_content_wrapper7').html(); } }); */ jQuery("#your_details").click(function (event) { event.preventDefault(); jQuery('.your_data_sec').toggle(); }); function assistance(checked) { if (checked == "yes") { jQuery("#ferry_crossing_info").val("true"); console.log("assist checked"); } else { jQuery("#ferry_crossing_info").val("false"); console.log("assist Unchecked"); } } function event_book(checked) { if (checked == "yes") { jQuery("#event_booking").val("true"); console.log("event checked"); } else { jQuery("#event_booking").val("false"); console.log("event Unchecked"); } } function completeBooking() { var hotel_room_info = jQuery("#hotel_room_info").val(); var ferry_crossing_info = jQuery("#ferry_crossing_info").val(); var event_booking = jQuery("#event_booking").val(); //jQuery('.r-more').attr('disabled', 'disabled'); window.location.href = baseHref + "/wp-content/plugins/AG-Salesforce-Booking-Form/assets/api/forward/addExtras?hotel_room_info=" + hotel_room_info + "&&ferry_crossing_info=" + ferry_crossing_info; //var myKeyVals = {hotel_room_info: hotel_room_info, ferry_crossing_info: ferry_crossing_info, event_booking: event_booking}; } function getUrlParameter(sParam) { var sPageURL = window.location.search.substring(1), sURLVariables = sPageURL.split('&'), sParameterName, i; for (i = 0; i < sURLVariables.length; i++) { sParameterName = sURLVariables[i].split('='); if (sParameterName[0] === sParam) { return sParameterName[1] === undefined ? true : decodeURIComponent(sParameterName[1]); } } }; var leadid = getUrlParameter('refid'); jQuery('#refid').html("Your unique reference number: " + leadid); function enableLoadingOverlay() { $("delay_overlay").show(); } function datetimeToTimestamp(year, month, day, hour, minute, second) { var datum = new Date(Date.UTC(year, month - 1, day, hour, minute, second)); return datum.getTime() / 1000; } function getUrlParameter(sParam) { var sPageURL = window.location.search.substring(1), sURLVariables = sPageURL.split('&'), sParameterName, i; for (i = 0; i < sURLVariables.length; i++) { sParameterName = sURLVariables[i].split('='); if (sParameterName[0] === sParam) { return sParameterName[1] === undefined ? true : decodeURIComponent(sParameterName[1]); } } }; function getBrowser() { var nVer = navigator.appVersion; var nAgt = navigator.userAgent; var browserName = navigator.appName; var fullVersion = '' + parseFloat(navigator.appVersion); var majorVersion = parseInt(navigator.appVersion, 10); var nameOffset, verOffset, ix; // In Opera, the true version is after "Opera" or after "Version" if ((verOffset = nAgt.indexOf("Opera")) != -1) { browserName = "Opera"; fullVersion = nAgt.substring(verOffset + 6); if ((verOffset = nAgt.indexOf("Version")) != -1) fullVersion = nAgt.substring(verOffset + 8); } // In MSIE, the true version is after "MSIE" in userAgent else if ((verOffset = nAgt.indexOf("MSIE")) != -1) { browserName = "Microsoft Internet Explorer"; fullVersion = nAgt.substring(verOffset + 5); } // In Chrome, the true version is after "Chrome" else if ((verOffset = nAgt.indexOf("Chrome")) != -1) { browserName = "Chrome"; fullVersion = nAgt.substring(verOffset + 7); } // In Safari, the true version is after "Safari" or after "Version" else if ((verOffset = nAgt.indexOf("Safari")) != -1) { browserName = "Safari"; fullVersion = nAgt.substring(verOffset + 7); if ((verOffset = nAgt.indexOf("Version")) != -1) fullVersion = nAgt.substring(verOffset + 8); } // In Firefox, the true version is after "Firefox" else if ((verOffset = nAgt.indexOf("Firefox")) != -1) { browserName = "Firefox"; fullVersion = nAgt.substring(verOffset + 8); } // In most other browsers, "name/version" is at the end of userAgent else if ((nameOffset = nAgt.lastIndexOf(' ') + 1) < (verOffset = nAgt.lastIndexOf('/'))) { browserName = nAgt.substring(nameOffset, verOffset); fullVersion = nAgt.substring(verOffset + 1); if (browserName.toLowerCase() == browserName.toUpperCase()) { browserName = navigator.appName; } } // trim the fullVersion string at semicolon/space if present if ((ix = fullVersion.indexOf(";")) != -1) fullVersion = fullVersion.substring(0, ix); if ((ix = fullVersion.indexOf(" ")) != -1) fullVersion = fullVersion.substring(0, ix); majorVersion = parseInt('' + fullVersion, 10); if (isNaN(majorVersion)) { fullVersion = '' + parseFloat(navigator.appVersion); majorVersion = parseInt(navigator.appVersion, 10); } /* document.write('' + 'Browser name = ' + browserName + '
' + 'Full version = ' + fullVersion + '
' + 'Major version = ' + majorVersion + '
' + 'navigator.appName = ' + navigator.appName + '
' + 'navigator.userAgent = ' + navigator.userAgent + '
' ) */ return browserName + ' ' + fullVersion; } function getOS() { var OSName = "Unknown OS"; if (navigator.appVersion.indexOf("Win") != -1) OSName = "Windows"; if (navigator.appVersion.indexOf("Mac") != -1) OSName = "MacOS"; if (navigator.appVersion.indexOf("X11") != -1) OSName = "UNIX"; if (navigator.appVersion.indexOf("Linux") != -1) OSName = "Linux"; return OSName; } function getMOS() { var userAgent = navigator.userAgent || navigator.vendor || window.opera; // Windows Phone must come first because its UA also contains "Android" if (/windows phone/i.test(userAgent)) { return "Windows Phone"; } if (/android/i.test(userAgent)) { return "Android"; } if (/iPad|iPhone|iPod/.test(userAgent) && !window.MSStream) { return "iOS"; } return "unknown"; } /*** END ****************************************************************************/ })(jQuery); });