var isMobile = navigator.userAgent.match(/Android|BlackBerry|iPhone|iPad|iPod|Opera Mini|IEMobile/i); var drawer, origin, content; function showDrawer(id, name, orgId) { origin.attr("href", id); origin.attr("data-origin", orgId); origin.text(name); content.html($(id + " > .reference-text").html()); drawer.addClass("visible"); } function getSettings(key, type) { if ("localStorage" in window) { if (type === "boolean") { return (window.localStorage[key] === "true"); } else { return window.localStorage[key]; } } else { var value = "; " + document.cookie; var parts = value.split("; " + key + "="); if (parts.length == 2) { if (type === "boolean") { return (parts.pop().split(";").shift() === "true"); } else { return parts.pop().split(";").shift(); } } } } function setSettings(key, value) { if ("localStorage" in window) { window.localStorage[key] = value; } else { var now = new Date(); var time = now.getTime(); var expireTime = time + (10 * 365 * 24 * 24); now.setTime(expireTime); document.cookie = key + "=" + value + ";expires=" + now.toGMTString() +";path=/"; } } function initSettings() { if (document.getElementById("reference-settings")) { $("#reference-settings").show(); return; } var setbox = $("
").attr("id", "reference-settings").append( $("
").addClass("content").append( $("