'));
});
$("#menu-secondary-navigation-menu .rdp-gcs-search-form.search-form").each(function () {
var $searchForm = $(this),
$txtSearchTerm = $searchForm.find('.rdp-gcs-search-term'),
$searchResults = $('body.search_results'),
$searchResultsTitle = $('.p_title'),
$searchResultsContent = $('.p_content'),
$searchResultsPagination = $('.paginate_div');
function validateSearch() {
if ($txtSearchTerm.val() !== '') {
$searchForm.find('.rdp-gcs-search-button').attr("disabled", false);
} else {
$searchForm.find('.rdp-gcs-search-button').attr("disabled", true);
}
}
$searchResults.find('.entry-content').first().wrapInner('');
$searchResultsTitle.addClass('double').find('a').addClass('color-navy').append($('➲'));
$searchResultsContent.wrapInner('');
$searchResultsPagination.addClass('pagination archive-pagination').find('wdm_ul').addClass('page-numbers');
$searchForm.find('.rdp-gcs-search-button, .rdp-gcs-search-term').attr("tabindex", -1);
$searchForm.find('#cser').attr("value", "");
$searchForm.find('.rdp-gcs-search-term').attr("placeholder", "?")
.on("keydown", function (ev) {
ev.stopImmediatePropagation();
if (ev.which == 13) {
if ($('#' + this.form.id + ' #cseid').val() == 0) {
handle_search_and_highlight($txtSearchTerm.val());
} else if ($txtSearchTerm.val() !== '') {
$("body").unhighlight();
$('#' + this.form.id + ' #s').val('');
$('input[name=csep]').val(1);
this.form.submit();
}
} else {
validateSearch();
}
})
.on("keyup", function (ev) {
validateSearch();
});
$searchForm
.find('.rdp-gcs-search-button')
.on('click', function (ev) {
ev.stopImmediatePropagation();
if ($('#' + this.form.id + ' #cseid').val() == 0) {
handle_search_and_highlight($txtSearchTerm.val());
} else if ($txtSearchTerm.val() !== '') {
$("body").unhighlight();
$('#' + this.form.id + ' #s').val('');
$('input[name=csep]').val(1);
this.form.submit();
}
});
$searchForm
.on('mousemove', function (ev) {
validateSearch();
})
.on('focusin', function (ev) {
$('#menu-secondary-navigation-menu').addClass('search-active').find('.search').addClass('active');
$('#menu-secondary-navigation-menu > li a').fadeOut();
validateSearch();
})
.on('focusout', function (ev) {
$('#menu-secondary-navigation-menu > li a').fadeIn(function () {
$('#menu-secondary-navigation-menu').removeClass('search-active').find('.search').removeClass('active');
});
});
$('#SearchMenu')
.on('click', function (ev) {
ev.stopImmediatePropagation();
$('#menu-secondary-navigation-menu > .search > .search-form').find('.rdp-gcs-search-term')[0].focus();
});
});
})(jQuery);
(function ($) {
$(document).on('touchstart click', '.open-nav', function(e) {
if ($(e.target).is('#hamburger') || $(e.target).parents('nav.nav-primary').length) {
return true;
} else {
$(this).removeClass('open-nav');
//$('nav.nav-primary').show();
}
});
})(jQuery);
jQuery(document).ready(function ($) {
var r = 4, mrktoWait;
(mrktoWait = function () {
setTimeout(function () {
var $mko = $('.marketo-fat-form'), hashLink = $('[href="' + location.hash + '"]').first();
if ($mko.length) $mko.find('[style]').removeAttr('style').end().find('style').detach().end().fadeIn(), hashLink.length && hashLink.click(); else if (--r) mrktoWait();
}, 2000);
})();
});
(function ($) {
$('.slide').attr('style', 'display:none;');
$('.pagination').addClass('entry').find('ul').addClass('page-numbers').find('li a').addClass('small flat loose page-numbers button color-light');
$('.pagination .active').removeClass('active').find('a').addClass('current');
$('link[href*="xmlrpc.php"]').detach();
$('body').removeClass('woocommerce');
$('input.submit').addClass('color-navy');
$('.widget .blog-subscription input[type="submit"]').addClass('small closer').parent().find('[name="subscribe"]').addClass('color-orange').parent().find('[name="unsubscribe"]').addClass('color-grey').parent().find('br,label').detach();
$('.woocommerce-error li > small').on('click', function () { $(this).toggleClass('closed open') });
$('article.category-japanese').parents('body').addClass('category-japanese');
$('.category-japanese').first().parents('html').addClass('japanese-blog');
// $('.format_price').each(function () { var $ths = $(this); var prc = $ths.text(); if (prc !== "") { $ths.text(prc.replace(/\B(?=(\d{3})+(?!\d))/g, ",")); } });
})(jQuery);
jQuery(document).ready(function($) {
//Add Idera Menu
// $(".title-area").prepend("");
});
window.addEventListener("load", function () {
// wc_checkout_params
if (typeof wc_checkout_params === 'object' && wc_checkout_params.is_checkout === "1") {
return false;
}
var defaults = {
"law": {
"regionalLaw": true,
"countryCode": null
}
};
var whitelist = ["cookieconsent_status", "BIGipServer#", "PHPSESSID"];
var paths = ["/"];
var domains = [".sencha.com"];
var arrayValue = function (v) {
if ((v instanceof Array) === false) {
if (v instanceof String) {
v = [v];
} else {
v = [];
}
}
return v;
};
var arrayDiff = function (a1, a2) {
var a = [],
diff = [];
for (var i = 0; i < a1.length; i++) {
a[a1[i]] = true;
}
for (var i = 0; i < a2.length; i++) {
if (a[a2[i]]) {
delete a[a2[i]];
} else {
a[a2[i]] = true;
}
}
for (var k in a) {
diff.push(k);
}
return diff;
};
var listCookies = function () {
var theCookies = document.cookie.split(';');
var list = [];
for (var i = 0; i < theCookies.length; i++) {
var v = theCookies[i].split('=');
list.push(v[0].trim());
}
return list;
};
var deleteCookie = function (name, path, domain) {
var list = listCookies();
if (list.indexOf(name) >= 0) {
var marked = name + "=" +
((path) ? ";path=" + path : "") +
((domain) ? ";domain=" + domain : "") +
";expires=Thu, 01 Jan 1970 00:00:01 GMT";
console.log(marked);
document.cookie = marked;
}
};
var crumbleCookies = function (list, whitelist, paths, domains) {
var marked = arrayDiff(arrayValue(list), arrayValue(whitelist));
paths = paths.length ? arrayValue(paths) : ['/'];
domains = domains.length ? arrayValue(domains) : domains;
console.log(marked);
for (var iM = 0; iM < marked.length; iM++) {
for (var iP = 0; iP < paths.length; iP++) {
if (domains) {
for (var iD = 0; iD < domains.length; iD++) {
deleteCookie(marked[iM], paths[iP], domains[iD]);
}
} else {
deleteCookie(marked[iM], paths[iP]);
}
}
}
};
function Cookies() {
var i, x, y, c = document.cookie.split(";"),
o = {},
name;
if (arguments && arguments.length == 1 && typeof arguments[0] == 'string') {
name = arguments[0];
}
try {
for (i = 0; i < c.length; i++) {
x = c[i].substr(0, c[i].indexOf("="));
y = deserialize(unescape(c[i].substr(c[i].indexOf("=") + 1)));
x = x.replace(/^\s+|\s+$/g, "");
if (name) {
if (x == name) {
o[x] = y;
break;
}
} else {
o[x] = y;
}
}
for (var k in o) {
this[k] = o[k];
}
} catch (e) {
console.log(e);
}
}
function Cookie(name) {
Cookies.call(this, name);
this.name = name;
this.expires = -1;
this.Add = function add() {
switch (arguments.length) {
case 2:
this[this.name] = typeof this[this.name] != 'object' ? {} : this[this.name];
this[this.name][arguments[0]] = arguments[1];
break;
case 1:
default:
this[this.name] = arguments[0];
break;
}
}
this.Set = function set() {
try {
var exdate = new Date();
exdate.setDate(exdate.getDate() + this.expires);
var value = escape(serialize(this[this.name])) + ((this.expires == -1) ? '' : '; expires=' + exdate.toUTCString());
document.cookie = this.name + '=' + value + '; path=/;';
} catch (e) {
console.log(e);
}
}
}
Cookie.prototype = Object.create(Cookies.prototype);
// helper functions
function getCookie(name) {
var c = new Cookies(name);
return (name in c && c[name]);
}
function serialize(obj, prefix) {
if (typeof obj == "string") {
return obj;
}
var str = [];
for (var p in obj) {
if (obj.hasOwnProperty(p)) {
var k = prefix ? prefix + "[" + p + "]" : p,
v = obj[p];
str.push((v !== null && typeof v === "object") ? serialize(v, k) : encodeURIComponent(k) + "=" + encodeURIComponent(v));
}
}
return str.join("&");
}
function deserialize(str) {
var qso = {};
// Check for an empty querystring
if (str == "") {
return qso;
}
// Normalize the querystring
str = str.replace(/(^\?)/, '').replace(/;/g, '&');
while (str.indexOf("&&") != -1) {
str = str.replace(/&&/g, '&');
}
str = str.replace(/([\&]+$)/, '');
// Break the querystring into parts
var qs = str.split("&");
// Build the querystring object
for (var i = 0; i < qs.length; i++) {
var qi = qs[i].split("=");
qi = [decodeURIComponent(qi[0]), decodeURIComponent(qi[1])];
if (qso[qi[0]] != undefined) {
// If a key already exists then make this an object
if (typeof qso[qi[0]] == "string") {
var qt = qso[qi[0]];
if (qi[1] == "") {
qi[1] = null;
}
qso[qi[0]] = [];
qso[qi[0]].push(qt);
qso[qi[0]].push(qi[1]);
} else if (typeof qso[qi[0]] == "object") {
if (qi[1] == "") {
qi[1] = null;
}
qso[qi[0]].push(qi[1]);
}
} else {
// If no key exists just set it as a string
if (qi[1] == "") {
qi[1] = null;
}
qso[qi[0]] = qi[1];
}
}
var nqso = {},
a, j, k, o, p, q;
for (var i in qso) {
a = i.match(/([^\[\]]+)(\[[^\[\]]+[^\]])*?/g);
p = qso[i];
j = a && a.length;
while (j--) {
q = {};
q[a[j]] = p;
p = q;
}
// merge object
k = Object.keys(p)[0];
o = nqso;
while (k in o) {
p = p[k];
o = o[k];
k = Object.keys(p)[0];
}
o[k] = p[k];
}
if (Object.keys(nqso).length === 1 && nqso[Object.keys(nqso)[0]] === 'undefined') {
return Object.keys(nqso)[0];
}
return nqso;
}
if (getCookie("cookieconsent_status") === 'dismiss') {
crumbleCookies(listCookies(), whitelist, paths, domains);
}
window.cookieconsent.onInitialise = function (status) {
var type = this.options.type;
var didConsent = this.hasConsented();
if (type == 'opt-in' && !didConsent) {
crumbleCookies(listCookies(), whitelist, paths, domains);
}
if (type == 'opt-out' && !didConsent) {
crumbleCookies(listCookies(), whitelist, paths, domains);
}
};
window.cookieconsent.initialise({
"law": (typeof window.cookie_consent === 'object' ? window.cookie_consent.law : defaults.law),
"palette": {
"popup": {
"background": "#f5861f",
"text": "#ffffff"
},
"button": {
"background": "#d66e0d",
"text": "#ffffff"
}
},
"theme": "classic",
"type": "opt-in",
"content": {
"message": "Sencha uses cookies (required, functionality, and advertising cookies) to improve user experience. By using our website you consent to all cookies in accordance with our",
"dismiss": "No, thanks",
"allow": "Yes, I consent",
"link": "Cookie policy",
"href": "/legal/privacy/#CookiePolicy"
},
"position": "bottom-left",
onPopupOpen: function () {
var type = this.options.type;
var didConsent = this.hasConsented();
if (type == 'opt-in' && !didConsent) {
crumbleCookies(listCookies(), whitelist, paths, domains);
}
},
onStatusChange: function (status, chosenBefore) {
console.log(status, chosenBefore);
var type = this.options.type;
var didConsent = this.hasConsented();
if (type == 'opt-in' && status === 'dismiss') {
window.setTimeout(function () {
crumbleCookies(listCookies(), whitelist, paths, domains);
}, 500);
}
},
onRevokeChoice: function () {
var type = this.options.type;
if (type == 'opt-in') {
// crumbleCookies(listCookies(),whitelist,paths,domains);
}
if (type == 'opt-out') {
// enable cookies
}
}
})
});