function capLock(e, el){
kc = e.keyCode ? e.keyCode : e.which;
sk = e.shiftKey ? e.shiftKey : (kc == 16 ? true : false);
if ((kc >= 65 && kc <= 90 && !sk) || (kc >= 97 && kc <= 122 && sk)) {
$('.divCapson', $(el).parents('div').first()).show();
} else {
$('.divCapson', $(el).parents('div').first()).hide();
}
}
// js 2
try {
var timezone = Intl.DateTimeFormat().resolvedOptions().timeZone;
setCookie("local_tz", timezone);
} catch (e) {}
// this is used by tiki-confirm.js checkTimeout, so needs to be always set
const scriptStartDate = new Date(); //Be carefull, this will not be a global if this script ever becomes a module - benoitg - 2023-11-21
if (! timezone) {
function inArray(item, array) {
for (var i in array) {
if (array[i] === item) {
return i;
}
}
return false;
}
var allTimeZoneCodes = ["ACDT","ACST","ADDT","ADT","AEDT","AEST","AHDT","AHST","AKDT","AKST","AMT","APT","AST","AWDT","AWST","AWT","BDST","BDT","BMT","BST","CAST","CAT","CDDT","CDT","CEMT","CEST","CET","CMT","CPT","CST","CWT","CHST","DMT","EAT","EDDT","EDT","EEST","EET","EMT","EPT","EST","EWT","FFMT","FMT","GDT","GMT","GST","HDT","HKST","HKT","HMT","HPT","HST","HWT","IDDT","IDT","IMT","IST","JDT","JMT","JST","KDT","KMT","KST","LST","MDDT","MDST","MDT","MEST","MET","MMT","MPT","MSD","MSK","MST","MWT","NDDT","NDT","NPT","NST","NWT","NZDT","NZMT","NZST","PDDT","PDT","PKST","PKT","PLMT","PMT","PPMT","PPT","PST","PWT","QMT","RMT","SAST","SDMT","SJMT","SMT","SST","TBMT","TMT","UCT","UTC","WAST","WAT","WEMT","WEST","WET","WIB","WITA","WIT","WMT","YDDT","YDT","YPT","YST","YWT","A","B","C","D","E","F","G","H","I","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"];
var now_string = now.toString();
var offsethours = - now.getTimezoneOffset() / 60;
setCookie("local_tzoffset", offsethours);
var m = now_string.match(/[ \(]([A-Z]{3,6})[ \)]?[ \d]*$/); // try three or more char tz first at the end or just before the year
if (!m) {
m = now_string.match(/[ \(]([A-Z]{1,6})[ \)]?[ \d]*$/); // might be a "military" one if not
}
if (m) {
m = m[1];
} else { // IE (sometimes) gives UTC +offset instead of the abbreviation
// sadly this workaround will fail for non-whole hour offsets
var hours = - now.getTimezoneOffset() / 60;
m = "GMT" + (hours > 0 ? " + " : "") + hours;
}
// Etc/GMT+ is equivalent to GMT-
if (m.substring(0,4) == "GMT + ") {
m = "Etc / GMT - " + m.substring(4);
setCookie("local_tz", m);
}
if (m.substring(0,4) == "GMT - ") {
m = "Etc / GMT + " + m.substring(4);
setCookie("local_tz", m);
}
if (inArray(m, allTimeZoneCodes)) {
setCookie("local_tz", m);
}
}
//-->