function setBundle(bundle) { document.getElementById("sales_aid_data_pack").textContent = bundle + "GB Selected"; document.getElementById("selected_bundle").value = bundle; } function getTotalSaving() { var vodaRoaming = new Map(); vodaRoaming.set("1", "512"); vodaRoaming.set("2", "1024"); vodaRoaming.set("4", "2048"); vodaRoaming.set("6", "3072"); vodaRoaming.set("10", "5120"); var bundleCost = new Map(); bundleCost.set("1", "40"); bundleCost.set("2", "70"); bundleCost.set("4", "120"); bundleCost.set("6", "170"); bundleCost.set("10", "200"); var employeeNumber = document.getElementById("employee_input").value; if (employeeNumber == null) { alert("Please Enter Number of Employees"); return; } var selectedBundle = document.getElementById("selected_bundle").value; if (selectedBundle == null) { alert("Please select a Bundle"); return; } var selectedCountry = document.getElementById("selected_country").value; if (selectedCountry == null) { alert("Please select a Country"); return; } var vodaCost = parseInt(vodaRoaming.get(selectedBundle)) * parseInt(employeeNumber); var ourBundleCost = parseInt(bundleCost.get(selectedBundle)) * parseInt(employeeNumber); document.getElementById("sales_aid_package_details_var").textContent = selectedBundle + "GB"; document.getElementById("sales_aid_uk_price_var").textContent = isNaN(vodaCost)? "": "£" + vodaCost + ".00"; document.getElementById("sales_aid_unifi_price_var").textContent = isNaN(ourBundleCost)? "": "£" + ourBundleCost + ".00"; var saving = parseInt(vodaCost) - parseInt(ourBundleCost); document.getElementById("sales_aid_total_saved_var").textContent = isNaN(saving)? "": "£" + saving + ".00"; } function reset() { document.getElementById("sales_aid_total_saved_var").textContent = ""; document.getElementById("sales_aid_data_pack").textContent = " "; document.getElementById("selected_bundle").value = ""; document.getElementById("sales_aid_uk_price_var").textContent = ""; document.getElementById("sales_aid_unifi_price_var").textContent = ""; document.getElementById("employee_input").value = ""; normalImg(); } jQuery(function($) { $("#sales_aid_started_btn").click(function() { $("#sales_aid_home").hide(); $("#sales_aid_intro").animate({direction: "left", width:'toggle'},350); }); $("#sales_aid_go_btn").click(function() { $("#sales_aid_intro").hide(); $("#sales_aid_employees_page").animate({direction: "left", width:'toggle'},350); }); $("#employees_page_n_btn").click(function() { $("#sales_aid_employees_page").hide(); $("#sales_aid_travel_page").animate({direction: "left", width:'toggle'},350); }); $("#travel_page_n_btn").click(function() { $("#sales_aid_travel_page").hide(); $("#sales_aid_package_page").animate({direction: "left", width:'toggle'},350); }); $("#package_page_n_btn").click(function() { $("#sales_aid_package_page").hide(); $("#sales_aid_package_details").animate({direction: "left", width:'toggle'},350); }); $("#package_details_n_btn").click(function() { $("#sales_aid_package_details").hide(); $("#sales_aid_total_save_page").animate({direction: "left", width:'toggle'},350); }); $("#total_save_page_reset_btn").click(function() { $("#sales_aid_total_save_page").hide(); $("#sales_aid_home").animate({direction: "left", width:'toggle'},350); }); $("#employees_page_p_btn").click(function() { $("#sales_aid_employees_page").hide(); $("#sales_aid_intro").animate({direction: "left", width:'toggle'},350); }); $("#travel_page_p_btn").click(function() { $("#sales_aid_travel_pages").hide(); $("#sales_aid_employees_page").animate({direction: "left", width:'toggle'},350); }); $("#package_page_p_btn").click(function() { $("#sales_aid_package_page").hide(); $("#sales_aid_travel_page").animate({direction: "left", width:'toggle'},350); }); $("#package_details_p_btn").click(function() { $("#sales_aid_package_details").hide(); $("#sales_aid_package_page").animate({direction: "left", width:'toggle'},350); }); $("#total_save_page_p_btn").click(function() { $("#sales_aid_total_save_page").hide(); $("#sales_aid_package_details").animate({direction: "left", width:'toggle'},350); }); }); function africaImg() { document.getElementById("travel_image").src = "http://travelwin.wpengine.com/wp-content/uploads/2017/05/africa.png"; } function northAmericaImg() { document.getElementById("travel_image").src = "http://travelwin.wpengine.com/wp-content/uploads/2017/05/north-america.png"; } function southAmericaImg() { document.getElementById("travel_image").src = "http://travelwin.wpengine.com/wp-content/uploads/2017/05/south-america.png"; } function oceaniaImg() { document.getElementById("travel_image").src = "http://travelwin.wpengine.com/wp-content/uploads/2017/05/oceania.png"; } function asiaImg() { document.getElementById("travel_image").src = "http://travelwin.wpengine.com/wp-content/uploads/2017/05/asia.png"; } function europeImg() { document.getElementById("travel_image").src = "http://travelwin.wpengine.com/wp-content/uploads/2017/05/europe.png"; } function normalImg() { if (document.getElementById("selected_country") == null) { document.getElementById("travel_image").src = "http://travelwin.wpengine.com/wp-content/uploads/2017/05/world.png"; } } function setCountry(country) { document.getElementById("selected_country").value = country; }