har-down
Version:
har download 从 chrome 生成的 har 文件中下载整个网站所有资源
1,138 lines (797 loc) • 38.8 kB
JavaScript
$(document).ready(function () {
$(".Direction-Vertical > label:nth-child(3)").wrap("<div class='no-direction'></div>");
$('.Direction-Vertical').each(function () {
$(this).find('.no-direction').siblings('label').wrapAll("<div class='count-direction'></div>");
})
if ($('.scfSubmitButtonBorder').length == 0) {
if ($('.noscroll').length = 0)
if ($('.scfForm').length > 0 && $('.scfForm') != undefined) {
$('html, body').animate({
scrollTop: $(".scfForm").offset().top - 50
}, 'slow');
}
}
var youtubeid = getUrlVars()["ytvid"];
var vyoukuid = getUrlVars()["ykvid"];
if (youtubeid != null) {
// document.getElementById('autoVideoplay').src = "//www.youtube.com/embed/" + youtubeid + "?autoplay=1";
document.getElementById('autoVideoplay').src = "//www.youtube.com/embed/" + youtubeid + "?autoplay=1" + 1 + "&rel=" + 0;
}
else if (vyoukuid != null) {
document.getElementById('autoVideoplay').src = "//www://player.youku.com/embed/" + vyoukuid + "?autoplay=1";
}
/* Get iframe src attribute value i.e. YouTube video url
and store it in a variable */
if (youtubeid != null || vyoukuid != null) {
var url = $("#autoVideoplay").attr('src');
/* Remove iframe src attribute on page load to
prevent autoplay in background */
$("#autoVideoplay").attr('src', '');
/* Assign the initially stored url back to the iframe src
attribute when modal is displayed */
$('#myModal').modal('show');
$("#myModal").on('shown.bs.modal', function () {
$("#autoVideoplay").attr('src', url);
});
/* Assign empty url value to the iframe src attribute when
modal hide, which stop the video playing */
$("#myModal").on('hide.bs.modal', function () {
$("#autoVideoplay").attr('src', '');
});
}
function getUrlVars() {
var vars = [], hash;
var hashes = window.location.href.slice(window.location.href.indexOf('?') + 1).split('&');
for (var i = 0; i < hashes.length; i++) {
hash = hashes[i].split('=');
vars.push(hash[0]);
vars[hash[0]] = hash[1];
}
return vars;
}
/* Global Search */
$("#global_search input").on('input', function () {
var search_input = $(this).val();
if (search_input == '') {
$("#global_search .search_img").css("display", "block");
$("#global_search .search_clear, #second_search .search_clear").css("display", "none");
}
if (search_input != '') {
//$( "#global_search .search_img" ).css("display","none");
//$( "#global_search .search_clear" ).css("display","block");
}
});
$("#global_search .search_clear").click(function () {
$("#global_search input").val('');
$("#global_search .search_img").css("display", "block");
$("#global_search .search_clear").css("display", "none");
});
resizeFunction();
$(window).resize(function () {
//setTimeout(resizeFunction, 500);
resizeFunction();
});
function resizeFunction() {
var deviceWidth = $(window).outerWidth();
/* Home Page Banner*/
if (deviceWidth <= 1024) {
if (mobileBannerSource != '') {
$(".home_banner").find("#desktop_banner").remove();
$('<iframe style="width: 100%;" name="Stack" src="' + mobileBannerSource + '" frameborder="0" scrolling="no" class="banner_iframe" id="mobile_banner"></iframe>').appendTo('.home_banner');
$(".home_banner").find(".banner_iframe:gt(0)").remove();
var bannerWidth = $(".banner_iframe").width();
var bannerHeight = bannerWidth / 3;
$(".banner_iframe").height(bannerHeight);
}
} else {
if (desktopBannerSource != '') {
$(".home_banner").find("#mobile_banner").remove();
$('<iframe style="width: 100%;" name="Stack" src="' + desktopBannerSource + ' " frameborder="0" scrolling="no" class="banner_iframe" id="desktop_banner"></iframe>').appendTo('.home_banner');
$(".home_banner").find(".banner_iframe:gt(0)").remove();
var bannerWidth = $(".banner_iframe").width();
var bannerHeight = bannerWidth / 3;
$(".banner_iframe").height(bannerHeight);
}
}
/* Style for Desktop*/
if (deviceWidth > 750) {
/* Home page newslist and stock ticker modification */
var isStockTickerThr = $(".right_content .stock_ticker_cont").length;
if (isStockTickerThr > 0) {
if ($(".inner_content .content_right .recent_newslist .newslist1").length > 1) {
$(".inner_content .content_right .recent_newslist .newslist1:last-child").remove();
}
$(".inner_content .content_right .recent_newslist .eventslistOnHome").css({ "width": "48%", "margin-right": "4%", "float": "left" });
$(".inner_content .content_right .recent_newslist .newslist1").css("width", "100%");
$(".inner_content .content_right .recent_newslist .stock_ticker_cont").css({ "width": "48%", "float": "left" });
}
/*Mindtree:- Fix when there are two different RightContent Widget(with their own heading) on Home-Begin*/
var newsListingWidgetOnHomeCOunt = $(".content_right .recent_newslist .eventslistOnHome").length;
if (newsListingWidgetOnHomeCOunt == 1) {
// $(".inner_content .content_right .recent_newslist .eventslistOnHome").css("width", "100%");
}
else if (newsListingWidgetOnHomeCOunt == 2) {
$(".inner_content .content_right .recent_newslist .eventslistOnHome").css("width", "48%");
}
/*Mindtree:- Fix when there are two different RightContent Widget(with their own heading) on Home-End*/
/*Main Menu For Desktop */
$(".nav .dropdown").each(function () {
var submenu_len = $(this).find(".dropdown-menu li").length;
$(this).find(">a span").addClass('down_arrow');
$(this).click(function () {
$(this).find(">a span").addClass('down_arrow');
$(this).find(">.dropdown-menu li a").css({ "background-color": "#fff", "color": "#3e3e3e" });
});
if (submenu_len == 0) {
$(this).find(">a span").removeClass('down_arrow');
$(this).find(".dropdown-menu").remove();
$(this).find(">a").removeAttr("data-toggle");
}
/* For Secondary menu */
$(this).find(">.dropdown-menu li ").each(function () {
var second_submenu_len = $(this).find(">.dropdown-menu li").length;
$(this).find("a").css({ "background-color": "#fff", "color": "#3e3e3e" });
if (second_submenu_len > 0) {
$(this).find(">a span").addClass('right_arrow');
}
});
$(this).find('a').removeAttr('class data-toggle');
});
/* Background color for second level menu*/
$(".nav .dropdown-menu li a, ul.SuggestionsBorder li a").hover(
function () {
$(this).css("background-color", "#eaeaea");
},
function () {
$(this).css("background-color", "#fff");
});
//alert(deviceWidth);
$(".main_header .custom_nav_bar ul.nav > li > a").removeAttr("style");
$(".main_header .custom_nav_bar ul > li").click(function () {
//alert('desk');
$(this).find(">a").removeAttr("style");
});
//$(".main_header .custom_nav_bar ul.nav > li > a").css({"background-color":"#fff","color":"#3e3e3e"});
/* Main menu for Desktop*/
$(".main_header nav ul.navbar-nav > li").hover(
function () {
$(this).addClass("active_menu BrandingColorBottomBorder");
},
function () {
$(this).removeClass("active_menu BrandingColorBottomBorder");
});
/*4 Mar Begin- Added the hover fuction below as Branding color was not coming */
$("#main-menu>li").hover(
function () {
//$(this).addClass( "brandcolor" );
$(this).css("border-color", brandingColor);
//$('<style>#main-menu>li>ul:before{border-color:transparent transparent ' + brandingColor + ' transparent}</style>').appendTo('#main-menu');
if (brandingColor == '') {
$('<style>#main-menu>li>ul:before{border-color:transparent transparent #bbb transparent}</style>').appendTo('#main-menu');
} else {
$('<style>#main-menu>li>ul:before{border-color:transparent transparent ' + brandingColor + ' transparent}</style>').appendTo('#main-menu');
}
},
function () {
//$(this).removeClass( "brandcolor" );
$(this).css("border-color", "#fff");
$("#main-menu>style").remove();
});
/*4 Mar END- Added the hover fuction below as Branding color was not coming */
/* Footer Address */
$(".footer_top>ul> li:first-child").append($(".footer_top .address"));
/* Foreign Lang Selection For Desktop*/
$(".news_list .news ul li").each(function () {
$(this).find(".news_content").append($(this).find(".foreign_lang_selection"));
$(this).find(">.foreign_lang_selection").remove();
//$(this).append($(this).find(".foreign_lang_selection"));
});
/*stock tikker*/
$(".main_header .header_top").append($(".body_content .inner_content .stock_tikker"));
/* mobile search box */
$(".global_search_mob .up_arrow").css("display", "none");
$(".mobile_search_box").css("display", "none");
/* Investor Tab */
/* $(".tab ul").removeClass("nav-justified");*/
/* Main menu dropdown on hover */
$(".main_header nav ul.navbar-nav li").hover( /* Changed */
function () {
var menu_length = $(this).find('ul li').length;
if (menu_length > 0) {
$(this).addClass("open");
}
},
function () {
var menu_length = $(this).find('ul li').length;
if (menu_length > 0) {
$(this).removeClass("open");
}
});
$(".main_header").removeAttr('style');
//set main menu top based on the main header container Height
$("#main-menu").css("top", 0);
}
/* Style for Mobile*/
if (deviceWidth <= 750) {
/* Home page newslist and stock ticker modification */
var isStockTickerThr = $(".right_content .stock_ticker_cont").length;
if (isStockTickerThr > 0) {
if ($(".inner_content .content_right .recent_newslist .newslist1").length > 1) {
$(".inner_content .content_right .recent_newslist .newslist1:last-child").remove();
}
$(".inner_content .content_right .recent_newslist .eventslistOnHome").css("width", "100%");
$(".inner_content .content_right .recent_newslist .stock_ticker_cont").css("width", "100%");
}
/*stock tikker*/
/*Mindtree:- Fix when there are two different RightContent Widget(with their own heading) on Home-Begin*/
var newsListingWidgetOnHomeCOunt = $(".content_right .recent_newslist .eventslistOnHome").length;
if (newsListingWidgetOnHomeCOunt == 2) {
$(".inner_content .content_right .recent_newslist .eventslistOnHome").css("width", "100%");
}
/*Mindtree:- Fix when there are two different RightContent Widget(with their own heading) on Home-End*/
$(".body_content .inner_content").append($(".main_header .stock_tikker"));
$(".main_header nav ul.navbar-nav > li").hover(
function () {
$(".main_header nav ul.navbar-nav > li").removeClass("active_menu BrandingColorBottomBorder");
});
$(".main_header .custom_nav_bar ul > li").find(">.dropdown-menu li a").css({ "background-color": "#afafaf", "color": "#e3e3e3" });
$(".main_header .custom_nav_bar ul > li").click(function () {
$(".main_header .custom_nav_bar> ul > li > a span").removeClass('up_arrow');
$(".main_header .custom_nav_bar >ul > li > a span").addClass('down_arrow');
var menu_len = $(this).find("ul li");
$(".main_header .custom_nav_bar ul.nav > li > a").css({ "background-color": "#fff", "color": "#3e3e3e" });
if (menu_len.length > 0) {
var className = $(this).find("> a span").attr('class');
if (className == 'down_arrow') {
$(this).find("> a span").removeClass('down_arrow');
$(this).find("> a span").addClass('up_arrow');
} else {
$(this).find("> a span").removeClass('up_arrow');
$(this).find("> a span").addClass('down_arrow');
}
$(this).find(">a").css({ "background-color": "#afafaf", "color": "#fff" }); // odd clicks
var classStatus = $(this).hasClass("open");
if (classStatus == true) {
$(this).find("> a span").removeClass('up_arrow');
$(this).find("> a span").addClass('down_arrow');
$(this).find("> a").css({ "background-color": "#fff", "color": "#3e3e3e" });
}
/* For Secondary menu*/
$(this).find(">.dropdown-menu li ").each(function () {
var second_submenu_len = $(this).find(">.dropdown-menu li").length;
$(this).find("a").css({ "background-color": "#afafaf", "color": "#e3e3e3" });
if (second_submenu_len > 0) {
$(this).find(">a span").addClass('right_arrow');
}
});
}
});
/* Foreign Lang Selection*/
$(".news_list .news ul li").each(function () {
$(this).append($(this).find(".foreign_lang_selection"));
});
/* Product Category page */
$(".product_category_menu .menu li a").click(function (event) {
if (event.target !== this) return; /* changed on oct28 */
// $(this).off('click');
var className = $(this).attr('class');
if (className == 'active') {
event.preventDefault();
$(".product_category_menu").animate({ left: "-110%" }, 500);
$("#product_category_content .product_content").find('.content').slideDown(1000);
}
});
$("#product_category_content .product_content .product_title .back").click(function () {
$("#product_category_content .product_content").find('.content').slideUp(1000);
$(".product_category_menu").animate({ left: "0px" }, 500);
});
/*Footer Menu */
$(".main_footer .footer_top").prepend($(".footer_bottom .footer_menu"));
/* Investor Tab */
/*$(".tab ul").addClass("nav-justified");*/
/* Main menu dropdown on hover for mobile */ /* Changed*/
$(".main_header nav ul.navbar-nav li").unbind('mouseenter mouseleave');
/* Remove background color 2nd level main menu */
$(".nav .dropdown-menu li a").unbind('mouseenter mouseleave');
/* Add click event to main menu */ /* Changed*/
$(".main_header .custom_nav_bar ul.nav > li > a").attr({
class: "dropdown-toggle", "data-toggle": "dropdown"
});
/* Remove background color 2nd level main menu */
$(".nav .dropdown-menu li a").unbind('mouseenter mouseleave');
var logoImageHeight = $(".main_header .header_top .ametek_logo").height();
if (logoImageHeight > 28) {
var resizeLogoHeight = logoImageHeight + 12;
$(".main_header").height(resizeLogoHeight);
//set main menu top based on the main header container Height
$("#main-menu").css("top", resizeLogoHeight); // changed on feb 6
}
if (!$('.main_header .search .country_lang').length > 0) {
$('.main_header .header_top>a').css('left', '30%');
}
}
/* For Safari Browser */
if (navigator.userAgent.indexOf('Safari') != -1 && navigator.userAgent.indexOf('Chrome') == -1) {
// window.location.reload(true);
//alert($(".tab").html());
$(".tab").html($(".tab").html());
}
}
/* Global Search */
$(".global_search_mob .search_btn").click(function () {
$(".global_search_mob .up_arrow").slideToggle(500);
$(".mobile_search_box").slideToggle(500);
});
/*Main Menu For Mobile */
$(".main_header nav button").click(function (event) {
event.preventDefault();
var i = $(".main_header .custom_nav_bar").css("left");
if (i == '-250px') {
$(".main_header .custom_nav_bar").animate({ left: "15px" }, 500);
} else {
$(".main_header .custom_nav_bar").animate({ left: "-250px" }, 500);
}
/* var left = $(".wrapper .body_content").css("left");
if (left == '0px') {
$(".wrapper .body_content").animate({ left: "250px" }, 500);
} else {
$(".wrapper .body_content").animate({ left: "0" }, 500);
} */
});
/* search result page */
$("#search_result_content .search_catag_list ul li a").click(function () {
$("#search_result_content .search_catag_list ul li a").css({ "font-family": "PT Sans", "font-weight": "400" });
$(this).css({ "font-family": "PT Sans", "font-weight": "700" });
});
/* product category page */
/* product category page */
$(".leftmenu_withsubmenu ul.menu > li").each(function () { /*Changed */
var submenu_len = $(this).find('ul li').length;
if (submenu_len > 0) {
$(this).find('>a span:first-of-type').addClass('dropdown_rarrow');
}
});
$(".leftmenu_withsubmenu ul.menu > li > a span").click(function () {
event.preventDefault();
$(".leftmenu_withsubmenu ul.menu > li > a").find('span:first-of-type').removeClass('dropdown_darrow').addClass('dropdown_rarrow');
var arrow_classname = $(this).attr('class');
if ((arrow_classname == 'dropdown_rarrow') || (arrow_classname == 'dropdown_darrow')) {
if (arrow_classname == 'dropdown_rarrow') {
$(this).removeClass('dropdown_rarrow').addClass('dropdown_darrow');
} else {
$(this).removeClass('dropdown_darrow').addClass('dropdown_rarrow');
}
if (true == $(this).parent().next().is(':visible')) {
$(this).removeClass('dropdown_darrow').addClass('dropdown_rarrow');
}
}
// event.preventDefault();
//$(".leftmenu_withsubmenu ul.menu > li > a").css({"font-family": "PT Sans", "font-weight": "400"});
//$(this).css({"font-family": "PT Sans", "font-weight": "700"});
if (false == $(this).parent().next().is(':visible')) {
$('.leftmenu_withsubmenu ul li ul').slideUp(300);
// $(".leftmenu_withsubmenu ul li ul li a").css({"font-family": "PT Sans", "font-weight": "400"});
}
$(this).parent().next().slideToggle(300);
});
$('.leftmenu_withsubmenu ul.menu > li > a').click(function (event) {
if (event.target !== this) return; /* changed on oct28 */
var font_family = $(this).css('font-family');
var className = $(this).attr('class');
var font_weight = $(this).css('font-weight');
/*Hemant: 9th Oct, 2018 Updated font weight*/
/*if (font_family == 'PT Sans' || font_weight == 'bold' || font_weight == '700')*/
if ($(this).css('font-weight') == 700) {
var arrow_classname = $(this).find('span:first-of-type').attr('class');
if ((arrow_classname == 'dropdown_rarrow') || (arrow_classname == 'dropdown_darrow')) {
if (arrow_classname == 'dropdown_rarrow') {
$(this).find('span:first-of-type').removeClass('dropdown_rarrow').addClass('dropdown_darrow');
} else {
$(this).find('span:first-of-type').removeClass('dropdown_darrow').addClass('dropdown_rarrow');
}
if (true == $(this).next().is(':visible')) {
$(this).find('span:first-of-type').removeClass('dropdown_darrow').addClass('dropdown_rarrow');
}
}
if (className == 'active') {
event.preventDefault();
$(this).next().slideToggle();
}
else {
//this means the child is active
//Do nothing
}
}
});
$(".leftmenu_withsubmenu ul li ul li a").click(function () {
$(".leftmenu_withsubmenu ul li ul li a").css({ "font-family": "PT Sans", "font-weight": "400" });
$(this).css({ "font-family": "PT Sans", "font-weight": "700" });
});
// $('.leftmenu_withsubmenu ul li ul:eq(0)').show();
//$('.leftmenu_withsubmenu ul li a:eq(0)').css({"font-family": "PT Sans", "font-weight": "700"});
/* News Room For Product */
$(".leftside_menu a").click(function (event) {
//event.preventDefault();
$(" .leftside_menu a").css({ "font-family": "PT Sans", "font-weight": "400" });
$(this).css({ "font-family": "PT Sans", "font-weight": "700" });
});
$(".news_year a").click(function (event) {
//event.preventDefault();
$(".news_year a").css({ "font-family": "PT Sans", "font-weight": "400" });
$(".news_year a").find("span").hide();
$(this).css({ "font-family": "PT Sans", "font-weight": "700" });
$(this).find("span").show();
});
//$(".news_list .news ul li").hover(
// function () {
// $(this).css("background-color", "#eaeaea");
// },
// function () {
// $(this).css("background-color", "#fff");
// });
/* Management Team */
$(".management_team ul li").hover(
function () {
$(this).css("background-color", "#eaeaea");
},
function () {
$(this).css("background-color", "#fff");
});
/* Overlay Map*/
$(".direction").click(function () {
//alert("hiiiii"+$(this).parent().parent().next());
// $(this).parent().parent().next().slideToggle();
$(this).next().slideToggle();
});
//$(".product_detail").click(function () {
// $(this).parent().next().on('show.bs.modal', function () {
// $(this).find(".map_direction").hide();
// });
//});
//$(".product_getdirection").click(function () {
// $(this).parent().next().on('show.bs.modal', function () {
// $(this).find(".map_direction").show();
// });
//});
/* Investor Tab */
$(".tab li").click(function () {
$(".tab li").removeClass("active");
$(".tab li").removeAttr("style");
$(this).addClass("active");
$(this).css("background-color", "#f9f9f9");
});
/* This section commented by Mindtree Dev for Recent News Widget on home. The news title and description need not to be wrapped now
Home Page News
$(".home_content .recent_newslist .recent_news_content").each(function () {
var news_heading = $(this).find('h5');
var content = $(this).find('p');
if (news_heading.text().length > 50) {
news_heading.text(news_heading.text().substr(0, 50));
news_heading.append("...");
}
if (content.text().length > 75) {
content.text(content.text().substr(0, 75));
content.append("...");
}
});*/
/*$(".news_list .news_content .content").each(function () {
var content = $(this);
if (content.html().length > 150) {
content.html(content.html().substr(0, 150));
content.append("...");
}
});*/
$('.tablist>ul>li:first-child').find('>.content').slideDown(500);
$('.tablist>ul>li:first-child>h4').find('.plus').text('-');
$('.tablist .tab_name').click(function (event) {
$('.tablist .tab_name').not(this).find('.plus').text('+');
var symbol = $(this).find('.plus').text();
if (symbol == '+') {
$(this).find('.plus').text('-');
} else {
$(this).find('.plus').text('+');
}
if (true == $(this).next().is(':visible')) {
$('.tablist>ul>li>.content').slideUp(500);
} else {
$('.tablist>ul>li>.content').slideUp(500);
$(this).next().slideToggle();
}
});
/*Child Tablist */
$('.child_tablist .child_tab_name').click(
function (event) {
$('.child_tablist .child_tab_name').not(this).find(
'.plus').text('+');
var symbol = $(this).find('.plus').text();
if (symbol == '+') {
$(this).find('.plus').text('-');
} else {
$(this).find('.plus').text('+');
}
if (true == $(this).next().is(':visible')) {
$('.child_tablist .content').slideUp(500);
} else {
$('.child_tablist .content').slideUp(500);
$(this).next().slideToggle();
}
});
//Added By Mindtree to stop the video when Modal pop up closes
$(document).on('hidden.bs.modal', '#product_video', function (event) { $('iframe').attr('src', ''); });
$(".scfForm input[type='submit']").on("click", function () {
var list = $(this).parents(".scfForm").find('.validation-summary-errors').length;
if (list > 0) {
$('html, body').animate({
scrollTop: $(this).find('.scfForm .validation-summary-errors').scrollTop() + $(".validation-summary-errors").offset().top - 50
}, 'slow');
}
});
});
/* append the URL onclick youtube/vyoukuUrl */
var append;
function updateURL(append, finalurl) {
if (history.pushState) {
var newurl = window.location.protocol + "//" + window.location.host + window.location.pathname + "?" + append + finalurl;
window.history.pushState({ path: newurl }, '', newurl);
}
}
function CallServerSideGetNewsFunction(methodName, resultsAlreadyRendered, resultToFetchPerCall, yearFolder, newsTags, languageName, lastShownItemId, homeNodeName) {
var result = null;
var resultsToFetch;
if (visibleResultCount == 0) //will be call on year click
{
resultsToFetch = resultToFetchPerCall * 2;
}
else { resultsToFetch = resultToFetchPerCall }
result = $.ajax({
type: "POST",
url: '/GlobalSearch.asmx/' + methodName,
data: '{"resultsAlreadyRendered":"' + resultsAlreadyRendered + '","countResultsToFetch":"' + resultsToFetch + '","yearFolder":"' + yearFolder + '","newsTags":"' + newsTags + '","languageName":"' + languageName + '","lastShownItemId":"' + lastShownItemId + '","homeNodeName":"' + homeNodeName + '"}',
contentType: "application/json; charset=utf-8",
dataType: "json",
async: false,
cache: false,
success: OnSuccess,
failure: function (response) {
alert('failure');
}
});
return result;
function OnSuccess(response) {
if (typeof response.d == 'string') {
return response.parseJSON;
}
else {
return $.parseJSON(response.d);
}
}
};
function CallServerSideGetSuggestionFunction(methodName, term, homeNodeName) {
if (term.length < 2) {
return;
}
var result = null;
result = $.ajax({
type: "POST",
url: '/GlobalSearch.asmx/' + methodName,
data: '{"term":"' + term + '","languageName":"' + currentContextLanguage + '","homeNodeName":"' + homeNodeName + '"}',
contentType: "application/json; charset=utf-8",
dataType: "json",
async: false,
cache: false,
success: OnSuccess,
failure: function (response) {
alert('failure');
}
});
return result;
function OnSuccess(response) {
if (typeof response.d == 'string') {
return response.parseJSON;
}
else {
return $.parseJSON(response.d);
}
}
};
//Method will be called for a seemore click
function SeeMoreGlobalResults(methodName, term, facetName, resultsAlreadyRendered, resultToFetchPerCall, currentLanguage, homeNodeName) {
var result = null;
result = $.ajax({
type: "POST",
url: '/GlobalSearch.asmx/' + methodName,
data: '{"searchedKeyword":"' + term + '","facetName":"' + facetName + '","resultsAlreadyRendered":"' + resultsAlreadyRendered + '","countResultsToFetch":"' + resultToFetchPerCall + '","languageName":"' + currentLanguage + '","homeNodeName":"' + homeNodeName + '"}',
contentType: "application/json; charset=utf-8",
dataType: "json",
async: false,
cache: false,
success: OnSuccess,
failure: function (response) {
alert('failure');
}
});
return result;
function OnSuccess(response) {
if (typeof response.d == 'string') {
return response.parseJSON;
}
else {
return $.parseJSON(response.d);
}
}
};
function SeeMoreGlobalResultsAdvanceSearch(methodName, term, facetName, resultsAlreadyRendered, resultToFetchPerCall, currentLanguage, homeNodeName, path) {
var result = null;
result = $.ajax({
type: "POST",
url: '/AdvanceSearchFilterService.asmx/' + methodName,
data: '{"searchedKeyword":"' + term + '","facetName":"' + facetName + '","resultsAlreadyRendered":"' + resultsAlreadyRendered + '","countResultsToFetch":"' + resultToFetchPerCall + '","languageName":"' + currentLanguage + '","homeNodeName":"' + homeNodeName + '","path":"' + path + '"}',
contentType: "application/json; charset=utf-8",
dataType: "json",
async: false,
cache: false,
success: OnSuccess,
failure: function (response) {
alert('failure');
}
});
return result;
function OnSuccess(response) {
if (typeof response.d == 'string') {
return response.parseJSON;
}
else {
return $.parseJSON(response.d);
}
}
};
function ShowHiddenResults(resultsULTag, liToUnhide) {
if (resultsULTag != 'undefined') {
var processedLiCount = 0;//How many li has been changed to show up
var indexOfHiddenLiToShow = resultsULTag.children.length - 1;
for (i = 0; i < liToUnhide; i++) {
if (resultsULTag.children[indexOfHiddenLiToShow].style.display == 'none') {
resultsULTag.children[indexOfHiddenLiToShow].style.display = '';
indexOfHiddenLiToShow--;
processedLiCount++;
}
else { break; }
}
}
return processedLiCount;
};
function ProductConfiguratorDropDownLoading(methodName, intLoad, strApplication, strCurrent, strChannel, homeNodeName) {
var result = null;
result = $.ajax({
type: "POST",
url: '/ProductConfiguratorDropDownLoading.asmx/' + methodName,
data: '{"intLoad":"' + intLoad + '","strApplication":"' + strApplication + '","strCurrent":"' + strCurrent + '","strChannel":"' + strChannel + '","homeNodeName":"' + homeNodeName + '"}',
contentType: "application/json; charset=utf-8",
dataType: "json",
async: false,
cache: false,
success: OnSuccess,
failure: function (response) {
alert('failure');
}
});
return result;
function OnSuccess(response) {
if (typeof response.d == 'string') {
return response;
}
else {
return $.parseJSON(response.d);
}
}
};
function ProductConfiguratorSearchResultsLoading(methodName, strApplication, strCurrent, strChannel, strEISPerf, homeNodeName) {
var result = null;
result = $.ajax({
type: "POST",
url: '/ProductConfiguratorDropDownLoading.asmx/' + methodName,
data: '{"strApplication":"' + strApplication + '","strCurrent":"' + strCurrent + '","strChannel":"' + strChannel + '","strEISPerf":"' + strEISPerf + '","homeNodeName":"' + homeNodeName + '"}',
contentType: "application/json; charset=utf-8",
dataType: "json",
async: false,
cache: false,
success: OnSuccess,
failure: function (response) {
alert('failure');
}
});
return result;
function OnSuccess(response) {
if (typeof response.d == 'string') {
return response;
}
else {
return response;
}
}
};
function CleanURL(anchorelem) {
if (anchorelem.hash == '') { return true; } else {
windowPath = window.location.pathname; thisCTAHrefPath = anchorelem.pathname;
trailingSlash = windowPath.substring(0, 1); if (trailingSlash != '/') { windowPath = '/' + windowPath; } trailingSlash = windowPath.substring(windowPath.length - 1, 1); if (trailingSlash != '/') { windowPath = windowPath + '/'; } trailingSlash = thisCTAHrefPath.substring(0, 1); if (trailingSlash != '/') { thisCTAHrefPath = '/' + thisCTAHrefPath; }
trailingSlash = thisCTAHrefPath.substring(thisCTAHrefPath.length - 1, 1); if (trailingSlash != '/') { thisCTAHrefPath = thisCTAHrefPath + '/'; }
if (windowPath == thisCTAHrefPath) { window.location.href = anchorelem.hash; return false; } else { return true; }
}
}
function RMALogOut(methodName) {
var result = null;
result = $.ajax({
type: "POST",
url: '/CustomerService.asmx/' + methodName,
contentType: "application/json; charset=utf-8",
dataType: "json",
async: false,
cache: false,
success: OnSuccess,
failure: function (response) {
alert('failure');
}
});
return result;
function OnSuccess(response) {
if (typeof response.d == 'string') {
return response;
}
else {
return $.parseJSON(response.d);
}
}
};
function Logout(methodName) {
result = $.ajax({
type: "POST",
url: '/CustomerService.asmx/' + methodName,
contentType: "application/json; charset=utf-8",
dataType: "json",
async: false,
cache: false,
success: OnSuccess,
failure: function (response) {
alert('failure');
}
});
return result;
function OnSuccess(response) {
if (typeof response.d == 'string') {
return response.parseJSON;
}
else {
return $.parseJSON(response.d);
}
}
};
function AjaxWebMethodCall(WebMethodUrl, DataObject) {
var result = null;
result = $.ajax({
type: "POST",
url: WebMethodUrl,
data: DataObject,
contentType: "application/json; charset=utf-8",
dataType: "json",
async: false,
cache: false,
success: OnSuccess,
failure: function (response) {
alert('failure');
}
});
return result;
function OnSuccess(response) {
if (typeof response.d == 'string') {
return response;
}
else {
return $.parseJSON(response.d);
}
}
};
$(".checkbox-wrapper > label:nth-child(3)").wrap("<div class='no-direction'></div>");
var checkbox = $('.checkbox-wrapper label').not('.no-direction label');
for (var i = 0; i < checkbox.length; i += 3) {
checkbox.slice(i, i + 3).wrapAll('<div class="checkbox-item-wrap" />');
}