$rightfeature)
$this.css("min-height", $leftpicture);
else
$this.css("min-height", $rightfeature);
})
} else {
$featurebox.css("min-height", "");
}
}
function SetEqualHeight(jQueryelements, passingWidth) {
try {
if (jQueryelements.length > 0) {
if (passingWidth == undefined) {
passingWidth = window.innerWidth || document.body.clientWidth;
}
if (passingWidth > 767) {
var max_height_found = 0;
jQueryelements.css({ 'height': 'auto' });
jQueryelements.each(function () {
var jQuerythis = jQuery(this);
if (jQuerythis.outerHeight() > max_height_found) {
if (jQueryelements.hasClass('m-product-placement-item') || jQueryelements.hasClass('m-panes-product-placement-item')) {
max_height_found = jQuerythis.outerHeight() + 40;
} else {
max_height_found = jQuerythis.outerHeight();
}
}
});
setTimeout(function () { jQueryelements.css('height', max_height_found); }, 500);
} else {
jQueryelements.css({ 'height': 'auto' });
}
}
}
catch (e) {
console.log(e);
}
}
var deskcount = "";
$(document).ready(function () {
/* Sticky Header */
var boxInitialTop = $('#headerRegion').outerHeight() - 15;
if ($(window).scrollTop() > boxInitialTop) {
if ($('.specs-stickynav').hasClass('f-sticky')) {
$('#Sticky-header-Navigation').removeClass("stickyH");
}
else {
$('#Sticky-header-Navigation').addClass("stickyH");
}
} else {
$('#Sticky-header-Navigation').removeClass("stickyH");
}
$(window).scroll(function () {
if ($(window).scrollTop() > boxInitialTop) {
if ($('.specs-stickynav').hasClass('f-sticky')) {
$('#Sticky-header-Navigation').removeClass("stickyH");
}
else {
$('#Sticky-header-Navigation').addClass("stickyH");
}
} else {
$('#Sticky-header-Navigation').removeClass("stickyH");
}
});
/* below code is to append url to FB/Twitter share*/
if (window.location.href.toLowerCase().indexOf("/compare-devices") != -1) {
var locale = $("meta[property='og:url']").attr("content") != undefined ? $("meta[property='og:url']").attr("content") : window.location.href;
var currentUrl = window.location.href.toLowerCase().split("?")[1];
var facebooksharelink = "https://www.facebook.com/sharer/sharer.php?m2w&s=100&u=" + locale.replace(/&/g, '%26') + "?" + currentUrl;
var twittersharelink = "http://twitter.com/share?url=" + locale.replace(/&/g, '%26') + "?" + currentUrl;
if (window.location.href.toLowerCase().indexOf("https://www.microsoft.com") != -1 || locale.toLowerCase().indexOf("https://www.microsoft.com") == 0 || locale.toLowerCase().indexOf("http://www.microsoft.com") == 0 || locale.toLowerCase().indexOf("http://windows.com") == 0 || locale.toLowerCase().indexOf("https://windows.com") == 0) {
if ($(".social-linked-icon.Facebook").length && $(".social-linked-icon.Twitter").length) {
$(".social-linked-icon.Facebook a").attr('href', facebooksharelink);
$(".social-linked-icon.Twitter a").attr('href', twittersharelink);
}
};
}
/* Adding below line for toggle off for prefers-reduce-motion */
if (window.matchMedia("(prefers-reduced-motion)").matches == true) { $('#inputToggle').click(); }
/* Adding for compare page table td */
$('#windowsh22.compare-windows-11-home-vs-pro-versions .c-table table tbody').find('td:first-child').attr('scope', 'row');
/* Adding QR code for the China footnote */
$("html[lang='zh-cn'] #social-network .f-share ul li:first-child").append("
")
/* Accessibility fixes start */
$('.c-table.two-column-table tr').each(function () {
var th = document.createElement('th');
var list = $(this).find('td:first-child').html();
$(this).find('td:first-child').replaceWith('' + list + ' | ');
});
$(".windows-11-specifications #table4 table").attr("role" , "presentation");
$(".windows-11-specifications #table5 table").attr("role" , "presentation");
$('.windows-11-specifications #table1 .c-table thead tr th').removeAttr("scope");
$('.windows-11-specifications #table2 .c-table thead tr th').removeAttr("scope");
$('.windows-11-specifications #table3 .c-table thead tr th').removeAttr("scope");
$('.windows-11-specifications #table1 .c-table tbody tr').each(function () {
var list = $(this).find('td:first-child').html();
$(this).find('td:first-child').replaceWith('' + list + ' | ');
});
$('.windows-11-specifications #table2 .c-table tbody tr').each(function () {
var list = $(this).find('td:first-child').html();
$(this).find('td:first-child').replaceWith('' + list + ' | ');
});
$('.windows-11-specifications #table3 .c-table tbody tr').each(function () {
var list = $(this).find('td:first-child').html();
$(this).find('td:first-child').replaceWith('' + list + ' | ');
});
$('#windowsh22.photo-movie-editor #table1 .c-table tbody tr').each(function () {
var list = $(this).find('td:first-child').html();
$(this).find('td:first-child').replaceWith('' + list + ' | ');
});
$(".laptop-buying-guide .hardware-table table tbody tr").each(function () {
var th = document.createElement('th');
var list = $(this).find('td:first-child').html();
$(this).find('td:first-child').replaceWith('' + list + ' | ');
});
$(".laptop-buying-guide .recommended-table table tbody tr").each(function () {
var th = document.createElement('th');
var list = $(this).find('td:first-child').html();
$(this).find('td:first-child').replaceWith('' + list + ' | ');
});
var tablerow;
for (var k = 0; k <= $('.c-table.two-column-table tr').length; k++) {
tablerow = $('.c-table.two-column-table tr')[k];
$(tablerow).find('th').attr("id", "row" + k);
$(tablerow).find('td').attr("aria-labelledby", "row" + k);
}
$(".expand-collapse-toggle-area button[data-source=expand]").attr("aria-expanded", "false");
$(".expand-collapse-toggle-area button[data-source=collapse]").attr("aria-expanded", "true");
$('.specs-stickynav .f-dropdown-menu').find('a.f-dropdown-link').attr('aria-haspopup', 'false');
jQuery(document).on('click keydown', '.specs-stickynav a.f-dropdown-link', function (e) {
//$(".specs-stickynav .f-dropdown-menu').find('a.f-dropdown-link").css("border-color", "#000");
if ((e.type == "click" || e.type == "keydown" && e.which == "13")) {
var expandbutton = $('#unique-id-for-list');
if (expandbutton.attr('aria-hidden') == "false") {
$('.specs-stickynav .f-dropdown-menu').find('a.f-dropdown-link').attr('aria-expanded', 'true');
$('.specs-stickynav .f-dropdown-menu').find('a.f-dropdown-link').attr('aria-haspopup', 'true');
}
else {
$('.specs-stickynav .f-dropdown-menu').find('a.f-dropdown-link').attr('aria-expanded', 'false');
$('.specs-stickynav .f-dropdown-menu').find('a.f-dropdown-link').attr('aria-haspopup', 'false');
}
}
});
$(document).on('keyup', '.specs-stickynav a.f-dropdown-link, .f-dropdown.specs-stickynav ul li.c-menu-item a', function (e) {
if (e.key == "Escape") {
e.preventDefault();
$('body').click();
$('.specs-stickynav .f-dropdown-menu').find('a.f-dropdown-link').attr('aria-expanded', 'false');
$('.specs-stickynav .f-dropdown-menu').find('a.f-dropdown-link').focus();
}
});
$(document).on('keydown', '.f-dropdown.specs-stickynav ul > li:first-child a', function (e) {
$this = $(this);
if (e.shiftKey && e.keyCode === 9) {
e.stopPropagation();
setTimeout(function () {
$this.parents("ul").siblings('a').focus();
}, 500);
}
});
$(document).on('keydown', '.f-dropdown.specs-stickynav ul > li:last-child a', function (e) {
$this = $(this);
if (e.shiftKey && e.keyCode === 9) {
e.stopPropagation();
setTimeout(function () {
$this.parent("li").prev().find('a').focus();
}, 500);
}
else if (e.keyCode === 9 && !e.shiftKey) {
$('body').click();
$('.specs-stickynav .f-dropdown-menu').find('a.f-dropdown-link').attr('aria-expanded', 'false');
}
});
$(document).on('click', 'body', function (e) {
var list = $("#unique-id-for-list")
if (!$(e.target).hasClass('f-dropdown-link')) {
list.hide();
list.attr('aria-hidden', 'true');
}
else if ($(e.target).hasClass('f-dropdown-link')) {
if (list.attr('aria-hidden') === 'true') {
list.hide();
} else {
list.show();
}
}
});
$(document).on('keydown', '#TYD-hero-hvp .holiday-video-auto .f-primary.blue-button', function (e) {
if (e.shiftKey && e.keyCode === 9) {
$(window).scrollTop(40);
}
});
$(document).on('keydown', '.Transfer-your-data .article-section-footnotes ul li:first-child a.c-hyperlink, .Transfer-your-data .drawer-panel .c-drawer#question-6, .Transfer-your-data .drawer-panel .c-drawer#question-4, .Transfer-your-data .drawer-panel .c-drawer#question-2', function (e) {
if (e.shiftKey && e.keyCode === 9) {
$(window).scrollTop($(window).scrollTop() - 200)
}
});
$(document).on('keydown', '#Sticky-header-Navigation #stickynavcommon a.blue-button', function (e) {
if (e.shiftKey && e.keyCode === 9) {
$(window).scrollTop(0)
}
});
$(document).on('keydown', '#windowsh22.AI-Page .drawer-panel .c-drawer#question-1', function (e) {
if (e.shiftKey && e.keyCode === 9) {
$(window).scrollTop($(window).scrollTop() - 200);
}
});
$('.end-of-support .drawer-panel #question-10 button, .end-of-support .drawer-panel #question-8 button, .end-of-support .drawer-panel #question-5 button').keydown(function(e){
if (e.shiftKey && e.keyCode === 9) {
$(window).scrollTop($(window).scrollTop() - 100)
}
});
$('.end-of-support .drawer-panel #question-10 button').keydown(function(e){
if (e.shiftKey && e.keyCode === 9) {
$(window).scrollTop($(window).scrollTop() - 100)
}
});
$('.end-of-support .drawer-panel #question-8 button').keydown(function(e){
if (e.shiftKey && e.keyCode === 9) {
$(window).scrollTop($(window).scrollTop() - 100)
}
});
$('.end-of-support .drawer-panel #question-5 button').keydown(function(e){
if (e.shiftKey && e.keyCode === 9) {
$(window).scrollTop($(window).scrollTop() - 100)
}
});
$('.laptop-buying-guide .article-section-footnotes ul li #1').keydown(function(e){
if (e.shiftKey && e.keyCode === 9) {
$(window).scrollTop($(window).scrollTop() - 100)
}
});
$('.laptop-buying-guide .c-link-navigation ul li:first-child a.c-hyperlink').keydown(function(e){
if (e.shiftKey && e.keyCode === 9) {
$(window).scrollTop($(window).scrollTop() - 100)
}
});
$('.laptop-buying-guide #retailers .m-banner sup:first-child a.c-hyperlink').keydown(function(e){
if (e.shiftKey && e.keyCode === 9) {
$(window).scrollTop($(window).scrollTop() - 150)
}
});
$('.laptop-buying-guide #panes-panel-ContentPlacementPanel ul li:last-child a.c-hyperlink').keydown(function(e){
if (e.shiftKey && e.keyCode === 9) {
$(window).scrollTop($(window).scrollTop() - 100)
}
});
$('.copilot-ai-features .article-section-footnotes ul li #1').keydown(function(e){
if (e.shiftKey && e.keyCode === 9) {
$(window).scrollTop($(window).scrollTop() - 150)
}
});
$('.copilot-ai-features .drawer-panel #question-5 button').keydown(function(e){
if (e.shiftKey && e.keyCode === 9) {
$(window).scrollTop($(window).scrollTop() - 100)
}
});
$('.copilot-ai-features .drawer-panel #question-3 button').keydown(function(e){
if (e.shiftKey && e.keyCode === 9) {
$(window).scrollTop($(window).scrollTop() - 200)
}
});
$('.copilot-ai-features #ai-Contentplacement .articletouts .m-content-placement-item').find('sup:first-child').keydown(function(e){
if (e.shiftKey && e.keyCode === 9) {
$(window).scrollTop($(window).scrollTop() - 200)
}
});
$('#windowsh22.laptop-buying-guide .c-pivot.center ul[role="tablist"] li.f-active').keydown(function(e){
if (e.shiftKey && e.keyCode === 9) {
$(window).scrollTop($(window).scrollTop() - 200)
}
});
$(document).on('keydown', 'body #windowsh22.PenVoiceTouch *', function (e) {
if (e.shiftKey && e.keyCode === 9 && $(e.target).parents(".image-priority-accolate.featurebox").length == 0 && $(e.target).parents(".specs-stickynav").length == 0) {
$(window).scrollTop($(window).scrollTop() - 120)
}
});
$(document).on('keydown', '#windowsh22.PenVoiceTouch .featurebox > .m-feature .c-group a.blue-button', function (e) {
if (!e.shiftKey && e.keyCode === 9) {
setTimeout(function () {
$(window).scrollTop($(window).scrollTop() + 80)
}, 10);
}
});
//#windowsh22.PenVoiceTouch .featurebox > .m-feature
$(".f-video-trigger button").click(function () {
setTimeout(function () {
$(".c-video-player .oneplayer-iframe").attr("role", "presentation");
$('.c-dialog.f-lightbox .nav-buttons button.c-glyph').focus();
}, 10);
});
var ViewPortWidth = $(window).width();
var attachDetachedStaticHeadingElem = $(".static-in-lower-vp h1.f-lean");
var attachDetachedAnimHedingElem = $(".animation-in-higher-vp h1.f-lean");
if (ViewPortWidth <= 1280) {
$(".animation-in-higher-vp h1.f-lean").attr('aria-hidden', 'true');
$(".static-in-lower-vp p").before(attachDetachedStaticHeadingElem);
} else {
$(".static-in-lower-vp h1.f-lean").attr('aria-hidden', 'true');
$(".animation-in-higher-vp p").before(attachDetachedAnimHedingElem);
}
$(".windows .c-in-page-navigation .nav-2 a").on("focus", function () {
$('html, body').animate({
scrollTop: $("#homepage-hero").offset().top + 1000
}, 250);
});
/* Accessibility fixes end */
var lastScrollTop = 0;
window.addEventListener("scroll", function () {
currentStickyNav();
//Highlight feature panel parallax
var st = window.pageYOffset || document.documentElement.scrollTop;
if (st > lastScrollTop) {
//Scroll down code here
$(".play-on-focus").each(function () {
if (isPanelInViewport(this, 500) && (window.matchMedia("(prefers-reduced-motion)").matches == false && $("#inputToggle").is(':checked') == true)) {
$(this).find("button").addClass("glyph-pause").removeClass("glyph-play");
if (!$(this).hasClass("video-played") && window.location.href.toLowerCase().indexOf("/windows/windows-11") == -1) {
$(this).find("video").attr("playsinline", "true");
$(this).find("video").get(0).play();
$(this).addClass("video-played");
$(this).find("button").addClass("glyph-pause").removeClass("glyph-play");
}
else {
//if(!$(this).find("button").hasClass("glyph-play")){
$(this).find("video").attr("playsinline", "true");
$(this).find("video").get(0).play();
$(this).addClass("video-played");
$(this).find('.mp4videoinline').on("pause ended", function () {
$(this).siblings("button").removeClass("glyph-pause").addClass("glyph-play");
});
//}
}
}
});
} else {
//Scroll up code here
if ($("html").scrollTop() == 0) {
$(".animation-container").addClass("position-fixed");
}
}
lastScrollTop = st <= 0 ? 0 : st;
}, false);
if ($featurebox.length > 0)
featureheightcomparison();
$(".article .image-priority-accolate.featurebox .c-group a.glyph-play").parents(".featurecontent").siblings().addClass("image-clickable");
$(".article .image-priority-accolate.featurebox .image-clickable").on("click", function () {
$(this).siblings().find(".c-group a.glyph-play").click();
})
$(".article .image-priority-accolate.featurebox").each(function () {
var anchorLength = $(this).find(".c-group a").length;
if (anchorLength >= 1) {
var anchroHref = $(this).find(".c-group a").eq(0).attr("href")
var anchorTarget = $(this).find(".c-group a").eq(0).attr("target")
var anchorAria = $(this).find(".c-group a").eq(0).attr("aria-label")
$(this).find(".accolate-section picture img").wrap("")
}
});
rownamesappending();
toutsminheightcalc();
changeSupToAnchor();
});
function isPanelInViewport(elem, morescroll) {
try {
var jQueryelem = jQuery(elem);
morescroll = morescroll == undefined ? 0 : morescroll;
// Get the scroll position of the page.
var scrollElem = ((navigator.userAgent.toLowerCase().indexOf('edge/') != -1) ? 'body' : 'html');
var viewportTop = jQuery(scrollElem).scrollTop();
if (navigator.userAgent.indexOf('Safari') != -1 && navigator.userAgent.indexOf('Chrome') == -1) {
viewportTop = window.pageYOffset;
}
var viewportBottom = viewportTop + jQuery(window).height();
// Get the position of the element on the page.
var elemTop;
var elemBottom;
if (jQueryelem.length > 0) {
elemTop = Math.round(jQueryelem.offset().top) + morescroll;
elemBottom = elemTop + jQueryelem.height();
}
return ((elemTop < viewportBottom) && (elemBottom > viewportTop));
}
catch (e) {
console.log(e);
}
}
function UHFDropdownClickOnIEbrowsers() {
/*
Fixing the UHF dropdown click issue only in IE browsers
Fix description:
1. Getting the clickable element (here the buttons)
2. On clicking changing the aria-expanded attribute to true
3. At the same time, if the dropdown is not showing changing aria-hidden to true to show the dropdown
4. If dropdown showing, changing aria-hidden to false to hide the dropdown and changing the button aria-expanded attribute to false
*/
if ((navigator.userAgent.toLowerCase().indexOf("trident") != -1 || navigator.userAgent.toLowerCase().indexOf("msie") != -1) && window.innerWidth > 860) {
$("#uhf-g-nav .nested-menu.uhf-menu-item button, #uhf-c-nav .all-ms-nav").on("click", function (e) {
e.preventDefault();
var isThisExpanded = $(this).attr("aria-expanded");
if (isThisExpanded == "false") {
$(this).attr("aria-expanded", "true");
$(this).next("ul").attr("aria-hidden", "false");
$(this).next("ul.f-multi-column.f-multi-column-6").css("margin-left", "-1000px");
} else {
$(this).attr("aria-expanded", "false");
$(this).next("ul").attr("aria-hidden", "true");
$(this).next("ul.f-multi-column.f-multi-column-6").css("margin-left", "0px");
}
});
}
}
var GetQueryStringParams_upgrade = function (sParam) {
var sPageURL = window.location.search.substring(1);
var sURLVariables = sPageURL.toLowerCase().split('&');
for (var i = 0; i < sURLVariables.length; i++) {
var sParameterName = sURLVariables[i].split('=');
if (sParameterName[0] == sParam.toLowerCase()) {
return sParameterName[1];
}
}
}
var DynamicFilteringForArticles = function () {
var allTypes = GetQueryStringParams_upgrade("type");
allTypes = allTypes != undefined ? allTypes.toLowerCase() : allTypes;
var allCategories = GetQueryStringParams_upgrade("category");
allCategories = allCategories != undefined ? allCategories.split(",") : allCategories;
var allSorts = GetQueryStringParams_upgrade("sort");
allSorts = allSorts != undefined ? allSorts.toLowerCase() : allSorts;
allCategories = allTypes == "resources" || allTypes == "articles" ? "" : allCategories;
var isClicked = [];
$(allCategories).each(function (key, item) {
if (isClicked.indexOf(item) == -1) {
if (item.indexOf("%20") != -1) {
item = item.toLowerCase().split("%20");
item = item.join(" ");
item = item.split("%27");
item = item.join("'");
}
$('#dropdownArea button.c-selected-buttons[data-filter="' + item.toLowerCase() + '"]').focus().click();
isClicked.push(item.toLowerCase());
}
});
if (allSorts == "recent") {
$(".mostrecent a").click();
}
if (allSorts == "popular") {
$(".mostpopular a").click();
}
$(".filter-component .buttonContainer, .filter-component .c-divider, .filter-banner").removeClass("hide");
if (allTypes == "resources") {
$('#dropdownArea button.c-selected-buttons[data-filter="resources"]').click();
}
else if (allTypes == "articles") {
$('#dropdownArea button.c-selected-buttons[data-filter="articles"]').click();
}
if (allTypes == "resources" || allTypes == "articles") {
$(".filter-component .buttonContainer, .filter-component .c-divider, .filter-banner").addClass("hide");
if ($("#dropdownArea button[aria-pressed=true]").length == 1) {
$(".clearallArticles").css('display', 'none');
} else {
$(".clearallArticles").css('display', 'block');
};
}
setTimeout(function () {
if (allTypes == "resources" || allTypes == "articles" || allSorts == "recent" || allSorts == "popular" || (allCategories != undefined && allCategories.length != 0)) {
$('html, body').animate({ scrollTop: $(".selectDisplays").offset().top });
}
}, 500);
}
var triggeringContentPlacementClick = function () {
if (typeof mwfAutoInit != "undefined" && $(".m-content-placement-item").length != 0) {
mwfAutoInit.ComponentFactory.create([
{
c: mwfAutoInit.ContentPlacementItem,
selector: 'body .m-content-placement-item'
}
]);
}
}
$(window).on('load resize', function (e) {
currentStickyNav();
setTimeout(function () {
$(".nav-buttons").css({
width: $(window).width() + "px",
height: $(window).height() + "px"
});
}, 100);
if (e.type == "resize") {
windows11herovideoplay();
/* heropanelanimationinhome(); */
UHFDropdownClickOnIEbrowsers();
SetEqualHeight($("#windowsh22.windows .c-section-common.performance-benifits .m-content-placement-item.shop-specs"));
SetEqualHeight($("#windowsh22.next-gen-ai-pcs #device-section section.m-content-placement-item>div .toutheading"));
SetEqualHeight($("#windowsh22.next-gen-ai-pcs .articletouts .m-content-placement-item ul.c-list"));
SetEqualHeight($("#windowsh22.next-gen-ai-pcs #device-section .m-content-placement-item .c-group"));
SetEqualHeight($(".copilot-plus-pcs .articletouts .m-content-placement-item div"));
SetEqualHeight($("#windowsh22.next-gen-ai-pcs .c-section-common.performance-benifits .m-content-placement-item.shop-specs"));
SetEqualHeight($(".end-of-support #win-10-panes-3up .m-panes .m-panes-product-placement-item h3.c-heading"));
SetEqualHeight($(".end-of-support #win-10-panes-3up .m-panes .m-panes-product-placement-item p.c-paragraph"));
SetEqualHeight($(".end-of-support #win-10-panes-3up .m-panes-product-placement-item h3.c-heading"));
SetEqualHeight($(".end-of-support #panes-panel-Win8 .f-stacked .m-panes-product-placement-item .c-paragraph"));
SetEqualHeight($(".end-of-support #panes-panel-Win8-t1-with-ocid .f-stacked .m-panes-product-placement-item .c-paragraph"));
SetEqualHeight($(".end-of-support #panes-panel-Win8-t2-with-ocid .f-stacked .m-panes-product-placement-item .c-paragraph"));
SetEqualHeight($(".end-of-support #panes-panel-Win8-t3-with-ocid .f-stacked .m-panes-product-placement-item .c-paragraph"));
SetEqualHeight($(".end-of-support #content-placement-win7 .content-touts .articletouts p.toutpara"));
SetEqualHeight($(".end-of-support #content-placement-win7 .content-touts .articletouts h3.toutheading"));
SetEqualHeight($(".end-of-support #win-10-panes-3up .m-panes-product-placement-item p.c-paragraph"));
SetEqualHeight($(".end-of-support #win-10-panes-3up .m-panes-product-placement-item .c-call-to-action"));
SetEqualHeight($(".end-of-support .contentPlacement4up .content-touts .articletouts p.toutpara"));
SetEqualHeight($(".end-of-support .contentPlacement4up .content-touts .articletouts h3.toutheading"));
SetEqualHeight($(".windows .content-touts .articletouts p.toutpara"));
SetEqualHeight($(".windows #homeContentPlacemet .content-touts .articletouts h3.toutheading"));
SetEqualHeight($(".windows #bestwindows .content-touts .articletouts h3.toutheading"));
SetEqualHeight($("#PivotTarget0 #articleslisting .content-touts h3"));
SetEqualHeight($(".Transfer-your-data .content-touts .articletouts p.toutpara"));
SetEqualHeight($(".Transfer-your-data .content-touts .articletouts h3.toutheading"));
SetEqualHeight($(".compare-windows-11-home-vs-pro-versions .articletouts .m-content-placement-item h3.toutheading"));
SetEqualHeight($(".compare-windows-11-home-vs-pro-versions .articletouts .m-content-placement-item p.toutpara"));
SetEqualHeight($(".article-category .content-touts"));
SetEqualHeight($(".remote-resource-center .content-touts"));
SetEqualHeight($(".getting-started #cp-tipstricks .m-product-placement .m-product-placement-item h3"));
SetEqualHeight($(".getting-started #cp-tipstricks .m-product-placement .m-product-placement-item p"));
SetEqualHeight($(".getting-started .m-content-placement [data-grid='col-3 pad-6x'] .articletouts h3"));
SetEqualHeight($(".getting-started .m-content-placement [data-grid='col-3 pad-6x'] .articletouts p"));
SetEqualHeight($(".getting-started .m-content-placement [data-grid='col-4 pad-6x'] .articletouts h3"));
SetEqualHeight($(".getting-started .m-content-placement [data-grid='col-4 pad-6x'] .articletouts p"));
SetEqualHeight($(".getting-started .m-content-placement [data-grid='col-6 pad-6x'] .articletouts h3"));
SetEqualHeight($(".getting-started .m-content-placement [data-grid='col-6 pad-6x'] .articletouts p"));
SetEqualHeight($(".new-article #right-container .content-touts .articletouts section h3"));
SetEqualHeight($(".new-article #right-container .content-touts .articletouts section p"));
SetEqualHeight($(".new-article #right-container .content-touts .articletouts section div.c-group"));
SetEqualHeight($(".postcard-article #right-container .content-touts .articletouts section h3"));
SetEqualHeight($(".postcard-article #right-container .content-touts .articletouts section p"));
SetEqualHeight($(".postcard-article #right-container .content-touts .articletouts section div.c-group"));
SetEqualHeight($(".comprehensive-security #comprehensiveSecurity_Contentplacement1_malwareProtection .content-touts .articletouts section"));
SetEqualHeight($(".comprehensive-security #comprehensiveSecurity_Contentplacement1_phishingprevention .content-touts .articletouts section"));
SetEqualHeight($(".comprehensive-security #comprehensiveSecurity_Contentplacement1_appsecurity .content-touts .articletouts section"));
SetEqualHeight($("#windowsh22.photo-movie-editor .content-touts .articletouts section"));
SetEqualHeight($("#windowsh22.laptop-buying-guide .numberContentPlacement .content-touts .articletouts section > div > .toutheading"));
//SetEqualHeight($("#windowsh22.laptop-buying-guide .numberContentPlacement .content-touts .articletouts section > div > .toutpara"));
SetEqualHeight($("#windowsh22.laptop-buying-guide #Content_Placement-panel-16 .content-touts .articletouts section > div > .toutpara"));
//#windowsh22.laptop-buying-guide .numberContentPlacement .toutheading
SetEqualHeight($("#windowsh22.windows .c-section-common.performance-benifits .m-content-placement-item.shop-specs .card-icon-heading-in-a-row"));
SetEqualHeight($("#windowsh22.windows .c-section-common.performance-benifits .m-content-placement-item.shop-specs .m-right-item .c-heading"));
SetEqualHeight($("#windowsh22.windows .c-section-common.performance-benifits .m-content-placement-item.shop-specs > div p.c-paragraph"));
SetEqualHeight($("#windowsh22.windows .c-section-common.performance-benifits .m-content-placement-item.shop-specs .card-description .c-group"));
// #windowsh22.windows .c-section-common.performance-benifits .m-content-placement-item.shop-specs > div
//#windowsh22.windows .c-section-common.performance-benifits .m-content-placement-item.shop-specs .card-icon-heading-in-a-row
/* eos start */
if (window.location.href.toLowerCase().indexOf("end-of-support") != -1) {
ocidparam = GetQueryStringParams_upgrade("os");
if (ocidparam == 'win7'){
setTimeout(function () {
SetEqualHeight($(".end-of-support .contentPlacement4up .content-touts .articletouts p.toutpara"));
SetEqualHeight($(".end-of-support .contentPlacement4up .content-touts .articletouts h3.toutheading"));
SetEqualHeight($(".end-of-support #panes-panel-Win8 .f-stacked .m-panes-product-placement-item .c-paragraph"));
SetEqualHeight($(".end-of-support #win-10-panes-3up .m-panes-product-placement-item p.c-paragraph"));
SetEqualHeight($(".end-of-support #win-10-panes-3up .m-panes-product-placement-item .c-call-to-action"));
}, 2000);
}
if(ocidparam == 'win8'){
setTimeout(function () {
SetEqualHeight($(".end-of-support .contentPlacement4up .content-touts .articletouts p.toutpara"));
SetEqualHeight($(".end-of-support .contentPlacement4up .content-touts .articletouts h3.toutheading"));
SetEqualHeight($(".end-of-support #panes-panel-Win8 .f-stacked .m-panes-product-placement-item .c-paragraph"));
SetEqualHeight($(".end-of-support #win-10-panes-3up .m-panes-product-placement-item p.c-paragraph"));
SetEqualHeight($(".end-of-support #win-10-panes-3up .m-panes-product-placement-item .c-call-to-action"));
}, 2000);
}
}
/* eos end */
/* Making dropdown for the Link Navigation panel in Lower Viewport */
if(window.matchMedia("(max-width:539px)").matches && $(".wdg-support-links #prefooterDrawer").attr("aria-expanded") == "false") {
$(".wdg-support-links .c-link-navigation").hide();
$(".wdg-support-links #prefooterDrawer").attr("aria-expanded", "false");
}
else {
$(".wdg-support-links .c-link-navigation").show();
$(".wdg-support-links #prefooterDrawer").attr("aria-expanded", "true");
}
//window.matchMedia("(max-width:539px)").matches ? $(".wdg-support-links .c-link-navigation").hide() : $(".wdg-support-links .c-link-navigation").show()
setTimeout(function () {
if ($featurebox.length > 0) {
featureheightcomparison();
}
},100);
} else if (e.type == "load") {
//featureheightcomparison();
windows11mosicanimation();
windows11herovideoplay();
SetEqualHeight($("#windowsh22.windows .c-section-common.performance-benifits .m-content-placement-item.shop-specs"));
SetEqualHeight($("#windowsh22.next-gen-ai-pcs #device-section section.m-content-placement-item>div .toutheading"));
SetEqualHeight($("#windowsh22.next-gen-ai-pcs .articletouts .m-content-placement-item ul.c-list"));
SetEqualHeight($("#windowsh22.next-gen-ai-pcs #device-section .m-content-placement-item .c-group"));
SetEqualHeight($(".copilot-plus-pcs .articletouts .m-content-placement-item div"));
SetEqualHeight($("#windowsh22.next-gen-ai-pcs .c-section-common.performance-benifits .m-content-placement-item.shop-specs"));
SetEqualHeight($(".end-of-support #win-10-panes-3up .m-panes-product-placement-item h3.c-heading"));
SetEqualHeight($(".end-of-support #win-10-panes-3up .m-panes-product-placement-item p.c-paragraph"));
SetEqualHeight($(".end-of-support #panes-panel-Win8 .f-stacked .m-panes-product-placement-item .c-paragraph"));
SetEqualHeight($(".end-of-support #panes-panel-Win8-t1-with-ocid .f-stacked .m-panes-product-placement-item .c-paragraph"));
SetEqualHeight($(".end-of-support #panes-panel-Win8-t2-with-ocid .f-stacked .m-panes-product-placement-item .c-paragraph"));
SetEqualHeight($(".end-of-support #panes-panel-Win8-t3-with-ocid .f-stacked .m-panes-product-placement-item .c-paragraph"));
SetEqualHeight($(".end-of-support #content-placement-win7 .content-touts .articletouts p.toutpara"));
SetEqualHeight($(".end-of-support #content-placement-win7 .content-touts .articletouts h3.toutheading"));
SetEqualHeight($(".end-of-support #win-10-panes-3up .m-panes-product-placement-item p.c-paragraph"));
SetEqualHeight($(".end-of-support #win-10-panes-3up .m-panes-product-placement-item .c-call-to-action"));
SetEqualHeight($(".end-of-support .contentPlacement4up .content-touts .articletouts p.toutpara"));
SetEqualHeight($(".end-of-support .contentPlacement4up .content-touts .articletouts h3.toutheading"));
SetEqualHeight($(".windows .content-touts .articletouts p.toutpara"));
SetEqualHeight($(".windows #homeContentPlacemet .content-touts .articletouts h3.toutheading"));
SetEqualHeight($(".windows #bestwindows .content-touts .articletouts h3.toutheading"));
SetEqualHeight($("#PivotTarget0 #articleslisting .content-touts h3"));
SetEqualHeight($(".Transfer-your-data .content-touts .articletouts p.toutpara"));
SetEqualHeight($(".Transfer-your-data .content-touts .articletouts h3.toutheading"));
SetEqualHeight($(".compare-windows-11-home-vs-pro-versions .articletouts .m-content-placement-item h3.toutheading"));
SetEqualHeight($(".compare-windows-11-home-vs-pro-versions .articletouts .m-content-placement-item p.toutpara"));
SetEqualHeight($(".article-category .content-touts"));
SetEqualHeight($(".remote-resource-center .content-touts"));
SetEqualHeight($(".getting-started #cp-tipstricks .m-product-placement .m-product-placement-item h3"));
SetEqualHeight($(".getting-started #cp-tipstricks .m-product-placement .m-product-placement-item p"));
SetEqualHeight($(".getting-started .m-content-placement [data-grid='col-3 pad-6x'] .articletouts h3"));
SetEqualHeight($(".getting-started .m-content-placement [data-grid='col-3 pad-6x'] .articletouts p"));
SetEqualHeight($(".getting-started .m-content-placement [data-grid='col-4 pad-6x'] .articletouts h3"));
SetEqualHeight($(".getting-started .m-content-placement [data-grid='col-4 pad-6x'] .articletouts p"));
SetEqualHeight($(".getting-started .m-content-placement [data-grid='col-6 pad-6x'] .articletouts h3"));
SetEqualHeight($(".getting-started .m-content-placement [data-grid='col-6 pad-6x'] .articletouts p"));
SetEqualHeight($(".new-article #right-container .content-touts .articletouts section h3"));
SetEqualHeight($(".new-article #right-container .content-touts .articletouts section p"));
SetEqualHeight($(".new-article #right-container .content-touts .articletouts section div.c-group"));
SetEqualHeight($(".postcard-article #right-container .content-touts .articletouts section h3"));
SetEqualHeight($(".postcard-article #right-container .content-touts .articletouts section p"));
SetEqualHeight($(".postcard-article #right-container .content-touts .articletouts section div.c-group"));
SetEqualHeight($(".comprehensive-security #comprehensiveSecurity_Contentplacement1_malwareProtection .content-touts .articletouts section"));
SetEqualHeight($(".comprehensive-security #comprehensiveSecurity_Contentplacement1_phishingprevention .content-touts .articletouts section"));
SetEqualHeight($(".comprehensive-security #comprehensiveSecurity_Contentplacement1_appsecurity .content-touts .articletouts section"));
SetEqualHeight($("#windowsh22.photo-movie-editor .content-touts .articletouts section"));
SetEqualHeight($("#windowsh22.laptop-buying-guide .numberContentPlacement .content-touts .articletouts section > div > .toutheading"));
//SetEqualHeight($("#windowsh22.laptop-buying-guide .numberContentPlacement .content-touts .articletouts section > div > .toutpara"));
SetEqualHeight($("#windowsh22.laptop-buying-guide #Content_Placement-panel-16 .content-touts .articletouts section > div > .toutpara"));
SetEqualHeight($("#windowsh22.windows .c-section-common.performance-benifits .m-content-placement-item.shop-specs .card-icon-heading-in-a-row"));
SetEqualHeight($("#windowsh22.windows .c-section-common.performance-benifits .m-content-placement-item.shop-specs .m-right-item .c-heading"));
SetEqualHeight($("#windowsh22.windows .c-section-common.performance-benifits .m-content-placement-item.shop-specs > div p.c-paragraph"));
SetEqualHeight($("#windowsh22.windows .c-section-common.performance-benifits .m-content-placement-item.shop-specs .card-description .c-group"));
//#windowsh22.windows .c-section-common.performance-benifits .m-content-placement-item.shop-specs .card-description .c-group a
/* eos start */
if (window.location.href.toLowerCase().indexOf("end-of-support") != -1) {
ocidparam = GetQueryStringParams_upgrade("os");
if (ocidparam == 'win7'){
setTimeout(function () {
SetEqualHeight($(".end-of-support .contentPlacement4up .content-touts .articletouts p.toutpara"));
SetEqualHeight($(".end-of-support .contentPlacement4up .content-touts .articletouts h3.toutheading"));
SetEqualHeight($(".end-of-support #panes-panel-Win8 .f-stacked .m-panes-product-placement-item .c-paragraph"));
SetEqualHeight($(".end-of-support #win-10-panes-3up .m-panes-product-placement-item p.c-paragraph"));
SetEqualHeight($(".end-of-support #win-10-panes-3up .m-panes-product-placement-item .c-call-to-action"));
}, 2000);
}
if(ocidparam == 'win8'){
setTimeout(function () {
SetEqualHeight($(".end-of-support .contentPlacement4up .content-touts .articletouts p.toutpara"));
SetEqualHeight($(".end-of-support .contentPlacement4up .content-touts .articletouts h3.toutheading"));
SetEqualHeight($(".end-of-support #panes-panel-Win8 .f-stacked .m-panes-product-placement-item .c-paragraph"));
SetEqualHeight($(".end-of-support #win-10-panes-3up .m-panes-product-placement-item p.c-paragraph"));
SetEqualHeight($(".end-of-support #win-10-panes-3up .m-panes-product-placement-item .c-call-to-action"));
}, 2000);
}
}
/* eos end */
toutsminheightcalc();
animationwhenstickyisthere();
animationwhenstickyistherecomp();
animationwhenstickyistherecomplaptopbuyingguide();
animationwhenstickyistherephotomovieeditor();
setTimeout(function () {
if ($featurebox.length > 0) {
featureheightcomparison();
}
},100);
$(document).on("click", "section.m-content-placement-item[data-js-href="http://approjects.co.za/?big=javascript:void(0);"] .supBLink", function (e) {
e.stopImmediatePropagation();
});
UHFDropdownClickOnIEbrowsers();
setTimeout(function () {
DynamicFilteringForArticles();
if (mwfAutoInit != undefined && $(".m-pagination").length != 0) {
mwfAutoInit.ComponentFactory.detach($(".m-pagination")[0], "Pagination");
}
triggeringContentPlacementClick();
rownamesappending();
toutsminheightcalc();
if (mwfAutoInit != undefined && $(".c-pivot.custom-pivot").length != 0) {
mwfAutoInit.ComponentFactory.detach($(".c-pivot.custom-pivot")[0], "Pivot");
}
}, 1500);
setTimeout(function () {
/* Hiding Footnotes that are not in page */
var thisURL = window.location.href.toLowerCase();
if (thisURL.indexOf("windows/features") != -1 || thisURL.indexOf("windows/tips-and-tricks") != -1) {
}
else {
var supNumbers = [];
$("sup a").each(function () {
supNumbers.push($(this).text().trim());
});
$(".article-section-footnotes ul li").each(function () {
var thisNumber = $(this).find(".supFn").text();
if (supNumbers.indexOf(thisNumber) == -1 && thisNumber != "") {
$(this).addClass("hide");
}
else if ($(this).find("a").length == 0) {
$(this).replaceWith('' + $(this).html() + '
');
}
});
if (window.location.href.toLowerCase().indexOf("/comprehensive-security") != -1) {
$(".article-section-footnotes ul > p + li").replaceWith('' + $(".article-section-footnotes ul > p + li").html() + '
');
}
$('.article-section-footnotes > div > div').prepend($('.article-section-footnotes ul > p').clone()).html();
$('.article-section-footnotes ul > p').remove();
}
}, 3000);
if (mwfAutoInit != undefined && $(".m-pagination").length != 0) {
mwfAutoInit.ComponentFactory.detach($(".m-pagination")[0], "Pagination");
}
setTimeout(function () {
var elements = $('.hubmain .m-content-placement-item');
var elementsHero = document.getElementsByClassName('m-hero-item');
var titleName = jQuery("span[itemprop='name']").text();
for (var i = 0; i < elements.length; i++) {
var el = elements[i];
if (el.getAttribute('data-js-href') != null && !el.classList.contains('hmc-content-placement-item')) {
var attrValue = el.getAttribute('data-js-href').toString();
if (attrValue.indexOf('void') == -1) {
el.removeAttribute('data-js-href');
var elClone = el.cloneNode(true);
el.parentNode.replaceChild(elClone, el);
}
}
}
for (var i = 0; i < elementsHero.length; i++) {
var elHero = elementsHero[i];
if (elHero.getAttribute('data-js-href') != null) {
var attrValueH = elHero.getAttribute('data-js-href').toString();
if (attrValueH.indexOf('void') == -1) {
elHero.removeAttribute('data-js-href');
var elCloneH = elHero.cloneNode(true);
elHero.parentNode.replaceChild(elCloneH, elHero);
}
}
}
}, 2000);
var mosaicLength = $(".devices-mosaic").length;
if (mosaicLength != 0) {
var mosaicAnimation = gsap.timeline({
scrollTrigger: {
trigger: ".devices-mosaic",
start: "top center",
end: "bottom top",
scrub: 1
}
});
mosaicAnimation.fromTo(".mosaic_firstleft_img_main picture img", { y: -70, ease: "none" }, { y: 70, ease: "none" });
}
var navURL = window.location.href.toLowerCase();
if ((navURL.indexOf('/features') != -1 || navURL.indexOf('/tips-and-tricks') != -1 || navURL.indexOf('/getting-started') != -1) && navURL.indexOf('?') != -1) {
$("#all-tips .tipsTricks-filters-section").each(function () {
var hashValue = window.location.href.toLowerCase().split('?')[1];
if (navURL.indexOf('ocid') != -1) {
var ocidVariationparam = GetQueryStringParams_upgrade("ocid").toLowerCase();
}
let filterParam = [];
if (hashValue.includes("%2c")) {
hashValue = hashValue.replaceAll("%2c", ",");
}
if (hashValue.includes("#")) {
hashValue = hashValue.split('#')[0];
}
if (hashValue.includes("&")) {
hashValue = hashValue.split('&')[0];
}
filterParam[0] = hashValue.split('=')[1];
let cnt = 0;
if (filterParam[0].includes(",")) {
filterParam = filterParam[0].split(",");
}
let filterView = document.querySelectorAll(".tipstricks-filter");
var featuresheroreplaceocidheroh1 = $('.features .ocid_hero h1');
var featuresheroreplaceocidbannerh1 = $('.features .ocid_banner h1');
$('.featured-single-card.Productivity_ocid').addClass('hide');
for (j = 0; j < filterParam.length; j++) {
for (i = 0; i < filterView.length; i++) {
if (filterView[i].getAttribute('url-name').toLowerCase() == filterParam[j].toLowerCase()) {
if (cnt == filterParam.length - 1) {
cnt += 1;
}
else {
filterView[i].className += " clicked-btn";
filterView[i].ariaPressed = true;
cnt += 1;
}
}
if (cnt == filterParam.length) {
filterView[i].click();
}
}
if (window.location.href.toLowerCase().indexOf("ocid") != -1) {
if (window.location.href.toLowerCase().indexOf('shortcuts') != -1 && ocidVariationparam.indexOf("aidcmm3sfiorvc") == 0 && currentLocale.toLowerCase() == "en-us") {
$(".ocid_banner").addClass('hide');
$(".ocid_hero").removeClass('hide');
$(featuresheroreplaceocidbannerh1).replaceWith($('' + featuresheroreplaceocidbannerh1.html() + '
'));
}
if (window.location.href.toLowerCase().indexOf('productivity') != -1 && ocidVariationparam.indexOf("prod_growthcenter_cons_cge_eng_spotlight_lockscreenw11_virtualdesktops") == 0 && currentLocale.toLowerCase() == "en-us") {
$('.featured-single-card.Productivity_ocid').removeClass('hide');
}
}
}
});
}
if ((navURL.indexOf('/features') != -1 || navURL.indexOf('/tips-and-tricks') != -1 || navURL.indexOf('/getting-started') != -1) && navURL.indexOf('#') != -1) {
var hashValue = window.location.hash.toLowerCase();
if (hashValue != "") {
$("#all-tips .featured-single-card").each(function () {
var thisAnchorHash = $(this).find("div.c-group").find("a").attr("href").toLowerCase();
if (thisAnchorHash == hashValue) {
$(this).find("div.c-group").find("a").trigger("click");
}
});
}
}
else if (navURL.indexOf('/comprehensive-security') != -1 && navURL.indexOf('#') != -1) {
var hashValue = window.location.hash.toLowerCase();
if (hashValue != "") {
$(".m-feature .featurecontent").each(function () {
var thisAnchorHash = $(this).find("div.c-group").find("a").attr("href").toLowerCase();
if (thisAnchorHash == hashValue) {
$(this).find("div.c-group").find("a").trigger("click");
}
});
}
}
if (window.matchMedia("(prefers-reduced-motion)").matches == true) {
var upgradeWithVideo = $(".upgraded-width video")[0];
}
$('#default-lightbox .nav-buttons').on("click", function (e) {
if ($(e.target).hasClass("nav-buttons") && jQuery(".c-dialog").attr("aria-hidden") == "false") {
$(".c-dialog button[data-js-dialog-hide]").click();
}
});
var userOS; // will either be iOS, Android or unknown
var userOSver; // this is a string, use Number(userOSver) to convert
function getOS() {
var ua = navigator.userAgent;
var uaindex;
// determine OS
if (ua.match(/iPad/i) || ua.match(/iPod/i) || ua.match(/iPhone/i)) {
userOS = 'iOS';
uaindex = ua.indexOf('OS');
}
else if (ua.match(/Android/i)) {
userOS = 'Android';
uaindex = ua.indexOf('Android');
}
else {
userOS = 'unknown';
}
// determine version
if (userOS === 'iOS' && uaindex > -1) {
userOSver = ua.substr(uaindex + 3, 3).replace('_', '.');
}
else if (userOS === 'Android' && uaindex > -1) {
userOSver = ua.substr(uaindex + 8, 3);
}
else {
userOSver = 'unknown';
}
}
getOS();
if (userOS === 'iOS') {
setTimeout(function () {
$('.sync-across-your-devices .c-pivot li[aria-controls="PivotTarget1"]').trigger("click");
}, 500);
}
else if (userOS === 'Android') {
setTimeout(function () {
$('.sync-across-your-devices .c-pivot li[aria-controls="PivotTarget0"]').trigger("click");
}, 500);
}
else {
setTimeout(function () {
$('.sync-across-your-devices .c-pivot li[aria-controls="PivotTarget0"]').trigger("click");
}, 500);
}
if (window.location.href.toLowerCase().indexOf("/en-us/windows/sync-across-your-devices") != -1) { $('html, body').animate({ scrollTop: ($("#headerArea").offset().top) }, 500); $("#headerArea").focus(); }
primaryareaTop();
if(window.matchMedia("(max-width:539px)").matches) {
$(".wdg-support-links .c-link-navigation").hide();
$(".wdg-support-links #prefooterDrawer").attr("aria-expanded", "false");
}
}
});
document.addEventListener("visibilitychange", function () {
if (document.hidden) {
} else {
$(".play-on-focus").each(function () {
if (isPanelInViewport(this, 500) && (window.matchMedia("(prefers-reduced-motion)").matches == false && $("#inputToggle").is(':checked') == true)) {
if ($(this).hasClass("video-played") && window.location.href.toLowerCase().indexOf("/windows/windows-11") != -1) {
$(this).find("button").addClass("glyph-pause").removeClass("glyph-play");
}
}
});
}
});
var rownamesappending = function () {
//Arranging class names in row wise for higher viewport
$("div[class*='tout-row-large-'].content-touts").removeClass(function (index, css) {
return (css.match(/(^|\s)tout-row-large-\S+/g) || []).join(' ');
});
if ($(".shopmain").length > 0) {
$articletouts = $(".shopmain .m-content-placement .content-touts:not(.hide-articles)");
var $articleswithouthide = $(".shopmain .m-content-placement .content-touts");
} else {
$articletouts = $(".articlesmain .m-content-placement .content-touts:not(.hide-articles)");
var $articleswithouthide = $(".articlesmain .m-content-placement .content-touts");
}
deskcount = $articletouts.length;
var toutsdivision = 3;
var toutsrowvalue = $articleswithouthide.attr("data-grid") !== undefined ? $articleswithouthide.attr("data-grid") : "col-4";
if (toutsrowvalue.indexOf("col-3") > -1) { toutsdivision = 4; } else if (toutsrowvalue.indexOf("col-4") > -1) { toutsdivision = 3; } else if (toutsrowvalue.indexOf("col-6") > -1) { toutsdivision = 2; } else { toutsdivision = 3; }
var dcount = 0;
for (var index = 0; index < deskcount; index++) {
if (index % toutsdivision === 0) {
dcount = dcount + 1;
}
$articletouts.eq(index).addClass("tout-row-large-" + dcount);
}
deskcount = dcount;
}
function toutsminheightcalc() {
if (window.matchMedia('(min-width: 768px)').matches) {
setTimeout(function () {
$articletouts.css("min-height", "").find(".c-heading,p,.toutpara").css("min-height", "");
if ($(".shopmain").length > 0) {
var articlerowclass = ".shopmain .m-content-placement .content-touts.tout-row-large-";
} else {
var articlerowclass = ".articlesmain .m-content-placement .content-touts.tout-row-large-";
}
for (var i = 0; i < deskcount; i++) {
var head = articlerowclass + (i + 1) + " .toutheading";
var para = articlerowclass + (i + 1) + " .toutpara";
var cta = articlerowclass + (i + 1) + " .c-group";
var toutsrow = articlerowclass + (i + 1);
setofferrowheight(head, para, cta, toutsrow);
}
});
} else {
setTimeout(function () {
$articletouts.css("min-height", "").find(".c-heading,p,.toutpara").css("min-height", "");
})
}
}
//Setting min-height for each column in multioffer popup
function setofferrowheight(heading, para, cta, toutsrow) {
if ($(heading) != undefined && $(heading).maxHeight() != undefined) {
var pheight = $(heading).maxHeight().outerHeight();
$(heading).css("min-height", pheight);
}
if ($(para) != undefined && $(para).maxHeight() != undefined) {
var hheight = $(para).maxHeight().outerHeight();
$(para).css("min-height", hheight);
}
if ($(cta) != undefined && $(cta).maxHeight() != undefined) {
var hheight = $(cta).maxHeight().outerHeight();
$(cta).css("min-height", hheight);
}
setTimeout(function () {
if ($(toutsrow) != undefined && $(toutsrow).maxHeight() != undefined) {
var offerrowheight = $(toutsrow).maxHeight().outerHeight(true);
$(toutsrow).css("min-height", offerrowheight);
}
}, 1000);
}
/**plugin/function for setting/getting max height for elements in list**/
$.fn.maxHeight = function () {
if (arguments.length === 1) {
var param = arguments[0];
$(this).each(function () {
$(this).css('max-height', param + 'px');
})
}
else if (arguments.length === 0) {
var highest = null; //var to keep highest height element
var hi = 0; //var to keep height
$(this).each(function () {
var h = $(this).innerHeight();
if (h >= hi) {
hi = h;
highest = $(this);
}
});
return highest; //returns element with highest height from list
}
else {
console.log("error:please give appropriate parameters");
}
}
function changeSupToAnchor() {
try {
var getInnerTxt = "";
var convertedHtml = "";
var supItemsArray = [];
$('sup:not(.no-link)').each(function () {
getInnerTxt = $(this).text();
getInnerTxt = getInnerTxt.replace('*(', '');
getInnerTxt = getInnerTxt.replace(')', '');
supItemsArray = getInnerTxt.split(', ');
for (var itr = 0; itr < supItemsArray.length; itr++) {
convertedHtml += "" +
"" + supItemsArray[itr] + "" + ", ";
}
$(this).html(convertedHtml);
convertedHtml = "";
});
$('sup').find('span:last').remove();
}
catch (e) {
console.log(e);
}
};
function noSuperScript() {
try {
var scriptPageURL = window.location.href;
var panelSuperScripts = [];
var tooltipSuperScripts = [];
$('sup .supText:visible').not('.article-section-footnotes .c-caption-2 sup').each(function () {
var textSuperScript = $(this).text().trim();
panelSuperScripts.push(textSuperScript);
});
panelSuperScripts = $.unique(panelSuperScripts);
$('.c-tooltip sup').each(function () {
var textSuperScript = $(this).text().trim();
tooltipSuperScripts.push(textSuperScript);
});
tooltipSuperScripts = $.unique(tooltipSuperScripts);
if (panelSuperScripts.length == 0) {
$('.article-section-footnotes').addClass('hide');
} else {
if ($('.article-section-footnotes').hasClass('hide')) {
setTimeout(function () {
$('.article-section-footnotes').removeClass('hide');
}, 2000)
}
}
$('.article-section-footnotes .c-caption-2').each(function () {
var footnoteScript = $(this).find('.supLink .supFn').text().trim();
if ($.inArray(footnoteScript, panelSuperScripts) == -1) {
$(this).addClass('hide');
} else {
if ($(this).hasClass('hide')) {
$(this).removeClass('hide');
}
}
if ($(this).hasClass('context-glyph-tile')) {
$(this).removeClass('hide');
}
});
}
catch (e) {
console.log(e);
}
};
$(document).on('click', '.supBLink', function (e) {
try {
e.preventDefault();
$('.c-caption-2').blur();
var innerContent = $(this).find('.supText').html();
if ($('.lastClicked').length > 0) {
$('.lastClicked').removeClass('lastClicked');
}
$(this).addClass('lastClicked');
var referencedFnSup = "";
$('.supFn').each(function () {
if ($(this).text() === innerContent) {
referencedFnSup = $(this);
referencedFnSup.parent().parent().attr('tabindex', '0');
referencedFnSup.parent().parent().trigger("focus");
referencedFnSup.parent().parent().attr('tabindex', '-1');
}
});
}
catch (e) {
console.log(e);
}
});
/*click and keypress functionality of footnotes*/
$(document).on('click', '.supLink', function (e) {
try {
e.preventDefault();
var lastClickedSup = $('.lastClicked');
var innerContent = $(this).find('.supFn').html();
var referencedBdSup = "";
if (innerContent == $('.lastClicked .supText').html()) {
lastClickedSup.trigger("focus");
lastClickedSup.removeClass('lastClicked');
}
else {
$('sup .supText').each(function () {
if (innerContent === $(this).html()) {
referencedBdSup = $(this);
referencedBdSup.parent().trigger("focus");
// return false;
}
});
}
}
catch (e) {
console.log(e);
}
});
function ManageConsentChanges() {
siteConsent.manageConsent();
}
window.getCookie = function (name) {
var match = document.cookie.match(new RegExp('(^| )' + name + '=([^;]+)'));
if (match) return match[2];
}
function GetCategoryFromMSCC(msccvalue) {
var mscc = msccvalue;
if (msccvalue.match("^cid")) {
var startIndex = msccvalue.indexOf("c1=");
mscc = msccvalue.substring(startIndex, msccvalue.length);
}
if (msccvalue.match("^c1")) {
var endIndex = msccvalue.indexOf("-cid");
mscc = msccvalue.substring(0, endIndex);
}
return mscc
}
$("#c-uhff-footer_managecookies").on("click", function (e) {
e.preventDefault();
ManageConsentChanges();
});
function ShowHideManageCookies(managecookielabel) {
if (typeof siteConsent != "undefined" && siteConsent.isConsentRequired) {
if ($("#c-uhff-footer_managecookies").length > 0) {
$("#c-uhff-footer_managecookies").removeClass("x-hidden");
}
else {
var li = '';
$(".c-uhff-base .c-list.f-bare li:eq(1)").after(li);
$(document).on("click", "#c-uhff-footer_managecookies", function (e) {
e.preventDefault();
ManageConsentChanges();
});
}
}
}
function handlingPageNation() {
var pagenLength = $(".m-pagination li.x-page").length;
if (pagenLength == 1) {
$(".pagination-bottom").css("visibility", "hidden");
$(".sortSection, .sortdivider").addClass('hide');
} else {
$(".pagination-bottom").css("visibility", "visible");
$(".sortSection, .sortdivider").removeClass('hide');
}
var pageNumber = $(".m-pagination .x-page.f-active").text();
if (pageNumber == pagenLength) {
$(".m-pagination li a.next").css("visibility", "hidden");
} else {
$(".m-pagination li a.next").css("visibility", "visible");
}
if (pageNumber > 1) {
$(".m-pagination li a.preview").css("visibility", "visible");
} else {
$(".m-pagination li a.preview").css("visibility", "hidden");
}
}
var handlingResultsCountInBanner = function () {
var pagenumber = $('.f-active').text();
var count = (pagenumber * 12) - 11;
var totalArticles = $(".content-touts.filtered").length != 0 ? $(".content-touts.filtered").length : $(".content-touts").length;
var tono = pagenumber * 12 < totalArticles ? pagenumber * 12 : totalArticles;
$("#resultsCount").html('Results ' + count + '-' + ' ' + tono + '' + ' of ' + '' + totalArticles + '' + ' ');
}
$(document).ready(function () {
currentStickyNav();
var paginationAriaLabelChange = function () {
/*var originalText = $(".m-pagination").find("li.f-active a").attr("aria-label");
$(".m-pagination li.f-active a").attr("aria-label", originalText + " selected");*/
$(".m-pagination li").each(function () {
var thisLi = $(this);
var originalText = $(this).text();
if (thisLi.hasClass("f-active")) {
thisLi.find("a").attr("aria-label", "Page " + originalText + " selected");
} else {
thisLi.find("a").attr("aria-label", "Page " + originalText);
}
});
}
setTimeout(function () {
$(".mostpopular a").addClass("popularFilter").removeClass("recentFilter");
var $sorted_items;
$sorted_items = getSorted(".articlesmain .content-touts:not(.hide)", "data-popular").clone();
$(".articlesmain .content-touts:not(.hide)").remove();
$('.articlesmain .m-content-placement [data-grid="col-12 stack-2"]').append($sorted_items);
$(".articlesmain .m-content-placement").closest("[data-grid=container]").append('')
var pageSize = 12;
pagenationReset = function (isFiltered) {
var pageCount;
var pageNumber = $(".m-pagination li.f-active").text() === "" ? parseInt("1") : parseInt($(".m-pagination li.f-active").text());
if (isFiltered === false) {
pageCount = $(".content-touts").length / pageSize;
$(".m-pagination").empty();
} else {
pageCount = $(".content-touts.filtered").length / pageSize;
$(".m-pagination").empty();
}
for (var i = 0; i < pageCount; i++) {
$(".m-pagination").append('' + (i + 1) + ' ');
}
var paginationLiLength = $(".m-pagination").children('li').length;
if ($(".m-pagination").children('li').eq(pageNumber - 1).length !== 0) {
$(".m-pagination").children('li').eq(pageNumber - 1).addClass("f-active");
$(".m-pagination").prepend('Previous');
$(".m-pagination").append('Next');
} else {
$(".m-pagination").children('li').eq(paginationLiLength - 1).addClass("f-active").click();
}
}
pagenationReset(false);
showPage = function (page, isFiltered) {
if (isFiltered === false) {
//$(".content-touts").addClass('hide-articles');
$(".content-touts").each(function (n) {
if (n >= pageSize * (page - 1) && n < pageSize * page) {
$(this).removeClass('hide-articles');
}
});
pagenationReset(false);
} else {
var pageCountFiltered = $(".content-touts.filtered").length / pageSize;
if (parseInt(Math.ceil(pageCountFiltered)) !== 1) {
$(".content-touts.filtered").addClass("hide-articles");
$(".content-touts.filtered").each(function (n) {
if (n >= pageSize * (page - 1) && n < pageSize * page) {
$(this).removeClass('hide-articles');
}
});
pagenationReset(true);
} else {
$(".content-touts.filtered.hide-articles").removeClass('hide-articles');
pagenationReset(true);
}
}
}
showPage(1, false);
$(document).on("click", ".m-pagination li a.preview", function (e) {
e.preventDefault();
var n = parseInt($(".m-pagination li.x-page.f-active").text()) - 1;
n > 0 && $(".m-pagination li.x-page").eq(n - 1).trigger("click");
handlingPageNation()
});
$(document).on("click", ".m-pagination li a.next", function (e) {
e.preventDefault();
var n = parseInt($(".m-pagination li.x-page.f-active").text()) - 1;
n < $(".m-pagination li.x-page").length - 1 && $(".m-pagination li.x-page").eq(n + 1).trigger("click");
handlingPageNation();
});
handlingPageNation();
$(document).on("click", ".m-pagination li.x-page", function () {
handlingPageNation()
$(".m-pagination li.x-page").removeClass("f-active");
var isInputChecked = $("#dropdownArea button[aria-pressed=true]").length;
$(this).addClass("f-active");
handlingResultsCountInBanner()
if (isInputChecked === 0) {
showPage(parseInt($(this).text()), false);
} else {
showPage(parseInt($(this).text()), true);
}
handlingPageNation();
$(".sortSection .recentFilter, .sortSection .popularFilter").focus();
rownamesappending();
toutsminheightcalc();
paginationAriaLabelChange();
});
handlingFilter();
paginationAriaLabelChange();
}, 1000);
$('.featured-single-card.Productivity_ocid').addClass('hide');
$(document).on("click", ".play-on-focus button.glyph-pause", function () {
if ($(".switch #inputToggle").is(':checked')) {
$(".switch #inputToggle").trigger("click");
}
});
});
var headingEle = $('.popularAtrcles h2');
var popularArticlesText = headingEle.attr("data-popular-articles");
var popularResourcesText = headingEle.attr("data-popular-resources");
var popularArticlesResourcesText = headingEle.attr("data-popular-all");
var recentArticlesText = headingEle.attr("data-recent-articles");
var recentResourcesText = headingEle.attr("data-recent-resources");
var recentArticlesResourcesText = headingEle.attr("data-recent-all");
var handlingHeadingForPopularRecent = function (filterWith) {
var thisPageURL = window.location.href.toLowerCase();
var thisArticleHeadingIs = thisPageURL.indexOf("type=resources") != -1 ? "resources" : thisPageURL.indexOf("type=articles") != -1 ? "articles" : "all";
if (filterWith == "data-popular") {
if (thisArticleHeadingIs == "resources") {
headingEle.text(popularResourcesText);
}
if (thisArticleHeadingIs == "articles") {
headingEle.text(popularArticlesText);
}
if (thisArticleHeadingIs == "all") {
headingEle.text(popularArticlesResourcesText);
}
}
if (filterWith == "data-recent") {
if (thisArticleHeadingIs == "resources") {
headingEle.text(recentResourcesText);
}
if (thisArticleHeadingIs == "articles") {
headingEle.text(recentArticlesText);
}
if (thisArticleHeadingIs == "all") {
headingEle.text(recentArticlesResourcesText);
}
}
}
handlingHeadingForPopularRecent("data-popular");
var handlingMostPopularMostRecent = function (filterWith) {
var $sorted_items;
//var hideArticlesLength = $(".content-touts.hide-articles").length;
var filteredArticlesLength = $(".content-touts.filtered").length;
if (filteredArticlesLength != 0) {
$sorted_items = getSorted(".content-touts.filtered", filterWith).clone();
$(".content-touts.filtered").remove();
$('.m-content-placement [data-grid="col-12 stack-2"]').append($sorted_items);
showPage(parseInt($(".m-pagination li.f-active").text()), true);
}
if (filteredArticlesLength == 0) {
$sorted_items = getSorted(".content-touts", filterWith).clone();
$(".content-touts").remove();
$('.m-content-placement [data-grid="col-12 stack-2"]').append($sorted_items);
showPage(parseInt($(".m-pagination li.f-active").text()), false);
}
handlingHeadingForPopularRecent(filterWith);
$("ul.m-pagination li.x-page").eq(0).trigger("click");
rownamesappending();
toutsminheightcalc();
triggeringContentPlacementClick();
}
$(document).on("click", ".mostpopular", function () {
$(".mostpopular a").addClass("popularFilter");
$(".mostrecent a").removeClass("recentFilter");
handlingMostPopularMostRecent("data-popular");
})
$(document).on("click", ".mostrecent", function () {
$(".mostrecent a").addClass("recentFilter");
$(".mostpopular a").removeClass("popularFilter");
handlingMostPopularMostRecent("data-recent");
})
/* Filtering Articles */
function handlingFilter() {
/* Render Articles based on selected checkbox */
$(document).on("click", "#dropdownArea button", function (e) {
e.preventDefault();
var _this = $(this);
if (_this.attr("aria-pressed") == "false") {
_this.attr("aria-pressed", "true");
_this.attr("aria-label", _this.attr("data-js-unselected-text"));
} else {
_this.attr("aria-pressed", "false")
_this.attr("aria-label", _this.attr("data-js-selected-text"));
}
var mySelections = [];
//$('.showall').hide();
var filterboxesLength = $("#dropdownArea button[aria-pressed=true]").length;
if (filterboxesLength > 0) {
$(".clearallArticles").css('display', 'block');
} else {
$(".clearallArticles").css('display', 'none');
}
$("#dropdownArea button[aria-pressed=true]").each(function () {
var selectedValue = $(this).attr('data-filter');
mySelections.push(selectedValue);
});
var thisPageURL = window.location.href.toLowerCase();
var thisArticleIs = thisPageURL.indexOf("type=resources") != -1 ? ".content-touts.resources-article" : thisPageURL.indexOf("type=articles") != -1 ? ".content-touts.normal-article" : ".content-touts";
$(".content-touts").removeClass('filtered hide-articles');
$(mySelections).each(function (key, thisValue) {
$(".content-touts").each(function () {
var compare_option = $(this).attr('data-filter');
if (compare_option.indexOf(thisValue) == -1) {
if (!$(this).hasClass('filtered')) {
$(this).addClass('hide-articles');
}
} else {
$(this).removeClass('hide-articles');
$(this).addClass('filtered');
}
});
});
handlingResultsCountInBanner();
inputChecked();
handlingPageNation();
if (mySelections.length == 0) {
$('.mostpopular a').trigger("click");
}
rownamesappending();
toutsminheightcalc();
});
handlingResultsCountInBanner();
triggeringContentPlacementClick();
}
function inputChecked() {
var isInputChecked = $("#dropdownArea button[aria-pressed=true]").length;
if (isInputChecked === 0) {
showPage(parseInt($(".m-pagination li.f-active").text()), false);
} else {
showPage(parseInt($(".m-pagination li.f-active").text()), true);
}
}
$('.c-navigation-menu button').on('click', function () {
setTimeout(function () {
var $firstCheckbox = $("#dropdownArea button").addClass('first');
$firstCheckbox.focus();
}, 50);
});
$(document).on("click", ".clearallArticles a", function () {
var clickedButton = $("#dropdownArea button[aria-pressed=true]");
$(clickedButton).each(function () {
$(this).trigger('click');
});
$(".mostpopular a").addClass("popularFilter");
$(".mostrecent a").removeClass("recentFilter");
var thisURL = window.location.href.toLowerCase();
if (thisURL.indexOf("articles") != -1 && (thisURL.indexOf("type=") != -1 || thisURL.indexOf("category=") != -1 || thisURL.indexOf("sort=") != -1)) {
DynamicFilteringForArticles();
}
setTimeout(function () {
if ($("#dropdownArea button[aria-pressed=true]").length == 0) {
$(".clearallArticles").css('display', 'none');
} else {
$(".clearallArticles").css('display', 'block');
};
if (window.location.href.toLowerCase().indexOf('type=') != -1) {
if ($("#dropdownArea button[aria-pressed=true]").length == 1) {
$(".clearallArticles").css('display', 'none');
} else {
$(".clearallArticles").css('display', 'block');
};
}
}, 1000)
$(".mostpopular a").trigger("click");
rownamesappending();
toutsminheightcalc();
triggeringContentPlacementClick();
})
var getSorted = function (selector, attrName) {
if (attrName == "data-recent") {
return $(
$(selector).toArray().sort(function (a, b) {
var aVal = (a.getAttribute(attrName)),
bVal = (b.getAttribute(attrName));
return bVal - aVal;
})
);
}
if (attrName == "data-popular") {
return $(
$(selector).toArray().sort(function (a, b) {
var aVal = (a.getAttribute(attrName)),
bVal = (b.getAttribute(attrName));
return bVal - aVal;
}).reverse()
);
}
};
/* Redesign most popular, most recent */
// $(document).on("click", "#filteredDropdownArea-generated-select-menu-1 span", function () {
// var $filterSorted;
// $filterSorted = getSorted(".dropdown-filter-articles .image-priority-accolate", "data-recent");
// $(".dropdown-filter-articles .image-priority-accolate").remove();
// $filterSorted.insertBefore('.dropdown-filter-articles #category-loadmore-articles')
// });
// $(document).on("click", "#filteredDropdownArea-generated-select-menu-0 span", function () {
// var $filterSorted;
// $filterSorted = getSorted(".dropdown-filter-articles .image-priority-accolate", "data-popular");
// $(".dropdown-filter-articles .image-priority-accolate").remove();
// $filterSorted.insertBefore('.dropdown-filter-articles #category-loadmore-articles')
//
// });
// setTimeout(function () {
// $("#filteredDropdownArea-generated-select-menu-0 span").trigger('click');
// }, 1500);
$(document).ready(function () {
$("nav.c-in-page-navigation ul li a").attr('aria-current', 'false');
$("nav.c-in-page-navigation ul li a.f-active").attr('aria-current', 'page');
/* Accessibility fix for 136278*/
$("#category-loadmore-articles .c-group").find("a.c-call-to-action").attr('role', 'button');
/* Accessibility fix for 136127*/
$(".category-link-navigation nav ul li.active a").attr('aria-current', 'page');
/* Accessibility fix for 136282*/
$(".category-link-navigation nav ul li a.c-hyperlink picture div").removeAttr('role', 'link');
/* Accessibility fix for 130910*/
$("#retailers nav ul li a.c-hyperlink picture div").removeAttr('role', 'link');
$("#windowsh22.get-windows-11 .retailers nav ul li a.c-hyperlink picture div").removeAttr('role', 'link');
if($("#retailers .m-banner h2 sup").length > 0) {
$("#retailers > div").append("" + ($('#retailers h2 sup:first-child').clone()).html() + "" + ($('#retailers h2 sup:last-child').clone()).html() + "");
$("#retailers h2 sup").remove();
}
if ($("#performancecards .card-with-sup div.m-right-item h4 sup").length > 0) {
$("#performancecards .card-with-sup div.m-right-item").prepend($('#performancecards .card-with-sup div.m-right-item > h4')[0].outerHTML + "" + ($('#performancecards .card-with-sup div.m-right-item h4 sup').clone()).html() + ""); $("#performancecards .card-with-sup div.m-right-item > h4 + span + h4").remove();
$("#performancecards .card-with-sup div.m-right-item > h4 sup").remove();
}
// $("#windowsh22.get-windows-11 #retailers > div").append("" + ($('#retailers h2 sup:first-child').clone()).html() + "" + ($('#retailers h2 sup:last-child').clone()).html() + "");
// $("#windowsh22.get-windows-11 #retailers h2 sup").remove();
$(".wdg-support-links nav ul li a.c-hyperlink picture div").removeAttr('role', 'link');
/* Accessibility fix for 135993*/
/* Accessibility fix for 154951*/
$(".compare-edition-tables.c-table tbody tr td:first-child").each(function () {
$(this).replaceWith('' + $(this).html() + ' | ');
});
/* Accessibility fix for 154951*/
$('.feature-products-content h4').replaceWith(function () {
return '' + $(this).text() + '
';
});
var featuresheroreplaceocidheroh1 = $('.features .ocid_hero h1');
if ((window.location.href.toLowerCase().indexOf("/features") != -1 || window.location.href.toLowerCase().indexOf("/tips-and-tricks") != -1) && window.location.href.toLowerCase().indexOf("shortcuts") == -1) {
$(featuresheroreplaceocidheroh1).replaceWith($('' + featuresheroreplaceocidheroh1.html() + '
'));
}
/* Accessibility fix for 136171
$("#primaryArea").attr({ 'data-bi-area':'body', 'tabindex':'-1'});
setTimeout(function () {
$("#primaryArea main").removeAttr('data-bi-area');
}, 1000);
*/
/*
$(".hero-item-copy-animation .video-parallax-copy > div > div").hide();
var _delayCopy = $(".hero-item-copy-animation").find(".video-parallax-copy > div > div");
if ($(".hero-item-copy-animation").hasClass("fadeIn")) {
setTimeout(function () {
_delayCopy.fadeIn(700);
}, 5000);
}
*/
if (($(".hero-item-copy-animation").length != 0) && window.matchMedia("(prefers-reduced-motion)").matches == false) {
let videoTextElement = $(".hero-item-copy-animation .video-parallax-copy > div > div")
videoTextElement.hide();
var heroVideo = $(".hero-item-copy-animation").find("video")[0];
heroVideo.addEventListener('ended', function () {
videoTextElement.fadeIn("slow");
});
}
function showHomeSticky() {
$(window).scroll(function () {
var stickyStart = $('.home-stickynav')
if ($(window).scrollTop() >= stickyStart.offset().top) {
stickyStart.css({ "opacity": "1", "display": "block" });
}
if ($(window).scrollTop() < stickyStart.offset().top) {
stickyStart.css({ "opacity": "0", "display": "none" });
}
});
}
if ($('.sticky-in-page-nav').hasClass('home-stickynav')) {
showHomeSticky();
};
/* SAYD */
$('#ios-faq-panel .c-drawer').each(function (index) {
var drawerID = $(this).attr('id');
var drawerpanelID = $(this).find('.c-drawer-panel').attr('id');
var ariaControlID = $(this).find('button').attr('aria-controls');
$(this).attr('id', 'iOS' + drawerID);
$(this).find('.c-drawer-panel').attr('id', 'iOS' + drawerpanelID);
$(this).find('button').attr('aria-controls', 'iOS' + ariaControlID);
});
$('.sync-across-your-devices #PivotTarget1 .disclaimer li.c-caption-2').each(function (index) {
var drawerID = $(this).find('a.supLink').attr("id");
$(this).find('a.supLink').attr('id', 'iOS' + drawerID);
});
$('.sync-across-your-devices #iOS-numberlist-banner').parent().addClass('numberbanner-gradient');
$('.sync-across-your-devices .SAYD-contentplacement').parent().addClass('numbercontentplacement-gradient');
$('.sync-across-your-devices #android-numberlist-banner').parent().addClass('numberbanner-gradient');
$('.sync-across-your-devices #iOS-phonelink-banner').parent().addClass('phonelinkbanner');
$('.sync-across-your-devices .SAYD-contentplacement').parent().addClass('number-contentplacement');
$('.sync-across-your-devices #SAYDContentPlacemet.m-content-placement.crossCards').parent().addClass('SAYD_crosscard');
/* Cateogry page LoadMore for most popular, most recent */
loadmoreArticlesLength = $(".article-category .dropdown-filter-articles .featurebox").length;
x = 5;
$('.article-category .dropdown-filter-articles .featurebox .accolate-section:lt(' + x + ')').removeClass('hide-articles');
$('.article-category #category-loadmore-articles a').click(function () {
x = (x + 5 <= loadmoreArticlesLength) ? x + 5 : loadmoreArticlesLength;
$('.article-category .dropdown-filter-articles .featurebox .accolate-section:lt(' + x + ')').removeClass('hide-articles');
//$('.article-category #category-loadless-articles').show();
if (x == loadmoreArticlesLength) {
$('.article-category #category-loadmore-articles').hide();
}
});
//$('.article-category #category-loadless-articles a').click(function () {
// x = (x - 5 < 0) ? 3 : x - 5;
// $('.article-category .dropdown-filter-articles .featurebox .accolate-section').not(':lt(' + x + ')').addClass('hide-articles');
// $('.article-category #category-loadmore-articles').show();
// $('.article-category #category-loadless-articles').show();
// if (x == 5) {
// $('.article-category #category-loadless-articles').hide();
// }
//});
/*Home page LoadMore for most popular*/
loadmoreHomeArticlesLength = $(".remote-resource-center #rrc-home-articles .content-touts").length;
var y = 9;
$('.remote-resource-center #rrc-home-articles .content-touts').addClass('hide');
$('.remote-resource-center #rrc-home-articles .content-touts:lt(' + y + ')').removeClass('hide');
$('.remote-resource-center #category-loadmore-articles a').click(function () {
y = (y + 9 <= loadmoreHomeArticlesLength) ? y + 9 : loadmoreHomeArticlesLength;
$('.remote-resource-center #rrc-home-articles .content-touts:lt(' + y + ')').removeClass('hide').removeClass('hide-articles');
if (y == loadmoreHomeArticlesLength) {
$('.remote-resource-center #category-loadmore-articles').hide();
}
});
/* ImageDialog */
/* $(document).on('click', '.image-dialog', function () {
var lightBox = $("#default-lightbox");
lightBox.find(".c-video-player").addClass("hide");
lightBox.find(".c-video-player").next('img').remove();
var thisOuterHTML = $(this).find('img').attr('data-src');
lightBox.find("div[role='document']").append('
');
lightBox.attr("aria-hidden", false);
$('body').addClass('removeoverflow');
}); /*
/* postcard OCID */
var postcardOCID = window.location.search.toLowerCase().indexOf('postcard');
if (postcardOCID != -1) {
$(".ocid-postcard").removeClass("hide");
$(".mixed-article").addClass("hide");
} else {
$(".ocid-postcard").addClass("hide");
$(".mixed-article").removeClass("hide");
}
if (window.location.href.toLowerCase().indexOf("organize-digital-declutter") != -1) {
ocidparam = GetQueryStringParams_upgrade("ocid");
if (ocidparam == 'fy22_mar_xstory_inp_spot_1_declutter_post' || ocidparam == 'fy22_mar_xstory_inp_spot_2_declutter_post' || ocidparam == 'fy22_mar_xstory_inp_spot_3_declutter_post' || ocidparam == 'fy22_mar_xstory_inp_start_declutter_post' || ocidparam == 'fy22_mar_xstory_inp_mini_declutter_post') {
$(".ocid-postcard").removeClass("hide");
$(".mixed-article").addClass("hide");
} else if (ocidparam == 'fy22_mar_xstory_inp_spot_1_declutter_full' || ocidparam == 'fy22_mar_xstory_inp_spot_2_declutter_full' || ocidparam == 'fy22_mar_xstory_inp_spot_3_declutter_full' || ocidparam == 'fy22_mar_xstory_inp_start_declutter_full' || ocidparam == 'fy22_mar_xstory_inp_mini_declutter_full') {
$(".ocid-postcard").addClass("hide");
$(".mixed-article").removeClass("hide");
} else {
$(".ocid-postcard").addClass("hide");
$(".mixed-article").removeClass("hide");
}
}
/* New Article Readmore with OCID */
var articleOCID = window.location.search.toLowerCase().indexOf('readmore');
if (articleOCID != -1) {
$(".readmore-newarticle").removeClass("hide");
$("#left-container .readmoreshow").parents(".m-rich-content-block.articlerichcontent").nextAll().addClass("hide");
$("#sticky-share").addClass("hide");
$("#left-container").addClass("reduced-article");
var offsetArticleHeight = $(".readmoreshow").offset().top;
$(".reduced-article").css("height", offsetArticleHeight);
$("#right-container").addClass("morearticles-bg");
} else {
$(".readmore-newarticle").addClass("hide");
$("#left-container").removeClass("reduced-article");
$("#right-container").removeClass("morearticles-bg");
}
$(document).on('click', '.readmore-newarticle a', function () {
$("#left-container .readmoreshow").parents(".m-rich-content-block.articlerichcontent").nextAll().removeClass("hide");
$("#sticky-share").removeClass("hide");
$("#left-container").css("height", "initial");
$(".new-article #left-container").removeClass("reduced-article");
$(".readmore-newarticle").addClass("hide");
$("#right-container").removeClass("morearticles-bg");
});
$(".readmore-newarticle a").keydown(function (e) {
if (e.which == 13) {
e.preventDefault();
$(this).click();
$("#left-container .readmoreshow").parents(".m-rich-content-block.articlerichcontent").nextAll().find("a.c-hyperlink:first").eq(0).focus();
}
});
/* Tags page with OCID */
var showFiveArticlesTags = function () {
loadmoreTagsLength = $(".article-tags .tags-container .featurebox:not(.hide)").length;
var z = 5;
$('.article-tags .tags-container .featurebox:not(.hide) .m-feature:lt(' + z + ')').removeClass('hide-articles');
$('.article-tags #category-loadmore-articles a').click(function () {
z = (z + 5 <= loadmoreTagsLength) ? z + 5 : loadmoreTagsLength;
$('.article-tags .tags-container .featurebox:not(.hide) .m-feature:lt(' + z + ')').removeClass('hide-articles');
if (z == loadmoreTagsLength) {
$('.article-tags #category-loadmore-articles').hide();
}
});
if (z >= loadmoreTagsLength) {
$('.article-tags #category-loadmore-articles').hide();
}
}
var tagsParam = "";
var allTags = [];
$(".tags-container div[data-tags]").each(function () {
var tagVal = $(this).attr('data-tags').split(',');
tagVal.forEach(function (v, k) {
allTags.push(v.toLowerCase());
})
});
if (window.location.href.toLowerCase().indexOf("tag=") >= 0) {
tagsParam = GetQueryStringParams_upgrade("tag").toLowerCase();
if (tagsParam != "" && allTags.indexOf(tagsParam) != -1) {
$('#tag-banner span').text('"' + tagsParam + '"');
$(".tags-container div[data-tags]").each(function () {
var tagVal = $(this).attr('data-tags').toLowerCase();
if (tagVal.indexOf(tagsParam) == -1) {
$(this).addClass("hide");
}
});
} else {
$(".article-tags .tags-container .featurebox .m-feature").removeClass('hide-articles');
$('.article-tags .tags-container .featurebox:not(.hide) .m-feature:gt(4)').addClass('hide-articles');
}
}
/* load more tags */
showFiveArticlesTags();
/* Feature Products Full Bleed video popup*/
var $featureProductbox = $(".featured-products-bleed-area");
if ($featureProductbox.length > 0) {
var mFeatureProductPanel = $(".featured-products-bleed-area");
mFeatureProductPanel.each(function () {
var mFeatureAnchor = $(this).find(".c-call-to-action.c-glyph");
var mFeatureAnchorURL = $(mFeatureAnchor).attr("href");
var mFeatureVideosrc = $(mFeatureAnchor).attr("data-videosrc");
var mFeatureAnchorTarget = $(mFeatureAnchor).attr("target");
var mFeatureAnchorLength = $(mFeatureAnchor).length;
var mFeaturePanelImage = $(this).find("img");
if (mFeatureAnchorLength === 1 && mFeatureAnchorURL.toLowerCase().indexOf("javascript") === -1) {
$(mFeaturePanelImage).on("click", function () {
window.open(mFeatureAnchorURL, mFeatureAnchorTarget === '_blank' ? '_blank' : '_self')
})
} else if (mFeatureAnchorLength === 1 && mFeatureAnchor.hasClass("glyph-play") && mFeatureVideosrc.length > 0) {
$(mFeaturePanelImage).on("click", function () {
$(mFeatureAnchor).find("span").click();
})
}
});
}
if ($(".articlerichcontent.ol-numbers").attr("class") != undefined) {
var olClassName = $(".articlerichcontent.ol-numbers").attr("class").split(" ")[3];
var olStartNum = olClassName.split("-")[2];
if ($(".articlerichcontent").hasClass("ol-start-" + olStartNum)) {
$(".articlerichcontent.ol-numbers ol").attr("start", olStartNum)
}
}
});
/* check for ocid for get-organized-this-year */
$(document).ready(function () {
/* redirecting article url to new url */
var thisURLPathname = window.location.pathname;
if (thisURLPathname.toLowerCase().indexOf('/en-us/windows/remote-resource-center/tips-to-get-you-through-the-holidays') != -1) {
window.location.replace('http://approjects.co.za/?big=en-us/windows/remote-resource-center/top-organization-and-productivity-tips-to-be-happy');
}
if (thisURLPathname.toLowerCase().indexOf('/en-us/windows/remote-resource-center/smarter-online-holiday-shopping') != -1) {
window.location.replace('http://approjects.co.za/?big=en-us/windows/remote-resource-center/guide-to-smarter-and-safer-shopping-online');
}
/* getting-started page redirection
if(window.location.href.toLowerCase().indexOf("/getting-started") != -1) {
var gslocale = $("html").attr("lang");
var gsLocaleList = ["en-us", "de-de", "en-ca", "en-au", "fr-ca", "fr-fr", "ja-jp", "zh-cn", "en-gb"];
if (gsLocaleList.indexOf(gslocale) == -1) {
window.location.replace('http://approjects.co.za/?big=en-us/windows/getting-started');
}
}*/
/* computers page redirection */
var isGamingPage = window.location.href.toLowerCase().indexOf("/en-us/windows/windows-11-pc-gaming") != -1 ? true : false;
if (isGamingPage) {
$("#static-banner").removeClass("blue black").addClass("green")
}
if (window.location.href.toLowerCase().indexOf("get-organized-this-year") != -1) {
var currentOCID = window.location.search.toLowerCase().indexOf('inp_rmc_win');
if (currentOCID != -1) {
$(".with-ocid").removeClass("hide");
$(".without-ocid").remove();
} else {
$(".without-ocid").removeClass("hide");
$(".with-ocid").remove();
}
}
if (window.location.href.toLowerCase().indexOf("top-windows-widgets-to-know-about") != -1) {
ocidparam = GetQueryStringParams_upgrade("ocid");
if (ocidparam == 'fy22_oct_xstory_inp_spot_1_w10_widgets' || ocidparam == 'fy22_oct_xstory_inp_spot_2_w10_widgets') {
$(".without-spot1-ocid").remove();
$(".with-spot1-win11-ocid").remove();
$(".without-spot2-ocid").remove();
$(".with-spot2-win11-ocid").remove();
} else if (ocidparam == 'fy22_oct_xstory_inp_spot_1_w11_widgets' || ocidparam == 'fy22_oct_xstory_inp_spot_2_w11_widgets') {
$(".without-spot1-ocid").remove();
$(".with-spot1-win10-ocid").remove();
$(".without-spot2-ocid").remove();
$(".with-spot2-win10-ocid").remove();
} else {
$(".with-spot1-win10-ocid").remove();
$(".with-spot1-win11-ocid").remove();
$(".with-spot2-win10-ocid").remove();
$(".with-spot2-win11-ocid").remove();
}
}
if (window.location.href.toLowerCase().indexOf("windows-11-features-to-explore") != -1) {
ocidparam_1 = GetQueryStringParams_upgrade("ocid");
ocidparam_2 = GetQueryStringParams_upgrade("form");
if ((ocidparam_1 == 'fy22_jan_xstory_inp_spot_1_11things_w10' && ocidparam_2 == 'm402bi') || (ocidparam_1 == 'fy22_jan_xstory_inp_spot_2_11things_w10' && ocidparam_2 == 'm402bi')) {
$(".without-spot1-ocid").remove();
$(".with-spot1-win11-ocid").remove();
$(".without-spot2-ocid").remove();
$(".with-spot2-win11-ocid").remove();
} else if ((ocidparam_1 == 'fy22_jan_xstory_inp_spot_1_11things_w11' && ocidparam_2 == 'm402bi') || (ocidparam_1 == 'fy22_jan_xstory_inp_spot_2_11things_w11' && ocidparam_2 == 'm402bi')) {
$(".without-spot1-ocid").remove();
$(".with-spot1-win10-ocid").remove();
$(".without-spot2-ocid").remove();
$(".with-spot2-win10-ocid").remove();
} else {
$(".with-spot1-win10-ocid").remove();
$(".with-spot1-win11-ocid").remove();
$(".with-spot2-win10-ocid").remove();
$(".with-spot2-win11-ocid").remove();
}
}
if (window.location.href.toLowerCase().indexOf("compare-windows-11-home-vs-pro-versions") != -1) {
ocidparam = GetQueryStringParams_upgrade("tab");
if (ocidparam == "1") {
setTimeout(function () {
$('.c-pivot ul li').filter('[aria-controls="PivotTarget0"]').click();
$('html, body').animate({
scrollTop: ($(".c-pivot").offset().top)
}, 500);
}, 1000);
} else if (ocidparam == "2") {
setTimeout(function () {
setTimeout(function () {
$('.c-pivot ul li').filter('[aria-controls="PivotTarget1"]').click();
}, 800);
$('html, body').animate({
scrollTop: ($(".c-pivot").offset().top)
}, 500);
}, 1500);
}
}
if (window.location.href.toLowerCase().indexOf("get-windows-11") != -1) {
ocidparam = GetQueryStringParams_upgrade("tab");
if (ocidparam == "1") {
setTimeout(function () {
$('.c-pivot ul li').filter('[aria-controls="PivotTarget0"]').click();
$('html, body').animate({
scrollTop: ($(".c-pivot").offset().top)
}, 500);
}, 1000);
} else if (ocidparam == "2") {
setTimeout(function () {
setTimeout(function () {
$('.c-pivot ul li').filter('[aria-controls="PivotTarget1"]').click();
}, 800);
$('html, body').animate({
scrollTop: ($(".c-pivot").offset().top)
}, 500);
}, 1500);
}
}
/* var deepLinking = '';
var GetQueryStringParams_upgrade = function (sParam) {
var sPageURL = window.location.search.toLowerCase().substring(1);
var sURLVariables = sPageURL.split('&');
for (var i = 0; i < sURLVariables.length; i++) {
var sParameterName = sURLVariables[i].split('=');
if (sParameterName[0] == sParam) {
return sParameterName[1];
}
}
}
deepLinking = decodeURI(GetQueryStringParams_upgrade('ocid'));
if (deepLinking != "undefined" && deepLinking.toLowerCase() == "inp_omc_win") {
$(".with-ocid").removeClass("hide");
} else {
$(".without-ocid").removeClass("hide");
} */
var isAllowed = true;
jQuery(document).on('click keydown', '.c-drawer', function (event) {
if ((event.type == "keydown" && (event.keyCode == 13 || event.keyCode == 32)) || event.type == "click") {
try {
var thisDrawer = window.location.href.toLowerCase().indexOf("compare-windows-11-home-vs-pro-versions") != -1 ? $(this).closest('.compare-edition-tables.drawer-panel') : $(this).closest(".drawer-panel");
// var thisDrawer = $(this).closest(".drawer-panel");
var expanded = 0;
var closed = 0;
if (isAllowed) {
thisDrawer.find('.c-drawer').each(function (index, ele) {
if (jQuery(this).find('button').attr('aria-expanded') == "true") {
expanded += 1;
}
else {
closed += 1;
}
});
if (expanded === thisDrawer.find('.c-drawer:not(".remove")').length) {
var ele = thisDrawer.find('.expand-collapse-toggle-area button').eq(0);
jQuery(ele).removeClass('active').attr('tabindex', '-1');
jQuery(ele).attr('disabled', 'disabled');
jQuery(ele).siblings("button").eq(0).addClass('active').attr('tabindex', '0');
jQuery(ele).siblings("button").eq(0).removeAttr('disabled');
}
else if (closed === thisDrawer.find('.c-drawer:not(".remove")').length) {
var ele = thisDrawer.find('.expand-collapse-toggle-area button').eq(1);
jQuery(ele).removeClass('active').attr('tabindex', '-1');
jQuery(ele).attr('disabled', 'disabled');
jQuery(ele).siblings("button").eq(0).addClass('active').attr('tabindex', '0');
jQuery(ele).siblings("button").eq(0).removeAttr('disabled');
}
}
}
catch (e) {
console.log(e);
}
}
});
jQuery(document).on('click', '.expand-collapse-toggle-area .c-action-trigger', function () {
try {
var thisDrawer = $(this).closest(".drawer-panel");
var expanded = "false";
isAllowed = false;
if (jQuery(this).attr('data-source') === "expand") {
expanded = "true";
}
jQuery(this).removeClass('active').attr('tabindex', '-1').attr("disabled", "disabled").attr("aria-hidden","true");
//jQuery(this).removeClass('active').attr('tabindex', '-1').attr("style", "pointer-events: none; cursor:not-allowed; color: rgba(0,0,0,.2);").attr("aria-hidden","true");
jQuery(this).siblings("button").eq(0).addClass('active').attr('tabindex', '0').attr("aria-hidden","false").removeAttr("disabled").focus();
jQuery(thisDrawer).find('.c-drawer').each(function () {
if (jQuery(this).find('button').attr('aria-expanded') !== expanded) {
jQuery(this).find('button').click();
}
})
isAllowed = true;
}
catch (e) {
console.log(e);
}
});
});
/* Pivot script */
jQuery(document).ready(function () {
jQuery(".surface-hero-pivot-multi-img").each(function () {
jQuery(this).find(".m-hero-item>picture").eq(0).show().siblings("picture").hide();
})
jQuery(".surface-hero-pivot-multi-img .c-pivot a").on("click", function () {
var indx = jQuery(this).index();
jQuery(this).closest(".surface-hero-pivot-multi-img").find(".m-hero-item>picture:eq(" + indx + ")").show().siblings("picture").hide();
jQuery(this).closest(".surface-hero-pivot-multi-img").find(".m-hero-item .copy-item:eq(" + indx + ")").show().siblings(".copy-item").hide();
jQuery(this).addClass("f-active").attr("aria-selected", "true").attr("tabindex", "0").siblings("a").removeClass("f-active").attr("aria-selected", "false").attr("tabindex", "-1");
})
/* Hero pivot image selection END*/
/*pivot arrow functionality */
try {
jQuery(document).on("keyup", ".surface-hero-pivot-multi-img .c-pivot a", function (e) {
e.preventDefault();
var _this = $(this);
if ((e.which === 38 || e.keyCode === 38 || e.which === 37 || e.keyCode === 37)) {
/*
if (jQuery(this).index() == 0) {
jQuery(this).parent("header").find("a").eq(jQuery(this).parent("header").find("a").length - 1).focus();
jQuery(this).parent("header").find("a").eq(jQuery(this).parent("header").find("a").length - 1)[0].click();
}
else {
jQuery(this).prev().focus();
jQuery(this).parent("header").find("a").eq(jQuery(this).index() - 1)[0].click();
}
*/
setTimeout(function () {
_this.closest("header").find("a.f-active").click();
}, 500);
};
if ((e.which === 40 || e.keyCode === 40 || e.which === 39 || e.keyCode === 39)) {
/*
if (jQuery(this).index() == jQuery(this).parent("header").find("a").length - 1) {
jQuery(this).parent("header").find("a").eq(0).focus();
jQuery(this).parent("header").find("a").eq(0)[0].click();
}
else {
jQuery(this).next().focus();
jQuery(this).parent("header").find("a").eq(jQuery(this).index() + 1)[0].click();
}
*/
setTimeout(function () {
_this.closest("header").find("a.f-active").click();
}, 500);
};
});
} catch (exception) {
console.log(exception);
}
/* Plugin code */
gsap.registerPlugin(ScrollTrigger, ScrollToPlugin);
/*
var parallaxLength = $("[class*=vertical-parallax-hero]").length;
if (parallaxLength != 0) {
gsap.set("[class*=vertical-parallax-hero] picture", { autoAlpha: 0, scale: 0.65 });
gsap.timeline({
scrollTrigger: {
trigger: ".vertical-parallax-hero3",
start: "center bottom",
end: "center 75%",
scrub: 1
}
}).to(".vertical-parallax-hero3 picture", { autoAlpha: 1, duration: 1, scale: 1 });
gsap.timeline({
scrollTrigger: {
trigger: ".vertical-parallax-hero2",
start: "center bottom",
end: "center 75%",
scrub: 1
}
}).to(".vertical-parallax-hero2 picture", { autoAlpha: 1, duration: 1, scale: 1 });
}
*/
if (window.location.pathname == '/zh-cn/windows' || window.location.pathname == '/zh-cn/windows/' || window.location.pathname == '/zh-cn/windows/default.aspx') {
var animLength = $(".animation-container").length;
if (animLength != 0) {
if ($("html").scrollTop() == 0) {
$(".animation-container").addClass("position-fixed");
}
var browserWidth = window.innerWidth || document.body.clientWidth;
var xValue = 150, yValue = 335;
if (browserWidth > 1800) {
xValue = 150;
yValue = 335;
}
if (browserWidth >= 1600 && browserWidth <= 1799) {
xValue = 130;
yValue = 300;
}
if (browserWidth >= 1536 && browserWidth <= 1599) {
xValue = 119;
yValue = 268;
}
if (browserWidth >= 1366 && browserWidth <= 1535) {
xValue = 109;
yValue = 245;
}
if (browserWidth >= 1280 && browserWidth <= 1365) {
xValue = 100;
yValue = 226;
}
var videoFrom = { opacity: 1 };
var videoTo = { opacity: 0, delay: 0, duration: 2 };
var img1From = { className: "hide", x: xValue, y: yValue, scale: 4.6 };
var img1To = { className: "", x: 0, y: 0, scale: 1, duration: 1 };
var img2To = { delay: 0.03, y: innerHeight * 1, duration: 1 };
var headingFrom = { opacity: 0, delay: 0, ease: "power0.out" };
var headingTo = { opacity: 1, delay: 0, duration: 1 };
var heroAnimation = gsap.timeline({
scrollTrigger: {
trigger: ".animation-container",
start: "top top",
end: "bottom top",
scrub: 1,
pin: true
},
onStart: function () {
$(".animation-container").addClass("position-fixed");
},
onComplete: function () {
$(".animation-container").removeClass("position-fixed");
}
});
/*heroAnimation.to({ scroll: 0 }, {duration: 1, scroll: 1});*/
/*heroAnimation.fromTo(".animation-container", { className: 'animation-container animation-in-higher-vp position-fixed' }, { className: 'animation-container animation-in-higher-vp' }, 0.10);*/
heroAnimation.fromTo(".video-container", videoFrom, videoTo, 0.20);
heroAnimation.fromTo(".image-container1 img", img1From, img1To, 0.31);
heroAnimation.from(".image-container2 img", img2To, 0.32);
heroAnimation.fromTo(".heading-container", headingFrom, headingTo, 0.5);
heroAnimation.fromTo(".home-stickynav", { opacity: 0 }, { opacity: 1, ease: "none", duration: 0 }, 2);
/* heroAnimation.fromTo(".home-stickynav", { opacity: 0, height: 1 }, { opacity: 1, height: 55, ease: "none", duration: 0.1 }, 3); */
}
}
$(document).on('click', '.show-more-link', function () {
var linkText = $(this).attr('data-showless-string');
var linkAria = $(this).attr('data-lessaria');
$('#show-more-faq .show-more').each(function () {
$(this).removeClass('hide');
});
$(this).text(linkText);
$(this).attr("aria-label", linkAria);
$(this).removeClass('show-more-link').addClass('show-less-link');
$("#show-more-faq .c-drawer.show-more").first().find("button").focus();
});
$(document).on('click', '.show-less-link', function () {
var linkText = $(this).attr('data-showmore-string');
var linkAria = $(this).attr('data-showaria');
$('#show-more-faq .show-more').each(function () {
$(this).addClass('hide');
});
$(this).text(linkText);
$(this).attr("aria-label", linkAria);
$(this).removeClass('show-less-link').addClass('show-more-link');
});
var retailersAnnounce = {
"Dell": [{
"da-dk": "https://www.dell.com/da-dk/lp/windows-11",
"de-at": "https://www.dell.com/de-at/shop/notebooks-ultrabooks/sr/laptops/windows-10-home?appliedRefinements=27562",
"de-ch": "https://www.dell.com/de-ch/lp/windows-11",
"de-de": "https://www.dell.com/de-de/lp/windows-11",
"en-au": "https://www.dell.com/en-au/lp/windows-11",
"en-gb": "https://www.dell.com/en-uk/shop/laptops/sr/laptops/windows-10-home?appliedRefinements=24218",
"en-hk": "https://www.dell.com/en-hk/lp/windows-11",
"en-ie": "https://www.dell.com/en-ie/shop/laptops/sr/laptops/windows-10-home?appliedRefinements=29602",
"en-in": "https://www.dell.com/en-in/lp/windows-11",
"en-my": "https://www.dell.com/en-my/lp/windows-11",
"en-nz": "https://www.dell.com/en-nz/lp/windows-11",
"en-sg": "https://www.dell.com/en-sg/lp/windows-11",
"en-us": "https://www.dell.com/en-us/lp/windows-11",
"en-ca": "https://www.dell.com/en-ca/lp/windows-11",
"es-es": "https://www.dell.com/es-es/lp/windows-11",
"nl-be": "https://www.dell.com/nl-be/shop/dell-laptops/sr/laptops/windows-10-home?appliedRefinements=27562",
"fr-ca": "https://www.dell.com/fr-ca/lp/windows-11",
"fr-ch": "https://www.dell.com/fr-ch/lp/windows-11",
"fr-fr": "https://www.dell.com/fr-fr/lp/windows-11",
"it-it": "https://www.dell.com/it-it/shop/notebook-dell/sr/laptops/windows-10-home?appliedRefinements=27562",
"ja-jp": "https://www.dell.com/ja-jp/lp/windows-11",
"ko-kr": "https://www.dell.com/ko-kr/lp/windows-11",
"nb-no": "https://www.dell.com/no-no/lp/windows-11",
"nl-nl": "https://www.dell.com/nl-nl/lp/windows-11",
"pt-br": "https://www.dell.com/pt-br/lp/windows-11",
"sv-se": "https://www.dell.com/sv-se/lp/windows-11",
"zh-cn": "https://www.dell.com/zh-cn/lp/windows-11",
"zh-hk": "https://www.dell.com/zh-hk/lp/windows-11",
"zh-tw": "https://www.dell.com/zh-tw/lp/windows-11"
}],
"HP": [{
"en-us": "https://www.hp.com/us-en/shop/vwa/laptops/opsy=Windows-10-Home,Windows-10-Pro;availability=In-Stock",
"en-sg": "https://store.hp.com/sg-en/default/laptops-tablets.html?hp_facet_os%5B0%5D=Windows+10+Pro+64&hp_facet_os%5B1%5D=Windows+10+Home+64&hp_facet_os%5B2%5D=Windows+10+S&plp_sort_stock=Next+day+delivery",
"en-my": "https://store.hp.com/my-en/default/laptops-tablets.html?hp_facet_os%5B0%5D=Windows+10+Home+64&hp_facet_os%5B1%5D=Windows+10+Pro+64&hp_facet_os%5B2%5D=Windows+10+Home+Single+Language+64&plp_sort_stock=Next+day+delivery",
"en-au": "https://store.hp.com/au-en/default/laptops-tablets.html?hp_facet_os%5B0%5D=Windows+10+Pro+64&hp_facet_os%5B1%5D=Windows+10+Home+64&hp_facet_os%5B2%5D=Windows+10+S&plp_sort_stock=In-Stock",
"en-in": "https://store.hp.com/in-en/default/laptops-tablets.html?hp_facet_os%5B0%5D=Windows+10+Home+64&hp_facet_os%5B1%5D=Windows+10+Pro+64&hp_facet_os%5B2%5D=Windows+10+Home+Single+Language+64&hp_facet_os%5B3%5D=Windows+10+Home+64+Plus+Single+Language&plp_sort_stock=Dispatch+within+2+days",
"en-id": "https://store.hp.com/id-en/default/laptops-tablets.html?hp_facet_os%5B0%5D=Windows+10+Home+64&hp_facet_os%5B1%5D=Windows+10+Pro+64&hp_facet_os%5B2%5D=Windows+10+Home+Single+Language+64&hp_facet_os%5B3%5D=Windows+10+Home+64+Plus+Single+Language&plp_sort_stock=Dispatch+within+2+days",
"th-th": "https://store.hp.com/th-en/default/laptops-tablets.html?hp_facet_os%5B0%5D=Windows+10+Pro+64&hp_facet_os%5B1%5D=Windows+10+Home+64&plp_sort_stock=Same+day+delivery",
"en-hk": "https://www.hp.com/hk-en/shop/laptops-tablets.html?hp_facet_os%5B0%5D=Windows+10+Pro+64&hp_facet_os%5B1%5D=Windows+10+Home+64&hp_facet_os%5B2%5D=Windows+10+IoT+Enterprise+for+Thin+Clients&plp_sort_stock=In+Stock",
"zh-hk": "https://www.hp.com/hk-zh/shop/laptops-tablets.html?hp_facet_os%5B0%5D=Windows+10+Pro+64&hp_facet_os%5B1%5D=Windows+10+Home+64&hp_facet_os%5B2%5D=Windows+10+IoT+Enterprise+for+Thin+Clients&plp_sort_stock=In+Stock",
"ko-kr": "https://store.hp.com/kr-ko/default/laptops-tablets.html?hp_facet_os%5B0%5D=Windows+10+Pro+64&hp_facet_os%5B1%5D=Windows+10+Home+64&plp_sort_stock=%EC%9E%AC%EA%B3%A0",
"zh-cn": "https://www.hpstore.cn/laptops-tablets.html#category.brand",
"ja-jp": "https://jp.ext.hp.com/notebooks/personal/envy",
"it-it": "https://store.hp.com/italystore/merch/list.aspx?sel=ntb&ctrl=f&fc_os_win10home=1&fc_os_win10pro=1",
"sv-se": "https://store.hp.com/swedenstore/merch/list.aspx?sel=ntb&ctrl=f&fc_os_win10home=1&fc_os_win10pro=1",
"nl-nl": "https://store.hp.com/netherlandsstore/merch/list.aspx?sel=ntb&ctrl=f&fc_os_win10home=1&fc_os_win10pro=1",
"de-ch": "https://store.hp.com/switzerlandstore/merch/list.aspx?sel=ntb&ctrl=f&fc_os_win10home=1&fc_os_win10pro=1",
"fr-ch": "https://store.hp.com/switzerlandstore/merch/list.aspx?sel=ntb&ctrl=f&fc_os_win10home=1&fc_os_win10pro=1",
"de-de": "https://store.hp.com/germanystore/merch/list.aspx?sel=ntb&ctrl=f&fc_os_win10home=1&fc_os_win10pro=1",
"fr-fr": "https://store.hp.com/francestore/merch/list.aspx?sel=ntb&ctrl=f&fc_os_win10home=1&fc_os_win10pro=1",
"es-es": "https://store.hp.com/spainstore/merch/list.aspx?sel=NTB&ctrl=f&fc_os_win10home=1&fc_os_win10pro=1",
"en-gb": "https://store.hp.com/ukstore/merch/list.aspx?sel=ntb&ctrl=f&fc_os_win10home=1&fc_os_win10pro=1",
"pt-br": "https://store.hp.com/br-pt/default",
"es-ar": "https://store.hp.com/ar-es/default",
"es-co": "https://store.hp.com/co-es/default",
"es-cl": "https://store.hp.com/cl-es/default",
"es-mx": "https://store.hp.com/mx-es/default",
"en-ca": "https://store.hp.com/CanadaStore/Merch/Default.aspx",
"fr-ca": "https://store.hp.com/CanadaStore/Merch/Default.aspx",
"ar-xm": "https://www.hp.com/home.html",
"bg-bg": "https://www.hp.com/home.html",
"cs-cz": "https://www.hp.com/home.html",
"da-dk": "https://www.hp.com/home.html",
"de-at": "https://www.hp.com/home.html",
"el-gr": "https://www.hp.com/home.html",
"en-ie": "https://www.hp.com/home.html",
"en-is": "https://www.hp.com/home.html",
"en-nz": "https://www.hp.com/home.html",
"en-ph": "https://www.hp.com/home.html",
"en-za": "https://www.hp.com/home.html",
"es-xl": "https://www.hp.com/home.html",
"et-ee": "https://www.hp.com/home.html",
"fi-fi": "https://www.hp.com/home.html",
"fr-be": "https://www.hp.com/home.html",
"fr-xf": "https://www.hp.com/home.html",
"he-il": "https://www.hp.com/home.html",
"hr-hr": "https://www.hp.com/home.html",
"hu-hu": "https://www.hp.com/home.html",
"lt-lt": "https://www.hp.com/home.html",
"lv-lv": "https://www.hp.com/home.html",
"nb-no": "https://www.hp.com/home.html",
"nl-be": "https://www.hp.com/home.html",
"pl-pl": "https://www.hp.com/home.html",
"pt-pt": "https://www.hp.com/home.html",
"ro-ro": "https://www.hp.com/home.html",
"ru-ru": "https://www.hp.com/home.html",
"sk-sk": "https://www.hp.com/home.html",
"sl-si": "https://www.hp.com/home.html",
"sr-latn-rs": "https://www.hp.com/home.html",
"tr-tr": "https://www.hp.com/home.html",
"uk-ua": "https://www.hp.com/home.html",
"vi-vn": "https://www.hp.com/home.html",
"zh-tw": "https://www.hp.com/home.html"
}],
"Lenovo": [{
"en-us": "http://www.lenovo.com/windows-11",
"ar-xm": "http://www.lenovo.com/windows-11",
"bg-bg": "http://www.lenovo.com/windows-11",
"cs-cz": "http://www.lenovo.com/windows-11",
"da-dk": "http://www.lenovo.com/windows-11",
"de-at": "http://www.lenovo.com/windows-11",
"de-ch": "http://www.lenovo.com/windows-11",
"de-de": "http://www.lenovo.com/windows-11",
"el-gr": "http://www.lenovo.com/windows-11",
"en-au": "http://www.lenovo.com/windows-11",
"en-ca": "http://www.lenovo.com/windows-11",
"en-gb": "http://www.lenovo.com/windows-11",
"en-hk": "http://www.lenovo.com/windows-11",
"en-id": "http://www.lenovo.com/windows-11",
"en-ie": "http://www.lenovo.com/windows-11",
"en-in": "http://www.lenovo.com/windows-11",
"en-is": "http://www.lenovo.com/windows-11",
"en-my": "http://www.lenovo.com/windows-11",
"en-nz": "http://www.lenovo.com/windows-11",
"en-ph": "http://www.lenovo.com/windows-11",
"en-sg": "http://www.lenovo.com/windows-11",
"en-za": "http://www.lenovo.com/windows-11",
"es-ar": "http://www.lenovo.com/windows-11",
"es-cl": "http://www.lenovo.com/windows-11",
"es-co": "http://www.lenovo.com/windows-11",
"es-es": "http://www.lenovo.com/windows-11",
"es-mx": "http://www.lenovo.com/windows-11",
"es-xl": "http://www.lenovo.com/windows-11",
"et-ee": "http://www.lenovo.com/windows-11",
"fi-fi": "http://www.lenovo.com/windows-11",
"fr-be": "http://www.lenovo.com/windows-11",
"fr-ca": "http://www.lenovo.com/windows-11",
"fr-ch": "http://www.lenovo.com/windows-11",
"fr-fr": "http://www.lenovo.com/windows-11",
"fr-xf": "http://www.lenovo.com/windows-11",
"he-il": "http://www.lenovo.com/windows-11",
"hr-hr": "http://www.lenovo.com/windows-11",
"hu-hu": "http://www.lenovo.com/windows-11",
"it-it": "http://www.lenovo.com/windows-11",
"ja-jp": "http://www.lenovo.com/windows-11",
"ko-kr": "http://www.lenovo.com/windows-11",
"lt-lt": "http://www.lenovo.com/windows-11",
"lv-lv": "http://www.lenovo.com/windows-11",
"nb-no": "http://www.lenovo.com/windows-11",
"nl-be": "http://www.lenovo.com/windows-11",
"nl-nl": "http://www.lenovo.com/windows-11",
"pl-pl": "http://www.lenovo.com/windows-11",
"pt-br": "http://www.lenovo.com/windows-11",
"pt-pt": "http://www.lenovo.com/windows-11",
"ro-ro": "http://www.lenovo.com/windows-11",
"ru-ru": "http://www.lenovo.com/windows-11",
"sk-sk": "http://www.lenovo.com/windows-11",
"sl-si": "http://www.lenovo.com/windows-11",
"sr-latn-rs": "http://www.lenovo.com/windows-11",
"sv-se": "http://www.lenovo.com/windows-11",
"th-th": "http://www.lenovo.com/windows-11",
"tr-tr": "http://www.lenovo.com/windows-11",
"uk-ua": "http://www.lenovo.com/windows-11",
"vi-vn": "http://www.lenovo.com/windows-11",
"zh-cn": "http://www.lenovo.com/windows-11",
"zh-hk": "http://www.lenovo.com/windows-11",
"zh-tw": "http://www.lenovo.com/windows-11"
}],
"Acer": [{
"en-us": "http://www.acer.com/windows-11#shop-now",
"ar-xm": "http://www.acer.com/windows-11#shop-now",
"bg-bg": "http://www.acer.com/windows-11#shop-now",
"cs-cz": "http://www.acer.com/windows-11#shop-now",
"da-dk": "http://www.acer.com/windows-11#shop-now",
"de-at": "http://www.acer.com/windows-11#shop-now",
"de-ch": "http://www.acer.com/windows-11#shop-now",
"de-de": "http://www.acer.com/windows-11#shop-now",
"el-gr": "http://www.acer.com/windows-11#shop-now",
"en-au": "http://www.acer.com/windows-11#shop-now",
"en-ca": "http://www.acer.com/windows-11#shop-now",
"en-gb": "http://www.acer.com/windows-11#shop-now",
"en-hk": "http://www.acer.com/windows-11#shop-now",
"en-id": "http://www.acer.com/windows-11#shop-now",
"en-ie": "http://www.acer.com/windows-11#shop-now",
"en-in": "http://www.acer.com/windows-11#shop-now",
"en-is": "http://www.acer.com/windows-11#shop-now",
"en-my": "http://www.acer.com/windows-11#shop-now",
"en-nz": "http://www.acer.com/windows-11#shop-now",
"en-ph": "http://www.acer.com/windows-11#shop-now",
"en-sg": "http://www.acer.com/windows-11#shop-now",
"en-za": "http://www.acer.com/windows-11#shop-now",
"es-ar": "http://www.acer.com/windows-11#shop-now",
"es-cl": "http://www.acer.com/windows-11#shop-now",
"es-co": "http://www.acer.com/windows-11#shop-now",
"es-es": "http://www.acer.com/windows-11#shop-now",
"es-mx": "http://www.acer.com/windows-11#shop-now",
"es-xl": "http://www.acer.com/windows-11#shop-now",
"et-ee": "http://www.acer.com/windows-11#shop-now",
"fi-fi": "http://www.acer.com/windows-11#shop-now",
"fr-be": "http://www.acer.com/windows-11#shop-now",
"fr-ca": "http://www.acer.com/windows-11#shop-now",
"fr-ch": "http://www.acer.com/windows-11#shop-now",
"fr-fr": "http://www.acer.com/windows-11#shop-now",
"fr-xf": "http://www.acer.com/windows-11#shop-now",
"he-il": "http://www.acer.com/windows-11#shop-now",
"hr-hr": "http://www.acer.com/windows-11#shop-now",
"hu-hu": "http://www.acer.com/windows-11#shop-now",
"it-it": "http://www.acer.com/windows-11#shop-now",
"ja-jp": "http://www.acer.com/windows-11#shop-now",
"ko-kr": "http://www.acer.com/windows-11#shop-now",
"lt-lt": "http://www.acer.com/windows-11#shop-now",
"lv-lv": "http://www.acer.com/windows-11#shop-now",
"nb-no": "http://www.acer.com/windows-11#shop-now",
"nl-be": "http://www.acer.com/windows-11#shop-now",
"nl-nl": "http://www.acer.com/windows-11#shop-now",
"pl-pl": "http://www.acer.com/windows-11#shop-now",
"pt-br": "http://www.acer.com/windows-11#shop-now",
"pt-pt": "http://www.acer.com/windows-11#shop-now",
"ro-ro": "http://www.acer.com/windows-11#shop-now",
"ru-ru": "http://www.acer.com/windows-11#shop-now",
"sk-sk": "http://www.acer.com/windows-11#shop-now",
"sl-si": "http://www.acer.com/windows-11#shop-now",
"sr-latn-rs": "http://www.acer.com/windows-11#shop-now",
"sv-se": "http://www.acer.com/windows-11#shop-now",
"th-th": "http://www.acer.com/windows-11#shop-now",
"tr-tr": "http://www.acer.com/windows-11#shop-now",
"uk-ua": "http://www.acer.com/windows-11#shop-now",
"vi-vn": "http://www.acer.com/windows-11#shop-now",
"zh-cn": "http://www.acer.com/windows-11#shop-now",
"zh-hk": "http://www.acer.com/windows-11#shop-now",
"zh-tw": "http://www.acer.com/windows-11#shop-now"
}],
"ASUS": [{
"en-us": "http://www.asus.com/microsite/2021/windows11/",
"ar-xm": "http://www.asus.com/microsite/2021/windows11/",
"bg-bg": "http://www.asus.com/microsite/2021/windows11/",
"cs-cz": "http://www.asus.com/microsite/2021/windows11/",
"da-dk": "http://www.asus.com/microsite/2021/windows11/",
"de-at": "http://www.asus.com/microsite/2021/windows11/",
"de-ch": "http://www.asus.com/microsite/2021/windows11/",
"de-de": "http://www.asus.com/microsite/2021/windows11/",
"el-gr": "http://www.asus.com/microsite/2021/windows11/",
"en-au": "http://www.asus.com/microsite/2021/windows11/",
"en-ca": "http://www.asus.com/microsite/2021/windows11/",
"en-gb": "http://www.asus.com/microsite/2021/windows11/",
"en-hk": "http://www.asus.com/microsite/2021/windows11/",
"en-id": "http://www.asus.com/microsite/2021/windows11/",
"en-ie": "http://www.asus.com/microsite/2021/windows11/",
"en-in": "http://www.asus.com/microsite/2021/windows11/",
"en-is": "http://www.asus.com/microsite/2021/windows11/",
"en-my": "http://www.asus.com/microsite/2021/windows11/",
"en-nz": "http://www.asus.com/microsite/2021/windows11/",
"en-ph": "http://www.asus.com/microsite/2021/windows11/",
"en-sg": "http://www.asus.com/microsite/2021/windows11/",
"en-za": "http://www.asus.com/microsite/2021/windows11/",
"es-ar": "http://www.asus.com/microsite/2021/windows11/",
"es-cl": "http://www.asus.com/microsite/2021/windows11/",
"es-co": "http://www.asus.com/microsite/2021/windows11/",
"es-es": "http://www.asus.com/microsite/2021/windows11/",
"es-mx": "http://www.asus.com/microsite/2021/windows11/",
"es-xl": "http://www.asus.com/microsite/2021/windows11/",
"et-ee": "http://www.asus.com/microsite/2021/windows11/",
"fi-fi": "http://www.asus.com/microsite/2021/windows11/",
"fr-be": "http://www.asus.com/microsite/2021/windows11/",
"fr-ca": "http://www.asus.com/microsite/2021/windows11/",
"fr-ch": "http://www.asus.com/microsite/2021/windows11/",
"fr-fr": "http://www.asus.com/microsite/2021/windows11/",
"fr-xf": "http://www.asus.com/microsite/2021/windows11/",
"he-il": "http://www.asus.com/microsite/2021/windows11/",
"hr-hr": "http://www.asus.com/microsite/2021/windows11/",
"hu-hu": "http://www.asus.com/microsite/2021/windows11/",
"it-it": "http://www.asus.com/microsite/2021/windows11/",
"ja-jp": "http://www.asus.com/microsite/2021/windows11/",
"ko-kr": "http://www.asus.com/microsite/2021/windows11/",
"lt-lt": "http://www.asus.com/microsite/2021/windows11/",
"lv-lv": "http://www.asus.com/microsite/2021/windows11/",
"nb-no": "http://www.asus.com/microsite/2021/windows11/",
"nl-be": "http://www.asus.com/microsite/2021/windows11/",
"nl-nl": "http://www.asus.com/microsite/2021/windows11/",
"pl-pl": "http://www.asus.com/microsite/2021/windows11/",
"pt-br": "http://www.asus.com/microsite/2021/windows11/",
"pt-pt": "http://www.asus.com/microsite/2021/windows11/",
"ro-ro": "http://www.asus.com/microsite/2021/windows11/",
"ru-ru": "http://www.asus.com/microsite/2021/windows11/",
"sk-sk": "http://www.asus.com/microsite/2021/windows11/",
"sl-si": "http://www.asus.com/microsite/2021/windows11/",
"sr-latn-rs": "http://www.asus.com/microsite/2021/windows11/",
"sv-se": "http://www.asus.com/microsite/2021/windows11/",
"th-th": "http://www.asus.com/microsite/2021/windows11/",
"tr-tr": "http://www.asus.com/microsite/2021/windows11/",
"uk-ua": "http://www.asus.com/microsite/2021/windows11/",
"vi-vn": "http://www.asus.com/microsite/2021/windows11/",
"zh-cn": "http://www.asus.com/microsite/2021/windows11/",
"zh-hk": "http://www.asus.com/microsite/2021/windows11/",
"zh-tw": "http://www.asus.com/microsite/2021/windows11/"
}],
"Medion": [{
"de-de": "https://www.medion.com/de/shop/windows-update"
}],
"Microsoft": [{
"en-us": "http://approjects.co.za/?big=surface",
"en-ca": "http://approjects.co.za/?big=surface",
"fr-ca": "http://approjects.co.za/?big=surface",
"en-gb": "http://approjects.co.za/?big=surface",
"en-au": "http://approjects.co.za/?big=surface",
"fr-fr": "http://approjects.co.za/?big=surface",
"de-de": "http://approjects.co.za/?big=surface",
"ja-jp": "http://approjects.co.za/?big=surface"
}],
"NEC": [{
"ja-jp": "https://support.nec-lavie.jp/win11upg-info/"
}],
"Fujitsu": [{
"en-us": "https://azby.fmworld.net/support/win/eligibledevice/2021/",
"ar-xm": "https://azby.fmworld.net/support/win/eligibledevice/2021/",
"bg-bg": "https://azby.fmworld.net/support/win/eligibledevice/2021/",
"cs-cz": "https://azby.fmworld.net/support/win/eligibledevice/2021/",
"da-dk": "https://azby.fmworld.net/support/win/eligibledevice/2021/",
"de-at": "https://azby.fmworld.net/support/win/eligibledevice/2021/",
"de-ch": "https://azby.fmworld.net/support/win/eligibledevice/2021/",
"de-de": "https://azby.fmworld.net/support/win/eligibledevice/2021/",
"el-gr": "https://azby.fmworld.net/support/win/eligibledevice/2021/",
"en-au": "https://azby.fmworld.net/support/win/eligibledevice/2021/",
"en-ca": "https://azby.fmworld.net/support/win/eligibledevice/2021/",
"en-gb": "https://azby.fmworld.net/support/win/eligibledevice/2021/",
"en-hk": "https://azby.fmworld.net/support/win/eligibledevice/2021/",
"en-id": "https://azby.fmworld.net/support/win/eligibledevice/2021/",
"en-ie": "https://azby.fmworld.net/support/win/eligibledevice/2021/",
"en-in": "https://azby.fmworld.net/support/win/eligibledevice/2021/",
"en-is": "https://azby.fmworld.net/support/win/eligibledevice/2021/",
"en-my": "https://azby.fmworld.net/support/win/eligibledevice/2021/",
"en-nz": "https://azby.fmworld.net/support/win/eligibledevice/2021/",
"en-ph": "https://azby.fmworld.net/support/win/eligibledevice/2021/",
"en-sg": "https://azby.fmworld.net/support/win/eligibledevice/2021/",
"en-za": "https://azby.fmworld.net/support/win/eligibledevice/2021/",
"es-ar": "https://azby.fmworld.net/support/win/eligibledevice/2021/",
"es-cl": "https://azby.fmworld.net/support/win/eligibledevice/2021/",
"es-co": "https://azby.fmworld.net/support/win/eligibledevice/2021/",
"es-es": "https://azby.fmworld.net/support/win/eligibledevice/2021/",
"es-mx": "https://azby.fmworld.net/support/win/eligibledevice/2021/",
"es-xl": "https://azby.fmworld.net/support/win/eligibledevice/2021/",
"et-ee": "https://azby.fmworld.net/support/win/eligibledevice/2021/",
"fi-fi": "https://azby.fmworld.net/support/win/eligibledevice/2021/",
"fr-be": "https://azby.fmworld.net/support/win/eligibledevice/2021/",
"fr-ca": "https://azby.fmworld.net/support/win/eligibledevice/2021/",
"fr-ch": "https://azby.fmworld.net/support/win/eligibledevice/2021/",
"fr-fr": "https://azby.fmworld.net/support/win/eligibledevice/2021/",
"fr-xf": "https://azby.fmworld.net/support/win/eligibledevice/2021/",
"he-il": "https://azby.fmworld.net/support/win/eligibledevice/2021/",
"hr-hr": "https://azby.fmworld.net/support/win/eligibledevice/2021/",
"hu-hu": "https://azby.fmworld.net/support/win/eligibledevice/2021/",
"it-it": "https://azby.fmworld.net/support/win/eligibledevice/2021/",
"ja-jp": "https://azby.fmworld.net/support/win/eligibledevice/2021/",
"ko-kr": "https://azby.fmworld.net/support/win/eligibledevice/2021/",
"lt-lt": "https://azby.fmworld.net/support/win/eligibledevice/2021/",
"lv-lv": "https://azby.fmworld.net/support/win/eligibledevice/2021/",
"nb-no": "https://azby.fmworld.net/support/win/eligibledevice/2021/",
"nl-be": "https://azby.fmworld.net/support/win/eligibledevice/2021/",
"nl-nl": "https://azby.fmworld.net/support/win/eligibledevice/2021/",
"pl-pl": "https://azby.fmworld.net/support/win/eligibledevice/2021/",
"pt-br": "https://azby.fmworld.net/support/win/eligibledevice/2021/",
"pt-pt": "https://azby.fmworld.net/support/win/eligibledevice/2021/",
"ro-ro": "https://azby.fmworld.net/support/win/eligibledevice/2021/",
"ru-ru": "https://azby.fmworld.net/support/win/eligibledevice/2021/",
"sk-sk": "https://azby.fmworld.net/support/win/eligibledevice/2021/",
"sl-si": "https://azby.fmworld.net/support/win/eligibledevice/2021/",
"sr-latn-rs": "https://azby.fmworld.net/support/win/eligibledevice/2021/",
"sv-se": "https://azby.fmworld.net/support/win/eligibledevice/2021/",
"th-th": "https://azby.fmworld.net/support/win/eligibledevice/2021/",
"tr-tr": "https://azby.fmworld.net/support/win/eligibledevice/2021/",
"uk-ua": "https://azby.fmworld.net/support/win/eligibledevice/2021/",
"vi-vn": "https://azby.fmworld.net/support/win/eligibledevice/2021/",
"zh-cn": "https://azby.fmworld.net/support/win/eligibledevice/2021/",
"zh-hk": "https://azby.fmworld.net/support/win/eligibledevice/2021/",
"zh-tw": "https://azby.fmworld.net/support/win/eligibledevice/2021/"
}]
}
var thislocale = $("html").attr("lang");
var nonRetailers = ["ar-xm", "en-id", "en-is", "en-my", "en-ph", "en-sg", "es-ar", "es-xl", "fr-ch", "fr-xf", "he-il", "sr-latn-rs", "th-th", "vi-vn"];
var updateLink = function (tAnchor, retVal) {
var finalUrl = tAnchor.attr("href");
if (retailersAnnounce[retVal] != undefined && retailersAnnounce[retVal][0][thislocale] != undefined) {
tAnchor.removeClass("hide");
tAnchor.attr("href", retailersAnnounce[retVal][0][thislocale]);
tAnchor.attr("target", "_blank");
} else {
if (finalUrl != undefined && finalUrl.toLowerCase().indexOf("view-all-devices") != -1 && retVal != "") {
tAnchor.removeClass("hide");
tAnchor.attr("href", finalUrl + "?col=" + retVal);
}
else if (nonRetailers.indexOf(thislocale) == -1) {
tAnchor.removeClass("hide");
}
}
}
if (!String.prototype.startsWith) {
Object.defineProperty(String.prototype, 'startsWith', {
value: function (search, rawPos) {
var pos = rawPos > 0 ? rawPos | 0 : 0;
return this.substring(pos, pos + search.length) === search;
}
});
}
function get_bits_system_architecture() {
var _UA_String = navigator.userAgent.toLowerCase();
var _bits = 64, _is_Windows10 = false;
var _signature = _UA_String.indexOf("win64") != -1 ? "Win64" : _UA_String.indexOf("wow64") != -1 ? "WOW64" : "";
var whichDevice = _UA_String.indexOf("android") != -1 || _UA_String.indexOf("ipad") != -1 || _UA_String.indexOf("iphone") != -1 || _UA_String.indexOf("ipod") != -1 || _UA_String.indexOf("windows phone") != -1 ? "mobile" : "notmobile";
if (whichDevice == "notmobile") {
if (_UA_String.indexOf("windows nt 10") != -1) {
_is_Windows10 = true;
if (_signature != "") {
_bits = 64;
} else {
_bits = 32;
}
} else {
_bits = 64;
}
}
else {
_bits = "MOBILE/TABLET";
_signature = "MOBILE/TABLET";
}
return [_is_Windows10, _bits, _signature];
}
var navUserAgent = navigator.userAgent.toLowerCase();
var whichDevice = navUserAgent.indexOf("android") != -1 || navUserAgent.indexOf("ipad") != -1 || navUserAgent.indexOf("iphone") != -1 || navUserAgent.indexOf("ipod") != -1 || navUserAgent.indexOf("windows phone") != -1 ? "mobile" : "notmobile";
if (whichDevice == "notmobile") {
var ocidparam = "";
if (window.location.href.toLowerCase().indexOf("ocid") >= 0) {
ocidparam = GetQueryStringParams_upgrade("ocid");
}
if (ocidparam.startsWith("1_")) {
$("div#pchealthcheck").find(".bground-yes.custom-small-feature").removeClass("hide");
$('html, body').animate({
scrollTop: ($("#pchealthcheck").offset().top)
}, 100);
}
if (ocidparam.startsWith("2_")) {
var noDiv = $("div#pchealthcheck");
noDiv.find(".bground-no.custom-small-feature").removeClass("hide");
var vaAnchor = noDiv.find("a.va");
var oemVal = ocidparam.split("_")[1];
switch (oemVal) {
case "101":
updateLink(vaAnchor, "Dell");
break;
case "201":
updateLink(vaAnchor, "HP");
break;
case "301":
updateLink(vaAnchor, "Lenovo");
break;
case "401":
updateLink(vaAnchor, "Acer");
break;
case "501":
updateLink(vaAnchor, "ASUS");
break;
case "601":
updateLink(vaAnchor, "Samsung");
break;
case "701":
updateLink(vaAnchor, "Medion");
break;
case "801":
updateLink(vaAnchor, "NEC");
break;
case "901":
updateLink(vaAnchor, "Fujitsu");
break;
case "1001":
updateLink(vaAnchor, "Microsoft");
break;
default:
updateLink(vaAnchor, "");
break;
};
$('html, body').animate({
scrollTop: ($("#pchealthcheck").offset().top)
}, 100);
}
if (ocidparam.startsWith("3_")) {
$("div#pchealthcheck").find(".bground-dontknow.custom-small-feature").removeClass("hide");
$('html, body').animate({
scrollTop: ($("#pchealthcheck").offset().top)
}, 100);
}
var _OS_bits = get_bits_system_architecture();
if (ocidparam.startsWith("1_") == false && ocidparam.startsWith("2_") == false && ocidparam.startsWith("3_") == false) {
$(".windows-11 div#pchealthcheck").find(".bground-default.custom-small-feature").removeClass("hide");
/*
if (_OS_bits[1].toString() == "32") {
$(".windows-11 div#pchealthcheck").find(".bground-default.custom-small-feature").find("a.c-call-to-action").first().attr('href', 'https://aka.ms/GetPCHealthCheckAppX86');
} else {
$(".windows-11 div#pchealthcheck").find(".bground-default.custom-small-feature").find("a.c-call-to-action").first().attr('href', 'https://aka.ms/GetPCHealthCheckApp');
}
*/
}
} else {
$(".windows-11 div#pchealthcheck").find(".bground-default-mobile.custom-small-feature").removeClass("hide");
}
$("div#pchealthcheck").each(function () {
if ($(this).find(".custom-small-feature").hasClass("hide")) {
$(this).remove();
}
});
$("table tr td,table tr th").each(function () {
var thisColValue = $(this).attr("colspan");
if (thisColValue == undefined || thisColValue == "") {
$(this).removeAttr("colspan");
}
});
var drawerPanelLength = $(".compare-windows-11-home-vs-pro-versions td .drawer-panel").length;
if (drawerPanelLength != 0) {
$(".compare-windows-11-home-vs-pro-versions td .drawer-panel").each(function (index, elem) {
$(this).find("div.c-drawer").attr("id", "question-" + index);
$(this).find("button.c-glyph").attr("aria-controls", "simpleDrawer" + index);
$(this).find("div.c-drawer-panel").attr("id", "simpleDrawer" + index);
});
};
/* button start */
if (window.matchMedia("(prefers-reduced-motion)").matches == false) {
$(document).on("mousemove", ".rounded-corners .c-button.f-primary,.tipsTricks-filters-section .tipstricks-filter, .tipstricks-loadmore, .mp4inline .f-video-trigger .c-glyph.glyph-play", function (e) {
var boundaries = $(this)[0].getBoundingClientRect();
var x = boundaries.x;
var y = boundaries.y;
$(this)[0].style.setProperty("--x", e.clientX - x);
$(this)[0].style.setProperty("--y", e.clientY - y);
});
}
/* button end */
$(document).on("click keydown", "#all-tips .featured-single-card", function (e) {
if ((e.type == "click" || e.type == "keydown" && e.which == "13")) {
var hasLightBoxVideo = $(this).find(".glyph-play").length != 0 ? true : false;
var lightBox = $("#default-lightbox");
var thisOverlay = $(this).find(".m-content-placement-item");
var thisHasOverlay = thisOverlay.length != 0 ? true : false;
var thisHrefValue = $(this).find("div.c-group > a").attr("href");
var thisVideoSrc = $(this).find("div.c-group > a").attr("data-videosrc");
var hashValue = window.location.hash.toLowerCase();
//var thisVideoTile=false;
lightBox.find(".m-content-placement-item").remove();
if (window.location.href.toLowerCase().indexOf("/features") != -1 || window.location.href.toLowerCase().indexOf("/tips-and-tricks") != -1) {
$(this).addClass("tips-tricks-popup");
if ($(this)[0].className.includes('hide')) {
$('.tipstricks-loadmore').click();
}
leftRightNavigation();
tileTextUpdate();
}
else if (window.location.href.toLowerCase().indexOf("/getting-started") != -1) {
$(this).addClass("tips-tricks-popup");
}
$("#default-lightbox").attr("aria-hidden", false);
if (hasLightBoxVideo && !$(this).hasClass("clicked")) {
$(this).addClass("clicked");
$(this).find("a[data-js-dialog-show]").click();
/*if (hashValue == "") {
history.pushState({ page: "features" }, "Title", window.location.href + thisHrefValue);
}*/
}
else
if (thisHasOverlay) {
lightBox.addClass("tips-overlay");
if (thisVideoSrc == undefined) {
$("#default-lightbox").find(".c-video-player").addClass("hide");
}
var randomNumber = new Date().getMilliseconds() * Math.random();
var thisOuterHTML = thisOverlay[0].outerHTML;
lightBox.find("div[role='document']").append(thisOuterHTML);
var thisPanel = lightBox.find(".m-content-placement-item");
var thisPanelHeading = lightBox.find(".m-content-placement-item h3").text();
$("#default-lightbox #dialog-container[role='dialog']").attr("aria-label", thisPanelHeading);
var thisPanelImg = thisPanel.find("img");
var thisPanelSrc = thisPanelImg.attr("data-src");
if (hashValue == "") {
history.pushState({ page: "tips-and-tricks" }, "Title", window.location.href + thisHrefValue);
}
thisPanelImg.attr("src", thisPanelSrc + "&" + randomNumber);
thisPanel.removeClass("hide");
}
$('body').addClass('removeoverflow');
setTimeout(function () {
$('#default-lightbox .nav-buttons button.glyph-cancel').focus();
}, 100);
setTimeout(function () {
lightBox.find("section.m-content-placement-item").removeAttr("data-js-href");
}, 1000);
let keyPress = {};
setTimeout(function () {
$('#default-lightbox .m-content-placement-item:last a:last').keydown(function (e) {
var code = e.keyCode || e.which;
keyPress[code] = (e.type == 'keydown');
if (code === 9 && !(keyPress[9] && keyPress[16])) {
e.preventDefault();
$("#default-lightbox .nav-buttons button.glyph-cancel").focus();
}
});
$('#default-lightbox .nav-buttons button').keydown(function (e) {
var code = e.keyCode || e.which;
keyPress[code] = (e.type == 'keydown');
if (code === 27) {
e.preventDefault();
$(".tips-tricks-popup a").focus();
history.pushState({ page: "tips-and-tricks" }, "Title", window.location.pathname);
$("body").removeClass("removeoverflow").removeAttr("style");
}
else if (code === 9 && $(this).hasClass('glyph-cancel')) {
var ctaTile = $(this).parents('#default-lightbox').find('.m-content-placement-item a').length;
if (ctaTile == 0 && $(this).parents('#default-lightbox').find(".c-video-player").hasClass("hide")) {
e.preventDefault();
$("this").focus();
}
}
});
}, 100);
}
});
/* Comprehensive Security popup starts */
$(document).on("click keydown", ".security-popup", function (e) {
if ((e.type == "click" || e.type == "keydown" && e.which == "13")) {
var lightBox = $("#default-lightbox");
var thisOverlay = $(this).parents(".featurecontent").find(".m-content-placement-item");
var thisHasOverlay = thisOverlay.length != 0 ? true : false;
var hashValue = window.location.hash.toLowerCase();
var thisHrefValue = $(this).attr("href");
lightBox.find(".m-content-placement-item").remove();
$(this).addClass("tips-tricks-popup");
if (thisHasOverlay) {
lightBox.addClass("tips-overlay security-overlay");
var thisOuterHTML = thisOverlay[0].outerHTML;
lightBox.find("div[role='document']").append(thisOuterHTML);
var thisPanel = lightBox.find(".m-content-placement-item");
var thisPanelHeading = lightBox.find(".m-content-placement-item h3").text();
$("#default-lightbox #dialog-container[role='dialog']").attr("aria-label", thisPanelHeading);
var thisPanelImg = thisPanel.find("img");
var thisPanelSrc = thisPanelImg.attr("data-src");
thisPanelImg.attr("src", thisPanelSrc);
thisPanel.removeClass("hide");
$("#default-lightbox").attr("aria-hidden", false);
}
$('body').addClass('removeoverflow');
let keyPress = {};
setTimeout(function () {
$('#default-lightbox .nav-buttons button.glyph-cancel').focus();
$('#default-lightbox .nav-buttons button.c-glyph.glyph-cancel').keydown(function (e) {
var code = e.keyCode || e.which;
var ctaTile = $(this).parents('#default-lightbox').find('.m-content-placement-item a').length;
var urlPath = window.location.href;
keyPress[code] = (e.type == 'keydown');
if (code === 9 && ctaTile == 0) {
e.preventDefault();
$("this").focus();
}
else if (code == 27 || code == 13 || code == 32) {
$(".c-dialog button[data-js-dialog-hide]").click();
if (urlPath.indexOf('/comprehensive-security') != -1 && urlPath.indexOf('#') != -1) {
history.pushState({ page: "comprehensive-security" }, "Title", window.location.pathname + thisHrefValue);
}
$("body").removeClass("removeoverflow").removeAttr("style");
$('a[href="http://approjects.co.za/?big=#" + urlPath.split("#")[1] + '"]').focus();
}
else if (e.shiftKey && ctaTile == 0 || (e.shiftKey && e.keyCode === 9 && ctaTile == 0)) {
e.preventDefault();
$("this").focus();
}
else {
$('a[href="http://approjects.co.za/?big=#" + urlPath.split("#")[1] + '"]').focus();
if (urlPath.indexOf('/comprehensive-security') != -1 && urlPath.indexOf('#') != -1) {
history.pushState({ page: "comprehensive-security" }, "Title", window.location.pathname + thisHrefValue);
}
}
});
}, 100);
var urlPath = window.location.href;
$('a[href="http://approjects.co.za/?big=#" + urlPath.split("#")[1] + '"]').focus();
if (urlPath.indexOf('/comprehensive-security') != -1 && urlPath.indexOf('#') != -1) {
history.pushState("Title", window.location.pathname + thisHrefValue);
}
}
});
$(".comprehensive-security #comprehensiveSecurity_Contentplacement1_malwareProtection").parent().css("padding-bottom", "120px");
$(".comprehensive-security #comprehensiveSecurity_Contentplacement1_appsecurity").parent().css("padding-bottom", "120px");
$(".comprehensive-security #comprehensiveSecurity_Contentplacement1_phishingprevention").parent().css({ "padding-bottom": "120px", "background": "#F7F7F7" });
$('.comprehensive-security .featurebox .featurecontent').find('.c-group a').attr('tabindex', '0');
if (window.matchMedia("(min-width: 1600px)").matches) {
$(".comprehensive-security #comprehensiveSecurity_Contentplacement1_phishingprevention").parent().addClass("phishingprevention");
}
$(window).resize(function () {
if (window.location.href.toLowerCase().indexOf("/windows/comprehensive-security") != -1) {
resizeComprehensivePanels();
}
if (window.location.href.toLowerCase().indexOf("/windows/photo-movie-editor") != -1) {
if ($(window).width() <= 767) {
$("#photoMovieEditor_Contentplacement").parent().css("padding-bottom", "48px");
} else if ($(window).width() >= 768 && $(window).width() <= 1083) {
$("#photoMovieEditor_Contentplacement .content-touts").attr('data-grid', 'col-6 pad-6x');
$("#photoMovieEditor_Contentplacement").parent().css("padding-bottom", "60px");
} else {
$("#photoMovieEditor_Contentplacement .content-touts").attr('data-grid', 'col-4 pad-6x');
$("#photoMovieEditor_Contentplacement").parent().css("padding-bottom", "90px");
}
}
if (window.matchMedia("(min-width: 1084px)").matches) {
if (currentLocale != 'EN-US') {
$("#phoneLink picture source").remove();
}
if (currentLocale == 'ZH-CN') {
$("#phoneLink picture img").attr("src", "https://cdn-dynmedia-1.microsoft.com/is/image/microsoftcorp/MSFT-A-call-coming-in-on-a-phone-and-showing-up-on-a-PC-using-Phone-Link-RW16Ks5?scl=1");
$("#phoneLink picture img").attr("data-src", "https://cdn-dynmedia-1.microsoft.com/is/image/microsoftcorp/MSFT-A-call-coming-in-on-a-phone-and-showing-up-on-a-PC-using-Phone-Link-RW16Ks5?scl=1");
}
else {
$("#phoneLink picture img").attr("src", "https://cdn-dynmedia-1.microsoft.com/is/image/microsoftcorp/MSFT-sync-devices-RW13kMu?scl=1");
$("#phoneLink picture img").attr("data-src", "https://cdn-dynmedia-1.microsoft.com/is/image/microsoftcorp/MSFT-sync-devices-RW13kMu?scl=1");
}
//if (currentLocale == 'EN-US') {
$("#Copilot picture source").remove();
$("#Copilot picture img").attr("src", "https://cdn-dynmedia-1.microsoft.com/is/image/microsoftcorp/MSFT-Image-represents-Copilot-creativity-and-productivity-RW1hYpE?scl=1");
$("#Copilot picture img").attr("data-src", "https://cdn-dynmedia-1.microsoft.com/is/image/microsoftcorp/MSFT-Image-represents-Copilot-creativity-and-productivity-RW1hYpE?scl=1");
$("#spring-feature picture source").remove();
$("#spring-feature picture img").attr("src", "https://cdn-dynmedia-1.microsoft.com/is/image/microsoftcorp/MSFT-Laptop-with-Copilot-logo-and-colorful-bloom-RW1jQhE?scl=1");
$("#spring-feature picture img").attr("data-src", "https://cdn-dynmedia-1.microsoft.com/is/image/microsoftcorp/MSFT-Laptop-with-Copilot-logo-and-colorful-bloom-RW1jQhE?scl=1");
$("#Win11Featurehero picture source").remove();
$("#Win11Featurehero picture img").attr("src", "https://cdn-dynmedia-1.microsoft.com/is/image/microsoftcorp/MSFT-Laptop-with-Copilot-logo-and-colorful-bloom-RW1jRto?scl=1");
$("#Win11Featurehero picture img").attr("data-src", "https://cdn-dynmedia-1.microsoft.com/is/image/microsoftcorp/MSFT-Laptop-with-Copilot-logo-and-colorful-bloom-RW1jRto?scl=1");
//}
}
else {
if (currentLocale != 'EN-US') {
$("#phoneLink picture source").remove();
}
if (currentLocale == 'ZH-CN') {
$("#phoneLink picture img").attr("src", "https://cdn-dynmedia-1.microsoft.com/is/image/microsoftcorp/MSFT-A-call-coming-in-on-a-phone-and-showing-up-on-a-PC-using-Phone-Link-RW16Ptm?scl=1");
$("#phoneLink picture img").attr("data-src", "https://cdn-dynmedia-1.microsoft.com/is/image/microsoftcorp/MSFT-A-call-coming-in-on-a-phone-and-showing-up-on-a-PC-using-Phone-Link-RW16Ptm?scl=1");
}
else {
$("#phoneLink picture img").attr("src", "https://cdn-dynmedia-1.microsoft.com/is/image/microsoftcorp/MSFT-sync-devices-RW12HNd?scl=1");
$("#phoneLink picture img").attr("data-src", "https://cdn-dynmedia-1.microsoft.com/is/image/microsoftcorp/MSFT-sync-devices-RW12HNd?scl=1");
}
//if (currentLocale == 'EN-US') {
$("#Copilot picture source").remove();
$("#Copilot picture img").attr("src", "https://cdn-dynmedia-1.microsoft.com/is/image/microsoftcorp/msft-Image-represents-copilot-creativity-productivity-RW1hQBO?scl=1");
$("#Copilot picture img").attr("data-src", "https://cdn-dynmedia-1.microsoft.com/is/image/microsoftcorp/msft-Image-represents-copilot-creativity-productivity-RW1hQBO?scl=1");
$("#spring-feature picture source").remove();
$("#spring-feature picture img").attr("src", "https://cdn-dynmedia-1.microsoft.com/is/image/microsoftcorp/MSFT-copilot-plus-pcs-RW1jVsT?scl=1");
$("#spring-feature picture img").attr("data-src", "https://cdn-dynmedia-1.microsoft.com/is/image/microsoftcorp/MSFT-copilot-plus-pcs-RW1jVsT?scl=1");
$("#Win11Featurehero picture source").remove();
$("#Win11Featurehero picture img").attr("src", "https://cdn-dynmedia-1.microsoft.com/is/image/microsoftcorp/MSFT-copilot-plus-pcs-RW1jMi0?scl=1");
$("#Win11Featurehero picture img").attr("data-src", "https://cdn-dynmedia-1.microsoft.com/is/image/microsoftcorp/MSFT-copilot-plus-pcs-RW1jMi0?scl=1");
//}
}
});
$(document).ready(function () {
if (window.location.href.toLowerCase().indexOf("/windows/comprehensive-security") != -1) {
resizeComprehensivePanels();
}
if (window.location.href.toLowerCase().indexOf("/windows/photo-movie-editor") != -1) {
if ($(window).width() <= 767) {
$("#photoMovieEditor_Contentplacement").parent().css("padding-bottom", "48px");
} else if ($(window).width() >= 768 && $(window).width() <= 1083) {
$("#photoMovieEditor_Contentplacement .content-touts").attr('data-grid', 'col-6 pad-6x');
$("#photoMovieEditor_Contentplacement").parent().css("padding-bottom", "60px");
} else {
$("#photoMovieEditor_Contentplacement .content-touts").attr('data-grid', 'col-4 pad-6x');
$("#photoMovieEditor_Contentplacement").parent().css("padding-bottom", "90px");
}
}
});
/* Comprehensive Security popup ends */
//photo video popup starts
$(document).on("click keydown", "#windowsh22.photo-movie-editor .f-video-trigger button.c-action-trigger.c-glyph", function (e) {
if ((e.type == "click" || e.type == "keydown" && e.which == "13")) {
var lightBox = $("#default-lightbox");
var thisOverlay = $(this).parent().parent().parent();
var thisHasOverlay = thisOverlay.length != 0 ? true : false;
//$(this).addClass("photo-video-editor-popup");
if (thisHasOverlay) {
$("#default-lightbox").attr("aria-hidden", false);
var thisPanelHeading = $(this).attr("data-video-description");
$("#default-lightbox #dialog-container[role='dialog']").attr("aria-label", thisPanelHeading);
}
$('body').addClass('removeoverflow');
let keyPress = {};
setTimeout(function () {
$('#default-lightbox .nav-buttons button.glyph-cancel').focus();
$('#default-lightbox .nav-buttons button.c-glyph.glyph-cancel').keydown(function (e) {
var code = e.keyCode || e.which;
var ctaTile = $(this).parents('#default-lightbox').find('button.c-glyph.glyph-cancel').length;
keyPress[code] = (e.type == 'keydown');
if (code === 9 && ctaTile == 0) {
e.preventDefault();
$("this").focus();
}
else if (code == 27 || code == 13 || code == 32) {
$(".c-dialog button[data-js-dialog-hide]").click();
$("body").removeClass("removeoverflow").removeAttr("style");
}
else if (e.shiftKey && ctaTile == 0 || (e.shiftKey && e.keyCode === 9 && ctaTile == 0)) {
e.preventDefault();
$("this").focus();
}
else {
}
});
}, 100);
}
});
//photo video popup ends
/* Adding Dark Them to CatNav */
$("[data-theme] .js-global-head.global-head-cont").addClass("theme-dark").removeClass("theme-light");
$("[data-theme] .theme-dark #uhfLogo img").attr("src", "https://cdn-dynmedia-1.microsoft.com/is/image/microsoftcorp/MSFT_mslogo_RWLL6J?scl=1&fmt=png-alpha");
/* Making dropdown for the Link Navigation panel in Lower Viewport*/
});
$(document).ready(function () {
$(document).on("click", "#prefooterDrawer", function () {
var n = $(".wdg-support-links .c-link-navigation");
$(this).attr("aria-expanded", !n.is(":visible"));
$(".wdg-support-links .c-link-navigation").slideToggle();
});
$(document).on("click", ".end-of-support #PivotTarget2 #prefooterDrawer", function () {
var n = $(".wdg-support-links .c-link-navigation");
$(this).attr("aria-expanded", !n.is(":visible"));
$(".wdg-support-links .c-link-navigation").slideToggle();
});
$(".mscom-link.c-call-to-action").contents().wrap("");
$('#windowsh22.get-windows-11 .retailers li a').each(function () {
var oemArray = ["Dell", "HP", "Lenovo", "Acer", "ASUS", "Samsung", "Medion", "NEC", "Fujitsu", "Microsoft Store", "Microsoft"];
var dataRetailer = $(this).attr("data-retailer");
var oemValue = oemArray.indexOf(dataRetailer) != -1 ? "true" : "false";
$(this).attr("data-oem", oemValue);
});
/* comprehensive security start */
if (window.location.href.toLowerCase().indexOf("/windows/comprehensive-security") != -1) {
var winStickyNav = document.querySelector(".security-stickynav");
winStickyNav.parentElement.parentElement.parentElement.classList.add("full-width-sticky-nav");
}
/* comprehensive security end */
/* laptopbugingguide sticky issue start */
if (window.location.href.toLowerCase().indexOf("/windows/laptop-buying-guide") != -1) {
var winStickyNav = document.querySelector(".security-stickynav");
winStickyNav.parentElement.parentElement.parentElement.classList.add("full-width-sticky-nav");
}
/* laptopbugingguide sticky issue end */
});
var pcGamingAnimation;
var pcGamingAnimationGamecontrollerGoTop;
var pcGamingAnimationGamecontroller;
function parallax() {
pcGamingAnimation = gsap.timeline({
scrollTrigger: {
trigger: "#parallaxheroimage",
start: "-50% top",
end: "60% bottom",
scrub: 4,
markers: false
}
});
pcGamingAnimation.from(".parallax-hero-laptop-cls", { yPercent: -40, duration: 4 }, 1);
pcGamingAnimation.from("#parallaxheroimage .m-hero-item>div>div", { yPercent: 80, duration: 4 }, 1);
pcGamingAnimationGamecontrollerGoTop = gsap.timeline({
scrollTrigger: {
trigger: "#parallaxheroimage",
start: "30% top",
end: "bottom bottom",
scrub: 4,
// pin: ".parallax-hero-laptop-cls",
markers: false
}
});
pcGamingAnimationGamecontrollerGoTop.to("#parallaxheroimage .m-hero-item>div>div", { yPercent: -100, duration: 4 }, 2);
pcGamingAnimationGamecontrollerGoTop.to(".parallax-hero-laptop-cls", { yPercent: 15, duration: 4 }, 2);
pcGamingAnimationGamecontroller = gsap.timeline({
scrollTrigger: {
trigger: "#gamecontroller",
start: "top 85%",
end: "bottom bottom",
scrub: 4,
// pin: ".parallax-hero-laptop-cls",
markers: false
}
});
pcGamingAnimationGamecontroller.to("#gamecontroller .m-hero-item.f-y-center.f-transparent>div>div", { yPercent: -95, duration: 2 }, 3);
}
//Teams Chat Animation JS Starts
function winTeamsAnimationFunc() {
//ScrollTrigger.addEventListener("refresh", () => teamsAnimation.update());
//ScrollTrigger.refresh();
//teamsAnimation.pause(0).kill(true);
// ScrollTrigger.getByClass("pin-wrapper").kill(true);
var leftHeading = $(".left-heading .leftHeading").html();
var rightHeading = $(".right-heading .rightHeading").html();
var headingLength = 0;
//headingLength = (leftHeading.length > rightHeading.length) ? leftHeading.length : rightHeading.length;
headingLength = leftHeading == undefined && rightHeading == undefined ? 0 : (leftHeading.length > rightHeading.length) ? leftHeading.length : rightHeading.length;
if (headingLength < 20) {
$(".leftHeading").css("font-size", "34px");
$(".rightHeading").css("font-size", "34px");
}
else if (headingLength < 25) {
$(".leftHeading").css("font-size", "32px");
$(".rightHeading").css("font-size", "32px");
}
else if (headingLength < 35) {
$(".leftHeading").css("font-size", "27px");
$(".rightHeading").css("font-size", "27px");
}
else if (headingLength < 45) {
$(".leftHeading").css("font-size", "24px");
$(".rightHeading").css("font-size", "24px");
}
else if (headingLength > 50) {
$(".leftHeading").css("font-size", "20px");
$(".rightHeading").css("font-size", "20px");
}
var viewPortWidth = window.innerWidth;
var viewPortHeight = window.innerHeight;
var teamsImagescale = 0, teamsImageScaleEnd = 0, teamsImagePos = 0, leftHeadingPos = 0, rightHeadingPos = 0, featureContentPos = 0, featureImagePos = 0, rightImageScale = 0, leftImagePos = 0;
animationProperties();
if (viewPortWidth <= 1280) {
$("#chatTA").addClass("show").removeClass("hide");
$("#chat").addClass("hide").removeClass("show");
} else {
$("#chatTA").addClass("hide").removeClass("show");
$("#chat").addClass("show").removeClass("hide");
}
function animationProperties() {
//alert(viewPortWidth)
if (viewPortWidth >= 3001) {
teamsImagePos = -130;
teamsImagescale = 0.9;
teamsImageScaleEnd = 0.85;
leftHeadingPos = -0.13 * viewPortWidth;
rightHeadingPos = 0.13 * viewPortWidth;
leftImagePos = viewPortHeight * (-0.5);
featureContentPos = 0;
featureImagePos = '0px 80px';
rightImageScale = 2;
} else if (viewPortWidth >= 2700) {
teamsImagePos = -130;
teamsImagescale = 0.9;
teamsImageScaleEnd = 0.85;
leftHeadingPos = -340;
rightHeadingPos = 350;
leftImagePos = viewPortHeight * (-0.6);
featureContentPos = 0;
featureImagePos = '0px 80px';
rightImageScale = 2;
} else if (viewPortWidth >= 2100) {
teamsImagePos = -130;
teamsImagescale = 0.9;
teamsImageScaleEnd = 0.85;
leftHeadingPos = -340;
rightHeadingPos = 350;
leftImagePos = viewPortHeight * (-0.6);
featureContentPos = 0;
featureImagePos = '0px 80px';
rightImageScale = 2;
}
else if (viewPortWidth >= 1880) {
teamsImagePos = -130;
teamsImagescale = 0.9;
teamsImageScaleEnd = 0.85;
leftHeadingPos = -270;
rightHeadingPos = 280;
leftImagePos = -695;
featureContentPos = 0;
featureImagePos = '0px 80px';
rightImageScale = 2.2;
}
else if (viewPortWidth >= 1798) {
teamsImagePos = -130;
teamsImagescale = 0.9;
teamsImageScaleEnd = 0.85;
leftHeadingPos = -270;
rightHeadingPos = 280;
leftImagePos = -900;
featureContentPos = 0;
featureImagePos = '0px 80px';
rightImageScale = 2.2;
}
else if (viewPortWidth >= 1780) {
teamsImagePos = -275;
teamsImagescale = 0.9;
teamsImageScaleEnd = 0.85;
leftHeadingPos = -235;
rightHeadingPos = 235;
leftImagePos = -800;
featureContentPos = 0;
rightImageScale = 2.1;
featureImagePos = '0px 80px';
}
else if (viewPortWidth >= 1680) {
teamsImagePos = -155;
teamsImagescale = 0.9;
teamsImageScaleEnd = 0.85;
leftHeadingPos = -260;
rightHeadingPos = 260;
leftImagePos = -690;
featureContentPos = 0;
rightImageScale = 2.1;
featureImagePos = '0px 80px';
}
else if (viewPortWidth >= 1570) {
teamsImagePos = -205;
teamsImagescale = 0.9;
teamsImageScaleEnd = 0.85;
leftHeadingPos = -225;
rightHeadingPos = 240;
leftImagePos = -770;
featureContentPos = 0;
rightImageScale = 2;
featureImagePos = '0px 80px';
}
else if (viewPortWidth >= 1480) {
teamsImagePos = -188;
teamsImagescale = 0.8;
teamsImageScaleEnd = 0.75;
leftHeadingPos = -215;
rightHeadingPos = 215;
leftImagePos = -790;
featureContentPos = 0;
rightImageScale = 1.9;
featureImagePos = '0px 80px';
}
else if (viewPortWidth >= 1400) {
teamsImagePos = -188;
teamsImagescale = 0.8;
teamsImageScaleEnd = 0.75;
leftHeadingPos = -215;
rightHeadingPos = 215;
leftImagePos = -790;
featureContentPos = 0;
rightImageScale = 1.9;
featureImagePos = '0px 80px';
}
else if (viewPortWidth >= 1390) {
teamsImagePos = -181;
teamsImagescale = 0.8;
teamsImageScaleEnd = 0.75;
leftHeadingPos = -200;
rightHeadingPos = 220;
leftImagePos = -935;
featureContentPos = 0;
rightImageScale = 2;
featureImagePos = '0px 80px';
}
else if (viewPortWidth >= 1380) {
teamsImagePos = -181;
teamsImagescale = 0.8;
teamsImageScaleEnd = 0.75;
leftHeadingPos = -200;
rightHeadingPos = 220;
leftImagePos = -780;
featureContentPos = 0;
rightImageScale = 2;
featureImagePos = '0px 80px';
}
else if (viewPortWidth >= 1281) {
teamsImagePos = -205;
teamsImagescale = 0.8;
teamsImageScaleEnd = 0.75;
leftHeadingPos = -175;
rightHeadingPos = 190;
leftImagePos = -770;
featureContentPos = 0;
featureImagePos = '15px 40px';
rightImageScale = 2.2;
}
if (window.location.href.toLowerCase().indexOf("/ar-xm/windows/windows-11") != -1 || window.location.href.toLowerCase().indexOf("/he-il/windows/windows-11") != -1) {
if (viewPortWidth >= 1920) {
leftHeadingPos = -300;
rightHeadingPos = 235;
}
else if (viewPortWidth >= 1880) {
leftHeadingPos = -270;
rightHeadingPos = 210;
}
else if (viewPortWidth >= 1798) {
leftHeadingPos = -270;
rightHeadingPos = 215;
}
else if (viewPortWidth >= 1780) {
leftHeadingPos = -240;
rightHeadingPos = 155;
}
else if (viewPortWidth >= 1680) {
leftHeadingPos = -225;
rightHeadingPos = 165;
}
else if (viewPortWidth >= 1570) {
leftHeadingPos = -230;
rightHeadingPos = 165;
}
else if (viewPortWidth >= 1480) {
leftHeadingPos = -220;
rightHeadingPos = 135;
}
else if (viewPortWidth >= 1380) {
leftHeadingPos = -180;
rightHeadingPos = 115;
}
else if (viewPortWidth >= 1281) {
leftHeadingPos = -175;
rightHeadingPos = 115;
}
}
//else if (viewPortWidth >= 1280) {
// teamsImagePos = -235;
// teamsImagescale = 0.75;
// leftHeadingPos = -175;
// rightHeadingPos = 190;
// leftImagePos = -810;
// featureContentPos = 0;
// featureImagePos = '15px 40px';
// rightImageScale = 2.1;
//}
}
var animationDuration = $(".text-image-container").innerHeight() - $(window).innerHeight();
var teamsAnimation = gsap.timeline({
scrollTrigger: {
trigger: ".pin-wrapper",
start: "top top",
end: "130% bottom",
invalidateOnRefresh: true,
scrub: 2,
pin: ".pin-wrapper"
//markers: true
}
});
//ScrollTrigger.addEventListener("refreshInit", () => progress = teamsAnimation.progress);
//ScrollTrigger.addEventListener("refresh", () => teamsAnimation.scroll(progress * ScrollTrigger.maxScroll(window)));
var teamsAnimationvideo = gsap.timeline({
scrollTrigger: {
trigger: "#chatTA",
start: "30% 30%",
end: "80% 80%",
scrub: 4,
//markers: true
}
});
//var teamsConnect = gsap.timeline({
// scrollTrigger: {
// trigger: ".teams-connect-container",
// start: "top top",
// end: "bottom bottom",
// scrub: 4,
// pin: ".teams-connect",
// }
//});
//teamsAnimationvideo.to(".teamsVideo",{display:"none"}); className: "+=show gggg"
//teamsAnimation.to("#teams-container", { backgroundColor: "#e2eff9" , duration: 0.1, ease: "slow(0.7, 0.7, false)" });
teamsAnimation.to(".teams-icon", { scale: 0.7, duration: 0.1 })
.to(".teams-icon", { scale: 0.8, duration: 0.1 });
//teamsAnimationvideo.set(".teamsVideo", {className: "+=m-ambient-video f-lean mp4inline play-on-focus inline-popup white-theme no-play-pause teamsVideo video-played hide"});
teamsAnimation.set(".pin-image.teams-icon", { className: "+=pin-image teams-icon hide" });
teamsAnimation.set(".pin-image.teams-image", { className: "+=pin-image teams-image show" })
teamsAnimation.to(".pin-image.teams-image", { scale: teamsImagescale })
.to(".left-heading", { opacity: "1", x: leftHeadingPos, ease: "expo.out" }, ">")
.to(".right-heading", { opacity: "1", x: rightHeadingPos, ease: "expo.out" }, "<")
.to(".left-heading", { y: '-310', ease: "expo.in" }, ">")
.to(".right-heading", { y: '-310', ease: "expo.in" }, "<")
.to(".pin-image.teams-image", { scale: teamsImageScaleEnd }).to(".feature-content", { opacity: "1", y: leftImagePos, ease: "expo.out" })
.to(".feature-panel-right-image img", { opacity: "1", scale: rightImageScale, ease: "expo.out" })
.to(".pin-image.teams-image", { scale: teamsImageScaleEnd });
//teamsConnect.fromTo(".teams-connect img", { duration: 0 }, { delay: 0.2, opacity: "1", scale: 1.5 });
}
//Teams Chat Animation JS Ends
$(window).resize(function () {
if (window.location.href.toLowerCase().indexOf("/en-us/windows/windows-11-pc-gaming") != -1) {
var windowWidth = $(window).width();
if (windowWidth > 1280) {
parallax();
}
}
//teamsAnimation.scrollTrigger.refresh();
if (window.location.pathname.toLowerCase().split("/").pop() == "windows-11") {
winTeamsAnimationFunc();
}
});
//var teamsAnimation;
$(document).ready(function () {
$('.get-windows-11 #retailers li a').each(function () {
var oemArray = ["Dell", "HP", "Lenovo", "Acer", "ASUS", "Samsung", "Medion", "NEC", "Fujitsu", "Microsoft Store", "Microsoft"];
var dataRetailer = $(this).attr("data-retailer");
var oemValue = oemArray.indexOf(dataRetailer) != -1 ? "true" : "false";
$(this).attr("data-oem", oemValue);
});
if (window.location.href.toLowerCase().indexOf("/en-us/windows/windows-11-pc-gaming") != -1) {
var windowWidth1 = $(window).width();
if (windowWidth1 > 1280) {
parallax();
}
}
if (window.location.pathname.toLowerCase().split("/").pop() == "windows-11") {
winTeamsAnimationFunc();
}
});
// Windows 11 gradient effect changes starts
$(window).on('load resize', function (e) {
// var videoItem = $(".windows-11-pc-gaming .gradient-effect .videobutton");
var articlevideoItem = $(".featured-products-bleed-area .mp4inline button");
// videoItem.removeClass("glyph-play").addClass("glyph-pause");
articlevideoItem.removeClass("glyph-play").addClass("glyph-pause");
// var videoItem = $(".end-of-support #windowsTransfer .m-feature > picture .videobutton");
// videoItem.removeClass("glyph-play").addClass("glyph-pause");
// videoItem.removeClass("glyph-pause").addClass("glyph-play");
// videoanimationPanel1EOS();
});
$(document).ready(function () {
// videoanimationPanel1EOS();
$(".showinhigherVp.gradient").each(function (index) {
var _that = $(this);
var videoText = _that.find(".m-hero-item.gradient-effect>div>div");
var videoGrad = _that.find(".m-hero-item.gradient-effect");
videoText.css("display", "none");
$(this).find('.mp4videoinline').on("play", function () {
videoText.fadeOut('3s');
videoGrad.removeAttr("id");
var a = _that.find('.m-hero-item.gradient-effect .mp4inline .videobutton');
});
$(this).find('.mp4videoinline').on("pause ended", function () {
videoGrad.attr('id', videoGrad.attr('data-grad-id'));
videoText.fadeIn('3s');
var b = _that.find('.m-hero-item.gradient-effect .mp4inline .videobutton');
b.removeAttr('title');
});
})
gsap.utils.toArray(".FeaturePanels").forEach(function (FeaturePanels, i) {
ScrollTrigger.create({
trigger: FeaturePanels,
start: "top",
pin: true,
pinSpacing: false
});
});
gsap.utils.toArray(".FeaturePanelslast").forEach(function (FeaturePanelslast, i) {
ScrollTrigger.create({
trigger: FeaturePanelslast,
start: "top",
pin: true,
pinSpacing: false,
end: "top"
});
});
});
// Windows 11 gradient effect changes ends
//10-03-2022
var gettingStartedMetaJSON = {
"EN-US": [{
"TitleWin10": "Discover the best of Windows",
"TitleWin11": "Getting started with your new Windows PC",
"DescriptionWin10": "Discover all that Windows has to offer. Get tips to make the most of Windows 10 and check for Windows 11 compatibility.",
"DescriptionWin11": "Discover all that Windows 11 has to offer with this Welcome to Windows page by Microsoft. Learn about new features and quick tips in this Windows 11 guide.",
"KeywordsWin10": "windows 10 tips, get started with windows",
"KeywordsWin11": "welcome to windows, windows 11 guide",
"SocialShareImageWin10": "https://cdn-dynmedia-1.microsoft.com/is/image/microsoftcorp/MSFT-Woman-sitting-down-with-PC-on-her-lap-RWNb4X?scl=1",
"SocialShareImageWin11": "https://cdn-dynmedia-1.microsoft.com/is/image/microsoftcorp/MSFT-PC%20with-Windows-Widgets-and-bloom-in-background-RWNb7V?scl=1"
}],
"DE-DE": [{
"TitleWin10": "Entdecken Sie die Vorzüge von Windows",
"TitleWin11": "Erste Schritte mit Ihrem neuen Windows-PC",
"DescriptionWin10": "Finden Sie heraus, was Windows zu bieten hat. Erfahren Sie, wie Sie Windows 10 optimal nutzen können und prüfen Sie die Kompatibilität mit Windows 11.",
"DescriptionWin11": "Entdecken Sie mit dieser „Willkommen bei Windows“-Seite von Microsoft alles, was Windows 11 zu bieten hat. Erfahren Sie in diesem Windows 11-Leitfaden mehr über neue Funktionen und Schnelltipps.",
"KeywordsWin10": "tipps für windows 10, erste schritte mit windows",
"KeywordsWin11": "Willkommen bei Windows, Windows 11-Leitfaden",
"SocialShareImageWin10": "https://cdn-dynmedia-1.microsoft.com/is/image/microsoftcorp/MSFT-Woman-sitting-down-with-PC-on-her-lap-RWNb4X?scl=1",
"SocialShareImageWin11": "https://cdn-dynmedia-1.microsoft.com/is/image/microsoftcorp/MSFT-PC%20with-Windows-Widgets-and-bloom-in-background-RWNb7V?scl=1"
}],
"EN-AU": [{
"TitleWin10": "Discover the best of Windows",
"TitleWin11": "Getting started with your new Windows PC",
"DescriptionWin10": "Discover all that Windows has to offer. Get tips to make the most of Windows 10 and check for Windows 11 compatibility.",
"DescriptionWin11": "Discover all that Windows 11 has to offer with this Welcome to Windows page by Microsoft. Learn about new features and quick tips in this Windows 11 guide.",
"KeywordsWin10": "windows 10 tips, get started with windows",
"KeywordsWin11": "welcome to windows, windows 11 guide",
"SocialShareImageWin10": "https://cdn-dynmedia-1.microsoft.com/is/image/microsoftcorp/MSFT-Woman-sitting-down-with-PC-on-her-lap-RWNb4X?scl=1",
"SocialShareImageWin11": "https://cdn-dynmedia-1.microsoft.com/is/image/microsoftcorp/MSFT-PC%20with-Windows-Widgets-and-bloom-in-background-RWNb7V?scl=1"
}],
"EN-CA": [{
"TitleWin10": "Discover the best of Windows",
"TitleWin11": "Getting started with your new Windows PC",
"DescriptionWin10": "Discover all that Windows has to offer. Get tips to make the most of Windows 10 and check for Windows 11 compatibility.",
"DescriptionWin11": "Discover all that Windows 11 has to offer with this Welcome to Windows page by Microsoft. Learn about new features and quick tips in this Windows 11 guide.",
"KeywordsWin10": "windows 10 tips, get started with windows",
"KeywordsWin11": "welcome to windows, windows 11 guide",
"SocialShareImageWin10": "https://cdn-dynmedia-1.microsoft.com/is/image/microsoftcorp/MSFT-Woman-sitting-down-with-PC-on-her-lap-RWNb4X?scl=1",
"SocialShareImageWin11": "https://cdn-dynmedia-1.microsoft.com/is/image/microsoftcorp/MSFT-PC%20with-Windows-Widgets-and-bloom-in-background-RWNb7V?scl=1"
}],
"EN-GB": [{
"TitleWin10": "Discover the best of Windows",
"TitleWin11": "Getting started with your new Windows PC",
"DescriptionWin10": "Discover all that Windows has to offer. Get tips to make the most of Windows 10 and check for Windows 11 compatibility.",
"DescriptionWin11": "Discover all that Windows 11 has to offer with this Welcome to Windows page by Microsoft. Learn about new features and quick tips in this Windows 11 guide.",
"KeywordsWin10": "windows 10 tips, get started with windows",
"KeywordsWin11": "welcome to windows, windows 11 guide",
"SocialShareImageWin10": "https://cdn-dynmedia-1.microsoft.com/is/image/microsoftcorp/MSFT-Woman-sitting-down-with-PC-on-her-lap-RWNb4X?scl=1",
"SocialShareImageWin11": "https://cdn-dynmedia-1.microsoft.com/is/image/microsoftcorp/MSFT-PC%20with-Windows-Widgets-and-bloom-in-background-RWNb7V?scl=1"
}],
"FR-CA": [{
"TitleWin10": "Découvrez le meilleur de Windows",
"TitleWin11": "Pour commencer avec votre nouveau PC Windows",
"DescriptionWin10": "Découvrez tout ce que Windows a à offrir. Obtenez des conseils pour tirer profit au maximum de Windows 10 et découvrez si votre appareil est compatible avec Windows 11.",
"DescriptionWin11": "Découvrez tout ce que Windows 11 peut vous offrir avec cette page de Bienvenue dans Windows de Microsoft. Découvrez les nouvelles fonctionnalités et les conseils rapides dans ce guide de Windows 11.",
"KeywordsWin10": "conseils windows 10, mise en route de windows",
"KeywordsWin11": "bienvenue dans windows, guide windows 11",
"SocialShareImageWin10": "https://cdn-dynmedia-1.microsoft.com/is/image/microsoftcorp/MSFT-Woman-sitting-down-with-PC-on-her-lap-RWNb4X?scl=1",
"SocialShareImageWin11": "https://cdn-dynmedia-1.microsoft.com/is/image/microsoftcorp/MSFT-PC%20with-Windows-Widgets-and-bloom-in-background-RWNb7V?scl=1"
}],
"FR-FR": [{
"TitleWin10": "Découvrez le meilleur de Windows",
"TitleWin11": "Prenez en main votre nouveau PC Windows",
"DescriptionWin10": "Découvrez tout ce que Windows peut offrir. Obtenez des astuces pour tirer le meilleur parti de Windows 10 et vérifiez la compatibilité de Windows 11.",
"DescriptionWin11": "Découvrez tout ce que Windows 11 a à offrir avec cette page de bienvenue créée par Microsoft. Découvrez les nouvelles fonctionnalités et quelques astuces dans ce guide de Windows 11.",
"KeywordsWin10": "astuces Windows 10, prise en main de Windows",
"KeywordsWin11": "bienvenue dans windows, guide de Windows 11",
"SocialShareImageWin10": "https://cdn-dynmedia-1.microsoft.com/is/image/microsoftcorp/MSFT-Woman-sitting-down-with-PC-on-her-lap-RWNb4X?scl=1",
"SocialShareImageWin11": "https://cdn-dynmedia-1.microsoft.com/is/image/microsoftcorp/MSFT-PC%20with-Windows-Widgets-and-bloom-in-background-RWNb7V?scl=1"
}],
"JA-JP": [{
"TitleWin10": "Windows の最も素晴らしい機能を確認しましょう",
"TitleWin11": "Windows PC の新機能の使用を開始する",
"DescriptionWin10": "Windows が提供するすべてをご確認ください。Windows 10 の最大活用に役立つヒント集を入手して Windows 11 との互換性をご確認ください。",
"DescriptionWin11": "Microsoft が提供する、この「Windows へようこそ」ページで、Windows 11 が提供するすべてをご確認ください。この Windows 11 ガイドの新機能と簡単なヒントについてご覧ください。",
"KeywordsWin10": "Windows 10 のヒント集、Windows の使用を開始",
"KeywordsWin11": "Windows へようこそ, Windows 11 ガイド",
"SocialShareImageWin10": "https://cdn-dynmedia-1.microsoft.com/is/image/microsoftcorp/MSFT-Woman-sitting-down-with-PC-on-her-lap-RWNb4X?scl=1",
"SocialShareImageWin11": "https://cdn-dynmedia-1.microsoft.com/is/image/microsoftcorp/MSFT-PC%20with-Windows-Widgets-and-bloom-in-background-RWNb7V?scl=1"
}],
"ZH-CN": [{
"TitleWin10": "探索最好的 Windows",
"TitleWin11": "开始使用新的 Windows 电脑",
"DescriptionWin10": "探索 Windows 提供的所有功能。获取充分利用 Windows 10 的提示,并检查 Windows 11 的兼容性。",
"DescriptionWin11": "通过 Microsoft 的“欢迎使用 Windows”(Welcome to Windows) 页面了解 Windows 11 的所有功能。了解该 Windows 11 指南中的新功能和快速提示。",
"KeywordsWin10": "windows 10 提示,windows 入门",
"KeywordsWin11": "欢迎使用 windows 和 windows 11 指南",
"SocialShareImageWin10": "https://cdn-dynmedia-1.microsoft.com/is/image/microsoftcorp/MSFT-Woman-sitting-down-with-PC-on-her-lap-RWNb4X?scl=1",
"SocialShareImageWin11": "https://cdn-dynmedia-1.microsoft.com/is/image/microsoftcorp/MSFT-PC%20with-Windows-Widgets-and-bloom-in-background-RWNb7V?scl=1"
}]
}
if (window.location.href.toLowerCase().indexOf("/getting-started") != -1) {
var gettingStartedMeta = window.gettingStartedMeta || {};
gettingStartedMeta = gettingStartedMetaJSON;
}
$(document).ready(function () {
let allTips = document.querySelectorAll(".featured-single-card.tipsRedesign:not(.hide)");
for (i = 0; i < allTips.length; i++) {
if (i > 14) {
allTips[i].className = allTips[i].className + " hide";
}
}
if (allTips.length < 15) {
$('.tipstricks-loadmore').addClass("hide");
}
});
$('.tipstricks-loadmore').on('click', function () {
let allTips = document.querySelectorAll(".featured-single-card.tipsRedesign");
let filterView = document.querySelectorAll(".tipstricks-filter");
let selectedFilter = []
for (i = 0; i < filterView.length; i++) {
if (filterView[i].className.includes("clicked-btn")) {
selectedFilter.push(filterView[i].getAttribute("url-name"));
}
}
if (selectedFilter.length == 0) {
for (i = 15; i < allTips.length; i++) {
allTips[i].className = allTips[i].className.replace(" hide", "");
}
}
else {
let tiptricksLength = allTips.length;
for (i = 0; i < selectedFilter.length; i++) {
for (j = 0; j < tiptricksLength; j++) {
let tileFilters = allTips[j].getAttribute("tagname");
if (tileFilters.includes(selectedFilter[i])) {
allTips[j].className = allTips[j].className.replace(" hide", "");
}
else if (selectedFilter[i] == "Shortcuts" && allTips[j].getAttribute("shortcut") == "true") {
allTips[j].className = allTips[j].className.replace(" hide", "");
}
}
}
}
$(allTips[15]).find('a').focus();
$('.tipstricks-loadmore').addClass("hide");
});
var urlOld = window.location.href.toLowerCase();
if (window.location.href.toLowerCase().indexOf("ocid") != -1) {
var ocidVariationparamOld = GetQueryStringParams_upgrade("ocid");
}
else {
var ocidVariationparamOld = "";
}
$('.tipsTricks-filters-section .tipstricks-filter').on('click', function () {
$('.tipstricks-loadmore').addClass("hide");
let allTips = document.querySelectorAll(".featured-single-card.tipsRedesign");
for (i = 0; i < allTips.length; i++) {
if (!allTips[i].className.includes("hide")) {
allTips[i].className = allTips[i].className + " hide";
}
}
//filter colour based on selection
if (this.className.includes("clicked-btn")) {
$(this).removeClass("clicked-btn");
$(this).attr("aria-pressed", "false");
}
else {
$(this).addClass("clicked-btn");
$(this).attr("aria-pressed", "true");
}
filterDataMap();
checkIfAllFilterUnselect();
filterClickLoadMore();
if (window.location.href.toLowerCase().indexOf("/en-us/windows/features") != -1 || window.location.href.toLowerCase().indexOf("/en-us/windows/tips-and-tricks") != -1) {
if (window.location.href.toLowerCase().indexOf("ocid") != -1) {
var ocidVariationparam = GetQueryStringParams_upgrade("ocid");
if (ocidVariationparam.toLowerCase().indexOf("prod_growthcenter_cons_cge_eng_spotlight_lockscreenw11_virtualdesktops") == 0) {
if (window.location.href.toLowerCase().indexOf("productivity") != -1) {
$('.featured-single-card.Productivity_ocid').removeClass('hide');
}
else if (window.location.href.toLowerCase().indexOf("organization") != -1 || window.location.href.toLowerCase().indexOf("personalization") != -1) {
$('.featured-single-card.Productivity_ocid').removeClass('hide');
}
else {
$('.featured-single-card.Productivity_ocid').addClass('hide');
}
if (urlOld.indexOf("productivity") != -1 && ocidVariationparamOld.toLowerCase().indexOf("prod_growthcenter_cons_cge_eng_spotlight_lockscreenw11_virtualdesktops") == 0) {
$('.featured-single-card.Productivity_ocid').removeClass('hide');
$('.featured-single-card.Productivity_ocid').css('order', '-1');
}
}
else if (window.location.href.toLowerCase().indexOf("organization") != -1 || window.location.href.toLowerCase().indexOf("personalization") != -1) {
$('.featured-single-card.Productivity_ocid').removeClass('hide');
}
else {
$('.featured-single-card.Productivity_ocid').addClass('hide');
}
}
else if (window.location.href.toLowerCase().indexOf("organization") != -1 || window.location.href.toLowerCase().indexOf("personalization") != -1) {
$('.featured-single-card.Productivity_ocid').removeClass('hide');
}
else {
$('.featured-single-card.Productivity_ocid').addClass('hide');
}
let filterStatus = document.querySelectorAll(".tipstricks-filter");
let cnt = 0;
for (i = 0; i < filterStatus.length; i++) {
if (filterStatus[i].className.includes("clicked-btn")) {
cnt++;
}
}
if (cnt == 0) {
if (urlOld.indexOf("productivity") != -1 && ocidVariationparamOld.toLowerCase().indexOf("prod_growthcenter_cons_cge_eng_spotlight_lockscreenw11_virtualdesktops") == 0) {
for (i = 0; i < 15; i++) {
if (allTips[i].className.includes("hide"))
allTips[i].className = allTips[i].className.replace("hide", "");
}
$('.featured-single-card.Productivity_ocid').removeClass('hide');
}
else {
for (i = 1; i < 16; i++) {
if (allTips[i].className.includes("hide"))
allTips[i].className = allTips[i].className.replace("hide", "");
}
$('.featured-single-card.Productivity_ocid').addClass('hide');
}
$('.tipstricks-loadmore').removeClass("hide");
// var ocidVariationparamNew = GetQueryStringParams_upgrade("ocid");
// if (urlOld.indexOf("productivity") != -1 || ocidVariationparamOld.toLowerCase().indexOf("prod_growthcenter_cons_cge_eng_spotlight_lockscreenw11_virtualdesktops") == 0) {
// $('.featured-single-card.Productivity_ocid').addClass('hide');
// }
// else if ((urlOld.indexOf("productivity") != -1 && (window.location.href.toLowerCase().indexOf("/en-us/windows/features?ocid=prod_growthcenter_cons_cge_eng_spotlight_lockscreenw11_virtualdesktops") != -1 || window.location.href.toLowerCase().indexOf("/en-us/windows/tips-and-tricks?ocid=prod_growthcenter_cons_cge_eng_spotlight_lockscreenw11_virtualdesktops") != -1) || urlOld.indexOf("productivity") != -1)) {
// $('.featured-single-card.Productivity_ocid').removeClass('hide');
// }
}
}
});
//Filter based Data
function filterDataMap() {
let allTips = document.querySelectorAll(".featured-single-card.tipsRedesign");
let filterView = document.querySelectorAll(".tipstricks-filter");
let selectedFilter = [], filterUrl = [];
for (i = 0; i < filterView.length; i++) {
if (filterView[i].className.includes("clicked-btn")) {
selectedFilter.push(filterView[i].getAttribute("url-name"));
filterUrl.push(filterView[i].getAttribute("url-name"));
}
}
let allFilters = ["accessibility", "chat", "organization", "personalization", "productivity", "search", "security", "touch"];
//hide unselected data
for (j = 0; j < selectedFilter.length; j++) {
for (i = 0; i < allFilters.length; i++) {
if (selectedFilter[j] == allFilters[i]) {
allFilters.splice(i, 1);
}
}
}
let tiptricksLength = allTips.length;
for (i = 0; i < selectedFilter.length; i++) {
for (j = 0; j < tiptricksLength; j++) {
let tileFilters = allTips[j].getAttribute("tagname");
if (tileFilters.includes(selectedFilter[i])) {
allTips[j].className = allTips[j].className.replace(" hide", "");
}
else if (selectedFilter[i] == "Shortcuts" && allTips[j].getAttribute("shortcut") == "true") {
allTips[j].className = allTips[j].className.replace(" hide", "");
}
}
}
//for (i = 0; i < allTips.length; i++) {
/* if (allTips[i].getAttribute("tagname") == filterSelected) {
allTips[i].className = allTips[i].className.replace(" hide", "");
}
else {
if (!allTips[i].className.includes("hide")) {
allTips[i].className = allTips[i].className + " hide";
}
}
}*/
let hashValue = window.location.hash.toLowerCase();
let filterQuery = selectedFilter.length == 0 ? '' : '?filter=';
if (window.location.href.toLowerCase().indexOf("/en-us/windows/features") != -1 || window.location.href.toLowerCase().indexOf("/en-us/windows/tips-and-tricks") != -1) {
if (filterUrl.length > 0 || window.location.href.toLowerCase().indexOf("ocid") != -1) {
if (window.location.href.toLowerCase().indexOf("ocid") != -1) {
var ocidVariationparam = GetQueryStringParams_upgrade("ocid");
if (window.location.href.toLowerCase().indexOf(ocidVariationparam) != -1 && filterUrl.length == 0) {
filterQuery = "?" + window.location.href.split("&")[1];
}
else if (window.location.href.toLowerCase().indexOf(ocidVariationparam) != -1 && filterUrl.length > 0) {
for (let i = 0; i < filterUrl.length; i++) {
filterQuery += (i == filterUrl.length - 1) ? filterUrl[i] : filterUrl[i] + ',';
}
if (window.location.href.toLowerCase().indexOf("?ocid") != -1) {
filterQuery = filterQuery + "&" + window.location.href.split("?")[1];
}
else {
filterQuery = filterQuery + "&" + window.location.href.split("&")[1];
}
//filterQuery = filterQuery + "&" + window.location.href.split("&")[1];
}
else if (filterUrl.length > 0) {
for (let i = 0; i < filterUrl.length; i++) {
filterQuery += (i == filterUrl.length - 1) ? filterUrl[i] : filterUrl[i] + ',';
}
}
}
else if (filterUrl.length > 0 && !(window.location.href.toLowerCase().indexOf("ocid") != -1)) {
for (let i = 0; i < filterUrl.length; i++) {
filterQuery += (i == filterUrl.length - 1) ? filterUrl[i] : filterUrl[i] + ',';
}
}
}
}
else {
if (filterUrl.length > 0) {
for (let i = 0; i < filterUrl.length; i++) {
filterQuery += (i == filterUrl.length - 1) ? filterUrl[i] : filterUrl[i] + ',';
}
}
}
if (hashValue == "" || hashValue != "") {
history.pushState({ page: "tips-and-tricks" }, "Title", window.location.pathname + filterQuery);
}
// if (hashValue == "" || hashValue != "") {
// history.pushState({ page: "tips-and-tricks" }, "Title", window.location.pathname + filterQuery);
// }
}
//Filter unselect Data
function filterDataUnmap(filterSelected) {
let allTips = document.querySelectorAll(".featured-single-card.tipsRedesign");
for (i = 0; i < allTips.length; i++) {
let tileFilters = allTips[i].getAttribute("tagname");
if (tileFilters.includes(filterSelected)) {
allTips[i].className = allTips[i].className + " hide";
}
}
}
//Check if all filters are unselect
function checkIfAllFilterUnselect() {
let filterStatus = document.querySelectorAll(".tipstricks-filter");
let cnt = 0;
for (i = 0; i < filterStatus.length; i++) {
if (filterStatus[i].className.includes("clicked-btn")) {
cnt++;
}
}
if (cnt == 0) {
let allTips = document.querySelectorAll(".featured-single-card.tipsRedesign");
$('.tipstricks-loadmore').removeClass("hide");
let tiptricksLength = $('.tipstricks-loadmore').hasClass('hide') ? allTips.length : 15;
for (i = 0; i < tiptricksLength; i++) {
if (allTips[i].className.includes("hide"))
allTips[i].className = allTips[i].className.replace("hide", "");
}
}
//$('.featured-single-card.Productivity_ocid').addClass('hide');
}
$(document).ready(function () {
$("#windowsh22.windows #playpopup-hero .m-feature button.videobutton").addClass('glyph-play center');
$(".holiday-animated-hero .m-hero-item").each(function () {
// $(this).addClass("scroll");
// $(this).addClass("fadein");
var _height = $(this).offset().top;
var wh = window.pageYOffset || document.documentElement.scrollTop;
var _wh = wh + 100;
if (_wh > _height) {
if (!$(this).hasClass("video-played") && $(".hubmain").hasClass("animation-true")) {
$(this).find(".videobutton").trigger("click");
}
// if(!$('.switch').find("#inputToggle").is(':checked') && $(".hubmain").hasClass("animation-true")) {
// $("#inputToggle").trigger("click");
// }
}
if (navigator.userAgent.indexOf('Firefox') != -1) {
$('#windowsh22.windows .m-hero-item .videobutton').trigger("click");
$('#windowsh22.windows-11 .m-hero-item .videobutton').trigger("click");
}
});
if ((window.location.href.toLowerCase().indexOf("/features") != -1 || window.location.href.toLowerCase().indexOf("/tips-and-tricks") != -1 || window.location.href.toLowerCase().indexOf("/getting-started") != -1) && $(".featured-single-card.tipsRedesign").length > 0) {
let allTips = document.querySelectorAll(".featured-single-card.tipsRedesign");
let jk = 0;
for (i = 0; i < allTips.length; i++) {
allTips[i].setAttribute('tipNo', jk + 1);
jk++;
}
$(".feature-filtering").removeClass("hide");
$(".features-filter-section").removeClass("hide");
$(".tipstricks-loadmore").removeClass("hide");
$(".tips-current-position").removeClass("hide");
$(".tips-tricks-left").removeClass("hide");
$(".tips-tricks-right").removeClass("hide");
}
$('#default-lightbox .nav-buttons button.tips-tricks-right').on('click', function () {
var $this = $(this);
let allTips = document.querySelectorAll(".featured-single-card.tipsRedesign");
window.location.hash = '';
if (window.location.href.toLowerCase().endsWith("#")) {
var urlPath = window.location.href;
if (urlPath.indexOf('/features') != -1) {
history.pushState({ page: "features" }, "Title", window.location.pathname + window.location.search);
}
else if (urlPath.indexOf('/tips-and-tricks') != -1) {
history.pushState({ page: "tips-and-tricks" }, "Title", window.location.pathname + window.location.search);
}
}
for (i = 0; i < allTips.length; i++) {
if (allTips[i].className.includes("tips-tricks-popup")) {
if (allTips[i].className.includes("clicked")) {
allTips[i].className = allTips[i].className.replace("clicked", "");
}
allTips[i].className = allTips[i].className.replace("tips-tricks-popup", "");
if (!allTips[i + 1].className.includes("hide")) {
$('.featured-cards-group').children().eq(i + 1).click();
break;
} else {
let nextActiveTile = activeTile(i);
$('.featured-cards-group').children().eq(nextActiveTile).click();
break;
}
}
}
setTimeout(function () {
$this.attr("aria-pressed", "true");
$this.focus();
}, 110);
});
$('#default-lightbox .nav-buttons button.tips-tricks-left').on('click', function () {
var $this = $(this);
let allTips = document.querySelectorAll(".featured-single-card.tipsRedesign");
window.location.hash = '';
if (window.location.href.endsWith("#")) {
var urlPath = window.location.href;
if (urlPath.indexOf('/features') != -1) {
history.pushState({ page: "features" }, "Title", window.location.pathname + window.location.search);
}
else if (urlPath.indexOf('/tips-and-tricks') != -1) {
history.pushState({ page: "tips-and-tricks" }, "Title", window.location.pathname + window.location.search);
}
}
for (i = 0; i < allTips.length; i++) {
if (allTips[i].className.includes("tips-tricks-popup")) {
if (allTips[i].className.includes("clicked")) {
allTips[i].className = allTips[i].className.replace("clicked", "");
}
allTips[i].className = allTips[i].className.replace("tips-tricks-popup", "");
if (!allTips[i - 1].className.includes("hide")) {
$('.featured-cards-group').children().eq(i - 1).click();
break;
} else {
let nextActiveTile = previousActiveTile(i);
$('.featured-cards-group').children().eq(nextActiveTile).click();
break;
}
}
}
setTimeout(function () {
$this.attr("aria-pressed", "true");
$this.focus();
}, 110);
});
});
//Enabling left navigation and right navigation while routing between tiles
function leftRightNavigation() {
let allTips = document.querySelectorAll(".featured-single-card.tipsRedesign");
let tiptricksLength = $('.tipstricks-loadmore').hasClass('hide') ? allTips.length : 15;
for (i = 0; i < tiptricksLength; i++) {
if ($('.tipstricks-loadmore').length > 0 && allTips[i].className.includes("tips-tricks-popup")) {
if (i == tiptricksLength - 1) {
$('.tips-tricks-right').addClass("hide");
$('.tips-tricks-left').removeClass("hide");
}
else if (i == 0) {
$('.tips-tricks-left').addClass("hide");
$('.tips-tricks-right').removeClass("hide");
}
else {
$('.tips-tricks-right').removeClass("hide");
$('.tips-tricks-left').removeClass("hide");
}
}
}
if (i == tiptricksLength - 1) {
$('.tips-tricks-right').addClass("hide");
$('.tips-tricks-left').removeClass("hide");
}
else if (i == 0) {
$('.tips-tricks-left').addClass("hide");
$('.tips-tricks-right').removeClass("hide");
}
else {
$('.tips-tricks-right').removeClass("hide");
$('.tips-tricks-left').removeClass("hide");
}
}
//Active Tiles Features page
function tileTextUpdate() {
let allTips = document.querySelectorAll(".featured-single-card.tipsRedesign");
let selectedTiles = [];
let totalCount = 0, currentPosition = 0;
for (i = 0; i < allTips.length; i++) {
if (!allTips[i].className.includes("hide")) {
totalCount++;
allTips[i].getAttribute('tipNo');
selectedTiles.push(allTips[i].getAttribute('tipNo'));
}
}
let currentActiveTile = document.querySelector(".tips-tricks-popup");
for (i = 0; i < selectedTiles.length; i++) {
if (selectedTiles[i] == currentActiveTile.getAttribute('tipNo')) {
currentPosition = i + 1;
}
}
var previousButtonText = {
"ar-xm": "السابق", "bg-bg": "Назад", "cs-cz": "Předchozí", "da-dk": "Forrige",
"de-at": "Zurück", "de-ch": "Zurück", "de-de": "Zurück", "el-gr": "Προηγούμενο",
"en-au": "Previous", "en-ca": "Previous", "en-gb": "Previous", "en-hk": "Previous",
"en-id": "Previous", "en-ie": "Previous", "en-in": "Previous", "en-is": "Previous",
"en-my": "Previous", "en-nz": "Previous", "en-ph": "Previous", "en-sg": "Previous",
"en-za": "Previous", "es-ar": "Anterior", "es-cl": "Anterior", "es-co": "Anterior",
"es-es": "Anterior", "es-mx": "Anterior", "es-xl": "Anterior", "et-ee": "Eelmine",
"fi-fi": "Edellinen", "fr-be": "Précédent", "fr-ca": "Précédent", "fr-ch": "Précédent",
"fr-fr": "Précédent", "fr-xf": "Précédent", "he-il": "הקודם", "hr-hr": "Prethodna",
"hu-hu": "Előző", "it-it": "Indietro", "ja-jp": "前へ", "ko-kr": "이전",
"lt-lt": "Ankstesnis", "lv-lv": "Wstecz", "nb-no": "Forrige", "nl-be": "Vorige",
"nl-nl": "Vorige", "pl-pl": "Wstecz", "pt-br": "Voltar", "pt-pt": "Anterior",
"ro-ro": "Anteriorul", "ru-ru": "Назад", "sk-sk": "Späť", "sl-si": "Nazaj",
"sr-latn-rs": "Prethodno", "sv-se": "Föregående", "th-th": "ก่อนหน้า", "tr-tr": "Geri",
"uk-ua": "Назад", "vi-vn": "Trước đó", "zh-hk": "上一頁", "zh-tw": "上一頁", "zh-cn": "上一步", "en-us": "Previous"
};
var NextButtonText = {
"ar-xm": "التالي", "bg-bg": "Напред", "cs-cz": "Další", "da-dk": "Næste",
"de-at": "Weiter", "de-ch": "Weiter", "de-de": "Weiter", "el-gr": "Επόμενο",
"en-au": "Next", "en-ca": "Next", "en-gb": "Next", "en-hk": "Next",
"en-id": "Next", "en-ie": "Next", "en-in": "Next", "en-is": "Next",
"en-my": "Next", "en-nz": "Next", "en-ph": "Next", "en-sg": "Next",
"en-za": "Next", "es-ar": "Siguiente", "es-cl": "Siguiente", "es-co": "Siguiente",
"es-es": "Siguiente", "es-mx": "Siguiente", "es-xl": "Siguiente", "et-ee": "Järgmine",
"fi-fi": "Seuraava", "fr-be": "Suivant", "fr-ca": "Suivant", "fr-ch": "Suivant",
"fr-fr": "Suivant", "fr-xf": "Suivant", "he-il": "הבא", "hr-hr": "Sljedeća",
"hu-hu": "Következő", "it-it": "Avanti", "ja-jp": "次へ", "ko-kr": "다음",
"lt-lt": "Kitas", "lv-lv": "Dalej", "nb-no": "Neste", "nl-be": "Volgende",
"nl-nl": "Volgende", "pl-pl": "Dalej", "pt-br": "Avançar", "pt-pt": "Seguinte",
"ro-ro": "Următorul", "ru-ru": "Далее", "sk-sk": "Ďalej", "sl-si": "Naprej",
"sr-latn-rs": "Sledeće", "sv-se": "Nästa", "th-th": "ถัดไป", "tr-tr": "İleri",
"uk-ua": "Далі", "vi-vn": "Tiếp theo", "zh-hk": "下一頁", "zh-tw": "下一頁", "zh-cn": "下一个", "en-us": "Next"
};
var previousButtonLabel = {
"ar-xm": "عرض الشريحة السابقة", "bg-bg": "Преглед на предишния слайд", "cs-cz": "Zobrazit předchozí snímek", "da-dk": "Vis forrige slide",
"de-at": "Vorherige Folie ansehen", "de-ch": "Vorherige Folie ansehen", "de-de": "Vorherige Folie ansehen", "el-gr": "Προβολή προηγούμενης διαφάνειας",
"en-au": "View Previous slide", "en-ca": "View Previous slide", "en-gb": "View Previous slide", "en-hk": "View Previous slide",
"en-id": "View Previous slide", "en-ie": "View Previous slide", "en-in": "View Previous slide", "en-is": "View Previous slide",
"en-my": "View Previous slide", "en-nz": "View Previous slide", "en-ph": "View Previous slide", "en-sg": "View Previous slide",
"en-za": "View Previous slide", "es-ar": "Ver la diapositiva anterior", "es-cl": "Ver la diapositiva anterior", "es-co": "Ver la diapositiva anterior",
"es-es": "Ver la diapositiva anterior", "es-mx": "Ver la diapositiva anterior", "es-xl": "Ver la diapositiva anterior", "et-ee": "Kuva eelmine slaid",
"fi-fi": "Näytä edellinen dia", "fr-be": "Voir la diapositive précédente", "fr-ca": "Voir la diapositive précédente", "fr-ch": "Voir la diapositive précédente",
"fr-fr": "Voir la diapositive précédente", "fr-xf": "Voir la diapositive précédente", "he-il": "הצג שקופית קודמת", "hr-hr": "Prikaži prethodni slajd",
"hu-hu": "Előző dia megtekintése", "it-it": "Visualizza diapositiva precedente", "ja-jp": "前のスライドを表示", "ko-kr": "이전 슬라이드 보기",
"lt-lt": "Rodyti ankstesnę skaidrę", "lv-lv": "Skatīt iepriekšējo slaidu", "nb-no": "Vis forrige lysbilde", "nl-be": "Bekijk de vorige dia",
"nl-nl": "Bekijk de vorige dia", "pl-pl": "Wyświetl poprzedni slajd", "pt-br": "Ver o slide anterior", "pt-pt": "Ver diapositivo Anterior",
"ro-ro": "Vedeți diapozitivul anterior", "ru-ru": "Показать предыдущий слайд", "sk-sk": "Zobraziť predchádzajúcu snímku", "sl-si": "Prikaži prejšnji diapozitiv",
"sr-latn-rs": "Prikaži prethodni slajd", "sv-se": "Visa föregående bild", "th-th": "ดูสไลด์ก่อนหน้า", "tr-tr": "Önceki slaytı görüntüle",
"uk-ua": "Перегляд попереднього слайду", "vi-vn": "Xem trang trình bày trước", "zh-hk": "檢視上一張投影片", "zh-tw": "檢視上一張投影片", "zh-cn": "查看上一个幻灯片", "en-us": "View Previous slide"
};
var NextButtonLabel = {
"ar-xm": "عرض الشريحة التالية", "bg-bg": "Преглед на следващия слайд", "cs-cz": "Zobrazit další snímek", "da-dk": "Vis næste slide",
"de-at": "Nächste Folie ansehen", "de-ch": "Nächste Folie ansehen", "de-de": "Nächste Folie ansehen", "el-gr": "Προβολή επόμενης διαφάνειας",
"en-au": "View Next slide", "en-ca": "View Next slide", "en-gb": "View Next slide", "en-hk": "View Next slide",
"en-id": "View Next slide", "en-ie": "View Next slide", "en-in": "View Next slide", "en-is": "View Next slide",
"en-my": "View Next slide", "en-nz": "View Next slide", "en-ph": "View Next slide", "en-sg": "View Next slide",
"en-za": "View Next slide", "es-ar": "Ver la diapositiva siguiente", "es-cl": "Ver la diapositiva siguiente", "es-co": "Ver la diapositiva siguiente",
"es-es": "Ver la diapositiva siguiente", "es-mx": "Ver la diapositiva siguiente", "es-xl": "Ver la diapositiva siguiente", "et-ee": "Kuva järgmine slaid",
"fi-fi": "Näytä seuraava dia", "fr-be": "Voir la diapositive suivante", "fr-ca": "Voir la diapositive suivante", "fr-ch": "Voir la diapositive suivante",
"fr-fr": "Voir la diapositive suivante", "fr-xf": "Voir la diapositive suivante", "he-il": "הצג שקופית הבאה", "hr-hr": "Prikaži sljedeći slajd",
"hu-hu": "Következő dia megtekintése", "it-it": "Visualizza diapositiva successiva", "ja-jp": "次のスライドを表示", "ko-kr": "다음 슬라이드 보기",
"lt-lt": "Rodyti paskesnę skaidrę", "lv-lv": "Skatīt nākamo slaidu", "nb-no": "Vis neste lysbilde", "nl-be": "Bekijk de volgende dia",
"nl-nl": "Bekijk de volgende dia", "pl-pl": "Wyświetl następny slajd", "pt-br": "Ver o próximo slide", "pt-pt": "Ver diapositivo Seguinte",
"ro-ro": "Vedeți diapozitivul următor", "ru-ru": "Показать следующий слайд", "sk-sk": "Zobraziť ďalšiu snímku", "sl-si": "Prikaži naslednji diapozitiv",
"sr-latn-rs": "Prikaži sledeći slajd", "sv-se": "Visa nästa bild", "th-th": "ดูสไลด์ถัดไป", "tr-tr": "Sonraki slaytı görüntüle",
"uk-ua": "Перегляд наступного слайду", "vi-vn": "Xem trang trình bày tiếp theo", "zh-hk": "檢視下一張投影片", "zh-tw": "檢視下一張投影片", "zh-cn": "查看下一个幻灯片", "en-us": "View Next slide"
};
var tipsLocaleText = {
"ar-xm": "x من y", "bg-bg": "x от y", "cs-cz": "x z y", "da-dk": "x af y",
"de-at": "x von y", "de-ch": "x von y", "de-de": "x von y", "el-gr": "x από y",
"en-au": "x of y", "en-ca": "x of y", "en-gb": "x of y", "en-hk": "x of y",
"en-id": "x of y", "en-ie": "x of y", "en-in": "x of y", "en-is": "x of y",
"en-my": "x of y", "en-nz": "x of y", "en-ph": "x of y", "en-sg": "x of y",
"en-za": "x of y", "es-ar": "x de y", "es-cl": "x de y", "es-co": "x de y",
"es-es": "x de y", "es-mx": "x de y", "es-xl": "x de y", "et-ee": "x/y",
"fi-fi": "x/y", "fr-be": "x de y", "fr-ca": "x de y", "fr-ch": "x de y",
"fr-fr": "x de y", "fr-xf": "x de y", "he-il": "x מתוך y", "hr-hr": "x od y",
"hu-hu": "x / y", "it-it": "x di y", "ja-jp": "x / y", "ko-kr": "x/y",
"lt-lt": "x iš y", "lv-lv": "x. no y", "nb-no": "x av y", "nl-be": "x van y",
"nl-nl": "x van y", "pl-pl": "x z y", "pt-br": "x de y", "pt-pt": "x de y",
"ro-ro": "x din y", "ru-ru": "x из y", "sk-sk": "x z y", "sl-si": "x od y",
"sr-latn-rs": "x od y", "sv-se": "x av y", "th-th": "x จาก y", "tr-tr": "x / y",
"uk-ua": "x з y", "vi-vn": "x/y", "zh-hk": "x/y", "zh-tw": "x/y", "zh-cn": "x/y", "en-us": "x of y"
};
var thislocale = $("html").attr("lang");
var tileFooter = tipsLocaleText[thislocale];
tileFooter = tileFooter.replace("x", currentPosition);
tileFooter = tileFooter.replace("y", totalCount);
$('.tips-current-position').html(tileFooter);
//$(".tips-tricks-left")[0].ariaLabel=previousButtonLabel[thislocale];
$(".tips-tricks-left")[0].title = previousButtonText[thislocale];
//$(".tips-tricks-right")[0].ariaLabel=NextButtonLabel[thislocale];
$(".tips-tricks-right")[0].title = NextButtonText[thislocale];
$(".tips-tricks-right").attr('aria-label', NextButtonLabel[thislocale] + ' - ' + $('.tips-tricks-popup').next().eq(0).find('.tipsRedesign h3').text());
$(".tips-tricks-left").attr('aria-label', previousButtonLabel[thislocale] + ' - ' + $('.tips-tricks-popup').prev().eq(0).find('.tipsRedesign h3').text());
//$('.tips-current-position').html(currentPosition + ' of ' + totalCount);
if (currentPosition == totalCount) {
$('.tips-tricks-right').addClass("hide");
}
else if (currentPosition - 1 == 0) {
$('.tips-tricks-left').addClass("hide");
}
}
function activeTile(tileLoc) {
let allTips = document.querySelectorAll(".featured-single-card.tipsRedesign");
let cnt = tileLoc;
for (i = tileLoc + 1; i < allTips.length; i++) {
cnt += 1;
if (!allTips[i].className.includes("hide")) {
return cnt;
}
}
}
function previousActiveTile(tileLoc) {
let allTips = document.querySelectorAll(".featured-single-card.tipsRedesign");
let cnt = tileLoc;
for (i = tileLoc - 1; i >= 0; i--) {
cnt -= 1;
if (!allTips[i].className.includes("hide")) {
return cnt;
}
}
}
function filterClickLoadMore() {
let allTips = document.querySelectorAll(".featured-single-card.tipsRedesign");
let k = 0;
for (i = 0; i < allTips.length; i++) {
if (!allTips[i].className.includes("hide")) {
k++;
}
if (k > 15 && !allTips[i].className.includes("hide")) {
allTips[i].className = allTips[i].className + " hide";
$('.tipstricks-loadmore').removeClass("hide");
}
if (k < 15 && !allTips[i].className.includes("hide") && (window.location.href.toLowerCase().indexOf("/features") != -1 || window.location.href.toLowerCase().indexOf("/tips-and-tricks") != -1) && currentLocale.toLowerCase() == "en-us") {
$('.tipstricks-loadmore').addClass("hide");
}
}
if ((window.location.href.toLowerCase().indexOf("/features") != -1 || window.location.href.toLowerCase().indexOf("/tips-and-tricks") != -1) && currentLocale.toLowerCase() != "en-us") {
if (k < 15 && !allTips[i].className.includes("hide")) {
$('.tipstricks-loadmore').addClass("hide");
}
}
}
$('[data-vg]').each(function (index) {
var dataVG = $(this).attr("data-vg");
var dataID = $(this).attr("id");
dataID != "" && dataID != undefined ? $(this).attr('id', dataID) : $(this).attr('id', dataVG + '-panel-' + (index + 1));
});
window.matchMedia("(prefers-reduced-motion)").matches == false ? $(".hubmain").addClass("animation-true") : $(".hubmain").addClass("animation-false");
//Toggle Button JS ends
/*EOS page starts */
$(document).ready(function () {
jQuery(document).on('click keydown', '.c-drawer', function (e) {
if ((e.type == "click" || e.type == "keydown" && e.which == "13")) {
var eoswin8faq = $("div.c-drawer-panel p a span").find("span");
for(var i = 0 ; i < eoswin8faq.length;i++ ){
var faqbtntext = eoswin8faq[i].innerHTML;
eoswin8faq[i].replaceWith(faqbtntext);
}
}
});
if (window.location.href.toLowerCase().indexOf("end-of-support") != -1) {
// whenloadwin7Tab();
// whenloadwin8Tab();
// whenloadwin10Tab();
/*jQuery(document).on('click', '.c-drawer', function () {
var eoswin8faq = $("div.c-drawer-panel p a span").find("span");
for(var i = 0 ; i < eoswin8faq.length;i++ ){
var faqbtntext = eoswin8faq[i].innerHTML;
eoswin8faq[i].replaceWith(faqbtntext);
}
});*/
jQuery(document).on('click', '.expand-collapse-toggle-area .c-action-trigger', function () {
var thisDrawer = $(this).closest(".drawer-panel");
if (jQuery(this).attr('data-source') === "expand") {
noSuperScript();
var eoswin8faq = $("#show-more-faq-Win8 div.c-drawer-panel p a span").find("span");
for(var i = 0 ; i < eoswin8faq.length;i++ ){
var faqbtntext = eoswin8faq[i].innerHTML;
eoswin8faq[i].replaceWith(faqbtntext);
}
var eoswin7faq = $("#show-more-faq-Win7 div.c-drawer-panel p a span").find("span");
for(var i = 0 ; i < eoswin7faq.length;i++ ){
var faqbtntext7 = eoswin7faq[i].innerHTML;
eoswin7faq[i].replaceWith(faqbtntext7);
}
var eoswin10faq = $("#show-more-faq-Win10 div.c-drawer-panel p a span").find("span");
for(var i = 0 ; i < eoswin10faq.length;i++ ){
var faqbtntext10 = eoswin10faq[i].innerHTML;
eoswin10faq[i].replaceWith(faqbtntext10);
}
}else{
noSuperScript();
}
});
$(document).on("click", ".play-on-focus button.glyph-pause", function () {
if ($(".switch #inputToggle").is(':checked')) {
$(".switch #inputToggle").trigger("click");
}
});
$(document).on("click", ".play-on-focus button.glyph-play", function () {
var animationbtn = $(".switch #inputToggle").is(':checked');
if (!animationbtn) {
$(".switch #inputToggle").trigger("click");
}
});
$(document.body).on("click keydown", ".end-of-support .c-pivot li[aria-controls='PivotTarget2']", function () {
SetEqualHeight($(".end-of-support .contentPlacement4up .content-touts .articletouts p.toutpara"));
SetEqualHeight($(".end-of-support .contentPlacement4up .content-touts .articletouts h3.toutheading"));
SetEqualHeight($(".end-of-support #panes-panel-Win8 .f-stacked .m-panes-product-placement-item .c-paragraph"));
// $("#footnote_disclaimer").removeClass("hide");
noSuperScript();
// $("#footnote_disclaimer ul li [id='1']").parent().removeClass("hide");
// $("#footnote_disclaimer ul li [id='3']").parent().addClass("hide");
// $("#footnote_disclaimer ul li [id='4']").parent().addClass("hide");
// $("#footnote_disclaimer ul li [id='5']").parent().addClass("hide");
// $("#footnote_disclaimer ul li [id='6']").parent().removeClass("hide");
// $("#footnote_disclaimer ul li [id='7']").parent().addClass("hide");
if($(".end-of-support .drawer-panel p.expand-collapse-toggle-area button[data-source='expand']").is('[aria-expanded="false"]')){
$(".end-of-support .drawer-panel p.expand-collapse-toggle-area button[data-source='collapse']").trigger('click');
}
});
$(document.body).on("click keydown", ".end-of-support .c-pivot li[aria-controls='PivotTarget1']", function () {
// $("#footnote_disclaimer").removeClass("hide");
noSuperScript();
SetEqualHeight($(".end-of-support .contentPlacement4up .content-touts .articletouts p.toutpara"));
SetEqualHeight($(".end-of-support .contentPlacement4up .content-touts .articletouts h3.toutheading"));
SetEqualHeight($(".end-of-support #panes-panel-Win8 .f-stacked .m-panes-product-placement-item .c-paragraph"));
// $("#footnote_disclaimer ul li [id='1']").parent().removeClass("hide");
// $("#footnote_disclaimer ul li [id='3']").parent().addClass("hide");
// $("#footnote_disclaimer ul li [id='4']").parent().addClass("hide");
// $("#footnote_disclaimer ul li [id='6']").parent().removeClass("hide");
// $("#footnote_disclaimer ul li [id='5']").parent().removeClass("hide");
// $("#footnote_disclaimer ul li [id='7']").parent().addClass("hide");
if($(".end-of-support .drawer-panel p.expand-collapse-toggle-area button[data-source='expand']").is('[aria-expanded="false"]')){
$(".end-of-support .drawer-panel p.expand-collapse-toggle-area button[data-source='collapse']").trigger('click');
}
});
$(document.body).on("click keydown", ".end-of-support .c-pivot li[aria-controls='PivotTarget0']", function () {
noSuperScript();
if($("#fullBleedBgBanner")[0] !== undefined){
// $("#footnote_disclaimer").removeClass("hide");
// $("#footnote_disclaimer ul li [id='7']").parent().removeClass("hide");
}else{
// $("#footnote_disclaimer ul li [id='7']").parent().addClass("hide");
// $("#footnote_disclaimer").addClass("hide");
}
SetEqualHeight($(".end-of-support .contentPlacement4up .content-touts .articletouts p.toutpara"));
SetEqualHeight($(".end-of-support .contentPlacement4up .content-touts .articletouts h3.toutheading"));
SetEqualHeight($(".end-of-support #panes-panel-Win8 .f-stacked .m-panes-product-placement-item .c-paragraph"));
SetEqualHeight($(".end-of-support #win-10-panes-3up .m-panes-product-placement-item p.c-paragraph"));
SetEqualHeight($(".end-of-support #win-10-panes-3up .m-panes-product-placement-item .c-call-to-action"));
// $("#footnote_disclaimer ul li [id='1']").parent().addClass("hide");
// $("#footnote_disclaimer ul li [id='3']").parent().addClass("hide");
// $("#footnote_disclaimer ul li [id='4']").parent().addClass("hide");
// $("#footnote_disclaimer ul li [id='6']").parent().addClass("hide");
// $("#footnote_disclaimer ul li [id='5']").parent().addClass("hide");
if($(".end-of-support .drawer-panel p.expand-collapse-toggle-area button[data-source='expand']").is('[aria-expanded="false"]')){
$(".end-of-support .drawer-panel p.expand-collapse-toggle-area button[data-source='collapse']").trigger('click');
}
// $("#footnote_disclaimer ul li [id='3']").parent().removeClass("hide");
// $("#footnote_disclaimer ul li [id='4']").parent().removeClass("hide");
});
whenloadwin7Tab();
whenloadwin8Tab();
whenloadwin10Tab();
}
});
if (window.location.href.toLowerCase().indexOf("end-of-support") != -1) {
ocidparam = GetQueryStringParams_upgrade("os");
var eosWin8Click = function () {
$(".end-of-support .c-pivot li").removeClass('f-active');
$(".end-of-support .c-pivot li[aria-controls='PivotTarget1']").addClass('f-active');
// $('.c-pivot ul li').filter('[aria-controls="PivotTarget1"]').click();
whenloadwin8Tab();
}
var eosWin7Click = function () {
$(".end-of-support .c-pivot li").removeClass('f-active');
$(".end-of-support .c-pivot li[aria-controls='PivotTarget2']").addClass('f-active');
whenloadwin7Tab();
}
var eosWin10Click = function () {
$(".end-of-support .c-pivot li").removeClass('f-active');
$(".end-of-support .c-pivot li[aria-controls='PivotTarget0']").addClass('f-active');
$('.c-pivot ul li').filter('[aria-controls="PivotTarget0"]').click();
whenloadwin10Tab();
}
if (navigator.appVersion.indexOf("Windows NT 6.3") != -1 || navigator.appVersion.indexOf("Windows NT 6.2") != -1) {
if (ocidparam == 'win8') {
eosWin8Click();
}
else if (ocidparam == 'win7') {
eosWin7Click();
}
else if (ocidparam == 'win10') {
eosWin10Click();
}
else {
eosWin8Click();
}
}
else if (navigator.appVersion.indexOf("Windows NT 6.1") != -1) {
ocidparam = GetQueryStringParams_upgrade("os");
if (ocidparam == 'win8') {
eosWin8Click();
}
else if (ocidparam == 'win7') {
eosWin7Click();
}
else if (ocidparam == 'win10') {
eosWin10Click();
}
else {
eosWin7Click();
}
}
else if (navigator.appVersion.indexOf("Windows NT 10.0") != -1 || navigator.userAgent.indexOf("Windows NT 10.0") != -1) {
ocidparam = GetQueryStringParams_upgrade("os");
var ocidparamload = GetQueryStringParams_upgrade("ocid");
if(ocidparamload == 'win10_app_omc_win_ie' && ocidparam !='win10' && ocidparam !='win8' && ocidparam !='win7'){
$(".fullBleedBgBannerforwin10").addClass("hide");
$(".fullBleedBgBannerforwin11").addClass("hide");
eosWin10Click();
}
if (ocidparam == 'win8') {
if(ocidparamload == 'win10_app_omc_win_ie'){
$(".fullBleedBgBannerforwin10").addClass("hide");
$(".fullBleedBgBannerforwin11").addClass("hide");
eosWin8Click();
} else{
eosWin8Click();
}
}
else if (ocidparam == 'win7') {
if(ocidparamload == 'win10_app_omc_win_ie'){
$(".fullBleedBgBannerforwin10").addClass("hide");
$(".fullBleedBgBannerforwin11").addClass("hide");
eosWin7Click();
} else{
eosWin7Click();
}
}
else if(ocidparam == 'win10'){
$(".fullBleedBgBannerforwin11").removeClass("hide");
if(ocidparamload == 'win10_app_omc_win_ie'){
$(".fullBleedBgBannerforwin10").addClass("hide");
$(".fullBleedBgBannerforwin11").addClass("hide");
eosWin10Click();
} else{
eosWin10Click();
}
}
} else {
if (ocidparam == 'win8') {
eosWin8Click();
}
if (ocidparam == 'win7') {
eosWin7Click();
}
if (ocidparam == 'win10') {
eosWin10Click();
}
}
}
$('#show-more-faq-Win7 .c-drawer').each(function (index) {
var drawerID = $(this).find('.c-drawer-panel').attr("id");
var ariaControlID = $(this).find('button').attr("aria-controls");
$(this).find('.c-drawer-panel').attr('id', 'Win7' + drawerID);
$(this).find('button').attr('aria-controls', 'Win7' + drawerID);
});
$('#show-more-faq-Win10 .c-drawer').each(function (index) {
var drawerID = $(this).find('.c-drawer-panel').attr("id");
var ariaControlID = $(this).find('button').attr("aria-controls");
$(this).find('.c-drawer-panel').attr('id', 'Win10' + drawerID);
$(this).find('button').attr('aria-controls', 'Win10' + drawerID);
});
/*EOS page ends */
/*Win11 page Win10 OCID functionality starts*/
var currentLocale = document.getElementsByTagName("html")[0].getAttribute("lang").toUpperCase();
var win11_OCID_locales = ["DE-AT", "DE-CH", "DE-DE", "EN-AU", "EN-CA", "EN-GB", "EN-IE", "EN-IN", "EN-US", "ES-ES", "ES-MX", "FR-CA", "FR-FR", "IT-IT", "JA-JP", "NL-BE", "NL-NL", "PT-BR", "ZH-CN"];
var ocid_win11 = GetQueryStringParams_upgrade("ocid");
var ocidVal = ["prod_wincge_cons_cgc_usg_spotlight_win11upgrade_fomo", "prod_wincge_cons_cgc_usg_spotlight_win11upgrade_compat", "prod_wincge_cons_cgc_usg_spotlight_win11upgrade_snap", "prod_wincge_cons_cgc_usg_spotlight_win11upgrade_gamer", "prod_wincge_cons_cgc_usg_spotlight_win11upgrade_chat", "prod_wincge_cons_cgc_usg_spotlight_win11upgrade_store", "prod_wincge_cons_cgc_usg_spotlight_win11upgrade_widget"];
if (window.location.href.toLowerCase().indexOf("/windows-11") != -1 && win11_OCID_locales.indexOf(currentLocale) != -1 && ocidVal.indexOf(ocid_win11) != -1) {
navigator.userAgentData.getHighEntropyValues(["platformVersion"]).then(function (ua) {
if (navigator.userAgentData.platform === "Windows") {
var majorPlatformVersion = parseInt(ua.platformVersion.split('.')[0]);
if (majorPlatformVersion > 0 && !(majorPlatformVersion >= 13)) {
$(".windows-11 #HeroItem-panel-1,.windows-11 #Banner-panel-2,.windows-11 #ImageorVideoWithContent-panel-3").addClass("hide");
$(".windows-11 #HeroItem-panel-4 .m-hero-item").removeClass("margin-top-36");
if (currentLocale == 'ZH-CN') {
$(".windows-11 #ImageorVideoWithContent-panel-1").addClass('hide');
}
}
}
});
}
/*Win11 page Win10 OCID functionality ends*/
/*if(window.location.href.toLowerCase().indexOf("/features") != -1) {
setInterval(textSpacingIssues, 500);
function textSpacingIssues() {
var checkHead = $("head");
var headCSS = checkHead.find("#phltsbkmklt");
if (headCSS.length >= 1) {
$('div#default-lightbox .m-content-placement-item > div').attr('style', 'padding: 0px !important; margin-left: 5px !important');
$("div#default-lightbox .m-content-placement-item p").attr('style', 'padding: 0px !important;font-size: 18px; margin-bottom: 0px !important');
$('div#default-lightbox .m-content-placement-item > div > h3').attr('style', 'font-size: 26px !important');
$('div#default-lightbox .c-glyph.glyph-cancel').attr('style', 'line-height: 0px !important');
$('.tipsTricks-filters-section .tipstricks-filter').attr('style', 'max-width: 230px');
$('.tipsTricks-filter-container').attr('style', 'display: inline-block');
}
}
}*/
$("#all-tips .featured-single-card .c-group .glyph-play").keydown(function (e) {
if (e.which == 13) {
e.preventDefault();
$(this).closest(".featured-single-card").click();
setTimeout(function () { $("#default-lightbox").addClass('tips-overlay'); }, 500);
}
});
/*OCID logic for features page starts*/
if (window.location.href.toLowerCase().indexOf("shortcuts") != -1) {
var ocidVariationparam = GetQueryStringParams_upgrade("ocid");
if (window.location.href.toLowerCase().indexOf("ocid") != -1) {
if (ocidVariationparam.indexOf("AIDcmm3sfiorvc") == 0) {
$(".ocid_banner").addClass('hide');
$(".ocid_hero").removeClass('hide');
}
}
}
if (window.location.href.toLowerCase().indexOf("productivity") != -1) {
if (window.location.href.toLowerCase().indexOf("ocid") != -1) {
var ocidVariationparam = GetQueryStringParams_upgrade("ocid");
if (ocidVariationparam.toLowerCase().indexOf("prod_growthcenter_cons_cge_eng_spotlight_lockscreenw11_virtualdesktops") == 0) {
$('.featured-single-card.Productivity_ocid').removeClass('hide');
}
else {
$('.featured-single-card.Productivity_ocid').addClass('hide');
}
}
else {
$('.featured-single-card.Productivity_ocid').addClass('hide');
}
}
/*OCID logic for windows 11 pc gaming page starts*/
if (window.location.href.toLowerCase().indexOf("windows-11-pc-gaming") != -1) {
var ocidVariationparam = GetQueryStringParams_upgrade("ocid");
if (ocidVariationparam == 'prod_wincge_cons_cgc_usg_spotlight_win11upgrade_gamerspace') {
$(".with-gamer-space-ocid").removeClass('hide');
$(".with-gamer-rock-ocid").addClass('hide');
$(".with-gamer-dunes-ocid").addClass('hide');
$(".without-gamer-ocid").addClass("hide");
$('html, body').animate({
scrollTop: ($(".with-gamer-space-ocid").offset().top)
}, 100);
} else if (ocidVariationparam == 'prod_wincge_cons_cgc_usg_spotlight_win11upgrade_gamerrocks') {
$(".with-gamer-space-ocid").addClass('hide');
$(".with-gamer-rock-ocid").removeClass('hide');
$(".with-gamer-dunes-ocid").addClass('hide');
$(".without-gamer-ocid").addClass("hide");
$('html, body').animate({
scrollTop: ($(".with-gamer-rock-ocid").offset().top)
}, 100);
} else if (ocidVariationparam == 'prod_wincge_cons_cgc_usg_spotlight_win11upgrade_gamerdunes') {
$(".with-gamer-space-ocid").addClass('hide');
$(".with-gamer-rock-ocid").addClass('hide');
$(".with-gamer-dunes-ocid").removeClass('hide');
$(".without-gamer-ocid").addClass("hide");
$('html, body').animate({
scrollTop: ($(".with-gamer-dunes-ocid").offset().top)
}, 100);
} else {
$(".with-gamer-space-ocid").addClass('hide');
$(".with-gamer-rock-ocid").addClass('hide');
$(".with-gamer-dunes-ocid").addClass('hide');
$(".without-gamer-ocid").removeClass("hide");
}
}
/*OCID logic for windows 11 pc gaming page ends*/
/*OCID logic for EOS page starts*/
/* 10/17/23 eos ocid updates start*/
/*
if (window.location.href.toLowerCase().indexOf("end-of-support") != -1) {
if (window.location.href.toLowerCase().indexOf("ocid") != -1) {
var ocidVariationparameos = GetQueryStringParams_upgrade("ocid");
if (ocidVariationparameos == 'win10_app_omc_win_canvaseosoct2023') {
$(".ocid_feature").removeClass('hide');
$(".end-of-support #FeatureOcid").css("display", "block");
} else {
$(".ocid_feature").addClass('hide');
$(".end-of-support #FeatureOcid").css("display", "none");
}
}
}
*/
/* 10/17/23 eos ocid updates end*/
if (window.location.href.toLowerCase().indexOf("/en-us/windows/end-of-support") != -1) {
$('.hubmain.end-of-support').find('.m-panes a.hatch-button').attr('role', 'button');
$('#win8_app_omc_win_t1_feature_id').attr("data-grid", "container");
$('#win8_app_omc_win_t2_feature_id').attr("data-grid", "container");
$('#win8_app_omc_win_t3_feature_id').attr("data-grid", "container");
$("#footnote_disclaimer ul li [id='7']").parent().addClass("hide");
$(".main-panel-without-ocid").removeClass("hide");
$(".win8_app_omc_win_t1-with-ocid").addClass('hide');
$(".win8_app_omc_win_t2-with-ocid").addClass('hide');
$(".win8_app_omc_win_t3-with-ocid").addClass('hide');
/*
var ocidVariationparam = GetQueryStringParams_upgrade("ocid");
if (ocidVariationparam == 'win8_app_omc_win_t1') {
$(".win8_app_omc_win_t1-with-ocid").removeClass('hide');
$(".win8_app_omc_win_t2-with-ocid").addClass('hide');
$(".win8_app_omc_win_t3-with-ocid").addClass('hide');
$(".main-panel-without-ocid").addClass("hide");
$("#footnote_disclaimer ul li [id='*']").parent().addClass("hide");
$("#footnote_disclaimer ul li [id='**']").parent().addClass("hide");
$("#footnote_disclaimer ul li [id='7']").parent().addClass("hide");
} else if (ocidVariationparam == 'win8_app_omc_win_t2') {
$(".win8_app_omc_win_t1-with-ocid").addClass('hide');
$(".win8_app_omc_win_t2-with-ocid").removeClass('hide');
$(".win8_app_omc_win_t3-with-ocid").addClass('hide');
$(".main-panel-without-ocid").addClass("hide");
$("#footnote_disclaimer ul li [id='*']").parent().addClass("hide");
$("#footnote_disclaimer ul li [id='**']").parent().addClass("hide");
} else if (ocidVariationparam == 'win8_app_omc_win_t3') {
$(".win8_app_omc_win_t1-with-ocid").addClass('hide');
$(".win8_app_omc_win_t2-with-ocid").addClass('hide');
$(".win8_app_omc_win_t3-with-ocid").removeClass('hide');
$(".main-panel-without-ocid").addClass("hide");
$("#footnote_disclaimer ul li [id='7']").parent().addClass("hide");
} else {
$(".win8_app_omc_win_t1-with-ocid").addClass('hide');
$(".win8_app_omc_win_t2-with-ocid").addClass('hide');
$(".win8_app_omc_win_t3-with-ocid").addClass('hide');
$(".main-panel-without-ocid").removeClass("hide");
$("#footnote_disclaimer ul li [id='7']").parent().addClass("hide");
}*/
}
/*OCID logic for EOS page ends*/
/*ends new ocid logic for EOS OCID=win10_app_omc_win_gw2 */
/*Accessibility starts*/
$(function () {
$(".m-back-to-top").attr("data-aria-label", $(".m-back-to-top").attr("aria-label"));
/*
$(document).on("click", ".m-back-to-top", function() {
if (window.location.href.toLowerCase().indexOf("/tips-and-tricks") != -1 && urlPath.indexOf('#') != -1) {
history.pushState({ page: "tips-and-tricks" }, "Title", window.location.origin + window.location.pathname + window.location.search);
}
});
*/
$(".postcard-article #sticky-share .social-linked-icon.Facebook a").attr("data-aria-label", $("#sticky-share .social-linked-icon.Facebook a").attr("aria-label"))
$(".postcard-article #sticky-share .social-linked-icon.Twitter a").attr("data-aria-label", $("#sticky-share .social-linked-icon.Twitter a").attr("aria-label"))
$(".postcard-article #sticky-share .social-linked-icon.Pinterest a").attr("data-aria-label", $("#sticky-share .social-linked-icon.Pinterest a").attr("aria-label"))
});
/*Accessibility ends*/
/*EOS chat functionality starts*/
// if (window.location.href.toLowerCase().indexOf("/en-us/windows/end-of-support") != -1) {
// jQuery.ajax({
// type: "GET",
// url: "https://mcraa.fs.liveperson.com/messaging-agent-availability/api/account/60270350/getSkillAvailability?skillID=3842183838",
// dataType: "json",
// success: function (availability) {
// var agentAvailability = availability;
// console.log("Availability", agentAvailability.availability);
// var ocidVariationparam = GetQueryStringParams_upgrade("ocid");
// if (agentAvailability.availability == "yes" && ocidVariationparam == undefined) {
// $(".eos_sidebar button").removeClass('hide');
// }
// },
// error: function (err) {
// console.log(err);
// }
// });
// var eosChatHTML = function () {
// return '' +
// '
' +
// '' +
// '
' +
// '
';
// }
// $("body").append(eosChatHTML());
// //$("#HeroItem-Win7").append(eosChatHTML("chatButtonWin7"));
// $("body").append('' +
// '' +
// '
')
// const chatButton = document.querySelector('#chatButton');
// chatButton.addEventListener("click", chatButtonClick);
// var iframe = document.getElementById('iFrame');
// var buttonClicked = false;
// var LPinitialized = false;
// var regulatedMarket = false;
// var iframeStarted = false;
// var log = document.getElementById('log');
// var msgStore = [];
// // Send message to iframe
// var sendMessage = function sendMessage(msg) {
// iframe.contentWindow.postMessage(msg, '*');
// }
// // Function to send 'lpcurl' and 'initializeLP'
// var startIframe = function startIframe() {
// //Added as there is more then 1 button, and each one is triggering the Start function, this keeps from going a second time.
// if (!iframeStarted) {
// // Send 'lpcurl'
// sendMessage({ lpcurl: location.href });
// console.log('lpcurl sent');
// // Check to see if initializeLP hasn't already been called. Do not send 'initializeLP' multiple times this can lead to multiple sessions.
// // Check to see if non-regulated market
// if (WcpConsent.siteConsent.isConsentRequired) {
// regulatedMarket = true;
// }
// // if regulated market only send 'initializeLP' on acceptInvite or buttonClick
// if (!LPinitialized && !regulatedMarket) {
// sendMessage({ action: 'initializeLP' });
// LPinitialized = true;
// console.log('initializeLP sent');
// }
// console.log("Is this a Regulated site" + regulatedMarket);
// // To use 1DS telemetry send 'lppagename'
// sendMessage({ lppagename: location.href });
// }
// iframeStarted = true;
// }
// var logger = function logger(msg) {
// //logger({'data': {engagement: 'buttonReady'}})
// msgStore.push(msg.data);
// var currentLog = '';
// for (i = 0; i < Object.keys(msgStore).length; i++) {
// var name = Object.keys(msg.data)[i];
// var value = msg.data[name];
// if (name != undefined) {
// if (i == 0) {
// currentLog = name + ' : ' + value;
// } else {
// currentLog = currentLog + ' | ' + name + ' : ' + value;
// }
// }
// }
// log.innerHTML = '' + currentLog + '
' + log.innerHTML;
// }
// // Handle messages from iFrame
// window.addEventListener('message', function (msg) {
// logger(msg);
// if (msg.data.window) {
// console.log('(LP Message): ' + msg.data);
// switch (msg.data.window) {
// case 'maximized':
// iframe.style.width = msg.data.width;
// iframe.style.height = msg.data.height;
// if (msg.data.height === '100vh') {
// iframe.style.position = 'absolute';
// iframe.style.right = '0px';
// } else {
// iframe.style.position = 'fixed';
// iframe.style.bottom = '0';
// iframe.style.right = '0px';
// iframe.style.boxShadow = '0 0 6px rgb(214, 214, 214)';
// }
// break;
// case 'minimized':
// iframe.style.width = msg.data.width;
// iframe.style.height = msg.data.height;
// iframe.style.position = 'fixed';
// iframe.style.bottom = '0';
// iframe.style.right = '0';
// iframe.style.boxShadow = '0 0 6px rgb(214, 214, 214)';
// break;
// case 'closed':
// iframe.style.width = msg.data.width;
// iframe.style.height = msg.data.height;
// buttonClicked = false;
// chatButton.disabled = false;
// break;
// case 'opened':
// //On page refresh iFrame will send 'opened'
// iframe.style.width = msg.data.width;
// iframe.style.height = msg.data.height;
// buttonClicked = true;
// LPinitialized = true;
// chatButton.disabled = true;
// break;
// default:
// console.log('msg not in case');
// break;
// }
// }
// //On 'buttonReady' send lpcurl and initializeLP
// if (msg.data.engagement) {
// console.log('(LP Message): ' + msg.data.engagement);
// switch (msg.data.engagement) {
// case 'buttonReady':
// chatButton.disabled = false;
// startIframe();
// break;
// default:
// break;
// };
// }
// });
// function chatButtonClick() {
// //send initializeLP if regulated market
// if (regulatedMarket && !LPinitialized) {
// sendMessage({ action: 'initializeLP' });
// LPinitialized = true;
// console.log('initializeLP sent in chatButtonClick');
// }
// // Check to see if button was already clicked so we don't send 'open' and 'topic' twice. Sending twice can lead to multiple leadID and Topic showing in LivePerson dashboard
// if (!buttonClicked) {
// sendMessage({ action: 'open' });
// sendMessage({ lppagename: location.href })
// sendMessage({ action: 'Topic', Topic: 'Store' });
// sendMessage({ action: 'parentsize', Height: window.innerHeight, PixelRatio: 1, Width: window.innerWidth });
// buttonClicked = true;
// //disable buttons so multiple sessions cannot be started
// chatButton.disabled = true;
// }
// }
// }
/*EOS chat functionality ends*/
/*OCID logic for computers page starts*/
if (window.location.href.toLowerCase().indexOf("/computers") != -1) {
var ocidVariationcomputerparam = GetQueryStringParams_upgrade("ocid");
// ocidVariationcomputerparam = ocidVariationcomputerparam.toLowerCase();
if (ocidVariationcomputerparam == 'prod_cge_cons_win_eng_pcrefrfy23q1_italy') {
$('.with-italy-ocid').removeClass('hide');
$('.with-norway-ocid').addClass('hide');
$('.with-australia-ocid').addClass('hide');
$('.without-ocid').addClass("hide");
} else if (ocidVariationcomputerparam == 'prod_cge_cons_win_eng_pcrefrfy23q1_norway') {
$('.with-italy-ocid').addClass('hide');
$('.with-norway-ocid').removeClass('hide');
$('.with-australia-ocid').addClass('hide');
$('.without-ocid').addClass("hide");
} else if (ocidVariationcomputerparam == 'prod_cge_cons_win_eng_pcrefrfy23q1_australia') {
$('.with-italy-ocid').addClass('hide');
$('.with-norway-ocid').addClass('hide');
$('.with-australia-ocid').removeClass('hide');
$('.without-ocid').addClass('hide');
} else {
$('.with-italy-ocid').addClass('hide');
$('.with-norway-ocid').addClass('hide');
$('.with-australia-ocid').addClass('hide');
$('.without-ocid').removeClass('hide');
}
}
/*OCID logic for computers page ends*/
/* partnership page start*/
var addcolorpartnership = $("#partnership #contentPlacementPanelPartnershipID ").parent().attr("data-grid", "container");
addcolorpartnership.addClass("Adding-color-feature-cls");
$(".Adding-color-feature-cls").css({ "background": "#F1FAF5", "max-width": "100%" });
//$("#featurefullbleedPanelPartnershipID").css({ "background": "#F1FAF5", "width": "100%", "max-width": "100%" });
$('#partnership #imagefullbleedPanelPartnershipID').wrap("");
$('#partnership .linearGradient div > div > h1').append("");
$('#partnership #savethedayid .linearGradient > h2').append("");
$('#partnership .linearGradientfeature > div > h2').append("");
$('#partnership .linearGradienthero > div > div > h2').append("");
$('.windows .holiday-animated-hero .holiday-video-auto.herowithgradientline-blue > div > div').prepend("");
$('.comprehensive-security .holiday-animated-hero .holiday-video-auto.herowithgradientline-blue > div > div').prepend("");
$('#windowsh22.laptops-for-students #lfcsFeaturehero .lfcs-hero.herowithgradientline-blue > div').prepend("");
$('#windowsh22.laptops-for-students #m365 .m365education.herowithgradientline-blue > div').prepend("");
$('.windows-11 .m-hero-item.herowithgradientline-blue > div > div').prepend("");
$('#windowsh22.windows .win11-feature-hero .m-hero-item.herowithgradientline-blue > div > div').prepend("");
$('#windowsh22.windows .win11-feature-hero-lowervp .m-hero-item.bettergothergradientline > div > div').prepend("");
$('.accessibility-features .m-hero-item > div > div').prepend("");
$(".accessibility-features #vision").attr("data-grid", "container");
$(".accessibility-features #hearing").attr("data-grid", "container");
$(".accessibility-features #mobility").attr("data-grid", "container");
$(".accessibility-features #neurodiversity").attr("data-grid", "container");
$('.compare-windows-11-home-vs-pro-versions .m-feature.herowithgradientline-blue > div').prepend("");
$('#view-all .herowithgradientline-blue .c-feature > div').prepend("");
$('.compare-windows-11-home-vs-pro-versions .m-hero-item.herowithgradientline-blue > div > div').prepend("");
$(".get-windows-11 .m-hero-item.herowithgradientline > div > div").prepend("");
$(".get-windows-11 .m-hero-item.herowithgradientline-blue > div > div").prepend("");
$(".get-windows-11 .image-priority-accolate .m-feature.herowithgradientline-blue .featurecontent").prepend("");
$('#windowsh22.windows #bing .bingChat.herowithgradientline-blue > div').prepend("");
$('.sync-across-your-devices .herowithgradient .m-hero-item > div > div').prepend("");
$(".features .m-hero-item.herowithbluegradientline > div > div").prepend("");
$('#windowsh22.windows #phoneLink .sync.herowithgradientline-blue > div').prepend("");
$('#windowsh22.windows #Copilot .sync.herowithgradientline-blue > div').prepend("");
$(".get-windows-11 .bts.m-hero-item.herowithgradientlineblue > div > div").prepend("");
$("#windowsh22.windows #pcs").attr("data-grid", "container");
$("#windowsh22.windows #Heroitem .m-feature.herowithgradientline-blue > div").prepend("");
$("#windowsh22.windows-11 #Heroitem .m-feature.herowithgradientline-blue > div").prepend("");
$("#windowsh22.windows #playpopup-hero .m-feature.herowithgradientline-blue > div").prepend("");
$("#windowsh22.windows #Bettertogether .m-feature.herowithgradientline-blue > div").prepend("");
$("#windowsh22.windows #Banner-panel-1").attr("data-grid", "container");
/* eod gradient line*/
$('.end-of-support #windowsTransfer .m-feature > div').prepend("");
$(".end-of-support #Heroitem .m-feature.herowithgradientline-blue > div").prepend("");
/* PVT page Js */
$('#windowsh22.PenVoiceTouch .m-content-placement.herowithgradientline-blue .content-touts .articletouts .m-content-placement-item > div').prepend("");
$('.comprehensive-security .herowithgradientline-blue .content-touts .articletouts .m-content-placement-item > div').prepend("");
$('#windowsh22.photo-movie-editor .herowithgradientline-blue .content-touts .articletouts .m-content-placement-item > div').prepend("");
$('#windowsh22.photo-movie-editor .herowithgradientline-blue .featurecontent').prepend("");
$("#windowsh22.photo-movie-editor #Banner-panel-1, #windowsh22.photo-movie-editor #clipchamp, #windowsh22.photo-movie-editor #photoMovieEditor_Faq, #windowsh22.photo-movie-editor #Banner-panel-0").attr("data-grid", "container");
$('#windowsh22.AI-Page .herowithgradientline-blue .content-touts .articletouts .m-content-placement-item > div').prepend("");
/* partnership page end*/
$("#Hero-Item-panel-3-Banner").attr("data-grid", "container");
/*EOS FAQ scrolling starts*/
$(window).on('load', function (e) {
setTimeout(function () {
if (window.location.href.toLowerCase().indexOf("/end-of-support") != -1) {
var link = window.location.href.split("#");
var id_tab = link[1];
if (id_tab != undefined && id_tab == "7faq") {
$('.c-pivot ul li').filter('[aria-controls="PivotTarget2"]').click();
$('html, body').animate({
scrollTop: ($("#7faq").offset().top)
}, 500);
}
if (id_tab != undefined && id_tab == "8faq") {
$('.c-pivot ul li').filter('[aria-controls="PivotTarget1"]').click();
$('html, body').animate({
scrollTop: ($("#8faq").offset().top)
}, 500);
}
if (id_tab != undefined && id_tab == "10faq") {
$('.c-pivot ul li').filter('[aria-controls="PivotTarget0"]').click();
$('html, body').animate({
scrollTop: ($("#10faq").offset().top)
}, 500);
}
}
}, 1000);
setTimeout(function () {
if (window.location.href.toLowerCase().indexOf("/get-windows-11") != -1) {
var link = window.location.href.split("#");
var id_tab = link[1];
if (id_tab != undefined && id_tab == "systemrequirements") {
$('.c-pivot ul li').filter('[aria-controls="PivotTarget1"]').click();
$('html, body').animate({
scrollTop: ($("#systemrequirements").offset().top) + 5
}, 500);
}
}
}, 1000);
});
/*EOS FAQ scrolling ends*/
/* accessbility page start*/
$("#accessbilityContentplacement_1_Banner_2").parent().css({ "background": "#f2f2f2" });
$("#accessbilityContentplacement_1_Banner_4").parent().css({ "background": "#f2f2f2" });
if (window.location.href.toLowerCase().indexOf("/features") != -1 || window.location.href.toLowerCase().indexOf("/tips-and-tricks") != -1) {
setInterval(textSpacingIssues, 500);
function textSpacingIssues() {
var checkHead = $("head");
var headCSS = checkHead.find("#lphltsbkmklt");
if (headCSS.length >= 1) {
$('div#default-lightbox .m-content-placement-item > div').attr('style', 'padding: 2px !important');
$('div#default-lightbox .m-content-placement-item > div > h3').attr('style', 'font-size: 19px');
$('#default-lightbox .m-content-placement-item > div > p').attr('style', 'font-size: 15px; padding: 0px; margin-bottom: 0px !important;');
}
}
};
/* accessbility page end*/
$(document).ready(function () {
animationwhenstickyisthere();
animationwhenstickyistherecomp();
animationwhenstickyistherecomplaptopbuyingguide();
/* Holiday animated hero JS starts*/
heropanelanimationinhome();
videoanimationPanel();
videoanimationPanelforEOS();
videoanimationPanelforEOSGroupId();
videoanimationPanelforHome();
//videoanimationPanel1();
windows11mosicanimation();
$("#windowsh22.comprehensive-security .security-popup").attr("role", "button");
var heroreplaceh1 = $('#windowsh22.windows .animation-off.holiday-animated-hero .m-hero-item h1');
$(heroreplaceh1).replaceWith($('' + heroreplaceh1.html() + '
'));
var win11heroreplaceh1 = $('#windowsh22.windows-11 .animation-off.holiday-animated-hero .m-hero-item h1')
$(win11heroreplaceh1).replaceWith($('' + win11heroreplaceh1.html() + '
'));
var heroreplaceh1tyd = $('#windowsh22.Transfer-your-data .animation-off.holiday-animated-hero .m-hero-item h1');
$(heroreplaceh1tyd).replaceWith($('' + heroreplaceh1tyd.html() + '
'));
windows11herovideoplay();
$(".windows .crossCards").parent().removeAttr('data-grid', 'container');
$(".laptops-for-students #lfcsHighlightfeature").parent().removeAttr('data-grid', 'container');
$("#view-all #lfcsHighlightfeature").parent().removeAttr('data-grid', 'container');
/*eos*/
$(".end-of-support #fullBleedBgBanner").parent().removeAttr('data-grid', 'container');
if (window.matchMedia("(min-width: 1084px)").matches) {
if (currentLocale != 'EN-US') {
$("#phoneLink picture source").remove();
}
if (currentLocale == 'ZH-CN') {
$("#phoneLink picture img").attr("src", "https://cdn-dynmedia-1.microsoft.com/is/image/microsoftcorp/MSFT-A-call-coming-in-on-a-phone-and-showing-up-on-a-PC-using-Phone-Link-RW16Ks5?scl=1");
$("#phoneLink picture img").attr("data-src", "https://cdn-dynmedia-1.microsoft.com/is/image/microsoftcorp/MSFT-A-call-coming-in-on-a-phone-and-showing-up-on-a-PC-using-Phone-Link-RW16Ks5?scl=1");
}
// else if (currentLocale == 'EN-US') {
// $("#phoneLink picture video").attr("poster", "https://cdn-dynmedia-1.microsoft.com/is/image/microsoftcorp/MSFT-sync-devices-RW1cMjP?scl=1");
// $("#phoneLink picture video source").attr("src", "https://wus-streaming-video-rt-microsoft-com.akamaized.net/2676b45f-0a82-4d9d-8f18-99f3f032f56a/33d7510c-0145-423d-91a9-85402d92_3400.mp4");
// }
else {
$("#phoneLink picture img").attr("src", "https://cdn-dynmedia-1.microsoft.com/is/image/microsoftcorp/MSFT-sync-devices-RW13kMu?scl=1");
$("#phoneLink picture img").attr("data-src", "https://cdn-dynmedia-1.microsoft.com/is/image/microsoftcorp/MSFT-sync-devices-RW13kMu?scl=1");
}
//if (currentLocale == 'EN-US') {
$("#Copilot picture source").remove();
$("#Copilot picture img").attr("src", "https://cdn-dynmedia-1.microsoft.com/is/image/microsoftcorp/MSFT-Image-represents-Copilot-creativity-and-productivity-RW1hYpE?scl=1");
$("#Copilot picture img").attr("data-src", "https://cdn-dynmedia-1.microsoft.com/is/image/microsoftcorp/MSFT-Image-represents-Copilot-creativity-and-productivity-RW1hYpE?scl=1");
$("#spring-feature picture source").remove();
$("#spring-feature picture img").attr("src", "https://cdn-dynmedia-1.microsoft.com/is/image/microsoftcorp/MSFT-Laptop-with-Copilot-logo-and-colorful-bloom-RW1jQhE?scl=1");
$("#spring-feature picture img").attr("data-src", "https://cdn-dynmedia-1.microsoft.com/is/image/microsoftcorp/MSFT-Laptop-with-Copilot-logo-and-colorful-bloom-RW1jQhE?scl=1");
$("#Win11Featurehero picture source").remove();
$("#Win11Featurehero picture img").attr("src", "https://cdn-dynmedia-1.microsoft.com/is/image/microsoftcorp/MSFT-Laptop-with-Copilot-logo-and-colorful-bloom-RW1jRto?scl=1");
$("#Win11Featurehero picture img").attr("data-src", "https://cdn-dynmedia-1.microsoft.com/is/image/microsoftcorp/MSFT-Laptop-with-Copilot-logo-and-colorful-bloom-RW1jRto?scl=1");
//}
}
else {
if (currentLocale != 'EN-US') {
$("#phoneLink picture source").remove();
}
if (currentLocale == 'ZH-CN') {
$("#phoneLink picture img").attr("src", "https://cdn-dynmedia-1.microsoft.com/is/image/microsoftcorp/MSFT-A-call-coming-in-on-a-phone-and-showing-up-on-a-PC-using-Phone-Link-RW16Ptm?scl=1");
$("#phoneLink picture img").attr("data-src", "https://cdn-dynmedia-1.microsoft.com/is/image/microsoftcorp/MSFT-A-call-coming-in-on-a-phone-and-showing-up-on-a-PC-using-Phone-Link-RW16Ptm?scl=1");
}
// else if (currentLocale == 'EN-US') {
// $("#phoneLink picture video").attr("poster", "https://cdn-dynmedia-1.microsoft.com/is/image/microsoftcorp/MSFT-sync-device-RW1cMjU?scl=1");
// $("#phoneLink picture video source").attr("src", "https://wus-streaming-video-rt-microsoft-com.akamaized.net/3e5cf04b-a888-4954-9910-419331ffb3b6/99cc68c4-a0a9-4a75-90d6-a1a2f0ca_2250.mp4");
// }
else {
$("#phoneLink picture img").attr("src", "https://cdn-dynmedia-1.microsoft.com/is/image/microsoftcorp/MSFT-sync-devices-RW12HNd?scl=1");
$("#phoneLink picture img").attr("data-src", "https://cdn-dynmedia-1.microsoft.com/is/image/microsoftcorp/MSFT-sync-devices-RW12HNd?scl=1");
}
// if (currentLocale == 'EN-US') {
$("#Copilot picture source").remove();
$("#Copilot picture img").attr("src", "https://cdn-dynmedia-1.microsoft.com/is/image/microsoftcorp/msft-Image-represents-copilot-creativity-productivity-RW1hQBO?scl=1");
$("#Copilot picture img").attr("data-src", "https://cdn-dynmedia-1.microsoft.com/is/image/microsoftcorp/msft-Image-represents-copilot-creativity-productivity-RW1hQBO?scl=1");
$("#spring-feature picture source").remove();
$("#spring-feature picture img").attr("src", "https://cdn-dynmedia-1.microsoft.com/is/image/microsoftcorp/MSFT-copilot-plus-pcs-RW1jVsT?scl=1");
$("#spring-feature picture img").attr("data-src", "https://cdn-dynmedia-1.microsoft.com/is/image/microsoftcorp/MSFT-copilot-plus-pcs-RW1jVsT?scl=1");
$("#Win11Featurehero picture source").remove();
$("#Win11Featurehero picture img").attr("src", "https://cdn-dynmedia-1.microsoft.com/is/image/microsoftcorp/MSFT-copilot-plus-pcs-RW1jMi0?scl=1");
$("#Win11Featurehero picture img").attr("data-src", "https://cdn-dynmedia-1.microsoft.com/is/image/microsoftcorp/MSFT-copilot-plus-pcs-RW1jMi0?scl=1");
// }
}
});
function windows11mosicanimation() {
var mosaicwin11 = $("#windowsh22 #homeMosaic.custom-mosaic > div").length;
if (mosaicwin11 != 0) {
var mosaicwin11Animation = gsap.timeline({
scrollTrigger: {
trigger: "#windowsh22 #homeMosaic.custom-mosaic > div",
start: "top center",
end: "bottom top",
scrub: 1
}
});
mosaicwin11Animation.fromTo(".c-mosaic .mosaic-win11-left-img picture img", { yPercent: -50, y: -50, ease: "none" }, { yPercent: -50, y: 50, ease: "none" });
}
}
function windows11herovideoplay() {
$(".show-animation-on-hvp.holiday-animated-hero:not('.mp4inline')").each(function (index) {
if (window.location.href.toLowerCase().indexOf("/windows/transfer-your-data-with-windows-backup") != -1) {
if (window.outerWidth >= 1084) {
var videoText = $(this).find(".m-hero-item.holiday-video-auto > div > div");
videoText.show();
$(this).find('.mp4videoinline').on("play", function () {
});
var isSafari = /^((?!chrome|android).)*safari/i.test(navigator.userAgent);
if (isSafari) {
$(this).find('.mp4videoinline').on("ended", function () {
$(this).get(0).pause();
});
}
else {
$(this).find('.mp4videoinline').on("ended", function () {
$(this).get(0).load();
$(this).get(0).pause();
});
}
}
}
else
{
if (window.outerWidth >= 1084) {
var videoText = $(this).find(".m-hero-item.holiday-video-auto > div > div");
$(this).find('.mp4videoinline').on("play", function () {
videoText.hide();
});
var isSafari = /^((?!chrome|android).)*safari/i.test(navigator.userAgent);
if (isSafari) {
$(this).find('.mp4videoinline').on("ended", function () {
videoText.show();
$(this).get(0).pause();
});
}
else {
$(this).find('.mp4videoinline').on("ended", function () {
videoText.show();
$(this).get(0).load();
$(this).get(0).pause();
});
}
}
}
});
$("#windowsh22.windows .show-animation-lvp.holiday-animated-hero:not('.mp4inline')").each(function (index) {
if (window.location.href.toLowerCase().indexOf("/windows") != -1) {
$(this).find('.mp4videoinline').on("play", function () {
});
var isSafari = /^((?!chrome|android).)*safari/i.test(navigator.userAgent);
if (isSafari) {
$(this).find('.mp4videoinline').on("ended", function () {
$(this).get(0).pause();
});
}
else {
$(this).find('.mp4videoinline').on("ended", function () {
$(this).get(0).load();
$(this).get(0).pause();
});
}
}
});
}
function videoanimationPanel() {
var checking = $('.switch').find("#inputToggle").is(':checked');
var isHaving = $(".laptops-for-students .m365education .videobutton").hasClass("glyph-pause");
var isplayonfocus = $(".laptops-for-students .m365education").hasClass("play-on-focus");
if (!checking) {
if (isHaving || isplayonfocus) {
$(".laptops-for-students button.videobutton.glyph-pause").trigger('click');
$(".laptops-for-students .m365education").removeClass('play-on-focus');
$('.laptops-for-students .feature-animate-on').removeClass('video-played');
}
}
else {
$(".laptops-for-students button.videobutton.glyph-play").trigger('click');
$(".laptops-for-students .m365education").addClass('play-on-focus');
}
}
function videoanimationPanelforEOS() {
var checking = $('.switch').find("#inputToggle").is(':checked');
var isHaving = $(".end-of-support #windowsTransfer .m-feature .videobutton").hasClass("glyph-play");
var isplayonfocus = $(".end-of-support #windowsTransfer .m-feature").hasClass("play-on-focus");
if (!checking) {
if (isHaving || isplayonfocus) {
$(".end-of-support #windowsTransfer button.videobutton.glyph-pause").trigger('click');
$(".end-of-support #windowsTransfer .m-feature").removeClass('play-on-focus');
$('.end-of-support #windowsTransfer .feature-animate-on').removeClass('video-played');
}
}
else {
$(".end-of-support #windowsTransfer button.videobutton.glyph-pause").trigger('click');
$(".end-of-support #windowsTransfer .m-feature").addClass('play-on-focus');
}
}
function videoanimationPanelforEOSGroupId() {
var checking = $('.switch').find("#inputToggle").is(':checked');
var isHaving1 = $(".end-of-support #NewFeatureGroupId .m-feature .videobutton").hasClass("glyph-play");
var isplayonfocus1 = $(".end-of-support #NewFeatureGroupId .m-feature").hasClass("play-on-focus");
if (!checking) {
if (isHaving1 || isplayonfocus1) {
//$(".end-of-support #NewFeatureGroupId button.videobutton.glyph-pause").trigger('click');
$(".end-of-support #NewFeatureGroupId .m-feature").removeClass('play-on-focus');
$('.end-of-support #NewFeatureGroupId .feature-animate-on').removeClass('video-played');
}
}
else {
//$(".end-of-support #NewFeatureGroupId button.videobutton.glyph-pause").trigger('click');
$(".end-of-support #NewFeatureGroupId .m-feature").addClass('play-on-focus');
}
}
//NewFeatureGroupId
function videoanimationPanelforHome() {
var checking = $('.switch').find("#inputToggle").is(':checked');
var isHaving = $(".windows #phoneLink .m-feature .videobutton").hasClass("glyph-play");
var isplayonfocus = $(".windows #phoneLink .m-feature").hasClass("play-on-focus");
if (!checking) {
if (isHaving || isplayonfocus) {
$(".windows button.videobutton.glyph-pause").trigger('click');
$(".windows #phoneLink .m-feature").removeClass('play-on-focus');
$('.windows #phoneLink .m-feature').removeClass('video-played');
}
}
else {
$(".windows button.videobutton.glyph-pause").trigger('click');
$(".windows #phoneLink .m-feature").addClass('play-on-focus');
}
}
function videoanimationPanel1() {
$(".windows-11 .play-on-focus").each(function () {
$(this).removeClass("video-played");
$(this).removeClass("feature-animate-on");
$(this).find("video").attr("playsinline");
$(this).find("video").get(0).load();
$(this).find("video").get(0).pause();
$(this).find("video").get(0).currentTime = 0;
$(this).find("button").addClass("glyph-play").removeClass("glyph-pause");
});
}
function videoanimationPanelhomepage1() {
$(".windows .play-on-focus").each(function () {
$(this).removeClass("video-played");
$(this).removeClass("feature-animate-on");
$(this).find("video").attr("playsinline");
$(this).find("video").get(0).load();
$(this).find("video").get(0).pause();
$(this).find("video").get(0).currentTime = 0;
$(this).find("button").addClass("glyph-play").removeClass("glyph-pause");
});
}
function videoanimationPanel1EOS() {
$(".end-of-support .play-on-focus").each(function () {
$(this).removeClass("video-played");
$(this).removeClass("feature-animate-on");
$(this).find("video").attr("playsinline");
$(this).find("video").get(0).load();
$(this).find("video").get(0).pause();
$(this).find("video").get(0).currentTime = 0;
$(this).find("button").addClass("glyph-play").removeClass("glyph-pause");
});
}
function heropanelanimationinhome() {
if ($('.switch').find("#inputToggle").is(':checked')) {
$("#windowsh22 .win11-feature-hero .m-hero-item picture img.bettertogetherpaneloff").removeClass('bettertogetherpaneloff');
var bettertogetherpanel = $("#windowsh22 .win11-feature-hero").length;
if (bettertogetherpanel != 0) {
var bettertogetherAnimation = gsap.timeline({
scrollTrigger: {
trigger: "#windowsh22 .win11-feature-hero",
start: "top center",
end: "bottom top",
scrub: 1
}
}); bettertogetherAnimation.fromTo("#windowsh22 .win11-feature-hero .m-hero-item picture img", { yPercent: -40, y: -100, ease: "none" }, { yPercent: -50, y: 100, ease: "none" });
}
} else {
$("#windowsh22 .win11-feature-hero .m-hero-item picture img").addClass('bettertogetherpaneloff');
}
}
// better together panel end
// srolling effect in windows 11 page start
function animationwhenstickyisthere() {
if (window.location.href.toLowerCase().indexOf("/windows-11") != -1) {
var ocidVariationparamVal = window.location.href.split('#')[1];
if (ocidVariationparamVal == 'easiertouse' || ocidVariationparamVal == 'productivity' || ocidVariationparamVal == 'performancesecurity' || ocidVariationparamVal == 'gaming') {
if (window.location.href.toLowerCase().indexOf('ocid') != -1) {
var ocidparamval = GetQueryStringParams_upgrade("ocid");
if (ocidparamval.startsWith("1_") || ocidparamval.startsWith("2_") || ocidparamval.startsWith("3_")) {
$('html, body').animate({
scrollTop: ($("#pchealthcheck").offset().top) - 80
}, 100);
}
} else {
setTimeout(function () {
$('a[href="http://approjects.co.za/?big=#" + ocidVariationparamVal + '"]').trigger('click');
$('html, body ').animate({
scrollTop: ($("#" + ocidVariationparamVal).offset().top)
}, 100);
$('a[href="http://approjects.co.za/?big=#" + ocidVariationparamVal + '"]').focus();
}, 1000);
}
}
}
else if (window.location.href.toLowerCase().indexOf("/digital-pen-touch-voice-features") != -1) {
var hashValue = window.location.href.split('#')[1];
if (hashValue == 'touchscreen' || hashValue == 'digitalpens' || hashValue == 'voice') {
setTimeout(function () {
$('.specs-stickynav a[href="http://approjects.co.za/?big=#" + hashValue + '"]').trigger('click');
$('html, body ').animate({
scrollTop: ($("#" + hashValue).offset().top)
}, 100);
$('a[href="http://approjects.co.za/?big=#" + hashValue + '"]').focus();
}, 1000);
}
}
};
function animationwhenstickyistherecomp() {
if (window.location.href.toLowerCase().indexOf("/comprehensive-security") != -1) {
var hashValue = window.location.href.split('#')[1];
if (hashValue == 'malwareprotection' || hashValue == 'phishingprevention' || hashValue == 'appsecurity') {
setTimeout(function () {
$('.specs-stickynav a[href="http://approjects.co.za/?big=#" + hashValue + '"]').trigger('click');
$('html, body ').animate({
scrollTop: ($("#" + hashValue).offset().top)
}, 100);
$('a[href="http://approjects.co.za/?big=#" + hashValue + '"]').focus();
}, 1000);
}
}
};
function animationwhenstickyistherecomplaptopbuyingguide() {
if (window.location.href.toLowerCase().indexOf("/laptop-buying-guide") != -1) {
var hashValuelbg = window.location.href.split('#')[1];
if (hashValuelbg === 'choosewindows' || hashValuelbg === 'hardware' || hashValuelbg === 'formfactors') {
setTimeout(function () {
$('.specs-stickynav a[href="http://approjects.co.za/?big=#" + hashValuelbg + '"]').trigger('click');
$('html, body ').animate({
scrollTop: ($("#" + hashValuelbg).offset().top)
}, 100);
$('a[href="http://approjects.co.za/?big=#" + hashValuelbg + '"]').focus();
}, 1000);
}else if(hashValuelbg === "primaryArea"){
setTimeout(function () {
$('a[href="http://approjects.co.za/?big=#" + hashValuelbg + '"]').trigger('click');
$('html, body ').animate({
scrollTop: ($("#" + hashValuelbg).offset().top)
}, 100);
$('a[href="http://approjects.co.za/?big=#" + hashValuelbg + '"]').focus();
}, 300);
}
}
};
function animationwhenstickyistherephotomovieeditor() {
if (window.location.href.toLowerCase().indexOf("/photo-movie-editor") != -1) {
var hashValue = window.location.href.split('#')[1];
if (hashValue == 'editphotos' || hashValue == 'onedrivebackup' || hashValue == 'icloudintegration' || hashValue == 'videodemo' || hashValue == 'multitrackediting' || hashValue == 'screenrecorder' || hashValue == 'stocklibrary' || hashValue == 'videodemo2') {
setTimeout(function () {
var pivotTabId = $("#" + hashValue).parent().attr("id");
$('.c-pivot ul li').filter('[aria-controls="' + pivotTabId + '"]').click();
$('html, body ').animate({
scrollTop: ($("#" + hashValue).offset().top)
}, 100);
$('.c-pivot ul li').filter('[aria-controls="' + pivotTabId + '"]').focus();
}, 1000);
}
}
};
function primaryareaTop() {
if (window.location.href.toLowerCase().indexOf("#primaryarea") != -1) {
setTimeout(function () {
$('html, body').animate({
scrollTop: $(window).scrollTop(0)
}, 100);
}, 1000);
}
};
// srolling effect in windows 11 page end
// sticky footer issue start
var num = 0;
$(document).on("click keydown", "#stickynavwindows11 nav.sticky-navbarNew:not(.f-dropdown-menu) > ul > li > a", function (e) {
e.stopPropagation();
if ((e.type == "click" || e.type == "keydown" && e.which == "13")) {
$this = $(this);
var href = $this.attr("href");
//setTimeout(function () {
if (!($this.hasClass("f-active"))) {
num = 0;
$this.parents("ul").find("a").removeClass("f-active").attr('aria-current', 'false');
$this.addClass("f-active").attr('aria-current', 'page');
}
else {
num++;
}
$this.keydown(function (e) {
if (window.location.href.toLowerCase().indexOf("/comprehensive-security") != -1) {
if (e.keyCode === 9 && !e.shiftKey) {
e.preventDefault();
var href = $this.attr("href");
$(href).find("a")[0].focus();
num = 0;
}
else if (e.keyCode === 40) {
e.preventDefault();
var href = $this.attr("href");
$(href).find(".featurecontent h2").focus();
}
}
else {
if ($this.hasClass("f-active") && num >= 1 && e.keyCode === 9 && !e.shiftKey) {
e.preventDefault();
var href = $this.attr("href");
$(href).find("a")[0].focus();
num = 0;
}
else if (e.keyCode === 40) {
e.preventDefault();
var href = $this.attr("href");
$(href).find(".featurecontent h2").focus();
}
}
});
}
});
/*$(".image-priority-accolate.featurebox:first").on("keydown", "a:first", function (e) {
if (e.shiftKey && e.keyCode === 9) {
e.preventDefault();
var href = $(this).parents(".image-priority-accolate.featurebox").attr("id");
if (!$(".f-dropdown").hasClass("f-hide")) {
$('a[href="http://approjects.co.za/?big=#" + href + '"]').parents("ul").siblings("a").focus();
}
else {
$('a[href="http://approjects.co.za/?big=#" + href + '"]').parents("ul").find("li:last-child a").focus();
}
}
});*/
// sticky footer issue end
$('.animation-off').hide();
$('.feature-animate-off').hide();
$('#c-state-label-1').html($('#c-state-label-1').attr('data-on-string'));
$(".switch #inputToggle").on("click", function () {
heropanelanimationinhome();
videoanimationPanel();
videoanimationPanelforEOS();
videoanimationPanelforEOSGroupId();
videoanimationPanelforHome();
//videoanimationPanel1();
$('.feature-animate-on').removeClass("video-played");
$('.feature-animate-on video').removeAttr("playsinline");
if (!$(this).is(':checked')) {
$(this).attr('aria-checked', false);
$(".hubmain").addClass("animation-false");
$(".hubmain").removeClass("animation-true");
var heroreplaceh1 = $('#windowsh22.windows .animation-off.holiday-animated-hero .m-hero-item h2')
$(heroreplaceh1).replaceWith($('' + heroreplaceh1.html() + '
'));
var heroh1animationon = $('#windowsh22.windows .show-animation-on-hvp.holiday-animated-hero .m-hero-item h1')
$(heroh1animationon).replaceWith($('' + heroh1animationon.html() + '
'));
var heroreplaceh1tyd = $('#windowsh22.Transfer-your-data .animation-off.holiday-animated-hero .m-hero-item h1');
$(heroreplaceh1tyd).replaceWith($('' + heroreplaceh1tyd.html() + '
'));
var heroh1animationontyd = $('#windowsh22.Transfer-your-data .show-animation-on-hvp.holiday-animated-hero .m-hero-item h1')
$(heroh1animationontyd).replaceWith($('' + heroh1animationontyd.html() + '
'));
var Win11animatateh1 = $('#windowsh22.windows-11 .animation-off.holiday-animated-hero .m-hero-item h2')
$(Win11animatateh1).replaceWith($('' + Win11animatateh1.html() + '
'));
var win11heroh1animate = $('#windowsh22.windows-11 .show-animation-on-hvp.holiday-animated-hero .m-hero-item h1')
$(win11heroh1animate).replaceWith($('' + win11heroh1animate.html() + '
'));
$('.windows #devices-mosaic').addClass('mosaic-animate-stop');
$('.windows-11 #homeMosaic').addClass('mosaic-animate-stop');
$('.animation-off').show();
$('.show-animation-on-hvp.holiday-animated-hero').hide();
$('.show-animation-lvp').hide();
var offString = $('#c-state-label-1').attr('data-off-string');
$('#c-state-label-1').html(offString);
setTimeout(function () {
videoanimationPanel1();
videoanimationPanelhomepage1();
videoanimationPanel1EOS();
}, 200);
}
else {
$(this).attr('aria-checked', true);
$(".hubmain").removeClass("animation-false");
$(".hubmain").addClass("animation-true");
var heroreplaceh1 = $('#windowsh22.windows .animation-off.holiday-animated-hero .m-hero-item h1')
$(heroreplaceh1).replaceWith($('' + heroreplaceh1.html() + '
'));
var heroh1animationon = $('#windowsh22.windows .show-animation-on-hvp.holiday-animated-hero .m-hero-item h2')
$(heroh1animationon).replaceWith($('' + heroh1animationon.html() + '
'));
var heroreplaceh1tyd = $('#windowsh22.Transfer-your-data .animation-off.holiday-animated-hero .m-hero-item h1');
$(heroreplaceh1tyd).replaceWith($('' + heroreplaceh1tyd.html() + '
'));
var heroh1animationontyd = $('#windowsh22.Transfer-your-data .show-animation-on-hvp.holiday-animated-hero .m-hero-item h2')
$(heroh1animationontyd).replaceWith($('' + heroh1animationontyd.html() + '
'));
var win11heroh1 = $('#windowsh22.windows-11 .animation-off.holiday-animated-hero .m-hero-item h1')
$(win11heroh1).replaceWith($('' + win11heroh1.html() + '
'));
var win11heroh1animateOn = $('#windowsh22.windows-11 .show-animation-on-hvp.holiday-animated-hero .m-hero-item h2')
$(win11heroh1animateOn).replaceWith($('' + win11heroh1animateOn.html() + '
'));
$('.windows #devices-mosaic.mosaic-animate-stop').removeClass('mosaic-animate-stop');
$('.windows-11 #homeMosaic.mosaic-animate-stop').removeClass('mosaic-animate-stop');
$('.animation-off').hide();
$('.show-animation-on-hvp.holiday-animated-hero').show();
$('.show-animation-lvp').show();
$(".end-of-support .play-on-focus").addClass("feature-animate-on");
$(".windows-11 .play-on-focus").addClass("feature-animate-on");
$(".Transfer-your-data .play-on-focus").addClass("feature-animate-on");
windows11herovideoplay();
if(window.location.href.toLowerCase().indexOf("/windows/transfer-your-data-with-windows-backup") != -1) {
if ($('.Transfer-your-data .holiday-animated-hero .m-hero-item .mp4videoinline').length > 0) {
if (window.innerWidth <= 1083) {
$('.Transfer-your-data .show-animation-lvp .mp4videoinline').get(0).load();
$('.Transfer-your-data .show-animation-lvp .mp4videoinline').get(0).currentTime = 0;
setTimeout(function () {
$('.Transfer-your-data .show-animation-lvp .mp4videoinline').get(0).play();
}, 100);
} else {
$('.Transfer-your-data .show-animation-on-hvp .mp4videoinline').get(0).currentTime = 0;
setTimeout(function () {
$('.Transfer-your-data .show-animation-on-hvp .mp4videoinline').get(0).play();
}, 100);
}
}
} else if (window.location.href.toLowerCase().indexOf("/windows/windows-11") != -1) {
if ($('.windows-11 .holiday-animated-hero .m-hero-item .mp4videoinline').length > 0) {
if (window.innerWidth <= 1083) {
$('.windows-11 .show-animation-lvp .mp4videoinline').get(0).load();
$('.windows-11 .show-animation-lvp .mp4videoinline').get(0).currentTime = 0;
setTimeout(function () {
$('.windows-11 .show-animation-lvp .mp4videoinline').get(0).play();
}, 100);
} else {
$('.windows-11 .show-animation-on-hvp .mp4videoinline').get(0).currentTime = 0;
setTimeout(function () {
$('.windows-11 .show-animation-on-hvp .mp4videoinline').get(0).play();
}, 100);
}
}
} else if (window.location.href.toLowerCase().indexOf("/windows/end-of-support") != -1) {
if ($('.end-of-support .m-feature .mp4videoinline').length > 0) {
/*
if (window.innerWidth <= 1083) {
$('.end-of-support .mp4videoinline').get(0).load();
$('.end-of-support .mp4videoinline').get(0).currentTime = 0;
setTimeout(function () {
$('.end-of-support .mp4videoinline').get(0).play();
}, 100);
} else {
$('.end-of-support .mp4videoinline').get(0).load();
$('.end-of-support .mp4videoinline').get(0).currentTime = 0;
setTimeout(function () {
$('.end-of-support .mp4videoinline').get(0).play();
}, 100);
}
*/
}
} else if (window.location.href.toLowerCase().indexOf("/windows") != -1) {
if ($('.windows .holiday-animated-hero .m-hero-item .mp4videoinline').length > 0) {
if (window.innerWidth <= 1083) {
$('.windows .show-animation-lvp .mp4videoinline').get(0).load();
$('.windows .show-animation-lvp .mp4videoinline').get(0).currentTime = 0;
setTimeout(function () {
$('.windows .show-animation-lvp .mp4videoinline').get(0).play();
}, 100);
} else {
$('.windows .show-animation-on-hvp .mp4videoinline').get(0).currentTime = 0;
setTimeout(function () {
$('.windows .show-animation-on-hvp .mp4videoinline').get(0).play();
}, 100);
}
}
}
var onString = $('#c-state-label-1').attr('data-on-string');
$('#c-state-label-1').html(onString);
}
});
$(".switch #inputToggle").keydown(function (e) {
if (e.which == 13) {
$(this).click();
return false;
}
});
function currentStickyNav() {
$("nav.c-in-page-navigation ul li a").attr('aria-current', 'false');
$("nav.c-in-page-navigation ul li a.f-active").attr('aria-current', 'page');
}
function resizeComprehensivePanels() {
if ($(window).width() <= 767) {
$(".comprehensive-security #comprehensiveSecurity_Contentplacement1_malwareProtection").parent().css("padding-bottom", "40px");
$(".comprehensive-security #comprehensiveSecurity_Contentplacement1_phishingprevention").parent().css("padding-bottom", "40px");
$(".comprehensive-security #comprehensiveSecurity_Contentplacement1_appsecurity").parent().css("padding-bottom", "40px");
$(".comprehensive-security #comprehensiveSecurity_Contentplacement1_malwareProtection .content-touts").attr('data-grid', 'col-6 pad-6x');
$(".comprehensive-security #comprehensiveSecurity_Contentplacement1_phishingprevention .content-touts").attr('data-grid', 'col-6 pad-6x');
$(".comprehensive-security #comprehensiveSecurity_Contentplacement1_appsecurity .content-touts").attr('data-grid', 'col-6 pad-6x');
} else if ($(window).width() >= 768 && $(window).width() <= 1083) {
$(".comprehensive-security #comprehensiveSecurity_Contentplacement1_malwareProtection .content-touts").attr('data-grid', 'col-6 pad-6x');
$(".comprehensive-security #comprehensiveSecurity_Contentplacement1_phishingprevention .content-touts").attr('data-grid', 'col-6 pad-6x');
$(".comprehensive-security #comprehensiveSecurity_Contentplacement1_appsecurity .content-touts").attr('data-grid', 'col-6 pad-6x');
$(".comprehensive-security #comprehensiveSecurity_Contentplacement1_malwareProtection").parent().css("padding-bottom", "60px");
$(".comprehensive-security #comprehensiveSecurity_Contentplacement1_phishingprevention").parent().css("padding-bottom", "60px");
$(".comprehensive-security #comprehensiveSecurity_Contentplacement1_appsecurity").parent().css("padding-bottom", "60px");
} else {
$(".comprehensive-security #comprehensiveSecurity_Contentplacement1_malwareProtection .content-touts").attr('data-grid', 'col-4 pad-6x');
$(".comprehensive-security #comprehensiveSecurity_Contentplacement1_phishingprevention .content-touts").attr('data-grid', 'col-4 pad-6x');
$(".comprehensive-security #comprehensiveSecurity_Contentplacement1_appsecurity .content-touts").attr('data-grid', 'col-4 pad-6x');
$(".comprehensive-security #comprehensiveSecurity_Contentplacement1_malwareProtection").parent().css("padding-bottom", "120px");
$(".comprehensive-security #comprehensiveSecurity_Contentplacement1_appsecurity").parent().css("padding-bottom", "120px");
$(".comprehensive-security #comprehensiveSecurity_Contentplacement1_phishingprevention").parent().css({ "padding-bottom": "120px", "background": "#F7F7F7" });
}
var distance;
distance = $('#Modernprotection').offset().top - 240;
$(window).on('scroll', function () {
if ($(window).scrollTop() >= distance) {
$('#windowsh22.comprehensive-security a.f-active').addClass('f-inactive');
}
else {
$('#windowsh22.comprehensive-security a.f-active').removeClass('f-inactive');
}
});
}
/*accessbility bug fixes start */
setTimeout(function () {
$("#unique-id-for-list .c-menu-item:last-child").focusout(function () {
//aria-hidden="false"
$("#unique-id-for-list").attr("aria-hidden", "true");
$("#unique-id-for-list").css("display", "none");
});
}, 500);
//.windows-11-pc-gaming .f-video-trigger button.c-action-trigger.c-glyph.glyph-play
/*accessbility bug fixes end */
/*Adobe target condition for getting started starts*/
var adobetarget = window.wdgdb;
if (window.location.href.toLowerCase().indexOf("getting-started") != -1 && adobetarget != undefined) {
console.log("cookie accepted");
$('.forDefault').css('display', 'none');
var ocidVariationparam = GetQueryStringParams_upgrade("ocid");
if (ocidVariationparam != undefined) {
$('.nondefault').removeClass('nondefault');
if ($("div[data-vg='HeroItem']").hasClass("without-ocid")) {
$('.without-ocid').addClass('nondefault');
}
} else {
$('.nondefault').removeClass('nondefault');
}
if ($("div[data-vg='HeroItem']").hasClass("with-ocid") && (ocidVariationparam == 'inp_omc_win_welcomev2' || ocidVariationparam == 'fy2002onb_ema_rmc_win_' || ocidVariationparam == 'fy2002onb_ema_rmc_win_')) {
$('.forwin11').addClass('nondefault');
$('#forwin11.article-section-footnotes.disclaimer').css('display', 'none');
}
} else {
console.log("cookie denied");
$('.forDefault').css('display', 'block');
$('#forwin10.article-section-footnotes.disclaimer').css('display', 'none');
$('.forDefault.forMobile').css('display', 'none');
}
/* EOS loading issue */
function whenloadwin7Tab(){
SetEqualHeight($(".end-of-support .contentPlacement4up .content-touts .articletouts p.toutpara"));
SetEqualHeight($(".end-of-support .contentPlacement4up .content-touts .articletouts h3.toutheading"));
SetEqualHeight($(".end-of-support #contentplacement-4up-Win7.contentPlacement4up .content-touts .articletouts p.toutpara"));
SetEqualHeight($(".end-of-support #contentplacement-4up-Win7.contentPlacement4up .content-touts .articletouts h3.toutheading"));
SetEqualHeight($(".end-of-support #panes-panel-Win8 .f-stacked .m-panes-product-placement-item .c-paragraph"));
SetEqualHeight($(".end-of-support #win-10-panes-3up .m-panes-product-placement-item p.c-paragraph"));
SetEqualHeight($(".end-of-support #win-10-panes-3up .m-panes-product-placement-item .c-call-to-action"));
noSuperScript();
}
function whenloadwin8Tab(){
SetEqualHeight($(".end-of-support .contentPlacement4up .content-touts .articletouts p.toutpara"));
SetEqualHeight($(".end-of-support .contentPlacement4up .content-touts .articletouts h3.toutheading"));
SetEqualHeight($(".end-of-support #panes-panel-Win8 .f-stacked .m-panes-product-placement-item .c-paragraph"));
SetEqualHeight($(".end-of-support #win-10-panes-3up .m-panes-product-placement-item p.c-paragraph"));
SetEqualHeight($(".end-of-support #win-10-panes-3up .m-panes-product-placement-item .c-call-to-action"));
noSuperScript();
$('.c-pivot ul li').filter('[aria-controls="PivotTarget1"]').trigger('click');
}
function whenloadwin10Tab(){
SetEqualHeight($(".end-of-support .contentPlacement4up .content-touts .articletouts p.toutpara"));
SetEqualHeight($(".end-of-support .contentPlacement4up .content-touts .articletouts h3.toutheading"));
SetEqualHeight($(".end-of-support #panes-panel-Win8 .f-stacked .m-panes-product-placement-item .c-paragraph"));
SetEqualHeight($(".end-of-support #win-10-panes-3up .m-panes-product-placement-item p.c-paragraph"));
SetEqualHeight($(".end-of-support #win-10-panes-3up .m-panes-product-placement-item .c-call-to-action"));
noSuperScript();
}
$('.end-of-support .c-pivot ul li[aria-controls="PivotTarget0"]').on('click', function() {
SetEqualHeight($(".end-of-support #win-10-panes-3up .m-panes-product-placement-item p.c-paragraph"));
SetEqualHeight($(".end-of-support #win-10-panes-3up .m-panes-product-placement-item .c-call-to-action"));
});
/* EOS loading issue end */
/* ai page js*/
$(document).ready(function() {
$(document).on('click', '#windowsh22.AI-Page .articletouts .c-group a', function() {
$(this).css('border','none');
$(this).css('outline','2px dashed #000');
$(this).css('backgroundColor','rgba(0,103,184,.1)');
$(this).css('border','2px solid #000');
$(this).css('Color','#005da6');
});
$(document).on('click', '.copilot-ai-features #ai-hero a', function() {
$(this).css('border','none');
$(this).css('outline','2px dashed #000');
$(this).css('backgroundColor','rgba(0,103,184,.1)');
$(this).css('Color','#005da6');
});
$('#windowsh22.AI-Page .articletouts .c-group a').focusout(function() {
$('#windowsh22.AI-Page .articletouts .c-group a').removeAttr('style');
});
$('.copilot-ai-features #ai-hero a').focusout(function() {
$('.copilot-ai-features #ai-hero a').removeAttr('style');
});
$(document).on("click", function(e) {
if ($(e.target).is(".copilot-ai-features #ai-hero a") === false) {
$('.copilot-ai-features #ai-hero a').removeAttr('style');
}
});
$(document).on("click", function(e) {
e.stopPropagation();
if ($(e.target).is("#windowsh22.AI-Page .articletouts .c-group a") === false) {
$('#windowsh22.AI-Page .articletouts .c-group a').removeAttr('style');
}
});
});
/* ai page js ends*/
/*PME deeplink start */
$(window).on('load', function (e) {
if (window.location.href.toLowerCase().indexOf("/photo-movie-editor") != -1) {
var link = window.location.href.split("#");
var id_tab = link[1];
if (id_tab != undefined && id_tab == "clipchamp") {
$('html, body').animate({
scrollTop: ($("#clipchamp").offset().top)
}, 1000);
}
}
});
$(document).ready(function () {
if (window.location.href.toLowerCase().indexOf("/photo-movie-editor") != -1) {
var link = window.location.href.split("#");
var id_tab = link[1];
if (id_tab != undefined && id_tab == "clipchamp") {
$('html, body').animate({
scrollTop: ($("#clipchamp").offset().top)
}, 1000);
}
}
//Feature soruce remove if data-srcset is empty
$(".featurebox .m-feature picture source").each(function() {
if($(this).attr("data-srcset") == '') {
$(this).remove();
}
});
});
/*PME deeplink end */
/*tyd faq */
$(document).ready(function () {
if (window.location.href.toLowerCase().indexOf("transfer-your-data-with-windows-backup") != -1) {
jQuery(document).on('click', '.c-drawer', function () {
var eoswin8faq = $("#show-more-faq div.c-drawer-panel p a span").find("span");
for(var i = 0 ; i < eoswin8faq.length;i++ ){
var faqbtntext = eoswin8faq[i].innerHTML;
eoswin8faq[i].replaceWith(faqbtntext);
}
});
jQuery(document).on('click', '.expand-collapse-toggle-area .c-action-trigger', function () {
var thisDrawer = $(this).closest(".drawer-panel");
if (jQuery(this).attr('data-source') === "expand") {
var eoswin8faq = $("#show-more-faq div.c-drawer-panel p a span").find("span");
for(var i = 0 ; i < eoswin8faq.length;i++ ){
var faqbtntext = eoswin8faq[i].innerHTML;
eoswin8faq[i].replaceWith(faqbtntext);
}
}
});
}
//if (window.location.href.toLowerCase().indexOf("digital-pen-touch-voice-features") != -1) {
// $(document).on("click", "#windowsh22.PenVoiceTouch nav.c-in-page-navigation > ul li > a", function() {
// //console.log("clicked");
// if(!($(this).attr("href") == "#touchscreen")) {
// $('html, body').animate({
// scrollTop: ($($(this).attr("href")).offset().top -30)
// }, 1);
// }
// else {
// $('html, body').animate({
// scrollTop: ($($(this).attr("href")).offset().top)
// }, 1);
// }
// });
//}
});
$(document).ready(function () {
if($(".common-button ul li:last-child a.blue-button").length > 0){
var stickybutton = $("nav.common-button:not(.f-dropdown) ul li:last-child a.blue-button").parent("li").clone();
}
else {
var stickybutton = "";
}
$(window).on('load resize', function (e) {
if(window.matchMedia("(max-width:1083.98px)").matches) {
$(".common-button ul li:last-child a.blue-button").parent("li").remove();
slideWidth = 326;
$("#windowsh22.windows #performance .m-banner").attr("data-grid", "col-12");
}
else {
$("#windowsh22.windows #performance .m-banner").attr("data-grid", "col-8");
slideWidth = 450;
if($(".common-button ul li:last-child a.blue-button").length > 0) {
}
else if($("nav.common-button").length > 0){
stickybutton.removeAttr("role");
stickybutton.children()[0].removeAttribute("role");
$(".common-button ul").append(stickybutton);
$(".c-in-page-navigation.f-hide ul li a").attr("tabindex","-1");
$(".c-in-page-navigation.f-dropdown.common-button ul li:last-child").attr("role", "presentation");
$(".c-in-page-navigation.f-dropdown.common-button ul li:last-child a.blue-button").attr("role", "menuitem");
}
}
});
// if($(".common-button .f-dropdown ul li:last-child a.blue-button").length > 0 && window.matchMedia("(max-width:1083.98px)").matches) {
// $(".common-button .f-dropdown ul li").find(".blue-button").parent().remove();
// }
// if($(".common-button ul li:last-child a.blue-button").length > 0 && window.matchMedia("(max-width:1083.98px)").matches) {
// $(".common-button ul li").find(".blue-button").parent().remove();
// }
//photo movie editor pivot panel dynamic ids from second panel placement onwards(when same panel occurs multiple times in same page)
$('#windowsh22.photo-movie-editor #clip-champ-pivot-panel li, #windowsh22.laptop-buying-guide #laptop-display-section > ul li').each(function (index) {
var dataID = $(this).attr("id");
$(this).attr('id', dataID + '-panel');
var pivotAriaCtrls = $(this).attr("aria-controls");
$(this).attr('aria-controls', pivotAriaCtrls + '-panel');
var sectionId = $(this).parent().next().next('[role=tabpanel]').attr("id")
$(this).attr('aria-controls', pivotAriaCtrls + '-panel');
});
$('#windowsh22.photo-movie-editor #clip-champ-pivot-panel [role=tabpanel], #windowsh22.laptop-buying-guide #laptop-display-section [role=tabpanel]').each(function (index) {
var sectionId = $(this).attr("id");
$(this).attr('id', sectionId + '-panel');
});
if (window.location.href.toLowerCase().indexOf("/photo-movie-editor") != -1) {
//$('#videodemo video').get(0).pause();
$('#videodemo2 video').get(0).pause();
}
$("#windowsh22.next-gen-ai-pcs #show-more-faq2 .c-drawer").each(function (index) {
var dataID = $(this).attr("id");
$(this).attr('id', dataID + '-faq2');
var drawerAriaCtrls = $(this).find("button").attr("aria-controls");
$(this).find("button").attr('aria-controls', drawerAriaCtrls + '-faq2');
var faqAnswerDivID = $(this).find("div.c-drawer-panel").attr("id");
$(this).find("div.c-drawer-panel").attr('id', faqAnswerDivID + '-faq2');
});
for (var i = 1; i <= 15; i++) {
$("#windowsh22.laptop-buying-guide #Banner-panel-" + i).attr("data-grid", "container");
};
$("#windowsh22.laptop-buying-guide #choosewindows, #windowsh22.laptop-buying-guide #tools, #windowsh22.laptop-buying-guide #everyaction, #windowsh22.laptop-buying-guide #protectprojects, #windowsh22.laptop-buying-guide #laptops, #windowsh22.laptop-buying-guide #hardware, #windowsh22.laptop-buying-guide #formfactors").attr("data-grid", "container");
$('#windowsh22.laptop-buying-guide .herowithgradientline-blue .featurecontent').prepend("");
$('#windowsh22.laptop-buying-guide .herowithgradientline-blue.pivotpanel').prepend("");
$("#windowsh22.laptop-buying-guide .icon-content-placement").parent().addClass("functionality-factor-table");
$('.AI-Page #bing-ai .m-feature > div').prepend("");
$('.AI-Page #ai-getwin11 .m-feature > div').prepend("");
$('#windowsh22.windows-11 #Win11Featurehero .featurecontent').prepend("");
//$('#windowsh22.PenVoiceTouch .c-button').attr('role','button');
$("#windowsh22 .common-button .c-in-page-navigation ul.c-menu li a.blue-button").attr('role','menuitem');
});
/*Adobe target condition for getting started ends*/
/* accessibilty issue EOS play issue start */
var ViewPortWidth = $(window).width();
if (ViewPortWidth >= 300 && ViewPortWidth <= 1083) {
$(document).on("keydown", ".end-of-support #win-10-panes-3up .m-panes-product-placement-item .deviceCtaSection a.c-call-to-action", function (e) {
if (e.keyCode === 9 && e.shiftKey) {
}else if (e.keyCode === 9 && !e.shiftKey) {
e.preventDefault();
$(".end-of-support #windowsTransfer .m-feature > picture .videobutton.c-call-to-action.c-glyph.bottom-right").focus();
}
});
$(document).on("keydown", ".end-of-support #windowsTransfer .m-feature > picture .videobutton.c-call-to-action.c-glyph.bottom-right", function (e) {
if (e.keyCode === 9 && e.shiftKey) {
e.preventDefault();
$(".end-of-support #win-10-panes-3up .m-panes-product-placement-item .deviceCtaSection a.c-call-to-action").focus();
// $("#compare-button").focus();
}else if (e.keyCode === 9 && !e.shiftKey) {
e.preventDefault();
// $(".end-of-support #Heroitem .m-feature .c-group a.c-call-to-action").first().focus();
$(".end-of-support #windowsTransfer .rounded-corners .c-button.f-primary.blue-button").focus();
}
});
$(document).on("keydown", ".end-of-support #windowsTransfer .rounded-corners .c-button.f-primary.blue-button", function (e) {
if (e.keyCode === 9 && e.shiftKey) {
e.preventDefault();
$(".end-of-support #windowsTransfer .m-feature > picture .videobutton.c-call-to-action.c-glyph.bottom-right").focus();
// $("#compare-button").focus();
}else if (e.keyCode === 9 && !e.shiftKey) {
e.preventDefault();
if(_locale == "en-us") {
$(".end-of-support #Heroitem .m-feature .c-group a.c-call-to-action").first().focus();
}
else {
$(".end-of-support #EOS-Android-Mosaic .c-mosaic > div:first-child section .c-group a").focus();
}
}
});
$(document).on("keydown", ".end-of-support #id-win10.featurebox .rounded-corners .c-button.f-primary.blue-button", function (e) {
if (e.keyCode === 9 && e.shiftKey) {
e.preventDefault();
if(_locale == "en-us") {
$(".end-of-support #Heroitem .m-feature .c-group a.c-call-to-action").last().focus();
}
else {
$(".end-of-support #EOS-Android-Mosaic .SAYD-mosaic-right .c-group a.c-call-to-action").focus();
}
}else if (e.keyCode === 9 && !e.shiftKey) {
e.preventDefault();
$("#show-more-faq-Win10 .drawer-panel p.expand-collapse-toggle-area button").focus();
}
});
$(document).on("keydown", ".end-of-support #NewFeatureGroupId .m-feature-group .m-feature > picture .videobutton.c-call-to-action.c-glyph.bottom-right", function (e) {
if (e.keyCode === 9 && !e.shiftKey) {
settimeout(function(){
$(".end-of-support #NewFeatureGroupId .m-feature-group .m-area-heading sup").focus();
}, 100)
}else if (e.keyCode === 9 && e.shiftKey) {
settimeout(function(){
$(".end-of-support #NewFeatureGroupId .m-feature-group .m-area-heading sup").focus();
}, 100)
}
});
$(document).on("keydown", ".end-of-support #NewFeatureGroupId .m-feature-group .m-feature .c-group a", function (e) {
if (e.keyCode === 9 && !e.shiftKey) {
settimeout(function(){
$(".end-of-support #NewFeatureGroupId .m-feature-group .m-feature .c-group a").focus();
}, 100)
}else if (e.keyCode === 9 && e.shiftKey) {
settimeout(function(){
$(".end-of-support #NewFeatureGroupId .m-feature-group .m-area-heading sup").focus();
}, 100)
}
});
$(document).on("keydown", ".end-of-support #Heroitem .m-feature .c-group a.c-call-to-action:first", function (e) {
//e.preventDefault();
if (e.keyCode === 9 && e.shiftKey) { // Shift + Tab
$(".end-of-support #windowsTransfer .m-feature > picture .videobutton.c-call-to-action.c-glyph.bottom-right").focus();
}
else {
$(".end-of-support #Heroitem .m-feature .c-group a.c-call-to-action:last-child").focus();
}
});
} else{
$(document).on("keydown", ".end-of-support #windowsTransfer .m-feature > picture .videobutton.c-call-to-action.c-glyph.bottom-right", function (e) {
if (e.keyCode === 9 && e.shiftKey) {
e.preventDefault();
$(".end-of-support #windowsTransfer .rounded-corners .c-button.f-primary.blue-button").focus();
// $("#compare-button").focus();
}else if (e.keyCode === 9 && !e.shiftKey) {
e.preventDefault();
if(_locale == "en-us") {
$(".end-of-support #Heroitem .m-feature .c-group a.c-call-to-action").first().focus();
}
else {
$(".end-of-support #EOS-Android-Mosaic div > .c-mosaic-placement.f-width-large .c-group a.c-call-to-action").focus();
}
}
});
$(document).on("keydown", ".end-of-support #EOS-Android-Mosaic div > .c-mosaic-placement.f-width-large .c-group a.c-call-to-action", function (e) {
if (e.keyCode === 9 && e.shiftKey) {
e.preventDefault();
$(".end-of-support #windowsTransfer .m-feature > picture .videobutton.c-call-to-action.c-glyph.bottom-right").focus();
// $("#compare-button").focus();
}
});
$(document).on("keydown", ".end-of-support #windowsTransfer .rounded-corners .c-button.f-primary.blue-button", function (e) {
if (e.keyCode === 9 && e.shiftKey) {
e.preventDefault();
$(".end-of-support #win-10-panes-3up .m-panes-product-placement-item .deviceCtaSection a.c-call-to-action").focus();
}else if (e.keyCode === 9 && !e.shiftKey) {
e.preventDefault();
$(".end-of-support #windowsTransfer .m-feature > picture .videobutton.c-call-to-action.c-glyph.bottom-right").focus();
}
});
$(document).on("keydown", ".end-of-support #id-win10.featurebox .rounded-corners .c-button.f-primary.blue-button", function (e) {
if (e.keyCode === 9 && e.shiftKey) {
e.preventDefault();
if(_locale == "en-us") {
$(".end-of-support #Heroitem .m-feature .c-group a.c-call-to-action").last().focus();
}
else {
$(".end-of-support #EOS-Android-Mosaic .SAYD-mosaic-right .c-group a.c-call-to-action").focus();
}
}else if (e.keyCode === 9 && !e.shiftKey) {
e.preventDefault();
$("#show-more-faq-Win10 .drawer-panel p.expand-collapse-toggle-area button").focus();
}
});
$(document).on("keydown", ".end-of-support #Heroitem .m-feature .c-group a.c-call-to-action:first", function (e) {
if (e.keyCode === 9 && e.shiftKey) { // Shift + Tab
e.preventDefault();
$(".end-of-support #windowsTransfer .m-feature > picture .videobutton.c-call-to-action.c-glyph.bottom-right").focus();
}
});
//.end-of-support #id-win10.featurebox .rounded-corners .c-button.f-primary.blue-button
//.end-of-support #win-10-panes-3up .m-panes-product-placement-item .deviceCtaSection a.c-call-to-action:last
$(document).on("keydown", ".end-of-support #win-10-panes-3up .m-panes-product-placement-item .deviceCtaSection a.c-call-to-action:last", function (e) {
if (e.keyCode === 9 && !e.shiftKey) {
e.preventDefault();
$(".end-of-support #windowsTransfer .rounded-corners .c-button.f-primary.blue-button").focus();
}
});
}
/* EOS play issue ends */
/* accessibility fixes */
$(document).ready(function () {
$(".copilot-ai-features #ai-Contentplacement_spring").parent().addClass("spring-cp");
});
/*Script for rediecting OEM starts*/
$(document).ready(function () {
var ocidparam = "";
if (window.location.href.toLowerCase().indexOf("ocid") >= 0) {
ocidparam = GetQueryStringParams_upgrade("ocid").toLowerCase();
}
else {
ocidparam = "";
}
if(ocidparam.length > 0) {
/*if (ocidparam != -1 && window.location.href.toLowerCase().split("/windows/")[1].indexOf('96d4356d-e45d-4673-95b7-16d85962454b') != -1) {
$("#dell-redirect h2").attr("aria-hidden", "true");
$("#dell-redirect p").attr("aria-hidden", "true");
$("#dell-redirect").prepend('');
var loadText = "Redirecting to Dell.com. Please wait";
$('#OEMnarrate').text(loadText);
setTimeout(function () {
window.location.href = "https://www.dell.com/en-us/lp/everyday-is-easier-on-windows-11";
}, 5000);
}*/
if (ocidparam != -1 && window.location.href.toLowerCase().split("/windows/")[1].indexOf('5c0f8c09-0b1b-4ba8-868a-7cab040bce03') != -1) {
$("#hp-redirect h2").attr("aria-hidden", "true");
$("#hp-redirect p").attr("aria-hidden", "true");
$("#hp-redirect").prepend('');
var loadText = "Redirecting to HP.com. Please wait";
$('#OEMnarrate').text(loadText);
setTimeout(function () {
window.location.href = "https://www.hp.com/us-en/shop/cv/everyday-easier-with-windows-11";
}, 5000);
}
if (ocidparam != -1 && window.location.href.toLowerCase().split("/windows/")[1].indexOf('3614c57b-f79b-4ac2-a0b4-b6e7a7b50ac5') != -1) {
$("#Lenovo-redirect h2").attr("aria-hidden", "true");
$("#Lenovo-redirect p").attr("aria-hidden", "true");
$("#Lenovo-redirect").prepend('');
var loadText = "Redirecting to Lenovo.com. Please wait";
$('#OEMnarrate').text(loadText);
setTimeout(function () {
window.location.href = "https://www.lenovo.com/us/en/windows-11-and-lenovo/";
}, 5000);
}
/*if (ocidparam.startsWith("hol23") && window.location.href.toLowerCase().split("/windows/")[1].indexOf('96d4356d-e45d-4673-95b7-16d85962454b') != -1) {
var oemVal = ocidparam.split("hol23_")[1].toLowerCase();
switch (oemVal) {
case "us_p1_1_dell":
setTimeout(function () {
window.location.href = "https://www.dell.com/en-us/lp/everyday-is-easier-on-windows-11?cid=hol23_us_p1_1_shop_110123";
}, 5000);
break;
case "us_p1_2_dell":
setTimeout(function () {
window.location.href = "https://www.dell.com/en-us/lp/everyday-is-easier-on-windows-11?cid=hol23_us_p1_2_shop_110123";
}, 5000);
break;
case "us_p4_1_dell":
setTimeout(function () {
window.location.href = "https://www.dell.com/en-us/lp/everyday-is-easier-on-windows-11?cid=hol23_us_p4_1_shop_110123";
}, 5000);
break;
case "us_p4_2_dell":
setTimeout(function () {
window.location.href = "https://www.dell.com/en-us/lp/everyday-is-easier-on-windows-11?cid=hol23_us_p4_2_shop_110123";
}, 5000);
break;
case "us_p5_1_dell":
setTimeout(function () {
window.location.href = "https://www.dell.com/en-us/lp/everyday-is-easier-on-windows-11?cid=hol23_us_p5_1_shop_110123";
}, 5000);
break;
case "us_p5_2_dell":
setTimeout(function () {
window.location.href = "https://www.dell.com/en-us/lp/everyday-is-easier-on-windows-11?cid=hol23_us_p5_2_shop_110123";
}, 5000);
break;
case "us_p6_1_dell":
setTimeout(function () {
window.location.href = "https://www.dell.com/en-us/lp/everyday-is-easier-on-windows-11?cid=hol23_us_p6_1_shop_110123";
}, 5000);
break;
case "us_p6_2_dell":
setTimeout(function () {
window.location.href = "https://www.dell.com/en-us/lp/everyday-is-easier-on-windows-11?cid=hol23_us_p6_2_shop_110123";
}, 5000);
break;
default:
setTimeout(function () {
window.location.href = "https://www.dell.com/en-us/lp/everyday-is-easier-on-windows-11";
}, 5000);
};
}*/
if (ocidparam.startsWith("hol23") && window.location.href.toLowerCase().split("/windows/")[1].indexOf('5c0f8c09-0b1b-4ba8-868a-7cab040bce03') != -1) {
var oemVal = ocidparam.split("hol23_")[1].toLowerCase();
switch (oemVal) {
case "us_p1_1_hp":
setTimeout(function () {
window.location.href = "https://www.hp.com/us-en/shop/pcv/everyday-easier-with-windows-11?jumpid=hol23_us_p1_1_shop_110123";
}, 5000);
break;
case "us_p1_2_hp":
setTimeout(function () {
window.location.href = "https://www.hp.com/us-en/shop/pcv/everyday-easier-with-windows-11?jumpid=hol23_us_p1_2_shop_110123";
}, 5000);
break;
case "us_p4_1_hp":
setTimeout(function () {
window.location.href = "https://www.hp.com/us-en/shop/pcv/everyday-easier-with-windows-11?jumpid=hol23_us_p4_1_shop_110123";
}, 5000);
break;
case "us_p4_2_hp":
setTimeout(function () {
window.location.href = "https://www.hp.com/us-en/shop/pcv/everyday-easier-with-windows-11?jumpid=hol23_us_p4_2_shop_110123";
}, 5000);
break;
case "us_p5_1_hp":
setTimeout(function () {
window.location.href = "https://www.hp.com/us-en/shop/pcv/everyday-easier-with-windows-11?jumpid=hol23_us_p5_1_shop_110123";
}, 5000);
break;
case "us_p5_2_hp":
setTimeout(function () {
window.location.href = "https://www.hp.com/us-en/shop/pcv/everyday-easier-with-windows-11?jumpid=hol23_us_p5_2_shop_110123";
}, 5000);
break;
case "us_p6_1_hp":
setTimeout(function () {
window.location.href = "https://www.hp.com/us-en/shop/pcv/everyday-easier-with-windows-11?jumpid=hol23_us_p6_1_shop_110123";
}, 5000);
break;
case "us_p6_2_hp":
setTimeout(function () {
window.location.href = "https://www.hp.com/us-en/shop/pcv/everyday-easier-with-windows-11?jumpid=hol23_us_p6_2_shop_110123";
}, 5000);
break;
default:
setTimeout(function () {
window.location.href = "https://www.hp.com/us-en/shop/cv/everyday-easier-with-windows-11";
}, 5000);
};
}
if (ocidparam.startsWith("hol23") && window.location.href.toLowerCase().split("/windows/")[1].indexOf('3614c57b-f79b-4ac2-a0b4-b6e7a7b50ac5') != -1) {
var oemVal = ocidparam.split("hol23_")[1].toLowerCase();
switch (oemVal) {
case "us_p1_1_lenovo":
setTimeout(function () {
window.location.href = "https://www.lenovo.com/us/en/windows-11-and-lenovo/?cid=hol23:us:p1:1:shop:110123";
}, 5000);
break;
case "us_p1_2_lenovo":
setTimeout(function () {
window.location.href = "https://www.lenovo.com/us/en/windows-11-and-lenovo/?cid=hol23:us:p1:2:shop:110123";
}, 5000);
break;
case "us_p4_1_lenovo":
setTimeout(function () {
window.location.href = "https://www.lenovo.com/us/en/windows-11-and-lenovo/?cid=hol23:us:p4:1:shop:110123";
}, 5000);
break;
case "us_p4_2_lenovo":
setTimeout(function () {
window.location.href = "https://www.lenovo.com/us/en/windows-11-and-lenovo/?cid=hol23:us:p4:2:shop:110123";
}, 5000);
break;
case "us_p5_1_lenovo":
setTimeout(function () {
window.location.href = "https://www.lenovo.com/us/en/windows-11-and-lenovo/?cid=hol23:us:p5:1:shop:110123";
}, 5000);
break;
case "us_p5_2_lenovo":
setTimeout(function () {
window.location.href = "https://www.lenovo.com/us/en/windows-11-and-lenovo/?cid=hol23:us:p5:2:shop:110123";
}, 5000);
break;
case "us_p6_1_lenovo":
setTimeout(function () {
window.location.href = "https://www.lenovo.com/us/en/windows-11-and-lenovo/?cid=hol23:us:p6:1:shop:110123";
}, 5000);
break;
case "us_p6_2_lenovo":
setTimeout(function () {
window.location.href = "https://www.lenovo.com/us/en/windows-11-and-lenovo/?cid=hol23:us:p6:2:shop:110123";
}, 5000);
break;
default:
setTimeout(function () {
window.location.href = "https://www.lenovo.com/us/en/windows-11-and-lenovo/";
}, 5000);
};
}
}
});
/*Script for rediecting OEM ends*/
/*New FF page scripts starts*/
var SneakyprogressBar = $("#sneakymulti.multi-carousal .multi-carousal-wrapper .progressbar-wrapper .progress-bars");
$(".multi-carousal-placement .multi-carousal-div #carousalDiv > div:nth-child(even)").addClass("card_allign_up");
var slideLength = $(".multi-carousal-placement .multi-carousal-div #carousalDiv .carousal-slide").length;
function progressbarIndex(index) {
$(progressBar).find(".c-progress").removeClass("active");
$(progressBar).find(".c-progress").eq(index).addClass("active");
}
function SneakyprogressbarIndex(index) {
$(SneakyprogressBar).find(".c-progress").removeClass("active");
$(SneakyprogressBar).find(".c-progress").eq(index).addClass("active");
}
function inViewport(element, detectPartialElem) {
const viewport = $(window);
const vpWidth = viewport.width();
const vpHeight = viewport.height();
const vpTop = viewport.scrollTop();
const vpBottom = vpTop + vpHeight;
const vpLeft = viewport.scrollLeft();
const vpRight = vpLeft + vpWidth;
const $element = $(element);
const detectPartial = !!detectPartialElem; // if null or undefined, default to false
const elementOffset = $element.offset();
const elementTopArea = elementOffset.top + (detectPartial ? $element.height() : 0);
const elementBottomArea = elementOffset.top + (detectPartial ? 0 : $element.height());
const elementLeftArea = elementOffset.left + (detectPartial ? $element.width() : 0);
const elementRightArea = elementOffset.left + (detectPartial ? 0 : $element.width());
return (
(elementBottomArea <= vpBottom)
&& (elementTopArea >= vpTop))
&& ((elementRightArea <= vpRight)
&& (elementLeftArea >= vpLeft)
);
}
/* multi carosual home page start */
/*
if (window.location.href.toLowerCase().indexOf("/en-us/windows/") != -1) {
var sneakycarousel = $('#sneakymulti.multi-carousal .multi-carousal-placement .multi-carousal-div #carousalDiv');
var threshold = 150;
var slideWidth;
var sneakyprevBtn = $('#sneakymulti.multi-carousal .multi-carousal-placement .multi-carousal-wrapper .c-flipper#sneakyprev');
var sneakynextBtn = $('#sneakymulti.multi-carousal .multi-carousal-placement .multi-carousal-wrapper .c-flipper#sneakynext');
var SneakyprogressBar = $("#sneakymulti.multi-carousal .multi-carousal-wrapper .progressbar-wrapper .progress-bars");
let sneakycurrentIndex = 0;
sneakynextBtn.click(function () { sneakyShiftSlide(-1) })
sneakyprevBtn.click(function () { sneakyShiftSlide(1) })
function sneakyShiftSlide(direction) {
//if (sneakycarousel.hasClass('transition')) return;
var sneakyslides = document.querySelectorAll('#sneakymulti.multi-carousal .multi-carousal-placement .progressbar-wrapper .progress-bars .c-progress');
console.log(sneakyslides.length , 'slides');
//sneakycarousel.addClass('transition').css('transform', 'translateX(' + (direction * slideWidth) + 'px)');
setTimeout(function () {
if (direction === 1) {
$('#sneakymulti.multi-carousal #carousalDiv .carousal-slide:first-child').before($('#sneakymulti.multi-carousal #carousalDiv .carousal-slide:last-child'));
sneakycurrentIndex = (sneakycurrentIndex - 1 + sneakyslides.length) % sneakyslides.length;
if ($(SneakyprogressBar).find(".c-progress:first-child").hasClass("active")) {
$(SneakyprogressBar).find(".c-progress").removeClass("active");
$(SneakyprogressBar).find(".c-progress").eq(sneakycurrentIndex).addClass("active");
} else {
SneakyprogressbarIndex(sneakycurrentIndex);
}
} else if (direction === -1) {
$('#sneakymulti.multi-carousal #carousalDiv .carousal-slide:last-child').after($('#sneakymulti.multi-carousal #carousalDiv .carousal-slide:first-child'));
sneakycurrentIndex = (sneakycurrentIndex + 1) % sneakyslides.length;
if ($(SneakyprogressBar).find(".c-progress:last-child").hasClass("active")) {
$(SneakyprogressBar).find(".c-progress").removeClass("active");
$(SneakyprogressBar).find(".c-progress").eq(sneakyslides.length - 1).addClass("active");
sneakycurrentIndex = sneakyslides.length - 1;
console.log("currentIndex ele" , sneakycurrentIndex);
SneakyprogressbarIndex(0);
sneakycurrentIndex = 0;
console.log("previous btn selected" ,sneakycurrentIndex);
} else {
console.log("check oncee" , sneakycurrentIndex)
SneakyprogressbarIndex(sneakycurrentIndex);
}
}
// sneakycarousel.removeClass('transition')
// sneakycarousel.css('transform', 'translateX(0px)');
}, 500)
}
}
*/
/* multi carosual home page ends*/
/*old code */
var carouselProgressbarLocaleText = {
"ar-xm": "من", "bg-bg": "от", "cs-cz": "z", "da-dk": "af",
"de-at": "von", "de-ch": "von", "de-de": "von", "el-gr": "από",
"en-au": "of", "en-ca": "of", "en-gb": "of", "en-hk": "of",
"en-id": "of", "en-ie": "of", "en-in": "of", "en-is": "of",
"en-my": "of", "en-nz": "of", "en-ph": "of", "en-sg": "of",
"en-za": "of", "es-ar": "de", "es-cl": "de", "es-co": "de",
"es-es": "de", "es-mx": "de", "es-xl": "de", "et-ee": "/",
"fi-fi": "/", "fr-be": "de", "fr-ca": "de", "fr-ch": "de",
"fr-fr": "de", "fr-xf": "de", "he-il": "מתוך", "hr-hr": "od",
"hu-hu": "/", "it-it": "di", "ja-jp": "/", "ko-kr": "/",
"lt-lt": "iš", "lv-lv": "no", "nb-no": "av", "nl-be": "van",
"nl-nl": "van", "pl-pl": "z", "pt-br": "de", "pt-pt": "de",
"ro-ro": "din", "ru-ru": "из", "sk-sk": "z", "sl-si": "od",
"sr-latn-rs": "od", "sv-se": "av", "th-th": "จาก", "tr-tr": "/",
"uk-ua": "з", "vi-vn": "/", "zh-hk": "/", "zh-tw": "/", "zh-cn": "/", "en-us": "of"
};
var carouselProgressbarThislocale = $("html").attr("lang");
var carouselProgressbarText = carouselProgressbarLocaleText[carouselProgressbarThislocale];
$(document).ready(function(){
setTimeout(function(){
$("#experiences.multi-carousal .multicarousal-progress-update").text("1" + " " +carouselProgressbarText+ " " + $('#experiences.multi-carousal #carousalDiv .carousal-slide').length + " " + $('#experiences.multi-carousal #carousalDiv .carousal-slide').eq(0).find(".story-content .c-heading").text());
$("#sneakymulti.multi-carousal .sneaky-progress-update").text("1" + " " +carouselProgressbarText+ " " + $('#sneakymulti.multi-carousal #carousalDiv .carousal-slide').length + " " + $('#sneakymulti.multi-carousal #carousalDiv .carousal-slide').eq(0).find(".c-mainheading").text());
},10);
});
var carousel = $('#experiences .multi-carousal-placement .multi-carousal-div #carousalDiv');
var threshold = 150;
var slideWidth;
var prevBtn = $('#experiences.multi-carousal .multi-carousal-placement .multi-carousal-wrapper .c-flipper#prev');
var nextBtn = $('#experiences.multi-carousal .multi-carousal-placement .multi-carousal-wrapper .c-flipper#next');
var progressBar = $("#experiences.multi-carousal .multi-carousal-wrapper .progressbar-wrapper .progress-bars");
//var SneakyprogressBar = $("#experiences.multi-carousal .multi-carousal-wrapper .progressbar-wrapper .progress-bars");
let currentIndex = 0;
nextBtn.click(function () {
// shiftSlide(-1);
if (window.location.href.split("/").filter(item => item)[2].toLowerCase() == "ar-xm" || window.location.href.split("/").filter(item => item)[2].toLowerCase() == "he-il") {
shiftSlide(1);
} else {
shiftSlide(-1);
}
});
prevBtn.click(function () {
// shiftSlide(1);
if (window.location.href.split("/").filter(item => item)[2].toLowerCase() == "ar-xm" || window.location.href.split("/").filter(item => item)[2].toLowerCase() == "he-il") {
shiftSlide(-1);
} else {
shiftSlide(1);
}
});
var headingpoliteinfo;
var slidelength;
function shiftSlide(direction) {
if (carousel.hasClass('transition')) return;
slidelength = $('#experiences.multi-carousal #carousalDiv .carousal-slide').length;
var slides = document.querySelectorAll('#experiences.multi-carousal .multi-carousal-placement .progressbar-wrapper .progress-bars .c-progress');
carousel.addClass('transition')
.css('transform', 'translateX(' + (direction * slideWidth) + 'px)');
setTimeout(function () {
if (direction === 1) {
if (window.location.href.split("/").filter(item => item)[2].toLowerCase() == "ar-xm" || window.location.href.split("/").filter(item => item)[2].toLowerCase() == "he-il") {
$('#experiences.multi-carousal #carousalDiv .carousal-slide:last-child').after($('#experiences.multi-carousal #carousalDiv .carousal-slide:first-child'));
currentIndex = (currentIndex + 1 + slides.length) % slides.length;
if ($(progressBar).find(".c-progress:first-child").hasClass("active")) {
$(progressBar).find(".c-progress").removeClass("active");
$(progressBar).find(".c-progress").eq(currentIndex).addClass("active");
} else {
progressbarIndex(currentIndex);
}
} else {
headingpoliteinfo = $('#experiences.multi-carousal #carousalDiv .carousal-slide').eq(-1).find(".story-content .c-heading").text();
$('#experiences.multi-carousal #carousalDiv .carousal-slide:first-child').before($('#experiences.multi-carousal #carousalDiv .carousal-slide:last-child'));
currentIndex = (currentIndex - 1 + slides.length) % slides.length;
if ($(progressBar).find(".c-progress:first-child").hasClass("active")) {
$(progressBar).find(".c-progress").removeClass("active");
$(progressBar).find(".c-progress").eq(currentIndex).addClass("active");
} else {
progressbarIndex(currentIndex);
}
}
} else if (direction === -1) {
if (window.location.href.split("/").filter(item => item)[2].toLowerCase() == "ar-xm" || window.location.href.split("/").filter(item => item)[2].toLowerCase() == "he-il") {
$('#experiences.multi-carousal #carousalDiv .carousal-slide:last-child').insertBefore($('#experiences.multi-carousal #carousalDiv .carousal-slide:first-child'));
currentIndex = (currentIndex - 1 + slides.length) % slides.length;
if ($(progressBar).find(".c-progress:last-child").hasClass("active")) {
$(progressBar).find(".c-progress").removeClass("active");
$(progressBar).find(".c-progress").eq(currentIndex).addClass("active");
} else {
progressbarIndex(currentIndex);
}
} else {
headingpoliteinfo = $('#experiences.multi-carousal #carousalDiv .carousal-slide').eq(1).find(".story-content .c-heading").text();
$('#experiences.multi-carousal #carousalDiv .carousal-slide:last-child').after($('#experiences.multi-carousal #carousalDiv .carousal-slide:first-child'));
currentIndex = (currentIndex + 1) % slides.length;
if ($(progressBar).find(".c-progress:last-child").hasClass("active")) {
$(progressBar).find(".c-progress").removeClass("active");
$(progressBar).find(".c-progress").eq(slides.length - 1).addClass("active");
currentIndex = slides.length - 1;
progressbarIndex(0);
currentIndex = 0;
} else {
progressbarIndex(currentIndex);
}
}
}
carousel.removeClass('transition')
carousel.css('transform', 'translateX(0px)');
$("#experiences.multi-carousal .multicarousal-progress-update").text((currentIndex+1) + " " +carouselProgressbarText+ " " + " " + slidelength + " " +headingpoliteinfo);
}, 500)
}
//$("#carousalDiv .carousal-slide .story-content .c-heading .supBLink, #carousalDiv .carousal-slide .story-content .c-group .c-call-to-action").focus(function(){
//const element = $(this).closest('.carousal-slide');
//element[0].scrollIntoView();
//});
/*
var carousel = $('.multi-carousal-placement .multi-carousal-div #carousalDiv');
var threshold = 150;
var slideWidth;
var prevBtn = $('.multi-carousal .multi-carousal-placement .multi-carousal-wrapper .c-flipper#prev');
var nextBtn = $('.multi-carousal .multi-carousal-placement .multi-carousal-wrapper .c-flipper#next');
var progressBar = $(".multi-carousal .multi-carousal-wrapper .progressbar-wrapper .progress-bars");
let currentIndex = 0;
nextBtn.click(function () { shiftSlide(-1) })
prevBtn.click(function () { shiftSlide(1) })
function shiftSlide(direction) {
var slides = document.querySelectorAll('.multi-carousal .multi-carousal-placement .progressbar-wrapper .progress-bars .c-progress');
if (carousel.hasClass('transition')) return;
carousel.addClass('transition')
.css('transform', 'translateX(' + (direction * slideWidth) + 'px)');
currentIndex = $(progressBar).find(".c-progress.active").index();
setTimeout(function () {
if (direction === 1) {
$('.carousal-slide:first-child').before($('.carousal-slide:last-child'));
currentIndex = (currentIndex - 1 + slides.length) % slides.length;
if ($(progressBar).find(".c-progress:first-child").hasClass("active")) {
$(progressBar).find(".c-progress").removeClass("active");
$(progressBar).find(".c-progress").eq(currentIndex).addClass("active");
} else {
progressbarIndex(currentIndex);
}
} else if (direction === -1) {
$('.carousal-slide:last-child').after($('.carousal-slide:first-child'));
currentIndex = (currentIndex + 1) % slides.length;
if ($(progressBar).find(".c-progress:last-child").hasClass("active")) {
$(progressBar).find(".c-progress").removeClass("active");
$(progressBar).find(".c-progress").eq(slides.length - 1).addClass("active");
currentIndex = slides.length - 1;
progressbarIndex(0);
currentIndex = 0;
} else {
progressbarIndex(currentIndex);
}
}
carousel.removeClass('transition')
carousel.css('transform', 'translateX(0px)');
}, 500)
}
*/
/*
function shiftSlide(oneCarousel, direction, progressBar, slides, currentIndex , panel) {
//if(panel == 'sneakymulti'){}
if (oneCarousel.closest(".multi-carousal-placement .multi-carousal-div #carousalDiv").hasClass('transition')) return;
var slides = document.querySelectorAll('.multi-carousal .multi-carousal-placement .progressbar-wrapper .progress-bars .c-progress');
console.log(currentIndex , progressBar, "currentIndexprogressBar")
oneCarousel.closest(".multi-carousal-placement .multi-carousal-div #carousalDiv").addClass('transition')
.css('transform', 'translateX(' + (direction * slideWidth) + 'px)');
currentIndex = $(progressBar).find(".c-progress.active").index();
setTimeout(function () {
if (direction === 1) {
var lastChild = oneCarousel.find('.carousal-slide:last-child')
oneCarousel.find('.carousal-slide:first-child').before(lastChild);
currentIndex = (currentIndex - 1 + slides.length) % slides.length;
console.log(currentIndex , "currentIndex");
if ($(progressBar).find(".c-progress:first-child").hasClass("active")) {
$(progressBar).find(".c-progress").removeClass("active");
$(progressBar).find(".c-progress").eq(currentIndex).addClass("active");
} else {
progressbarIndex(currentIndex, progressBar);
}
} else if (direction === -1) {
var firstChild = oneCarousel.find('.carousal-slide:first-child')
oneCarousel.find('.carousal-slide:last-child').after(firstChild);
currentIndex = (currentIndex + 1) % slides.length;
console.log(currentIndex , "currentIndex -1");
if ($(progressBar).find(".c-progress:last-child").hasClass("active")) {
$(progressBar).find(".c-progress").removeClass("active");
$(progressBar).find(".c-progress").eq(slides.length - 1).addClass("active");
currentIndex = slides.length - 1;
progressbarIndex(0, progressBar);
currentIndex = 0;
} else {
progressbarIndex(currentIndex, progressBar);
}
}
oneCarousel.closest(".multi-carousal-placement .multi-carousal-div #carousalDiv").removeClass('transition')
oneCarousel.closest(".multi-carousal-placement .multi-carousal-div #carousalDiv").css('transform', 'translateX(0px)');
}, 500)
}
var allCarouselsEle = $('.multi-carousal');
var threshold = 150;
var slideWidth;
var progressBar;
allCarouselsEle.each(function(){
var thisCarouselEle = $(this);
console.log(thisCarouselEle , "thisCarouselElethisCarouselEle");
var prevBtn = thisCarouselEle.find('.c-flipper.f-previous');
var nextBtn = thisCarouselEle.find('.c-flipper.f-next');
progressBar = thisCarouselEle.find(".multi-carousal-wrapper .progressbar-wrapper .progress-bars");
var slides = thisCarouselEle.find('.multi-carousal-placement .progressbar-wrapper .progress-bars .c-progress');
var panel = $(this).attr('id');
let currentIndex = 0;
console.log(progressBar , "progressBarprogressBar");
nextBtn.click(function () { shiftSlide(thisCarouselEle, -1, progressBar, slides, currentIndex , panel) })
prevBtn.click(function () { shiftSlide(thisCarouselEle, 1, progressBar, slides, currentIndex , panel) })
});
*/
/*$(document).on('keydown', '#windowsh22.next-gen-ai-pcs .multi-carousal-wrapper .multi-carousal-div #carousalDiv .carousal-slide:not(:last-child) .story-content a:last-child, #windowsh22.windows .multi-carousal-wrapper .multi-carousal-div #carousalDiv .carousal-slide:not(:last-child) .story-content a:last-child', function (e) {
e.preventDefault();
var keyCode = e.keyCode || e.which;
if (keyCode == 9) {
if (e.shiftKey) {
} else {
nextBtn.click();
}
}
});
$(document).on('keydown', '#windowsh22.next-gen-ai-pcs .multi-carousal-wrapper .multi-carousal-div #carousalDiv .carousal-slide:not(:first-child) .story-content a:last-child, #windowsh22.windows .multi-carousal-wrapper .multi-carousal-div #carousalDiv .carousal-slide:not(:first-child) .story-content a:last-child', function (e) {
e.preventDefault();
var keyCode = e.keyCode || e.which;
if (keyCode == 9) {
if (e.shiftKey) {
prevBtn.click();
} else {
}
}
});
$(document).on('keydown','#windowsh22.next-gen-ai-pcs .multi-carousal-wrapper .multi-carousal-div #carousalDiv .carousal-slide:last-child .story-content a:last-child, #windowsh22.windows .multi-carousal-wrapper .multi-carousal-div #carousalDiv .carousal-slide:last-child .story-content a:last-child', function (e) {
e.preventDefault();
var keyCode = e.keyCode || e.which;
if (keyCode == 9) {
if (e.shiftKey) {
} else {
$(this).closest('.multi-carousal').parent().next().next().next().find("#device-section .content-touts:first-child a").focus();
}
}
});*/
/*New FF page scripts ends*/
/*New FF page custom component*/
$(document).ready(function () {
$("#windowsh22.NextGenAIPCs #microsoftandaiContentPlacement").parent().addClass("microsoftAi").removeAttr("data-grid");
$("#windowsh22.windows #whatsnewContentPlacement").parent().addClass("whatsnewgrid").removeAttr("data-grid");
$("#windowsh22.NextGenAIPCs #Hero-Image").parent().addClass("Heroimage").removeAttr("data-grid");
$("#windowsh22.windows #Hero-Image").parent().addClass("Heroimage").removeAttr("data-grid");
$("#windowsh22.NextGenAIPCs #Hero-Banner").parent().addClass("Herobanner").removeAttr("data-grid");
$("#windowsh22.windows #Hero-Banner").parent().addClass("Herobanner").removeAttr("data-grid");
rearrange(0);
$('#sneakymulti .multi-carousal-wrapper .c-flipper#sneakyprev').click(function () {
clickedCard($('.card--left'));
});
$('#sneakymulti .multi-carousal-wrapper .c-flipper#sneakynext').click(function () {
clickedCard($('.card--right'));
});
$(document).on("click", "#sneakymulti.multi-carousal .multi-carousal-wrapper .multi-carousal-div .carousal-slide.card--center .m-product-placement-item picture, #sneakymulti.multi-carousal .multi-carousal-wrapper .multi-carousal-div .carousal-slide.card--left .m-product-placement-item picture, #sneakymulti.multi-carousal .multi-carousal-wrapper .multi-carousal-div .carousal-slide.card--right .m-product-placement-item picture", function () {
var path = $(this).parent().find(".c-call-to-action").attr("href");
var elemHeading = $(this).next(".c-mainheading").text();
$(this).attr("data-js-href", path);
$(this).attr("data-bi-name", elemHeading);
window.location.href = path;
});
$(document).on("click", "#sneakymulti.multi-carousal .multi-carousal-placement .carousal-slide.card--center .story-content, ulti-carousal-placement .carousal-slide.card--left .story-content, ulti-carousal-placement .carousal-slide.card--right .story-content", function () {
var path = $(this).find(".c-call-to-action").attr("href");
var elemHeading = $(this).find("label.c-heading").text();
$(this).attr("data-js-href", path);
$(this).attr("data-bi-name", elemHeading);
window.location.href = path;
});
$(document).on("click", "#windowsh22.windows #whatsnewContentPlacement .content-touts:nth-child(1) .m-content-placement-item > picture, #windowsh22.windows #whatsnewContentPlacement .content-touts:nth-child(2) .m-content-placement-item > picture", function () {
var path = $(this).closest(".m-content-placement-item").find(".c-group a").attr("href");
var elemHeading = $(this).parent().find(".toutheading").text();
$(this).attr("data-js-href", path);
$(this).attr("data-bi-name", elemHeading);
window.location.href = path;
});
$("#sneakymulti.multi-carousal").attr("data-vg", $("#sneakymulti.multi-carousal").attr("id"));
$("#sneakymulti.multi-carousal .multi-carousal-wrapper .multi-carousal-div .carousal-slide.card--center .m-product-placement-item picture").attr("data-js-href", $("#sneakymulti.multi-carousal .multi-carousal-wrapper .multi-carousal-div .carousal-slide.card--center .m-product-placement-item picture").parent().find(".c-call-to-action").attr("href"));
$("#sneakymulti.multi-carousal .multi-carousal-wrapper .multi-carousal-div .carousal-slide.card--left .m-product-placement-item picture").attr("data-js-href", $("#sneakymulti.multi-carousal .multi-carousal-wrapper .multi-carousal-div .carousal-slide.card--left .m-product-placement-item picture").parent().find(".c-call-to-action").attr("href"));
$("#sneakymulti.multi-carousal .multi-carousal-wrapper .multi-carousal-div .carousal-slide.card--right .m-product-placement-item picture").attr("data-js-href", $("#sneakymulti.multi-carousal .multi-carousal-wrapper .multi-carousal-div .carousal-slide.card--right .m-product-placement-item picture").parent().find(".c-call-to-action").attr("href"));
$("#sneakymulti.multi-carousal .multi-carousal-wrapper .multi-carousal-div .carousal-slide.card--center .m-product-placement-item picture").attr("data-bi-name", $("#sneakymulti.multi-carousal .multi-carousal-wrapper .multi-carousal-div .carousal-slide.card--center .m-product-placement-item picture").next(".c-mainheading").text());
$("#sneakymulti.multi-carousal .multi-carousal-wrapper .multi-carousal-div .carousal-slide.card--left .m-product-placement-item picture").attr("data-bi-name", $("#sneakymulti.multi-carousal .multi-carousal-wrapper .multi-carousal-div .carousal-slide.card--left .m-product-placement-item picture").next(".c-mainheading").text());
$("#sneakymulti.multi-carousal .multi-carousal-wrapper .multi-carousal-div .carousal-slide.card--right .m-product-placement-item picture").attr("data-bi-name", $("#sneakymulti.multi-carousal .multi-carousal-wrapper .multi-carousal-div .carousal-slide.card--right .m-product-placement-item picture").next(".c-mainheading").text());
$("#sneakymulti.multi-carousal .multi-carousal-placement .carousal-slide.card--center .story-content").attr("data-js-href", $("#sneakymulti.multi-carousal .multi-carousal-placement .carousal-slide.card--center .story-content").parent().find(".c-call-to-action").attr("href"));
$("#sneakymulti.multi-carousal .multi-carousal-placement .carousal-slide.card--left .story-content").attr("data-js-href", $("#sneakymulti.multi-carousal .multi-carousal-placement .carousal-slide.card--left .story-content").parent().find(".c-call-to-action").attr("href"));
$("#sneakymulti.multi-carousal .multi-carousal-placement .carousal-slide.card--right .story-content").attr("data-js-href", $("#sneakymulti.multi-carousal .multi-carousal-placement .carousal-slide.card--right .story-content").parent().find(".c-call-to-action").attr("href"));
$("#sneakymulti.multi-carousal .multi-carousal-placement .carousal-slide.card--center .story-content").attr("data-bi-name", $("#sneakymulti.multi-carousal .multi-carousal-placement .carousal-slide.card--center .story-content").find("label.c-heading").text());
$("#sneakymulti.multi-carousal .multi-carousal-placement .carousal-slide.card--left .story-content").attr("data-bi-name", $("#sneakymulti.multi-carousal .multi-carousal-placement .carousal-slide.card--left .story-content").find("label.c-heading").text());
$("#sneakymulti.multi-carousal .multi-carousal-placement .carousal-slide.card--right .story-content").attr("data-bi-name", $("#sneakymulti.multi-carousal .multi-carousal-placement .carousal-slide.card--right .story-content").find("label.c-heading").text());
$("#windowsh22.windows #whatsnewContentPlacement .content-touts:nth-child(1) .m-content-placement-item > picture").attr("data-js-href", $("#windowsh22.windows #whatsnewContentPlacement .content-touts:nth-child(1) .m-content-placement-item > picture").closest(".m-content-placement-item").find(".c-group a").attr("href"));
$("#windowsh22.windows #whatsnewContentPlacement .content-touts:nth-child(2) .m-content-placement-item > picture").attr("data-js-href", $("#windowsh22.windows #whatsnewContentPlacement .content-touts:nth-child(2) .m-content-placement-item > picture").closest(".m-content-placement-item").find(".c-group a").attr("href"));
$("#windowsh22.windows #whatsnewContentPlacement .content-touts:nth-child(1) .m-content-placement-item > picture").attr("data-bi-name", $("#windowsh22.windows #whatsnewContentPlacement .content-touts:nth-child(1) .m-content-placement-item > picture").parent().find(".toutheading").text());
$("#windowsh22.windows #whatsnewContentPlacement .content-touts:nth-child(2) .m-content-placement-item > picture").attr("data-bi-name", $("#windowsh22.windows #whatsnewContentPlacement .content-touts:nth-child(2) .m-content-placement-item > picture").parent().find(".toutheading").text());
});
function clickedCard(cardclicked) {
let card = $(cardclicked);
slidelength = $('#experiences.multi-carousal #carousalDiv .carousal-slide').length;
if (card.attr("data-card")) {
if ($(card).hasClass('card--right')) {
var slideCurrIndex = parseInt(card.attr("data-card"));
headingpoliteinfo = $('#sneakymulti.multi-carousal #carousalDiv .carousal-slide').eq(slideCurrIndex).find(".c-mainheading").text();
if (card.attr("data-card") == 0) {
$(".c-sequence-indicator.dots .dot").eq($(".card").length - 1).addClass('f-active').attr("aria-selected", "true")
} else {
$(".c-sequence-indicator.dots .dot").eq(card.attr("data-card") - 1).addClass('f-active').attr("aria-selected", "true")
}
$("#sneakymulti.multi-carousal .sneaky-progress-update").text((slideCurrIndex + 1) + " " +carouselProgressbarText+ " " + " " + slidelength + " " +headingpoliteinfo);
}
if ($(card).hasClass('card--left')) {
var slideCurrIndex = parseInt(card.attr("data-card"));
headingpoliteinfo = $('#sneakymulti.multi-carousal #carousalDiv .carousal-slide').eq(slideCurrIndex).find(".c-mainheading").text();
if (card.attr("data-card") == 0) {
$(".c-sequence-indicator.dots .dot").eq($(".card").length - 1).addClass('f-active').attr("aria-selected", "true")
} else {
$(".c-sequence-indicator.dots .dot").eq(card.attr("data-card") - 1).addClass('f-active').attr("aria-selected", "true")
}
$("#sneakymulti.multi-carousal .sneaky-progress-update").text((slideCurrIndex + 1) + " " +carouselProgressbarText+ " " + " " + slidelength + " " +headingpoliteinfo);
}
$(".cards .card").addClass("zindex").attr("aria-hidden", "true");
rearrange(card.attr("data-card"));
SneakyprogressbarIndex(card.attr("data-card"));
}
}
function rearrange(card) {
var beforeCard = parseInt(card) - 1;
var afterCard = parseInt(card) + 1;
let cards = $("#sneakymulti.sneaky-multi-carousal #carousalDiv .carousal-slide");
var totalCard = cards.length;
for (let n = 0; n < cards.length; n++) {
cards.eq(n).removeClass("card--left");
cards.eq(n).removeClass("card--center");
cards.eq(n).removeClass("card--right");
}
cards.eq(card).addClass("card--center");
cards.eq(card).find("section").attr("tabindex", "-1");
cards.eq(card).removeClass("zindex");
if (card == 1) {
cards.eq(beforeCard).addClass("card--left").removeClass("zindex");
cards.eq(beforeCard).find("section").attr("tabindex", "-1");
cards.eq(afterCard).addClass("card--right").removeClass("zindex");
cards.eq(beforeCard).find("section").attr("tabindex", "-1");
} else if (card == 0) {
cards.eq(totalCard - 1).addClass("card--left").removeClass("zindex");
cards.eq(totalCard - 1).find("section").attr("tabindex", "-1");
cards.eq(1).addClass("card--right").removeClass("zindex");
cards.eq(1).find("section").attr("tabindex", "-1");
} else {
if (card == cards.length - 1) {
cards.eq(0).addClass("card--right").removeClass("zindex");
cards.eq(0).find("section").attr("tabindex", "-1");
} else {
cards.eq(card).next().addClass("card--right").removeClass("zindex");
cards.eq(card).next().find("section").attr("tabindex", "-1");
}
cards.eq(card).prev().addClass("card--left").removeClass("zindex");
cards.eq(card).prev().find("section").attr("tabindex", "-1");
}
}
/* Swiping Functionality */
document.addEventListener('touchstart', handleTouchStart, false);
document.addEventListener('touchmove', handleTouchMove, false);
var xDown = null;
var yDown = null;
function getTouches(evt) {
return evt.touches || // browser API
evt.originalEvent.touches; // jQuery
}
function handleTouchStart(evt) {
const firstTouch = getTouches(evt)[0];
xDown = firstTouch.clientX;
yDown = firstTouch.clientY;
};
function handleTouchMove(evt) {
if ( ! xDown || ! yDown ) {
return;
}
var xUp = evt.touches[0].clientX;
var yUp = evt.touches[0].clientY;
var xDiff = xDown - xUp;
var yDiff = yDown - yUp;
if ( Math.abs( xDiff ) > Math.abs( yDiff ) ) {/*most significant*/
if ( xDiff > 0 ) {
shiftSlide(-1);
clickedCard($('.card--right'));
} else {
/* left swipe */
shiftSlide(1);
clickedCard($('.card--left'));
}
} else {
if ( yDiff > 0 ) {
/* down swipe */
} else {
/* up swipe */
}
}
/* reset values */
xDown = null;
yDown = null;
};
/*New FF page custom component*/
$(document).ready(function () {
$("#windowsh22.NextGenAIPCs #microsoftandaiContentPlacement").parent().addClass("microsoftAi").removeAttr("data-grid");
$("#windowsh22.NextGenAIPCs #Hero-Image").parent().addClass("Heroimage").removeAttr("data-grid");
$("#windowsh22.NextGenAIPCs #Hero-Banner").parent().addClass("Herobanner").removeAttr("data-grid");
$(".copilot-plus-pcs #experiences.ocid_experiencescls").parent().hide();
$(".copilot-plus-pcs #hmc .ocid_hmc_cls").parent().hide();
$(".copilot-plus-pcs #security .ocid_securitycls").parent().hide();
if (window.location.href.toLowerCase().indexOf("/en-us/windows/copilot-plus-pcs") != -1) {
copilotocidparam = GetQueryStringParams_upgrade("ocid");
if(copilotocidparam != undefined) {
if ((copilotocidparam.indexOf("AIDcmmk4qoi8gt") == 0) || (copilotocidparam.indexOf("aidcmmk4qoi8gt") == 0) || (copilotocidparam.indexOf("AIDcmmx223v4de") == 0) || (copilotocidparam.indexOf("aidcmmx223v4de") == 0) || (copilotocidparam.indexOf("AIDcmmuc3hekp1") == 0) || (copilotocidparam.indexOf("aidcmmuc3hekp1") == 0) || (copilotocidparam.indexOf("AIDcmmntt0cr41") == 0) || (copilotocidparam.indexOf("aidcmmntt0cr41") == 0) || (copilotocidparam.indexOf("AIDcmml1b7lqlr") == 0) || (copilotocidparam.indexOf("aidcmml1b7lqlr") == 0) ) {
$(".copilot-plus-pcs #experiences.ocid_experiencescls").parent().show();
$(".copilot-plus-pcs #hmc .ocid_hmc_cls").parent().show();
$(".copilot-plus-pcs #security .ocid_securitycls").parent().show();
$(".copilot-plus-pcs #experiences.noocid_experiencescls").parent().hide();
$(".copilot-plus-pcs #hmc .noocid_hmc_cls").parent().hide();
$(".copilot-plus-pcs #security .noocid_securitycls").parent().hide();
$(".copilot-plus-pcs #experiences.noocid_experiencescls").parent().remove();
$(".copilot-plus-pcs #hmc .noocid_hmc_cls").parent().remove();
$(".copilot-plus-pcs #security .noocid_securitycls").parent().remove();
} else {
$(".copilot-plus-pcs #experiences.ocid_experiencescls").parent().hide();
$(".copilot-plus-pcs #hmc .ocid_hmc_cls").parent().hide();
$(".copilot-plus-pcs #security .ocid_securitycls").parent().hide();
$(".copilot-plus-pcs #experiences.ocid_experiencescls").parent().remove();
$(".copilot-plus-pcs #hmc .ocid_hmc_cls").parent().remove();
$(".copilot-plus-pcs #security .ocid_securitycls").parent().remove();
$(".copilot-plus-pcs #experiences.noocid_experiencescls").parent().show();
$(".copilot-plus-pcs #hmc .noocid_hmc_cls").parent().show();
$(".copilot-plus-pcs #security .noocid_securitycls").parent().show();
}
} else {
$(".copilot-plus-pcs #experiences.ocid_experiencescls").parent().hide();
$(".copilot-plus-pcs #hmc .ocid_hmc_cls").parent().hide();
$(".copilot-plus-pcs #security .ocid_securitycls").parent().hide();
$(".copilot-plus-pcs #experiences.ocid_experiencescls").parent().remove();
$(".copilot-plus-pcs #hmc .ocid_hmc_cls").parent().remove();
$(".copilot-plus-pcs #security .ocid_securitycls").parent().remove();
$(".copilot-plus-pcs #experiences.noocid_experiencescls").parent().show();
$(".copilot-plus-pcs #hmc .noocid_hmc_cls").parent().show();
$(".copilot-plus-pcs #security .noocid_securitycls").parent().show();
}
}
});
$(document).ready(function () {
//tagging updates for copilot-plus-pcs page
if (window.location.href.toLowerCase().indexOf("/windows/copilot-plus-pcs") != -1) {
$("#windowsh22.next-gen-ai-pcs #device-section .m-content-placement-item .c-group a.data-attr-cta").each(function () {
$(this).attr("href").match(/[^w{3}\.]([a-zA-Z0-9]([a-zA-Z0-9\-]{0,65}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,6}/gim)[0].split("/").filter(item => item) == "www.microsoft.com"|| $(this).attr("href").match(/[^w{3}\.]([a-zA-Z0-9]([a-zA-Z0-9\-]{0,65}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,6}/gim)[0].split("/").filter(item => item) == "www.dell.com"? $(this).attr("data-oem", true) : $(this).attr("data-oem", false);
$(this).parent().prevAll(".toutheading").text().toLowerCase().match("microsoft") != undefined || $(this).parent().prevAll(".toutheading").text().toLowerCase().match("microsoft") != null ? $(this).attr("data-retailer", "Microsoft Store") : $(this).attr("data-retailer", "");
$(this).parent().prevAll(".toutheading").text().toLowerCase().match("dell") != undefined || $(this).parent().prevAll(".toutheading").text().toLowerCase().match("dell") != null ? $(this).attr("data-retailer", $(this).parent().prevAll(".toutheading").text().trim().split(" ")[0]) : "";$(this).attr("data-product-name", $(this).parent().prevAll(".toutheading").text().trim());
});
}
if (window.location.href.toLowerCase().indexOf("/windows/copilot-plus-pcs") != -1 || window.location.href.toLowerCase().indexOf("/zh-cn/windows/windows-11-ai-plus-pcs") != -1) {
FAQSchemaLoad();
}
function FAQSchemaLoad() {
var faq1 = JSON.parse($("#show-more-faq1").next().html());
faq1 = faq1.mainEntity;
var faq2 = JSON.parse($("#show-more-faq2").next().html());
faq2 = faq2.mainEntity;
var multipleFAQArrays = [faq1, faq2];
var finalFAQArray = Array.prototype.concat(...multipleFAQArrays);
var context = JSON.parse($("#show-more-faq1").next().html())["@context"];
var faq_type = JSON.parse($("#show-more-faq1").next().html())["@type"];
$("#show-more-faq1").next().remove();
$("#show-more-faq2").next().remove();
var scriptString = " ";
$(scriptString).insertAfter($("#show-more-faq2"));
}
$(document).on("keydown", ".video-js .vjs-fullscreen-control", function(e){
if ((e.type == "keydown" && e.which == "9")) {
e.preventDefault();
$("#default-lightbox .glyph-cancel").focus();
}
});
});
$(document).on('keydown', '#sneakymulti.multi-carousal .multi-carousal-div .card--center .c-call-to-action:not(.f-primary):not(.f-secondary)', function (e) {
e.preventDefault();
var keyCode = e.keyCode || e.which;
if (keyCode == 9) {
if (e.shiftKey) {
if(!$("#sneakymulti.multi-carousal .progress-bars .c-progress:first-child").hasClass("active")) {
$("#sneakymulti.multi-carousal .multi-carousal-div .card--left .c-call-to-action:not(.f-primary):not(.f-secondary)").focus();
clickedCard($('.card--left'));
} else {
$(this).closest(".main-multi").find("#sneakymulti.multi-carousal .multi-carousal-placement .multi-carousal-wrapper .c-flipper#sneakynext").focus();
}
}else {
if(!$("#sneakymulti.multi-carousal .progress-bars .c-progress:last-child").hasClass("active")) {
$("#sneakymulti.multi-carousal .multi-carousal-div .card--right .c-call-to-action:not(.f-primary):not(.f-secondary)").focus();
clickedCard($('.card--right'));
}else {
$(this).closest(".main-multi").next().next().find("a")[0].focus();
}
}
}
});
//08/22/2024;
//Start Common JS
var aniGlobal = aniGlobal || {};
try {
(function () {
// check if a JS file is already loaded
var isFirstLoad = function isFirstLoad(nameSpace) {
var isFirst = nameSpace.firstLoad === undefined;
nameSpace.firstLoad = false;
return isFirst;
};
// if global.js is already loaded, don't run below code
if (!isFirstLoad(aniGlobal)) return;
/*! npm.im/object-fit-images 3.2.4 */
aniGlobal.objectFitImages = function () { "use strict"; function t(t, e) { return "data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='" + t + "' height='" + e + "'%3E%3C/svg%3E"; } function e(t) { if (t.srcset && !p && window.picturefill) { var e = window.picturefill._; t[e.ns] && t[e.ns].evaled || e.fillImg(t, { reselect: !0 }), t[e.ns].curSrc || (t[e.ns].supported = !1, e.fillImg(t, { reselect: !0 })), t.currentSrc = t[e.ns].curSrc || t.src; } } function i(t) { for (var e, i = getComputedStyle(t).fontFamily, r = {}; null !== (e = u.exec(i));) { r[e[1]] = e[2]; } return r; } function r(e, i, r) { var n = t(i || 1, r || 0); b.call(e, "src") !== n && h.call(e, "src", n); } function n(t, e) { t.naturalWidth ? e(t) : setTimeout(n, 100, t, e); } function c(t) { var c = i(t), o = t[l]; if (c["object-fit"] = c["object-fit"] || "fill", !o.img) { if ("fill" === c["object-fit"]) return; if (!o.skipTest && f && !c["object-position"]) return; } if (!o.img) { o.img = new Image(t.width, t.height), o.img.srcset = b.call(t, "data-ofi-srcset") || t.srcset, o.img.src = b.call(t, "data-ofi-src") || t.src, h.call(t, "data-ofi-src", t.src), t.srcset && h.call(t, "data-ofi-srcset", t.srcset), r(t, t.naturalWidth || t.width, t.naturalHeight || t.height), t.srcset && (t.srcset = ""); try { s(t); } catch (t) { window.console && console.warn("https://bit.ly/ofi-old-browser"); } } e(o.img), t.style.backgroundImage = 'url("' + (o.img.currentSrc || o.img.src).replace(/"/g, '\\"') + '")', t.style.backgroundPosition = c["object-position"] || "center", t.style.backgroundRepeat = "no-repeat", t.style.backgroundOrigin = "content-box", /scale-down/.test(c["object-fit"]) ? n(o.img, function () { o.img.naturalWidth > t.width || o.img.naturalHeight > t.height ? t.style.backgroundSize = "contain" : t.style.backgroundSize = "auto"; }) : t.style.backgroundSize = c["object-fit"].replace("none", "auto").replace("fill", "100% 100%"), n(o.img, function (e) { r(t, e.naturalWidth, e.naturalHeight); }); } function s(t) { var e = { get: function get(e) { return t[l].img[e ? e : "src"]; }, set: function set(e, i) { return t[l].img[i ? i : "src"] = e, h.call(t, "data-ofi-" + i, e), c(t), e; } }; Object.defineProperty(t, "src", e), Object.defineProperty(t, "currentSrc", { get: function get() { return e.get("currentSrc"); } }), Object.defineProperty(t, "srcset", { get: function get() { return e.get("srcset"); }, set: function set(t) { return e.set(t, "srcset"); } }); } function o() { function t(t, e) { return t[l] && t[l].img && ("src" === e || "srcset" === e) ? t[l].img : t; } d || (HTMLImageElement.prototype.getAttribute = function (e) { return b.call(t(this, e), e); }, HTMLImageElement.prototype.setAttribute = function (e, i) { return h.call(t(this, e), e, String(i)); }); } function a(t, e) { var i = !y && !t; if (e = e || {}, t = t || "img", d && !e.skipTest || !m) return !1; "img" === t ? t = document.getElementsByTagName("img") : "string" == typeof t ? t = document.querySelectorAll(t) : "length" in t || (t = [t]); for (var r = 0; r < t.length; r++) { t[r][l] = t[r][l] || { skipTest: e.skipTest }, c(t[r]); } i && (document.body.addEventListener("load", function (t) { "IMG" === t.target.tagName && a(t.target, { skipTest: e.skipTest }); }, !0), y = !0, t = "img"), e.watchMQ && window.addEventListener("resize", a.bind(null, t, { skipTest: e.skipTest })); } var l = "bfred-it:object-fit-images", u = /(object-fit|object-position)\s*:\s*([-.\w\s%]+)/g, g = "undefined" == typeof Image ? { style: { "object-position": 1 } } : new Image(), f = "object-fit" in g.style, d = "object-position" in g.style, m = "background-size" in g.style, p = "string" == typeof g.currentSrc, b = g.getAttribute, h = g.setAttribute, y = !1; return a.supportsObjectFit = f, a.supportsObjectPosition = d, o(), a; }();
aniGlobal.featureCard = function () {
var cardAffect = function cardAffect(itemList, itemTextClassName, btn) {
var delayTimeIcon = 0.1;
var delayTimeForNextCard = 0.4;
var delayTimeText = delayTimeIcon;
for (var i = 0; i < itemList.length; i++) {
itemList[i].classList.add('feature-card__text--effect');
itemList[i].style.animationDelay = "".concat(delayTimeIcon, "s");
var featureCardTextElements = $(".".concat(itemTextClassName))[i].children;
for (var a = 0; a < featureCardTextElements.length; a++) {
var contentEle = featureCardTextElements[a].querySelectorAll('.animate-text');
var contentEleTotalLines = 0;
var n = 0;
while (n < featureCardTextElements.length) {
contentEleTotalLines += contentEle.length;
n++;
}
for (var b = 0; b < contentEle.length; b++) {
contentEle[b].classList.add('on-focus');
contentEle[b].style.animationDelay = "".concat(delayTimeText, "s");
var timeSpeed = delayTimeForNextCard / contentEleTotalLines;
delayTimeText += timeSpeed;
}
}
delayTimeIcon += delayTimeForNextCard;
}
if (btn !== undefined) {
btn.classList.add('tech-specs__btn--effect');
btn.style.animationDelay = "".concat(delayTimeText, "s");
}
};
return {
cardAffect: cardAffect
};
}();
aniGlobal.panelInView = function () {
try {
// check if scrolling to panel
var scrollContent = function scrollContent(elm) {
if (document.querySelector(".".concat(elm)) != null) {
var position = document.querySelector(".".concat(elm)).getBoundingClientRect();
if (
position.top > 0 && position.top < window.innerHeight ||
position.bottom < window.innerHeight ||
position.top < 0 && position.bottom > window.innerHeight) {
return true;
}
}
};
// check is element is in view
var checkElementInView = function checkElementInView(element) {
if (element != null) {
var bounding = element.getBoundingClientRect();
return (
bounding.top >= 0 &&
bounding.left >= 0 &&
bounding.bottom <= (window.innerHeight || document.documentElement.clientHeight) &&
bounding.right <= (window.innerWidth || document.documentElement.clientWidth));
}
};
// check if panel partially/fully is visible
// for fully visible we set offsetHeight to 0
var checkPanelInView = function checkPanelInView(sectionName, offsetHeight) {
if (sectionName == undefined) {
}
if (document.querySelector(".".concat(sectionName)) != null) {
var position = document.querySelector(".".concat(sectionName)).getBoundingClientRect();
if (offsetHeight === undefined) {
offsetHeight = 1;
}
if (position.top < 0) {
return true;
}
return (
position.top >= 0 &&
position.left >= 0 &&
position.bottom - position.height * offsetHeight <= (
window.innerHeight || document.documentElement.clientHeight) &&
position.right <= (window.innerWidth || document.documentElement.clientWidth));
}
};
return {
scrollContent: scrollContent,
checkElementInView: checkElementInView,
checkPanelInView: checkPanelInView
};
} catch (e) { }
}();
aniGlobal.utility = function () {
/**
* @desc Utility Function to control the number of times a function is executes onEventHandler
* @param {function, int, int}
* @return {function}
*/
var debounce = function debounce(func, wait, immediate) {
var timeout;
return function () {
var context = this,
args = arguments;
var later = function later() {
timeout = null;
if (!immediate) func.apply(context, args);
};
var callImmediate = immediate && !timeout;
clearTimeout(timeout);
timeout = setTimeout(later, wait);
if (callImmediate) func.apply(context, args);
};
};
return {
debounce: debounce
};
}();
aniGlobal.lineAnimation = function () {
/**
* @desc Checks the HTML tag and check the lang attribute to check if the lang is supporated or not
* NOTE: Currently only ja-jp, zh-hk, zh-cn, zh-tw is not supported but this can be expanded to encompass more
* languages that are not supported
* @param {void} NONE
* @return {boolean}
* */
var langSupported = function langSupported() {
var lang = document.querySelector('html').getAttribute('lang');
if (lang == 'ja-jp' || lang == 'zh-hk' || lang == 'zh-cn' || lang == 'zh-tw') {
return false;
}
return true;
};
/**
* @desc Takes in Html Element containing text tags and seperates
* each text tag into a seperate tag for each line break visable in the DOM
* @param {Array } textElements
* @return {void}
*/
var lineBreakText = function lineBreakText(textElements) {
var numTextElements = textElements.length;
for (var i = 0; i < numTextElements; i++) {
var innerText = textElements[i].innerHTML.split(' ');
var offSetHeight = 0;
var wrappingSpan = document.createElement('SPAN');
/**
* wrappingSpan is a container for the seperate text tags per line.
* This is inserted after the current text tag to maintain order of tags in HTML.
* The Original tag containing the text is then removed as the wrappingSpan will take the place of that
*/
wrappingSpan.classList.add('animate-text-group');
wrappingSpan.setAttribute('aria-hidden', true);
textElements[i].insertAdjacentElement('afterend', wrappingSpan);
var newLineTag = document.createElement(textElements[i].tagName);
// padding removed so new text tags will not have spaces inherited
// from other classes when stacked on top of each other
newLineTag.style.margin = '0';
newLineTag.style.padding = '0';
newLineTag.classList.add('animate-text');
if (textElements[i].classList.contains('currently-focused')) {
newLineTag.classList.add('currently-focused');
}
wrappingSpan.appendChild(newLineTag);
// Check Regional Languages is supported
var langSupported = aniGlobal.lineAnimation.langSupported();
//If text contains anchor tag, set up animation for entire text block
if (textElements[i].innerHTML.includes(' offSetHeight) {
// slice off last word that caused offsetHeight to increase (overflow)
newLineTag.innerHTML = newLineTag.innerHTML.slice(
0,
newLineTag.innerHTML.length - txtElement.length);
newLineTag = document.createElement(textElements[i].tagName);
// padding removed so new text tags will not have spaces inherited
// from other classes when stacked on top of each other
newLineTag.style.margin = '0';
newLineTag.style.padding = '0';
newLineTag.classList.add('animate-text');
if (textElements[i].classList.contains('currently-focused')) {
newLineTag.classList.add('currently-focused');
}
wrappingSpan.appendChild(newLineTag);
newLineTag.innerHTML += txtElement;
}
}
}
var parentElement = textElements[i].parentElement;
parentElement.removeChild(textElements[i]);
}
};
/**
* @desc Reverts text elements that have been processed through function lineBreakText(). This
* function is called for setting up another call for lineBreakText() after the window has been resized
* @param {Array} animatedTextGroup
* @return {void}
*/
var revertLineBreakText = function revertLineBreakText(animatedTextGroup) {
/**
* Recreates the original text tags in HTML in order be broken down again and
* processed by lineBreakText() to new text aligned based on the new size
* of the line breaks from resizing
*/
for (var i = 0; i < animatedTextGroup.length; i++) {
var tagType = null;
var innerText = '';
var numChildren = animatedTextGroup[i].children.length;
var currentlyFocused = undefined;
for (var j = 0; j < numChildren; j++) {
if (tagType === null) {
tagType = animatedTextGroup[i].children[j].tagName;
}
if (
currentlyFocused === undefined && (
animatedTextGroup[i].children[j].classList.contains('on-focus') ||
animatedTextGroup[i].children[j].classList.contains('currently-focused'))) {
currentlyFocused = true;
}
innerText += animatedTextGroup[i].children[j].innerHTML.split();
}
var textElement = document.createElement(tagType);
textElement.classList.add('animate-text-group');
//remove any prev set animation classes
textElement.classList.remove('on-focus');
textElement.classList.remove('off-focus');
if (currentlyFocused) {
textElement.classList.add('currently-focused');
}
textElement.innerHTML = innerText;
animatedTextGroup[i].insertAdjacentElement('afterend', textElement);
var parentElement = animatedTextGroup[i].parentElement;
parentElement.removeChild(animatedTextGroup[i]);
}
};
/**
* @desc Animates Selected Collection of Elements containing 'animate-text' class
* @param {Array } animatedText
* @return void
*/
var initTextAnimation = function initTextAnimation(animatedText, delayTime) {
for (var i = 0; i < animatedText.length; i++) {
if (animatedText[i].classList.contains('animate-text')) {
animatedText[i].classList.add('on-focus');
animatedText[i].style.animationDelay = "".concat(delayTime, "s");
delayTime += 0.3;
}
}
};
return {
langSupported: langSupported,
lineBreakText: lineBreakText,
revertLineBreakText: revertLineBreakText,
initTextAnimation: initTextAnimation
};
}();
aniGlobal.panelHidden = function () {
var isPanelHidden = function isPanelHidden(el) {
if (getComputedStyle(el).display === "none") return true;
if (el === document.body) return false;
return isPanelHidden(el.parentElement);
};
return { isPanelHidden: isPanelHidden };
}();
})();
//END Common JS
(function () {
/* This Constant maintains the aspect ratio of the video through the video height */
var mediaAspectRatio = document.querySelector('.media-selector__display').getAttribute('data-aspectratio');
var desktopView = window.matchMedia('(min-width: 1084px)');
var tabletView = window.matchMedia('(min-width: 540px) and (max-width: 1083px)');
var mobileView = window.matchMedia('(min-width: 0px) and (max-width: 539px)');
var onePlayerVideo = document.querySelector('.video-gallery .c-video-player');
var mediaAutoPlay = document.querySelector(".video-gallery .media-selector__display").getAttribute("data-mediaautoplay") === 'false' ? false : true;
var featureContentPaddingTop = 0;
var inactiveHeaderHeights = [];
var activeHeaderHeight = 0;
var subcontentHeight = [];
var largestActiveHeaderHeight = 0;
var largestActiveHeaderWidth = 0;
var largestSubcontentHeight = 0;
/**
* EDGE CASE FIX: When the data-aspectratio data has been tampered with, revert to correct format
* */
var tamperedAspectRatoData = mediaAspectRatio.includes(',');
if (tamperedAspectRatoData) {
var reformattedAspectRatioData = mediaAspectRatio.replace(',', '.');
mediaAspectRatio = reformattedAspectRatioData;
var mediaDisplay = document.querySelector('.media-selector__display');
mediaDisplay.setAttribute('data-aspectratio', mediaAspectRatio);
}
/**
* @desc set the inactive heights for the headers upon load and on resize
* @param {void}
* @return {void}
*/
var _setHeaderHeights = function _setHeaderHeights() {
largestActiveHeaderHeight = 0;
var headerButton = document.querySelectorAll('.feature-button');
for (var i = 0; i < headerButton.length; i++) {
if (headerButton[i].classList.contains('header-enlarge') || headerButton[i].classList.contains('header-active') ||
headerButton[i].classList.contains('header-enlarge-mobile') || headerButton[i].classList.contains('header-active-mobile')) {
$(headerButton[i]).removeClass('header-active header-enlarge header-active-mobile header-enlarge-mobile');
headerButton[i].style.height = 'auto';
var inactiveHeight = headerButton[i].offsetHeight;
inactiveHeaderHeights[i] = inactiveHeight;
mobileView.matches ? headerButton[i].classList.add('header-active-mobile') : headerButton[i].classList.add('header-active');
headerButton[i].style.height = "".concat(headerButton[i].offsetHeight, "px");
// find largest active header height
if (largestActiveHeaderHeight < headerButton[i].offsetHeight) {
largestActiveHeaderHeight = headerButton[i].offsetHeight;
}
} else {
$(headerButton[i]).removeClass('header-revert header-revert-mobile');
headerButton[i].style.height = 'auto';
inactiveHeaderHeights[i] = headerButton[i].offsetHeight;
// find largest active header height
mobileView.matches ? headerButton[i].classList.add('header-active-mobile') : headerButton[i].classList.add('header-active');
if (largestActiveHeaderHeight < headerButton[i].offsetHeight) {
largestActiveHeaderHeight = headerButton[i].offsetHeight;
}
$(headerButton[i]).removeClass('header-active header-active-mobile');
// set header height to inactive height
headerButton[i].style.height = "".concat(inactiveHeaderHeights[i], "px");
}
}
};
/**
* @desc Set Chevron beginning or end of header feature text
* @param {void}
* @return {void}
* */
var setHeaderChevron = function setHeaderChevron() {
var featureHeader = document.querySelectorAll('.video-gallery .feature-header .feature-button');
for (var i = 0; i < featureHeader.length; i++) {
var headerText = featureHeader[i].innerHTML.trim();
featureHeader[i].innerHTML = "" + headerText + ""
}
};
/**
* @desc Set height to feature content to maintain UI consistency
* @param {void}
* @return {void}
*/
var _setFeatureListItemWidth = function _setFeatureListItemWidth() {
largestActiveHeaderWidth = 0;
var featureContent = document.querySelectorAll('.media-selector__content');
for (var i = 0; i < featureContent.length; i++) {
featureContent[i].style.width = 'auto';
if (largestActiveHeaderWidth < featureContent[i].offsetWidth) {
largestActiveHeaderWidth = featureContent[i].offsetWidth;
}
}
for (var _i = 0; _i < featureContent.length; _i++) {
featureContent[_i].style.width = "".concat(largestActiveHeaderWidth, "px");
}
};
/**
* @desc Find the largest text height of text element and applies that height to rest of the text element group
* @param {void}
* @returns void
*/
var _setSubtextHeight = function _setSubtextHeight() {
largestSubcontentHeight = 0;
var subcontentItems = document.querySelectorAll('.media-selector__content__subcontent');
for (var i = 0; i < subcontentItems.length; i++) {
//reset text height
subcontentItems[i].style.height = 'auto';
subcontentHeight[i] = subcontentItems[i].offsetHeight;
// find largest subcontent height
if (largestSubcontentHeight < subcontentItems[i].offsetHeight) {
largestSubcontentHeight = subcontentItems[i].offsetHeight;
}
//reset height to zero or update for subcontent intial state to be maintained
if (subcontentItems[i].classList.contains('subcontent-expand') === true) {
subcontentItems[i].style.height = "".concat(subcontentHeight[i], "px");
} else {
subcontentItems[i].style.height = '0px';
}
}
};
/**
* @desc set the height for the feature list
* @param {void}
* @return {void}
*/
var setFeatureHeights = function setFeatureHeights() {
// Measure and Set Inactive and Active Header Heights
_setHeaderHeights();
// Measure and Set Inactive and Active Subcontent Heights
_setSubtextHeight();
var featureListContainers = document.querySelectorAll('.media-selector__features__container');
for (var k = 0; k < featureListContainers.length; k++) {
if (desktopView.matches) {
/**
* Set Calculate and set container height to prevent video movement when
* switching between features on desktop view
*/
var containerHeight = 0;
for (var i = 0; i < inactiveHeaderHeights.length; i++) {
containerHeight += inactiveHeaderHeights[i];
}
containerHeight += featureContentPaddingTop * 2;
containerHeight += largestActiveHeaderHeight;
containerHeight += largestSubcontentHeight / 2;
featureListContainers[k].style.height = "".concat(containerHeight, "px");
} else {
featureListContainers[k].style.height = 'auto';
}
}
};
/**
* @desc add animation class to the .media-selector list-items to enable initial header animation
* @param {void}
* @return {void}
*/
var _enableAnimateFeatureHeader = function _enableAnimateFeatureHeader() {
var featureLists = document.querySelectorAll('.media-selector__features ul');
var delayTime = 0;
for (var j = 0; j < featureLists.length; j++) {
var numFeatureRows = featureLists[j].children.length;
var featureContainers = featureLists[j].children;
var selectedSubContent = featureLists[j].querySelector('.media-selector__content__subcontent');
selectedSubContent.classList.add('subcontent-expand');
selectedSubContent.style.height = "".concat(subcontentHeight[0], "px");
for (var i = 0; i < numFeatureRows; i++) {
//var selectedSubContent = document.querySelector('.media-selector__content__subcontent');
//selectedSubContent.classList.add('subcontent-expand');
//selectedSubContent.style.height = "".concat(subcontentHeight[0], "px");
featureContainers[i].classList.add('loadFeature');
featureContainers[i].setAttribute('style', "animation-delay: ".concat(delayTime.toString(), "s"));
/* if ($("#inputToggle").is(":checked"))
delayTime += 0.3;
else
delayTime = 0;*/
//For first feature header, add grow header text animation
//if (i === 0) {
var firstFeatureHeader = featureContainers[0].getElementsByClassName('feature-button')[0];
if (firstFeatureHeader !== undefined) {
firstFeatureHeader.style.height = 'auto';
mobileView.matches ? firstFeatureHeader.classList.add('header-active-mobile') : firstFeatureHeader.classList.add('header-active');
// set activeHeaderHeight for bar area update
activeHeaderHeight = firstFeatureHeader.offsetHeight;
$(firstFeatureHeader).removeClass('header-active header-active-mobile');
firstFeatureHeader.style.height = "".concat(inactiveHeaderHeights[0], "px");
firstFeatureHeader.style.height = "".concat(activeHeaderHeight, "px");
// add animation class
mobileView.matches ? firstFeatureHeader.classList.add('header-enlarge-mobile') : firstFeatureHeader.classList.add('header-enlarge');
}
//}
}
}
// Position Selection Bar on first feature content
var initFeatures = document.querySelectorAll(".media-selector__content[selected='true']");
for (var i = 0; i < initFeatures.length; i++) {
_handleSelectionBar(initFeatures[i]);
}
// _handleSelectionBar(document.querySelector('.media-selector__content'));
};
/**
* @desc If OnePlayer is Enabled, handle video play state
* @param {HTMLElement} currentFeatureVideo
* @returns void
*/
var _checkOnePlayerState = function _checkOnePlayerState(currentFeatureVideo) {
try {
var onePlayer = currentFeatureVideo.querySelector('.c-video-player');
var currContentVideo = onePlayer.getElementsByTagName("VIDEO")[0];
// Check if User is using IE11
var ua = window.navigator.userAgent;
var trident = ua.indexOf('Trident/');
// If User is NOT on IE11, video currentTime attribute will not be set
if (trident < 0) {
currContentVideo.currentTime = 0;
}
if (mediaAutoPlay && $(".hubmain").hasClass('animation-true')) {
currContentVideo.play();
}
else {
currContentVideo.pause();
}
}
catch (e) {
}
};
/**
* @desc loads the media source into the centered media display
* @param {domElement} selectedContent
* @param {boolean} initialLoad
* @return void
*/
function _loadMedia(contentIdx) {
try {
var currentDisplayMedia = document.querySelector('li.media-selector__content[content-idx="' + contentIdx + '"]').closest(".video-gallery");
var initialLoad = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
//clean feature components
var features = currentDisplayMedia.querySelector(".media-selector__display");
for (var i = 0; i < features.length; i++) {
$(features[i]).removeClass('mount unmount');
}
//First Initial load of video content
if (initialLoad === true) {
//console.log("INITIAL LOAD VIDEO");
var initialContent = currentDisplayMedia.querySelector(".media-selector__display__media[data-current='true']");
initialContent.classList.add('mount');
var initialVideos = currentDisplayMedia.querySelectorAll(".media-selector__display__media[data-current='true'] video");
/*if (mediaAutoPlay && $(".hubmain").hasClass('animation-true')) {
// initialVideo.classList.add('video-playing');
//currentDisplayMedia.querySelector(".media-selector__display__media[data-current='true'] button.glyph-play").click();
//initialVideo.play();
} else {
// initialVideo.setAttribute('autoplay', 'false');
//initialVideo.pause();
console.log('video pause on load');
}*/
initialVideos.forEach(function (initialVideo) {
if (initialVideo !== undefined && initialVideo !== null) {
if (mediaAutoPlay && $(".hubmain").hasClass('animation-true')) {
initialVideo.play();
}
else {
initialVideo.closest('.oneplayer-inline').setAttribute('data-autoplay', 'false');
initialVideo.setAttribute('autoplay', 'false');
initialVideo.load();
initialVideo.pause();
}
}
});
return;
}
var prevContent = currentDisplayMedia.querySelector(".media-selector__display__media[data-current='true']");
var currContent = currentDisplayMedia.querySelector(".media-selector__display__media[content-idx='" + contentIdx + "']");
//change video data-current status
prevContent.setAttribute('data-current', false);
currContent.setAttribute('data-current', true);
//Set previous selected feature's status
prevContent.setAttribute('selected', false);
prevContent.setAttribute('aria-hidden', true);
prevContent.classList.remove('mount');
prevContent.classList.remove('unmount');
prevContent.classList.add('unmount');
//Pause PrevContent video
var prevContentVideo = prevContent.getElementsByTagName("VIDEO")[0];
if (prevContentVideo !== undefined) {
prevContentVideo.pause();
}
//Set Currently selected feature status and load selected feature's data source
//TODO: Change this implementations
var prevSelectedFeature = document.querySelector(".media-selector__content[selected='true']");
prevSelectedFeature.setAttribute('selected', false);
var selectedFeature = document.querySelector('.media-selector__content[content-idx="' + contentIdx + '"]');
selectedFeature.setAttribute('selected', true);
//reset animation classes and re-add mount class for animation to trigger
currContent.setAttribute('aria-hidden', false);
currContent.setAttribute('selected', true);
currContent.classList.remove('unmount');
currContent.classList.remove('mount');
currContent.classList.add('mount');
var currContentVideo = currContent.getElementsByTagName("VIDEO")[0];
//Check if the current Media content is a video
if (currContentVideo !== undefined && currContentVideo !== null) {
//Check if OnePlayer is enabled
if (!!onePlayerVideo && onePlayerVideo !== undefined) {
_checkOnePlayerState(currContent);
} else {
// if HTML5 PLayer, Play Current Content Video
currContentVideo.currentTime = 0;
if (mediaAutoPlay && $(".hubmain").hasClass('animation-true')) {
currContentVideo.setAttribute('autoplay', 'true');
//currContentVideo.load();
currContentVideo.play();
}
else {
currContentVideo.setAttribute('autoplay', 'false');
currContentVideo.pause();
}
}
}
//In Mobile and table, user's view would jump back to display video after selecting a feature
if (mobileView.matches || tabletView.matches) {
var mediaDisplay = currentDisplayMedia.querySelector(".media-selector__display");// $('.media-selector__display')[0];
if (!aniGlobal.panelInView.checkElementInView(mediaDisplay)) {
$('html, body').animate({
// scrollTop: $(mediaDisplay).offset().top - 120 //$('.media-selector__display').offset().top - 120
},
500);
}
}
if (currContentVideo !== undefined) {
if (!!onePlayerVideo && onePlayerVideo !== undefined) {
// With One Player, Focus on OnePlayer Element
var videoPlayer = currContent.querySelector('.f-core-player');
videoPlayer.focus();
} else {
// Focus on video element if HTML5 player is used
currContentVideo.focus();
}
}
} catch (e) {
console.log('error in load media function' + e);
}
}
/**
* @desc Handles progress-bar repositioning
* @param {HTMLElement} currentFeature
* @return {void}
*/
var _handleSelectionBar = function _handleSelectionBar(currentFeature) {
var progressBar = currentFeature.parentElement.parentElement.querySelector('.selection-bar__position');
var positionIndex = Array.prototype.indexOf.call(currentFeature.parentElement.children, currentFeature);
//currentFeature.parentElement.indexOf(currentFeature);//.getAttribute('content-idx');
var postionTop = 0;
// Handle Bar Size
var barArea = currentFeature.parentElement.parentElement.querySelector('.selection-bar__position__area');
barArea.style.height = "".concat(activeHeaderHeight + subcontentHeight[positionIndex], "px");
// Handle Position
for (var i = 0; i < positionIndex; i++) {
postionTop += inactiveHeaderHeights[i] + featureContentPaddingTop * 2;
if (mobileView.matches) {
postionTop += 1; /** Temp fix for blue bar positioning in mobile viewport */
}
}
progressBar.style.top = "".concat(postionTop + featureContentPaddingTop, "px");
};
/**
* @desc Inital load of features components and loads the content of the first feature
* when in viewport
* @params none
* @return void
*/
function initialLoadContent() {
//Setup mediaContent elements with selected status
var sectionName = 'media-selector';
if (aniGlobal.panelInView.scrollContent(sectionName)) {
//Initiate Feature Headers to animate
_enableAnimateFeatureHeader();
var allAccordions = $('.media-selector__features');
for (var i = 0; i < allAccordions.length; i++) {
var subcontentText = $(allAccordions[i]).find('.animate-text-group')[0].children;
var subContent = $(allAccordions[i]).find('.media-selector__content');
for (var k = 0; k < subContent.length; k++) {
var _li = $(subContent[k]);
_li.find('p').attr('aria-hidden', 'true');
}
var _accordion = allAccordions[i];
var focusedOnFeature = _accordion.getElementsByClassName('media-selector__content__subcontent')[0];
_helperAnimateSubtext(focusedOnFeature);
var delayTime = 0;
for (var j = 0; j < subcontentText.length; j++) {
subcontentText[j].classList.add('on-focus');
subcontentText[j].style.animationDelay = "".concat(delayTime.toString(), "s");
}
var firstContentIDx = $('.media-selector__features:eq(' + i + ') li:eq(0)').attr('content-idx');
_loadMedia(firstContentIDx, true);
}
//initial video load
// Handle Selection Bar Position and Height
var selectedFeature = document.querySelector(".media-selector__content[selected='true']");
_handleSelectionBar(selectedFeature);
//animate in progress bar
var progressBar = document.querySelector('.selection-bar__position');
progressBar.classList.add('fade-in');
//Remove the event handler when features and media is loaded
window.removeEventListener('scroll', initialLoadContent);
setTabIndex();
}
}
/**
* @desc Helper function to set previous selected feature to fade-out animate
* @param {void}
* @return {void}
*/
var _helperOffFocusFeature = function _helperOffFocusFeature(currentFeature) {
var onFocusedTags = currentFeature.parentElement.querySelectorAll('.media-selector__content .animate-text');
var delayTime = 0;
for (var i = onFocusedTags.length - 1; i >= 0; i--) {
onFocusedTags[i].classList.remove('on-focus');
onFocusedTags[i].classList.add('off-focus');
onFocusedTags[i].style.animationDelay = "".concat(delayTime, "s");
//onFocusedTags[i].setAttribute('style', `animation-delay: ${delayTime}s`);
//delayTime += 0.1;
}
// Animate tags that are focused after window was resized
var currentlyFocusedTags = document.querySelectorAll('.media-selector__content .currently-focused');
//delayTime = 0;
for (var _i2 = currentlyFocusedTags.length - 1; _i2 >= 0; _i2--) {
currentlyFocusedTags[_i2].classList.remove('currently-focused');
currentlyFocusedTags[_i2].classList.add('off-focus');
currentlyFocusedTags[_i2].style.animationDelay = "".concat(delayTime, "s");
//delayTime += 0.1;
}
};
/**
* @desc Helper fuction to add feature header animations
* @param {HTMLElement} currentFeatureHeader
* @return {void}
*/
var _helperAnimateHeader = function _helperAnimateHeader(currentFeatureHeader) {
// Force focus selected header
currentFeatureHeader.focus();
currentFeatureHeader.setAttribute('init-selected', true);
var prevFeatureHeader = mobileView.matches ? currentFeatureHeader.closest(".c-list").querySelector('.header-enlarge-mobile') : currentFeatureHeader.closest(".c-list").querySelector('.header-enlarge');
if (prevFeatureHeader == undefined) {
prevFeatureHeader = mobileView.matches ? document.querySelector('.header-active-mobile') : document.querySelector('.header-active');
}
var prevFeatureIdx = prevFeatureHeader.parentElement.parentElement.getAttribute('content-idx');
//Update tab aria-pressed selected status on feature button
currentFeatureHeader.setAttribute('aria-expanded', true);
prevFeatureHeader.setAttribute('aria-expanded', false);
//Remove all previous active header style and animation classes on previous header
$(prevFeatureHeader).removeClass('header-active header-active-mobile header-enlarge header-enlarge-mobile header-revert header-revert-mobile');
void prevFeatureHeader.offsetHeight; // reflow
mobileView.matches ? prevFeatureHeader.classList.add('header-revert-mobile') : prevFeatureHeader.classList.add('header-revert');
prevFeatureHeader.style.height = "".concat(inactiveHeaderHeights[prevFeatureIdx], "px");
//animate chevron when Previous Active Feature Header is animating
var prevFeatureHeaderChevron = prevFeatureHeader.querySelector('.feature-header__chevron');
prevFeatureHeaderChevron.classList.add('fade-in');
// remove animation class on Active Feature Header Chevron for revert animation setup
var currFeatureHeaderChevron = currentFeatureHeader.querySelector('.feature-header__chevron');
currFeatureHeaderChevron.classList.remove('fade-in');
var currentFeatureIdx = currentFeatureHeader.parentElement.parentElement.getAttribute('content-idx');
$(currentFeatureHeader).removeClass('header-revert header-revert-mobile');
currentFeatureHeader.style.height = 'auto';
mobileView.matches ? currentFeatureHeader.classList.add('header-active-mobile') : currentFeatureHeader.classList.add('header-active');
activeHeaderHeight = currentFeatureHeader.offsetHeight; //update height of active feature header
$(currentFeatureHeader).removeClass('header-active header-active-mobile');
currentFeatureHeader.style.height = "".concat(inactiveHeaderHeights[currentFeatureIdx], "px");
void currentFeatureHeader.offsetHeight; // reflow
currentFeatureHeader.style.height = "".concat(activeHeaderHeight, "px");
// add animation class
mobileView.matches ? currentFeatureHeader.classList.add('header-enlarge-mobile') : currentFeatureHeader.classList.add('header-enlarge');
};
/**
* @desc Helper function to set currently selected feature subtext to animate
* @param {HTMLElement} subcontentText
* @return {void}
*/
var _helperOnFocusFeature = function _helperOnFocusFeature(subcontentText) {
var delayTime = 0;
/* if ($('.hubmain').hasClass('animation-true'))
delayTime = 0.6; */
for (var i = 0; i < subcontentText.length; i++) {
subcontentText[i].classList.remove('off-focus');
subcontentText[i].classList.add('on-focus');
subcontentText[i].style.animationDelay = "".concat(delayTime, "s");
/* if ($('.hubmain').hasClass('animation-true'))
delayTime += 0.15;
else
delayTime = 0;*/
}
};
/**
* @desc Helper function to expand the subcontent of currently selected feature in mobile view
* @param {HTMLElement} focusedOnFeature
* @return {void}
*/
var _helperAnimateSubtext = function _helperAnimateSubtext(focusedOnFeature) {
var prevOnFocus = focusedOnFeature.closest(".c-list").querySelector('.subcontent-expand');// document.querySelector('.subcontent-expand');
if (prevOnFocus !== undefined) {
prevOnFocus.classList.remove('subcontent-expand');
prevOnFocus.querySelector('p').setAttribute('aria-hidden', 'true');
}
//var selectedLi = focusedOnFeature.parentElement.parentElement.querySelector(".media-selector__content[selected='true']");
// if (selectedLi != undefined && selectedLi != null) {
// var offFocusFeature = focusedOnFeature.parentElement.parentElement.querySelector(".media-selector__content[selected='true']").querySelector('.media-selector__content__subcontent');
//offFocusFeature.style.height = '0px';
//}
//else {
// var offFocusFeature = document.querySelector(".media-selector__content[selected='true']").querySelector('.media-selector__content__subcontent');
//}
// if (offFocusFeature!= undefined)
var mediaSelectFeatuers = focusedOnFeature.parentElement.parentElement;
var mediaContent = mediaSelectFeatuers.querySelectorAll('.media-selector__content');
for (var i = 0; i < mediaContent.length; i++) {
mediaContent[i].querySelector('p').setAttribute('aria-hidden', 'true');
mediaContent[i].querySelector('.animate-text-group').setAttribute('aria-hidden', 'true');
mediaContent[i].querySelector('.media-selector__content__subcontent').style.height = "0px";
}
var focusedFeatureIndex = focusedOnFeature.parentElement.getAttribute('content-idx');
focusedOnFeature.classList.add('subcontent-expand');
focusedOnFeature.querySelector('.animate-text-group').setAttribute('aria-hidden', 'false');
focusedOnFeature.querySelector('p').setAttribute('aria-hidden', 'false');
focusedOnFeature.style.height = "".concat(subcontentHeight[focusedFeatureIndex], "px");
};
/**
* @desc onClickEventHandler when Feature is clicked out tapped on
* - Add appropriate animation to the clicked-on feature and the previous selected feature
* - loaded the data-src of the clicked-on feature to display
* @param {void}
* @return {void}
*/
$('.feature-button').click(function (e) {
e.preventDefault();
e.stopPropagation();
var currentFeature = $(this)[0].parentElement.parentElement;
var status = currentFeature.getAttribute('selected');
if (status === 'true') {
// Do nothing when clicking on a feature that is currently selected
return;
}
var currentFeatureHeader = $(this)[0];
var contentIdx = currentFeature.getAttribute('content-idx');
_helperAnimateHeader(currentFeatureHeader);
var focusedOnFeature = currentFeature.getElementsByClassName('media-selector__content__subcontent')[0];
_helperAnimateSubtext(focusedOnFeature);
var subcontentText = currentFeature.getElementsByClassName('animate-text');
//off-focus previous clicked-on feature
_helperOffFocusFeature(currentFeature);
//on-focus current clicked-on feature
_helperOnFocusFeature(subcontentText);
_loadMedia(contentIdx);
_handleSelectionBar(currentFeature);
currentFeatureHeader.focus();
if ($(".media-selector__content__subcontent p[aria-hidden='false']")) {
// $(".media-selector__content__subcontent p[aria-hidden='false'] .screen-reader-text").find('a').removeAttr("tabindex");
// $(".media-selector__content__subcontent p[aria-hidden='false'] .animate-text-group").find('a').attr("tabindex", "0");
// $(".media-selector__content__subcontent p[aria-hidden='true'] .animate-text-group").find('a').attr("tabindex", "-1");
}
var mediaContent = currentFeature.parentElement.querySelectorAll('.media-selector__content');
for (var i = 0; i < mediaContent.length; i++) {
mediaContent[i].setAttribute('selected', false);
}
currentFeature.setAttribute('selected', true);
setTabIndex();
});
/**
* @desc the purpose for this event handler is to allow the focus on the border to reappear on header
* if the header is current selected and expanded when being focused back to. This works in
* conjunction with method _helperAnimateHeader and css style for '.feature-header button:focus[init-selected="true"]'
*/
$('.feature-button').blur(function () {
var currentFeatureHeader = $(this)[0];
currentFeatureHeader.setAttribute('init-selected', false);
});
function setTabIndex() {
var animateText = $(".media-selector__content__subcontent p[aria-hidden='true'] .animate-text-group").find('a');
var readerText = $(".media-selector__content__subcontent p[aria-hidden='true'] .screen-reader-text").find('a');
var animateTextFalse = $(".media-selector__content__subcontent p[aria-hidden='false'] .animate-text-group").find('a');
var readerTextFalse = $(".media-selector__content__subcontent p[aria-hidden='false'] .screen-reader-text").find('a');
if ($(".media-selector__content__subcontent p")) {
$(".media-selector__content__subcontent p[aria-hidden='true'] .animate-text-group").attr('aria-hidden', 'true');
$(".media-selector__content__subcontent p[aria-hidden='false'] .animate-text-group").attr('aria-hidden', 'false');
if ($(".media-selector__content__subcontent p[aria-hidden='true'] .animate-text-group").find('a').length > 0) {
for (var i = 0; i < animateText.length; i++) {
animateText[i].setAttribute('tabindex', '-1');
}
for (var i = 0; i < readerText.length; i++) {
readerText[i].setAttribute('tabindex', '-1');
}
}
if ($(".media-selector__content__subcontent p[aria-hidden='false'] .animate-text-group").find('a').length > 0) {
for (var i = 0; i < animateTextFalse.length; i++) {
animateTextFalse[i].setAttribute('tabindex', '0');
}
for (var i = 0; i < readerTextFalse.length; i++) {
readerTextFalse[i].setAttribute('tabindex', '0');
}
}
}
if ($(".media-selector__content__subcontent p[aria-hidden='true']")) {
$(".media-selector__content__subcontent p[aria-hidden='true'] .animate-text-group").attr('aria-hidden', 'true');
}
else {
$(".media-selector__content__subcontent p[aria-hidden='false'] .animate-text-group").attr('aria-hidden', 'false');
}
}
var init = function init() {
//set inactive feature content height for blue progress bar positioning
var inactiveFeatureListItem = document.querySelector(".media-selector__content");
var featureAttr = window.getComputedStyle(inactiveFeatureListItem);
var paddingTopOffset = parseInt(featureAttr.getPropertyValue('padding-top'));
featureContentPaddingTop = paddingTopOffset;
/* Set Feature List Items Width */
_setFeatureListItemWidth();
/* Setting up text tags for line breaks for line animations */
var subcontentTextContent = document.querySelectorAll('.media-selector__content__subcontent p .animate-text-group');
aniGlobal.lineAnimation.lineBreakText(subcontentTextContent);
setTabIndex();
/* Trims Header Text Whitespace and adds Chevron */
setHeaderChevron();
/* Set Feature List Component Heights */
setFeatureHeights();
//Initiate Content state on page load
var mediaSelectFeatuers = document.querySelectorAll('.media-selector__features');
for (var j = 0; j < mediaSelectFeatuers.length; j++) {
var mediaContent = mediaSelectFeatuers[j].querySelectorAll('.media-selector__content');
for (var i = 1; i < mediaContent.length; i++) {
mediaContent[i].setAttribute('selected', false);
}
mediaContent[0].setAttribute('selected', true);
}
var mediaDisplay = document.querySelectorAll('.media-selector__display');
for (var j = 0; j < mediaDisplay.length; j++) {
var displayHeight = mediaDisplay[j].offsetWidth / mediaAspectRatio;
//set height for media content with the set aspect ratio; Html5 player and images
mediaDisplay[j].style.height = "".concat(displayHeight, "px");
var featureVideos = document.querySelectorAll(".media-selector__display__media video");
if (featureVideos !== undefined) {
for (var _i3 = 0; _i3 < featureVideos.length; _i3++) {
if (!onePlayerVideo || onePlayerVideo === undefined) {
featureVideos[_i3].pause();
}
}
}
}
};
/*=============================================================================================
Check if and components and parent components are hidden before initializing setup methods
- initialize init()
- check conditions for initialLoadContent() to run
- set listener for resize
============================================================================================= */
var videoGallery = document.querySelector('.video-gallery');
var checkComponentHidden = setInterval(function () {
if (!aniGlobal.panelHidden.isPanelHidden(videoGallery)) {
clearInterval(checkComponentHidden);
// Initialize component initial state (initial setup)
init();
// Set up for initial page load animations
if (aniGlobal.panelInView.checkPanelInView('media-selector')) {
initialLoadContent();
} else {
window.addEventListener('scroll', initialLoadContent);
}
// on resize event, recalculate component elements to correct alignment and animations
window.addEventListener('resize', aniGlobal.utility.debounce(function () {
/* Set Feature List Items Width */
_setFeatureListItemWidth();
var subcontentItem = document.querySelectorAll('.media-selector__content__subcontent');
for (var i = 0; i < subcontentItem.length; i++) {
subcontentItem[i].style.height = 'auto';
}
// Resize subtext content line breaks
aniGlobal.lineAnimation.revertLineBreakText(document.querySelectorAll('.media-selector__content__subcontent p .animate-text-group'));
aniGlobal.lineAnimation.lineBreakText(document.querySelectorAll('.media-selector__content__subcontent p .animate-text-group'));
// Readjust Feature Component Heights
setFeatureHeights();
// Readjust featureContentPaddingTop offset and activeFeatureHeaderHight offset
var inactiveFeatureListItem = document.querySelector(".media-selector__content[selected='false']");
var featureAttr = window.getComputedStyle(inactiveFeatureListItem);
var paddingTopOffset = parseInt(featureAttr.getPropertyValue('padding-top'));
featureContentPaddingTop = paddingTopOffset;
activeHeaderHeight = document.querySelector(".media-selector__content[selected='true'] .feature-header").offsetHeight;
// Readjust display-height
var mediaDisplay = document.querySelector('.media-selector__display');
var displayHeight = mediaDisplay.offsetWidth / mediaAspectRatio;
//set height for media content with the set aspect ratio; Html5 player and images
mediaDisplay.style.height = "".concat(displayHeight, "px");
// Reposition selection-bar
var activeFeatures = document.querySelectorAll(".media-selector__content[selected='true']");
for (var i = 0; i < activeFeatures.length; i++) {
_handleSelectionBar(activeFeatures[i]);
}
setTabIndex();
}, 100));
}
}, 100);
})();
}
catch (e) {
console.log();
}
//10/26/2022;
$(document).ready(function () {
$("#AutoStickyNavigation .custom-sticky-nav nav.custom-sticky-nav-mobile .custom-auto-nav-mobile-dropdown-items li:last-child > a").addClass("c-call-to-action c-glyph");
calcNavItemWidth();
window.scrollTo(window.scrollX, window.scrollY + 1);
var toggledDesktop = false;
$('.custom-sticky-nav .more').click(function (e) {
e.preventDefault();
toggledDesktop = !toggledDesktop;
$("#submenu, .more-options-link").attr("aria-expanded", toggledDesktop ? true : false);
$("#submenu").attr("aria-hidden", toggledDesktop ? false : true);
$("#submenu").slideToggle();
});
var toggledMobile = false;
$('.custom-sticky-nav-mobile .custom-auto-nav-mobile-toggle-button').click(function (e) {
e.preventDefault();
toggledMobile = !toggledMobile;
$(".custom-sticky-nav-mobile").attr("aria-expanded", toggledMobile ? true : false);
$(".custom-sticky-nav-mobile").attr("aria-hidden", toggledMobile ? false : true);
$(".custom-auto-nav-mobile-dropdown-items").slideToggle();
});
function calcNavItemWidth() {
var navwidth = 0;
var morewidth = $('#stickyNavDesktop .more').outerWidth(true);
$('#stickyNavDesktop > li:not(.more)').each(function () {
navwidth += $(this).outerWidth(true) + 20;
});
var availablespace = $('#nav-main').width() - morewidth;
if (navwidth > availablespace) {
var lastItem = $('#stickyNavDesktop > li:not(.more)').last();
lastItem.attr('data-width', lastItem.outerWidth(true));
lastItem.prependTo($('#stickyNavDesktop .more ul#submenu'));
calcNavItemWidth();
}
else {
var firstMoreElement = $('#stickyNavDesktop li.more ul#submenu li').first();
if (navwidth + firstMoreElement.data('width') < availablespace) {
firstMoreElement.insertBefore($('#stickyNavDesktop .more'));
}
}
if ($('.more li').length > 0) {
$('.more').css('display', 'block');
}
else {
$('.more').css('display', 'none');
}
}
$(window).on('resize load', function () {
calcNavItemWidth();
});
//check if more has options so that when sections inside 'More' reaches scrolltop 0 then 'More' can be highlighted, if not highlight can be removed via this function
function checkIfMoreHasOptions() {
setTimeout(function () {
if ($(".custom-sticky-nav .more li:not('.navitem-right-mobile')").hasClass("active")) {
$(".more-options-link").addClass("active-more");
$(".navitem-right li").removeClass("active");
}
else {
$(".more-options-link").removeClass("active-more");
if ($(".navitem-right-mobile").hasClass("active")) {
$(".navitem-right li").addClass("active");
$("#stickyNavDesktop .more li").removeClass("active");
}
else {
$(".navitem-right li").removeClass("active");
}
}
}, 500);
}
//hide more option dropdown on click anywhere in the body apart from the more button element area
var moreOptionButton = $(".more-options-link");
function moreOptionButtonToggle(e) {
if (!moreOptionButton.is(e.target) && moreOptionButton.has(e.target).length === 0) {
setTimeout(function () {
$("#submenu").hide();
}, 10);
}
}
$(document).on('keyup', function (e) {
if (e.key == "Escape") {
$("#submenu").hide();
$("#AutoStickyNavigation .custom-sticky-nav #nav-main > ul > li button.more-options-link").focus();
//toggleAriaAttr();
}
});
$("#AutoStickyNavigation .custom-sticky-nav #nav-main > ul > li.hidden #submenu li:nth-last-child(2)").on("keydown", function (e) {
e.preventDefault();
if (e.which === 9) {
$(this).parent().slideUp(500);
}
});
$(document).mouseup(function (e) {
moreOptionButtonToggle(e);
//toggleAriaAttr();
});
// function toggleAriaAttr()
// {
// $("#submenu, .more-options-link").attr("aria-expanded", false);
// $("#submenu, .more-options-link").attr("aria-hidden", true);
// }
//navigate to a section on scroll, making navitem active
var lastId,
topMenu = $("#stickyNavDesktop li, .custom-auto-nav-mobile-dropdown-items li, .nav-right-items li"),
topMenuHeight = topMenu.outerHeight(),
// All list items
menuItems = topMenu.find("a"),
// Anchors corresponding to menu items
scrollItems = menuItems.map(function () {
if ($(this).attr("href").charAt(0) == "#") {
var item = $($(this).attr("href"));
if (item.length) {
return item;
}
}
});
// Bind click handler to menu items
// to get a fancy scroll animation
menuItems.click(function (e) {
if ($(window).width() < 768) {
$(".custom-auto-nav-mobile-toggle-button#mobile-dropdown-toggle .activetext").text($(this).text());
$(".custom-auto-nav-mobile-dropdown-items").hide();
$(".custom-sticky-nav-mobile").attr("aria-expanded", false) }
var href = $(this).attr("href")
offsetTop = href === "#" ? 0 : $(href).offset().top - topMenuHeight + 1;
$('html, body').stop().animate(
{
scrollTop: offsetTop
}, 1000);
e.preventDefault();
});
$(window).on('resize scroll', function () {
checkIfMoreHasOptions();
if($("#stickyNavDesktop").is(':visible')) {
var distanceDesktop = $('#stickyNavDesktop').offset().top - 20;
}
if($('#stickyNavMobile').is(':visible')) {
var distanceMobile = $('#stickyNavMobile').offset().top - 20;
}
$window = $(window);
if ($(window).width() < 768) {
$("#AutoStickyNavigation .custom-sticky-nav-mobile li .custom-auto-nav-mobile-dropdown-items").hide();
}
if ($window.scrollTop() >= distanceDesktop) {
$(".brand-name, .CTAdiv").removeClass("hidden-visibility");
}
else {
$(".brand-name, .CTAdiv").addClass("hidden-visibility");
}
if ($window.scrollTop() >= distanceMobile) {
$(".CTAdiv-mobile").removeClass("hidden");
} else {
$(".CTAdiv-mobile").addClass("hidden");
}
if ($(window).width() >= 768 && $(window).width() <= 1083) {
$("#AutoStickyNavigation").parent().css({ "max-width": "calc(1600px + 10%)", "margin": "0 auto", "padding-left": "5%", "padding-right": "5%" });
} else {
$("#AutoStickyNavigation").parent().css({ "max-width": "", "margin": "", "padding-left": "", "padding-right": "" });
}
// Get container scroll position
var fromTop = $(this).scrollTop() + topMenuHeight + 10;
// Get id of current scroll item
var cur = scrollItems.map(function () {
if ($(this).offset().top < fromTop + 450)
return this;
});
// Get the id of the current element
cur = cur[cur.length - 1];
var id = cur && cur.length ? cur[0].id : "";
if (id != "") {
if (lastId !== id) {
lastId = id;
// Set/remove active class
menuItems.parent().removeClass("active").end().filter("[href="http://approjects.co.za/?big=#" + id + "']").parent().addClass("active");
$("#AutoStickyNavigation .custom-sticky-nav nav li a").attr("aria-current", "false");
$("#AutoStickyNavigation .custom-sticky-nav nav li.active a").attr("aria-current", "page");
$(".custom-auto-nav-mobile-toggle-button#mobile-dropdown-toggle .activetext").text($("#AutoStickyNavigation .custom-sticky-nav-mobile li.active").text());
//history.pushState({}, '', "#" + id);
}
}
});
});
//08/22/2024;
// const { AdaptiveCard } = require("adaptivecards");
// Reference : https://github.com/microsoft/BotFramework-WebChat/blob/main/packages/api/src/defaultStyleOptions.ts
const styleOptions = {
backgroundColor: "#E8E6DF",
botAvatarBackgroundColor: '#252323',
// botAvatarImage :'https://cdn-dynmedia-1.microsoft.com/is/content/microsoftcorplocal/surf-avatar-blue-dark-45x45.png',
bubbleBorderRadius: '1rem',
bubbleBackground: 'transparent',
bubbleFromUserBorderRadius: '1rem',
bubbleFromUserBackground: "rgb(0, 99, 177);",
bubbleFromUserAlignment: "right",
userAvatarInitials: "You",
suggestedActionLayout: 'stacked',
suggestedActionsFlowMaxHeight: '10%',
suggestedActionBorderStyle: 'solid red 2px',
suggestedActionBorderRadius: '1rem',
// botAvatarInitials: "S.A",
botAvatarImage: 'https://cdn-dynmedia-1.microsoft.com/is/content/microsoftcorplocal/surf-avatar-blue-dark-45x45'
}
const adaptiveCardHostConfig = {
"choiceSetInputValueSeparator": ", ",
"imageSizes": {
"small": 48,
"medium": 80,
"large": 160
},
};
var chatAvatar = $(".chatBox").attr('data-chatavatar');
var chatBotDiv = $(".chatBox");
var chatBotEndPointyUrl = $(".chatBox").attr('data-endpointurl');
const copilotBotURL = "https://2e6ce2ab2870e62cb4620de77fa717.1b.environment.api.powerplatform.com/powervirtualagents/botsbyschema/cr3fb_windowsConsumerHmc/directline/token?api-version=2022-03-01-preview";
function RefreshSession() {
RefreshChat()
}
function RefreshChat() {
var chatContainer = document.querySelector(".chatBox .chat-container");
if (chatBotDiv.length != 0) {
var webchat = chatContainer.querySelector('#webchat');
if (webchat) {
chatContainer.removeChild(webchat);
}
var newChat = document.createElement('div');
newChat.id = "webchat";
// Add any attributes or classes to newChat as needed
chatContainer.appendChild(newChat);
// Assuming loadChatBot returns a Promise
loadChatBot();
}
}
async function loadChatBot() {
if (chatBotDiv.length != 0) {
const { directLineURL, token } = await directLineUrlAndToken();
const directLine = CreateDirectLine(directLineURL, token);
directLine.postActivity({
localTimezone: Intl.DateTimeFormat().resolvedOptions().timeZone,
locale: 'en-US',
name: 'startConversation',
emitStartConversationEvent: true,
type: 'event'
})
.subscribe();
RenderWebChat(token, styleOptions);
subscribeToActivityStream(directLine);
}
}
async function directLineUrlAndToken() {
const tokenEndpointURL = new URL(copilotBotURL);
const locale = document.documentElement.lang || 'en';
const apiVersion = tokenEndpointURL.searchParams.get('api-version');
const [directLineURL, token] = await Promise.all([
fetch(new URL(`/powervirtualagents/regionalchannelsettings?api-version=${apiVersion}`, tokenEndpointURL))
.then(response => response.json())
.then(({ channelUrlsById: { directline } }) => directline),
fetch(tokenEndpointURL)
.then(response => response.json())
.then(({ token }) => token)
]);
return {
directLineURL: directLineURL, token: token
}
}
async function loadChatBotBtn() {
await loadChatBot();
}
function CreateDirectLine(url, token) {
return WebChat.createDirectLine({ domain: new URL('v3/directline', url), token });
}
function RenderWebChat(token, styleOptions) {
if (document.getElementById("webchat")) {
document.getElementById("webchat").remove();
const webchatDiv = document.createElement('div');
webchatDiv.id = 'webchat';
webchatDiv.setAttribute('role', 'main');
webchatDiv.setAttribute('height', '100%')
webchatDiv.setAttribute('width', '800px')
const chatContainer = document.getElementById("capture")
chatContainer.appendChild(webchatDiv);
/*webchatDiv.setAttribute("style", "border: solid grey 2px;")*/
window.WebChat.renderWebChat(
{
adaptiveCardHostConfig,
directLine: window.WebChat.createDirectLine({
token: token
}),
userID: 'sdf',
username: 'Web Chat User',
locale: 'en-US',
styleOptions
},
document.getElementById('webchat')
);
}
}
function clearAndCloseChat() {
var closeButton = document.querySelector(".chatbot-close");
RefreshChat().then(function () {
closeButton.click();
}).catch(function (error) {
console.error('Error during chat refresh:', error);
});
}
function disableContainer(containerId) {
var container1 = document.getElementsByClassName(containerId);
const numContainer = container1.length;
console.log(numContainer);
var container = container1[numContainer - 1];
if (!container) {
console.error('Container with ID ' + containerId + ' not found.');
return;
}
var children = container.querySelectorAll('*');
children.forEach(function (child) {
child.setAttribute('disabled', 'true');
// You may want to style the children differently or leave them unchanged
// Here, I'm just changing the color to grey and background color to lightgrey
child.style.color = '';
child.style.backgroundColor = '';
});
}
function disableContainerSelection(className) {
var container1 = document.getElementsByClassName(className);
const numContainer = container1.length;
console.log(numContainer);
var container = container1[numContainer - 1];
if (!container) {
console.error(`Container with ID: ${className} not found.`);
return;
}
DisableInputElements();
}
function disableButtonsByClass(className) {
disableContainerSelection("ac-container ac-adaptiveCard")
var buttons = document.querySelectorAll('.' + className);
const lastButton = buttons[buttons.length - 1]
lastButton.setAttribute('disabled', 'true');
lastButton.style.color = 'grey'; // Set color to grey
lastButton.style.backgroundColor = 'lightgrey';
lastButton.remove();
}
function enableButtonsByClass(className) {
var buttons = document.querySelectorAll('.' + className);
buttons.forEach(function (button) {
button.style.color = 'white';
button.removeAttribute('disabled');
button.style.backgroundColor = ''; // Remove background color styling
});
}
function hasAttachmentId(activity, id) {
return activity.attachments
&& activity.attachments.length > 0
&& activity.attachments[0].content
&& activity.attachments[0].content.id == id;
}
function addCustomClass(selector, className) {
var buttons = document.querySelectorAll('.' + selector);
buttons.forEach(function (button) {
button.classList.add("ac-button-overwrite");
});
}
// check how many there are from the the first question
// [Gaming] --> [Simple and basic, Complex and realistic]
// [Creating] --> [Beginner, Intermediate]
// [Just the basic]--> [Light, Heavy]
// [Entertainment] --> [Always at my desk, At home, but I move around, Anywhere with a wireless]
// [Work and school] --> [Light, Heavy]
// [Family] --> [Light, Heavy]
// [Gaming, Creating] --> [Beginner, Intermediate]
// [*,*] --> [Light, Heavy]
function updateCheckBoxState() {
const inputs = document.querySelectorAll('.ac-input-container input[type="checkbox"]');
const checkedCount = document.querySelectorAll('.ac-input-container input[type="checkbox"]:checked').length;
console.log("checkedCount", checkedCount);
inputs.forEach(input => {
if (checkedCount >= 2 && !input.checked) {
input.disabled = true;
input.style.cursor = "default";
input.nextElementSibling.style.cursor = "default";
} else {
input.disabled = false;
input.style.cursor = "pointer";
}
});
if (checkedCount == 0) {
$("#use-Container-Question1 .ac-pushButton").attr('disabled', 'true');
input.style.cursor = "pointer";
} else {
$("#use-Container-Question1 .ac-pushButton").removeAttr('disabled');
input.style.cursor = "default";
}
}
function DisableInputElements() {
const inputs = document.querySelectorAll('.ac-input-container input[type="checkbox"]');
inputs.forEach(input => {
input.disabled = true;
});
}
function addCheckboxEventListeners() {
const inputs = document.querySelectorAll('.ac-input-container input[type="checkbox"]');
inputs.forEach(input => {
input.addEventListener('change', updateCheckBoxState);
});
}
const testVar = [];
function subscribeToActivityStream(globalDirectLine) {
globalDirectLine.activity$.subscribe(function (activity) {
testVar.push(activity);
function handleButtonClick() {
document.getElementById("webchat").style.display = "none";
}
var seeResultsBtn = document.querySelector('button.ac-pushButton[title="See my results"]');
var talktoPersonalShopperBtn = document.querySelector('button.ac-pushButton[title="Talk to a personal shopper"]');
if (seeResultsBtn && !seeResultsBtn.getAttribute('data-listener')) {
seeResultsBtn.addEventListener('click', handleButtonClick);
seeResultsBtn.setAttribute('data-listener', 'true');
}
if (talktoPersonalShopperBtn && !talktoPersonalShopperBtn.getAttribute('data-listener')) {
talktoPersonalShopperBtn.document.addEventListener('click', handleButtonClick);
talktoPersonalShopperBtn.setAttribute('data-listener', 'true');
}
if (activity.attachments && activity.attachments.length > 0) {
}
switch (activity.type) {
case 'message':
if (activity.value && activity.value.actionSubmitId && activity.value.actionSubmitId.indexOf("Next") !== -1) {
//console.log(activity.attachments);
disableContainer("ac-container ac-adaptiveCard");
disableButtonsByClass("ac-pushButton");
}
setTimeout(function () {
$(".ac-container.ac-adaptiveCard .ac-pushButton").attr("disabled", "true");
$("#lo_loc_see_results .ac-pushButton").removeAttr("disabled", "true");
}, 200);
if (activity.attachments && activity.attachments.length > 0 && activity.attachments[0].content.id === "use-Container-Question1") {
setTimeout(addCheckboxEventListeners, 300);
}
if (hasAttachmentId(activity, "use-ACContainer")) {
// Handle the specific logic here
}
break;
case 'event':
if (activity.name === "refresh" && activity.value) {
// Handle refresh logic
}
break;
case 'endOfConversation':
document.getElementById("webchat").style.display = "none";
loadChatBotBtn().then(function () {
console.log("Chatbot reloaded.");
});
break;
case 'typing':
console.log('typing event');
break;
default:
console.log("unhandled event", activity);
}
});
}
// if(content.type == "AdaptiveCard")
function RenderAdaptiveCard(content) {
alert("should render adaptiveCard");
}
function RederSuggestedActions(suggestedActions) {
if (suggestedActions.length > 0) {
alert("should render suggested actions");
}
}
function RemoveAttributes(className, attribute) {
const element = document.querySelector("#webchat .ac-choiceSetInput-multiSelect")
if (element) {
console.log("accessibility fix success");
element.removeAttribute(attribute);
} else {
console.log(element);
console.log("accessibility fix failed");
}
}
(async function () {
await loadChatBot();
})()
document.addEventListener("DOMContentLoaded", function (event) {
var modalTrigger = document.querySelector('.modal-trigger');
var chatBox = document.querySelector('.chatBox');
var clickStartPlus = document.querySelector('.click-start');
var chatBotStart = document.querySelector('.chatBotStart');
if (document.querySelector(".chatbot-close") != null) {
document.querySelector('.chatbot-close').addEventListener("click", function (event) {
event.preventDefault();
const clickStartBtn = document.querySelector('.click-start');
const closeButton = document.querySelector('.chatbot-close');
chatBox.classList.remove('active');
// Remove the class to disable the slow animation effect
chatBox.classList.add('animate-close');
chatBox.classList.remove('animate-open');
clickStartBtn.classList.remove('d-none');
setTimeout(function () {
if (chatBox.classList.contains('animate-close')) {
chatBox.classList.add('d-none');
}
}, 2000);
});
const closeButton = document.querySelector(".chatbot-close");
closeButton.addEventListener("click", function () {
chatBotStart.focus();
});
function handleChatBotLoading() {
/*event.stopPropagation(); // Prevent parent click event from firing
event.preventDefault();*/
setTimeout(function () {
if (chatBox.classList.contains('animate-open')) {
chatBox.classList.remove('d-none');
}
}, 100);
const clickStartBtn = document.querySelector('.click-start');
const closeButton = document.querySelector('.chatbot-close');
var chatBot = document.querySelectorAll('#webchat');
if (chatBox.classList.contains('active')) {
chatBox.classList.remove('active');
} else {
if (chatBot.length == 0) {
$(".chatBox .chat-container").append('');
loadChatBot();
console.log("hello")
}
chatBox.classList.add('active');
chatBox.classList.add('animate-open');
chatBox.classList.remove('animate-close');
clickStartBtn.classList.add('d-none');
}
setTimeout(function () {
closeButton.focus();
}, 1000);
}
chatBotStart.addEventListener("click", handleChatBotLoading);
/*On Space-bar click loading chat bot*/
chatBotStart.addEventListener("keydown", function (event) {
if (event.code === "Space" || event.code === "Spacebar" || event.keyCode === 32) {
event.preventDefault()
handleChatBotLoading();
}
});
const uhf = document.querySelector('.uhf');
const sticky = document.querySelector('.bg-blue-sticky');
const chatBot = document.querySelector('.chatBox');
const chat = document.querySelector('.chatBox .chat-container');
const navHeight = uhf.offsetHeight;
chatBot.style.top = `${navHeight}px`;
chatBot.style.height = `calc(100% - ${navHeight}px)`;
function updateComponentStyles() {
const scrollY = window.scrollY || window.pageYOffset;
const newTop = Math.max(navHeight - scrollY, 0);
if (sticky != null && sticky != undefined && sticky.offsetHeight > 0) {
chatBot.style.top = `${sticky.offsetHeight}px`;
chatBot.style.height = `calc(100% - ${sticky.offsetHeight}px)`;
}
else {
if (window.matchMedia("(max-width: 767px)").matches) {
chatBot.style.top = 0;
chatBot.style.height = `calc(100%)`;
}
else {
chatBot.style.top = `${newTop}px`;
chatBot.style.height = `calc(100% - navHeight)`;
}
}
const height = newTop + navHeight + 5;
chat.style.height = `calc(100% - ${navHeight}px - 10px)`;
chatButtonPosition();
}
// set chatbot button position above back to top
updateComponentStyles();
chatButtonPosition();
document.addEventListener('resize', (e) => {
updateComponentStyles()
});
document.addEventListener('scroll', (e) => {
updateComponentStyles()
});
function chatButtonPosition() {
var backToTop = $("a.m-back-to-top");
if (backToTop.length > 0) {
if (backToTop.attr("aria-disabled") == false) {
clickStartPlus.style.bottom = "60px";
} else {
clickStartPlus.style.bottom = "0px";
}
} else {
clickStartPlus.style.bottom = "0px";
}
}
document.addEventListener('keydown', function (event) {
const chatbotModal = document.querySelector('.chatBox');
const focusableElements = chatbotModal.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])');
const firstFocusableElement = focusableElements[0];
const lastFocusableElement = focusableElements[focusableElements.length - 1];
if (event.key === 'Tab') {
if (event.shiftKey) {
if (document.activeElement === firstFocusableElement) {
event.preventDefault();
lastFocusableElement.focus();
}
} else {
if (document.activeElement === lastFocusableElement) {
event.preventDefault();
firstFocusableElement.focus();
}
}
}
if (event.key === "Escape") {
const closeButton = document.querySelector('.chatbot-close');
// Trigger click event on the close button
if (event.target.classList.contains("chatbot-close")) {
closeButton.click();
}
}
});
}
});
function isElementVisible(element) {
var rect = element.getBoundingClientRect();
return rect.top >= 0 && rect.top <= window.innerHeight;
}
window.addEventListener('scroll', function () {
var backToTop = document.querySelector("a.m-back-to-top");
var clickStart = document.querySelector(".chat-bot .click-start");
if (backToTop && clickStart) {
var backToTopPos = backToTop.getBoundingClientRect();
var backToTopHeight = backToTop.offsetHeight;
var windowHeight = window.innerHeight;
if (backToTopPos.top <= windowHeight && backToTop.getAttribute("aria-disabled") == 'false') {
clickStart.style.top = "auto";
clickStart.style.bottom = (windowHeight - backToTopPos.top - backToTopHeight + 60) + "px"; /* Add a margin or padding */
clickStart.classList.add("back-to-top-visible");
clickStart.classList.remove("hidden");
} else {
clickStart.style.top = "auto";
clickStart.style.bottom = "1px"; /* Adjust as needed */
clickStart.classList.remove("back-to-top-visible");
clickStart.classList.add("hidden");
}
}
});;