[\\s\\S]*?',
'gi');
function removeTags(html) {
var oldHtml;
do {
oldHtml = html;
html = html.replace(tagOrComment, '');
} while (html !== oldHtml);
return html.replace(//;
var badwordArray = [''];
var replaceString;
var hasBadword = false;
replaceString = v.replace(/(\r\n|\r|\n)/g, ' ');
replaceString = replaceString.replace(/[()'",.\{\}\[\]]/gi, '');
replaceString = replaceString.replace('%', '');
replaceString = replaceString.replace('&', '');
replaceString = replaceString.trim().toLowerCase();
for (var i = 0, len = badwordArray.length; i < len; ++i) {
if ((replaceString.indexOf(' ' + badwordArray[i].toLowerCase() + ' ') != -1)
|| ((badwordArray[i].length == replaceString.length) && replaceString.indexOf(badwordArray[i].toLowerCase()) == 0)
|| ((replaceString.lastIndexOf(' ' + badwordArray[i].toLowerCase()) != -1) && (replaceString.lastIndexOf(' ' + badwordArray[i].toLowerCase()) == (replaceString.length - (badwordArray[i].length + 1))))
|| ((replaceString.indexOf(badwordArray[i].toLowerCase() + ' ') == 0))
) {
hasBadword = true;
}
if (hasBadword) break;
}
return ((v.match(pathRegex) == null) && (v.match(blacklistRegex) == null) && !hasBadword);
}
$(document).ready(function () {
var pageUrl = document.URL;
$('#searchButton').click(function (e) {
if (pageUrl.toLowerCase().indexOf('/register') != -1) {
if ($("div.consumer-control").hasClass("consumer-profile")) {
if ($('html.mobile').length > 0) {
var reveal_height = $('#partialProf-modal').outerHeight();
var window_size = $(window).height();
var reveal_mt = (window_size - reveal_height) / 2;
$('#partialProf-modal').css({ "top": reveal_mt + "px" });
}
$('#partialProf-modal').foundation('reveal', 'open');
e.preventDefault();
return false;
}
}
e.preventDefault();
redirectToCoveo();
});
if ((pageUrl.toLowerCase().indexOf('/register') != -1) || (pageUrl.toLowerCase().indexOf('/sign-up') != -1) || (pageUrl.toLowerCase().indexOf('/verify-email') !=-1)
|| (pageUrl.toLowerCase().indexOf('/sign-up-confirmation') != -1)) {
$('.winDiaperStickbar').removeClass('winDiaperStickbar');
$(".show-for-large-up").find('div').remove();
$("#WDStickbar").addClass("hidewindiaper");
$('.RegistrationContainer').addClass('noregwindiaper');
$('.MobileWinDiaper').css("display", "none");
}
$(".search-block").keypress(function (e) {
if (e.keyCode == 13) {
if (pageUrl.toLowerCase().indexOf('/register') != -1) {
if ($("div.consumer-control").hasClass("consumer-profile")) {
if ($('html.mobile').length > 0) {
var reveal_height = $('#partialProf-modal').outerHeight();
var window_size = $(window).height();
var reveal_mt = (window_size - reveal_height) / 2;
$('#partialProf-modal').css({ "top": reveal_mt + "px" });
}
$('#partialProf-modal').foundation('reveal', 'open');
e.preventDefault();
return false;
}
}
e.preventDefault();
redirectToCoveo();
}
});
function redirectToCoveo() {
var langForCoveo = 'en-US';
var queryBoxValue = $("#searchInput").val();
var hashValue = removeTags(queryBoxValue);
if (!SanitizeCoveoSearch(hashValue.toLowerCase())) {
hashValue = "";
}
if (hashValue.toLowerCase().indexOf("script") >= 0 || hashValue.indexOf("Java") >= 0 || hashValue.indexOf("
") >= 0 || hashValue.indexOf(" | ") >= 0 || hashValue.indexOf("") >= 0 || hashValue.indexOf("