var oldUrl = window.location.href; var urlParam = window.location.search; var paramArray = urlParam.split('?'); var newUrl,tempUrl = ''; var segmentlcid =''; var grouplcid = ['AR','AR-SA','BH-BH','CE-BG','CS-CZ','DA','DA-DK','DE','DE-AT','DE-CH','DE-DE','EL-GR','EN','EN-DE','EN-IL','EN-AU','EN-CA','EN-GB','EN-CEE','EN-CE','EN-MEA','EN-ME','EN-APAC','EN-AP','EN-SG','EN-IE','EN-IN','EN-KO','EN-US','EN-ZA','ES','ES-CL','ES-CO','ES-ES','ES-MX','ES-XL','FI','FI-FI','FR-BE','FR-CA','FR-CH','FR','FR-FR','HE','HE-IL','HU-HU','ID','ID-ID','IT','IT-IT','JA','JA-JP','KO','KO-KR','NB-NO','NO','NL','NL-BE','NL-NL','PL','PL-PL','PT','PT-BR','PT-PT','RO-RO','RU','RU-RU','SK-SK','SV','SV-SE','TH-TH','TR','TR-TR','UK-UA','VI-NM','VI-VN','VN-NM','ZH-HK','ZH-TW','ZH','ZH-CN','ZH-SG']; if(paramArray.length > 2){ tempUrl = oldUrl; if(paramArray[1].toUpperCase() == paramArray[2].toUpperCase()){ newUrl = tempUrl.replace('?'+paramArray[2],''); paramArray = newUrl.split('?'); tempUrl = newUrl; } for(var i=2; i< paramArray.length; i++){ newUrl = tempUrl.replace('?'+paramArray[i],'&'+paramArray[i]); tempUrl = newUrl; } window.location.href = tempUrl; } /***** FOOTER PRIVACY START******/ //Detect GPC const globalPrivacyControlEnabled = navigator.globalPrivacyControl; // Set data sharing opt-in to false when GPC/AMC controls detected const GPC_DataSharingOptIn = (globalPrivacyControlEnabled) ? false : checkThirdPartyAdsOptOutCookie(); // Detect AMC opt out choice function checkThirdPartyAdsOptOutCookie() { try { const ThirdPartyAdsOptOutCookieName = '3PAdsOptOut'; var cookieValue = getCookie(ThirdPartyAdsOptOutCookieName); //for unauthenticated users return cookieValue != 1; } catch { return true; } } function getCookie(cookieName) { var cookieValue = document.cookie.match('(^|;)\\s*' + cookieName + '\\s*=\\s*([^;]+)'); return (cookieValue) ? cookieValue[2] : ''; } /***** FOOTER PRIVACY END******/ //Recaptcha Load var onloadCallback = function() { setTimeout(function(){ if(jQuery('#captcha_element').length>0){ jQuery('#captcha_element').html(''); grecaptcha.enterprise.render('captcha_element', { 'sitekey' : '6LcnoCoaAAAAAJ2dn4BW2JbImJqYj2MWAf8fl5tL' }); } }, 1000); }; /* -------------- Methods to be called only after DOM is ready ------------------------------- */ jQuery(document).ready(function() { // Fix Thank you page spacing issue & removed thankyou wrapper div from registration page if(jQuery('#formwrapper').length > 0){ if(!jQuery('#formwrapper').is(':visible')){ jQuery('article').removeClass('col-md-7'); } }else{ if(jQuery('.thankyouwrapper').length > 0 && jQuery('form').length > 0){ jQuery('.thankyouwrapper').remove(); } } // Header logo fix for open in new tab if(jQuery('.header-logo').length > 0){ jQuery('.header-logo').parent().attr('target','_blank'); } if (typeof MktoForms2 !== "undefined") { MktoForms2.whenReady(function(form) { jQuery('head').append('');/*For Adobe Analytics*/ if((jQuery('#emp_voucher').text().toUpperCase() == 'NO') || (jQuery('#emp_voucher').text()== '') || (jQuery('#emp_voucher').text().toUpperCase() !== 'YES')){ jQuery('#governmentEmployee').parents('.mktoFormRow').hide(); } /********LP - Banner image token start**********/ /********ALTER BG IMAGE URL BASED ON THE TOKEN FOR LCID**********/ var titleArea1 = jQuery(".title-area").css("background-image"); var titleArea2 = jQuery(".title-area-background").css("background-image"); var lcid = location.search.split('lcid=')[1]; if(lcid !== undefined){ if(grouplcid.indexOf(lcid.toUpperCase()) == -1){ lcid = 'EN'; } } if(titleArea1 && titleArea1.indexOf('clouddamcdn') != -1){ if(lcid == 'ar' || lcid == 'ar-sa'){ let arText = jQuery(".bannerimg-ar").text(); if(arText){ let url = "url('" + arText + "')"; jQuery(".title-area").css("background-image", url); } } if(lcid == 'he' || lcid == 'he-il'){ let heText = jQuery(".bannerimg-he").text(); if(heText){ let url = "url('" + heText + "')"; jQuery(".title-area").css("background-image", url); } } } if(titleArea2 && titleArea2.indexOf('clouddamcdn') != -1){ if(lcid == 'ar' || lcid == 'ar-sa'){ let arText = jQuery(".bannerimg-ar").text(); if(arText){ let url = "url('" + arText + "')"; jQuery(".title-area-background").css("background-image", url); } } if(lcid == 'he' || lcid == 'he-il'){ let heText = jQuery(".bannerimg-he").text(); if(heText){ let url = "url('" + heText + "')"; jQuery(".title-area-background").css("background-image", url); } } } //for body direction rtl replace CSS if((jQuery('body').attr('dir') == 'rtl' || jQuery('body').attr('dir') == 'RTL') && (jQuery('.dateTime').length > 0)){ let getcolor = jQuery('.dateTime').css('border-color'); let bordercolor = getcolor.split(' r'); if(bordercolor.length > 1){ jQuery('body[dir=rtl] .dateTime').css('border-color',bordercolor[0]); }else{ jQuery('body[dir=rtl] .dateTime').css('border-color','#dd3d01'); } } /********LP - Banner image token end**********/ // var contactmeForm = "#mktoForm_17147,#mktoForm_17119, #mktoForm_15316, #mktoForm_14284, #mktoForm_14288, #mktoForm_15216, #mktoForm_16408, #mktoForm_16911, #mktoForm_17049, #mktoForm_14970,#mktoForm_17132, #mktoForm_11544, #mktoForm_17133"; var buttontxt = jQuery('button[type="submit"]').text(); function getURLLCID() { var lcid; if ( window.location.href.match(/LCID=(\w{2}(?:-\w{2})?)/i) ) { lcid = window.location.href.match(/LCID=(\w{2}(?:-\w{2})?)/i); if(lcid === null){ lcid = null; }else{ lcid = lcid[1]; } if(grouplcid.indexOf(lcid.toUpperCase()) == -1){ lcid = 'EN'; } return lcid; } else if (window.location.href.match(/LCID-(\w{2}(?:-\w{2})?)/i) ) { lcid = window.location.href.match(/LCID-(\w{2}(?:-\w{2})?)/i); if(lcid === null){ lcid = null; }else{ lcid = lcid[1]; } if(grouplcid.indexOf(lcid.toUpperCase()) == -1){ lcid = "EN" } return lcid; } else if(jQuery("input[name='systemFormsLCID']").length > 0 && jQuery("input[name='systemFormsLCID']").val() != ''){ lcid = jQuery("input[name='systemFormsLCID']").val().trim(); return lcid; } else if(jQuery("input[name='systemFormsLanguageLocaleProduct']").val().indexOf("-") !== 1){ lcid = jQuery("input[name='systemFormsLanguageLocaleProduct']").val(); if(lcid.trim().substr(0,1) != '-'){ lcid = typeof lcid !== "undefined" ? lcid.trim().substr(0,5) : null; }else{ lcid = "EN-US"; } return lcid; }else{ lcid = "EN-US"; return lcid; } } // Categorization of Lcids based on Tiers var group1 = ['AR','AR-SA','BH-BH','CE-BG','CS-CZ','DA','DA-DK','DE','DE-AT','DE-CH','DE-DE','EL-GR','EN','EN-DE','EN-IL','EN-AU','EN-CA','EN-GB','EN-CEE','EN-CE','EN-MEA','EN-ME','EN-APAC','EN-AP','EN-SG','EN-IE','EN-IN','EN-KO','EN-US','EN-ZA']; var group2 = ['ES','ES-CL','ES-CO','ES-ES','ES-MX','ES-XL','FI','FI-FI','FR-BE','FR-CA','FR-CH','FR','FR-FR','HE','HE-IL','HU-HU','ID','ID-ID','IT','IT-IT','JA','JA-JP','KO','KO-KR','NB-NO','NO']; var group3 = ['NL','NL-BE','NL-NL','PL','PL-PL','PT','PT-BR','PT-PT','RO-RO','RU','RU-RU','SK-SK','SV','SV-SE','TH-TH','TR','TR-TR','UK-UA','VI-NM','VI-VN','VN-NM','ZH-HK','ZH-TW','ZH','ZH-CN','ZH-SG']; /* ----------------------------------- end ------------------------------------ */ // Get the lcid being used in the page and load the associated formStrings json file. var lcid = getURLLCID(); // account for improperly capitalized URL and input params if (lcid !== null) { lcid = lcid.toUpperCase(); } var language = getURLLCID().substring(0, 2).toUpperCase(); var fileName; if(jQuery('#mktoForm_17133').length > 0){ lcid = 'EN-US'; language = 'EN'; } if(group1.indexOf(lcid)!= -1){ fileName = 'formStrings1.js'; }else if(group2.indexOf(lcid)!= -1){ fileName = 'formStrings2.js'; }else if(group3.indexOf(lcid)!= -1){ fileName = 'formStrings3.js'; }else{ fileName = 'formStrings1.js'; } /* ----------------------- Load json file ---------------------------- */ jQuery.getScript("https://info.microsoft.com/rs/157-GQE-382/images/"+fileName, function() { var mktoForm = form; var russia = false; // for determining if labels are shown in form design var noLabels = false; var countrySelection; var key; var flightURL; var partnerPreferenceForm = false; var partnerCombinedStatement = false; var product_name = jQuery('#CountrySelector').text(); var partnerForms = '#mktoForm_17169, #mktoForm_16416, #mktoForm_13482, #mktoForm_15278, #mktoForm_15032, #mktoForm_15365, #mktoForm_15170, #mktoForm_15524, #mktoForm_15105, #mktoForm_14288, #mktoForm_14284, #mktoForm_10595, #mktoForm_18785, #mktoForm_14922, #mktoForm_15764, #mktoForm_14294, #mktoForm_15688, #mktoForm_14282, #mktoForm_13633, #mktoForm_16527, #mktoForm_15316, #mktoForm_16189, #mktoForm_15393, #mktoForm_15243, #mktoForm_15250, #mktoForm_15346, #mktoForm_15392, #mktoForm_16911, #mktoForm_15745, #mktoForm_17049, #mktoForm_17132, #mktoForm_17147, #mktoForm_18567, #mktoForm_18590, #mktoForm_18591, #mktoForm_18592, #mktoForm_18613, #mktoForm_18614, #mktoForm_18615, #mktoForm_18751, #mktoForm_18769'; var honeypotForms = '#mktoForm_4605, #mktoForm_10023, #mktoForm_12649, #mktoForm_4603, #mktoForm_12601, #mktoForm_9938, #mktoForm_10015, #mktoForm_16911, #mktoForm_13633, #mktoForm_2767, #mktoForm_15688, #mktoForm_14284, #mktoForm_2123, #mktoForm_3006, #mktoForm_10595, #mktoForm_18785'; var captchaCode = ''; sessionStorage.removeItem('recaptchaCode'); // //Header logo fix for iframe // if(jQuery('.header-logo').length > 0){ // jQuery('.header-logo').parent().attr('target','_top'); // } //Footer section if(jQuery('.footer-copyright').length > 0){ var systemDate = new Date(); var copyrightYear = systemDate.getFullYear(); jQuery('.footer-copyright').html('© Microsoft '+copyrightYear); } if(jQuery('#footerlinks a').length > 0){ var linkList = jQuery('#footerlinks a'); for(var i=0; i 0 || jQuery('#mktoForm_17132').length > 0){ if(jQuery('#countryContainer').length == 0){ jQuery('
').insertBefore('#Phone'); jQuery('#Phone').addClass('CC_Phone'); } //} //Privacy link update if(jQuery('#footerlinks').length > 0){ var links = jQuery('#footerlinks a'); if(links.length > 0){ let lcid = getURLLCID().toLowerCase(); for(var i=0; i < links.length; i++){ if(jQuery(links[i]).attr('href') == 'http://go.microsoft.com/fwlink/?LinkId=248681' || jQuery(links[i]).attr('href') == 'https://go.microsoft.com/fwlink/?LinkId=248681'){ jQuery(links[i]).attr('href', 'https://go.microsoft.com/fwlink/?LinkId=521839'); } if(lcid == 'ko-kr' && jQuery(links[i]).text() == 'Privacy & Cookies'){ jQuery(links[i]).text('개인정보처리방침 및 위치정보이용약관'); } } } } //Thank you page Width fix if(jQuery(".thankyouwrapper").length){ jQuery(".thankyouwrapper").parent().parent().removeClass('col-md-7').addClass('col-md-12'); } //RTL fix for webinar pages if ( lcid == "AR" || lcid == "HE" || lcid == "HE-IL" || lcid == "AR-SA" || lcid == "BH-BH") { if(jQuery('#progDateTime').length > 0 && jQuery('.date').length > 0 && jQuery('.time').length > 0 ){ var progDate = jQuery('.date').html(); var progTime = jQuery('.time').html(); if(jQuery.trim(progDate) != "" && jQuery.trim(progTime) != ""){ var tempDate, tempTime; var newDate = ''; var newTime = ''; tempDate = progDate.split(' '); tempTime = progTime.split(' '); if(tempDate.length > 0){ for(var i=0; i < tempDate.length; i++){ newDate += tempDate[i] + ' ‏'; } } if(tempTime.length > 0){ for(var j=0; j < tempTime.length; j++){ newTime += tempTime[j] + ' ‏'; } } jQuery('.date').html(newDate); jQuery('.time').html(newTime); } } } if(jQuery('#mktoForm_17133').length>0){ document.body.dir = "LTR"; jQuery('body').removeClass('rtl').addClass('ltr'); } //Teams Event if(jQuery('#mktoForm_16946').length > 0){ jQuery('#LblEmail').css({"font-family":"Segoe UI,Segoe UI Semilight,Segoe UI Light,Arial,Sans-Serif","margin-bottom":"5px"}); jQuery('#Email').css("padding","12px"); jQuery('#noHero-Button').hide(); jQuery('.webinarDetails').parents('.mktoFormRow').hide(); jQuery('.mktoOffset').css('width','0px'); jQuery('#ThankyouFormArea').hide(); jQuery('.waitText').show(); jQuery('.endText').hide(); teamsWebinar(); mktoForm.onSubmit(teamsRedirect); } // Webinar landing pages - Personalized Date time if(jQuery('#webinarDateReg').length > 0){ getWebinarTime(); } // New Captcha code if(jQuery('#captcha_element').length > 0 && (((jQuery('#captcha_enabled').val()).trim()).toUpperCase() == 'YES' || ((jQuery('#captcha_enabled').val()).trim()).toUpperCase() == 'Y')){ jQuery('#captcha_container').parents('.mktoFormRow').show(); setTimeout(function(){ if(jQuery('#captcha_element').find('iframe').length > 0){ setCaptchaLang(document.getElementById("captcha_element"), recaptchaLanguage[lcid]); } }, 1000); if(jQuery('#mktoForm_13633').length > 0){ var progProfElement = jQuery('#employeeRange').parents('.mktoFormRow'); var captcha_div = jQuery('#captcha_container').parents('.mktoFormRow'); captcha_div.insertAfter(progProfElement); } mktoForm.onValidate(function(valid){ if(valid){ var responseCode = jQuery('#g-recaptcha-response').val(); var reqErrorMsg = formLocalizationStrings[lcid].errorMessage['This field is required.']; var invalidErrorMsg = formLocalizationStrings[lcid].errorMessage['invalidCaptcha']; captchaCode = sessionStorage.getItem("recaptchaCode"); if(responseCode != ''){ if(responseCode != captchaCode){ var captchaValid = validateCaptcha(responseCode); if(captchaValid == 'Valid'){ captchaCode = sessionStorage.setItem("recaptchaCode", responseCode); mktoForm.submittable(true); }else{ mktoForm.showErrorMessage(invalidErrorMsg, jQuery('#g-recaptcha-response')); mktoForm.submittable(false); } } }else{ mktoForm.showErrorMessage(reqErrorMsg, jQuery('#g-recaptcha-response')); mktoForm.submittable(false); } }else{ return false; } }); }else{ jQuery('#captcha_container').parents('.mktoFormRow').hide(); } /** * Change dynamically the language of the ReCaptcha inside the selected container. * * @param recaptchaContainer * @param lang */ function setCaptchaLang(recaptchaContainer, lang) { lang = lang || "en"; // 1. Search for the ReCaptcha iframe const iframeGoogleCaptcha = recaptchaContainer.querySelector('iframe'); // 2. Retrieve the current language const currentLang = iframeGoogleCaptcha.getAttribute("src").match(/hl=(.*?)&/).pop(); // 3. Verify if the language that you want to set is different to the current one if (currentLang !== lang) { // 4. If it is, change it iframeGoogleCaptcha.setAttribute( "src", iframeGoogleCaptcha.getAttribute("src").replace( /hl=(.*?)&/, 'hl=' + lang + '&' ) ); } } function validateCaptcha(responseCode){ var flag = 0; var requestData = { "event": { "token": responseCode, "siteKey": "6LcnoCoaAAAAAJ2dn4BW2JbImJqYj2MWAf8fl5tL" } } $.ajax({ url: 'https://recaptchaenterprise.googleapis.com/v1beta1/projects/microsoft-gdc/assessments?key=AIzaSyDWC2oiaM5AzFFbgke76LEZoLY69jgB73o', type: 'POST', async: false, contentType: 'application/json', data: JSON.stringify(requestData), success: function(data, textStatus, xhr) { // console.log(data); if(data.tokenProperties.valid == true){ flag = 1; }else{ flag = 0; logCaptchaError(data.tokenProperties.invalidReason,xhr.status); } }, error: function(jqXHR, textStatus, errorThrown) { // console.log('Error: '+ jqXHR.responseJSON.error.message); flag = 0; logCaptchaError(jqXHR.responseJSON.error.message, jqXHR.responseJSON.error.code); } }); if(flag == 1){ return 'Valid'; }else{ return 'invalid'; } } function logCaptchaError(message,code){ var timeZone = Intl.DateTimeFormat().resolvedOptions().timeZone; if(timeZone == undefined || timeZone == 'undefined'){ timeZone = 'Unknown'; } var browserUsed = getBrowser(); var requestData = { "context": { "httpRequest": { "responseStatusCode": code, "method": "POST", "url": window.location.href }, "reportLocation": { "filePath": "Browser Used : " + browserUsed, "lineNumber": 0, "functionName": "Time zone : " + timeZone }, "user": "" }, "message": message, "serviceContext": { "service": window.location.href, "version": "" } } $.ajax({ url: 'https://clouderrorreporting.googleapis.com/v1beta1/projects/microsoft-gdc/events:report?key=AIzaSyCwlAz78EiiNJWPv7031jDm-yTU2laF4JQ', type: 'POST', contentType: 'application/json', data: JSON.stringify(requestData), success: function(data) { // console.log(data); }, error: function(jqXHR, textStatus, errorThrown) { // console.log(jqXHR); } }); } function getBrowser() { var browser; if((navigator.userAgent.indexOf("Opera") || navigator.userAgent.indexOf('OPR')) != -1 ){ browser = 'Opera'; }else if(navigator.userAgent.indexOf("Chrome") != -1 ){ browser = 'Chrome'; }else if(navigator.userAgent.indexOf("Safari") != -1){ browser = 'Safari'; }else if(navigator.userAgent.indexOf("Firefox") != -1 ) { browser = 'Firefox'; }else if(window.navigator.userAgent.indexOf("Edg") != -1){ browser = 'Edge'; }else if((navigator.userAgent.indexOf("MSIE") != -1 ) || (!!document.documentMode == true )){ browser = 'IE'; }else{ browser = 'unknown'; } return browser; } //PBI handraiser if(jQuery('#mktoForm_16911,#mktoForm_17132,#mktoForm_18601,#mktoForm_18609, #mktoForm_18751').length > 0){ jQuery('#ThankYouInsideSales').parents('.mktoFormRow').hide(); var fieldObjects = jQuery('#FirstName, #LastName, #Email, #Company, #Title, #Phone, #m365PurchasingPreference, #comments'); jQuery.each(fieldObjects, function( key, value ) { jQuery(value).parents('.mktoFormRow').hide(); }); jQuery('.channel_consent').parents('.mktoFormRow').hide(); jQuery(".mktoButton").attr("disabled", "disabled"); } if(jQuery('input[name=systemFormsTopicGUID]').length > 0 && jQuery('input[name=systemFormsTopicGUID]').val() != ''){ var topicId = jQuery('input[name=systemFormsTopicGUID]').val(); topicId = getTopicId(topicId); brand = brandingText.default['singleComTopic'][topicId]; }else{ if(jQuery("input[name='systemFormsLanguageLocaleProduct']").val().indexOf("-") !== 1){ var brand = jQuery("input[name='systemFormsLanguageLocaleProduct']").val(); var systemFormsVal = brand.substr(0,5); }else{ var brand = jQuery("input[name='systemFormsLanguageLocaleProduct']").val().trim().replace('-', '').toUpperCase(); var systemFormsVal = brand; } brand = typeof brand !== "undefined" && typeof systemFormsVal !== "undefined" ? brand.trim().replace(systemFormsVal + '-', '').toUpperCase() : brand; } //To remove accessibility issue if(jQuery("label[for='systemPartnerPreferenceMirrorOptIn']").length > 1){ jQuery("label[for='systemPartnerPreferenceMirrorOptIn']").eq(1).remove(); } /* Function to retrive the topic id */ function getTopicId(topicId){ var newTopicId = ''; if(topicId != undefined && topicId != ''){ for(var i=0; i< topicIDArray.length; i++){ if(topicId.indexOf(topicIDArray[i]) > -1){ newTopicId = topicIDArray[i]; return newTopicId; } } if(newTopicId == ''){ return topicIDArray[7]; } } } /** * Generate GUID for user tracking - uses performance.now() for uniqueness * * @function generateUUID * * @example // returns "cdf573ce-bc3d-49b2-87d4-026a27421da2". Unique each time it is called. * var uniqueTrackingNumber = generateUUID(); */ function generateUUID () { // Public Domain/MIT var d = new Date().getTime(); if (typeof performance !== 'undefined' && typeof performance.now === 'function'){ d += performance.now(); //use high-precision timer if available } return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function (c) { var r = (d + Math.random() * 16) % 16 | 0; d = Math.floor(d / 16); return (c === 'x' ? r : (r & 0x3 | 0x8)).toString(16); }); } /** * Namespace for yummie cookies! * * @namespace Cookies */ var Cookies = (function() { /** * Get a cookie by name and return its value * * @function Cookies.getCookie * @param {string} name Name of the cookie you want a value for * * @example // cookie named 'test' exists and has a stored value of true * getCookie('test'); // returns true */ function getCookie(name) { var dc = document.cookie; var prefix = name + "="; var begin = dc.indexOf("; " + prefix); if (begin == -1) { begin = dc.indexOf(prefix); if (begin != 0) return null; } else { begin += 2; } var end = document.cookie.indexOf(";", begin); if (end == -1) { end = dc.length; } // because unescape has been deprecated, replaced with decodeURI //return unescape(dc.substring(begin + prefix.length, end)); return decodeURI(dc.substring(begin + prefix.length, end)); } /** * Create a cookie and store it for X number of minutes in the brower * * @function Cookies.createCookie * * @param {string} name Name of your cookie? * @param {any} value What do you want your cookie to store? * @param {number} minutes How many minutes do you want your cookie to last? * * @example // sets cookie named 'test' with a value of true that expires in 1 day * createCookie('test', true, 1) */ function createCookie(name,value,minutes) { var expires = ""; if (minutes) { var date = new Date(); date.setTime(date.getTime() + (minutes*60*1000)); expires = "; expires=" + date.toUTCString(); } document.cookie = name + "=" + value + expires + "; path=/"; } return { getCookie : getCookie, createCookie : createCookie }; })(); // Clear the cookies after 15 sec for form 15647 function clearListCookies() { var cookies = document.cookie. split(" "); for (var i=0;i