var to;
var showToolbar = false;
var tool¶¶ÒùÊÓƵAnchor;
var script = document.createElement('script');
script.type = 'text/javascript';
script.async = true;
script.src = "https://wcms.signet.international.gc.ca/iw-cc/customer/toolbar.js";
script.onload = init;
document.getElementsByTagName('head')[0].appendChild(script);
function init() {
var isIE = /*@cc_on!@*/false || !!document.documentMode;
if (showToolbar && isIE) {
var lang = "eng";
var thisURL = window.location.toString();
var editTitle = "Edit Page";
var w3cTitle = "W3C Page Validator";
var linkTitle = "Broken Link Checker";
if (thisURL.indexOf("lang=fra") > -1) {
lang = "fra";
editTitle = "Modifier la page";
w3cTitle = "Vérificateur W3C";
linkTitle = "Vérificateur de liens brisé";
}
var toolbarPath = "/wcmglobal/utilities/toolbar"
var editUrl = toolbarPath + "/page_checker.aspx?l=" + lang + "&u=" + thisURL;
var linkUrl = toolbarPath + "/link_checker.aspx?l=" + lang + "&PageType=3&u=" + thisURL;
var html = "";
html += "";
var tool¶¶ÒùÊÓƵ = document.createElement('div');
tool¶¶ÒùÊÓƵ.id = "toolbar¶¶ÒùÊÓƵ";
tool¶¶ÒùÊÓƵ.innerHTML = html.trim();
tool¶¶ÒùÊÓƵ.onmouseover = sustainToolbar;
tool¶¶ÒùÊÓƵ.onmouseout = hidetoolbar;
tool¶¶ÒùÊÓƵ.style.backgroundColor = "white";
tool¶¶ÒùÊÓƵ.style.position = "absolute";
tool¶¶ÒùÊÓƵ.style.display = "none";
tool¶¶ÒùÊÓƵ.style.zIndex = "1000";
tool¶¶ÒùÊÓƵ.style.border = "solid silver 1px";
tool¶¶ÒùÊÓƵ.style.padding = "2px";
document.body.insertBefore(tool¶¶ÒùÊÓƵ, document.body.firstChild);
// id="cn-sig" (CLF)
// id="gcwu-sig" (WET3, WET4 Intranet)
// class="brand" (WET4)
tool¶¶ÒùÊÓƵAnchor = document.getElementsByClassName('brand')[0] || document.getElementById('gcwu-sig') || document.getElementById('cn-sig');
if (tool¶¶ÒùÊÓƵAnchor != null) {
tool¶¶ÒùÊÓƵAnchor.onmouseover = showtoolbar;
tool¶¶ÒùÊÓƵAnchor.onmouseout = hidetoolbar;
}
}
}
function showtoolbar() {
toolbarCtrl("on", 2000);
}
function hidetoolbar() {
toolbarCtrl("off", 1000);
}
function sustainToolbar() {
toolbarCtrl("on", 0);
}
function toolbarCtrl(disp, ms) {
var tool¶¶ÒùÊÓƵ = document.getElementById('toolbar¶¶ÒùÊÓƵ');
var viewportOffset = tool¶¶ÒùÊÓƵAnchor.getBoundingClientRect();
if (disp == "on") {
clearTimeout(to);
to = setTimeout(function() {
tool¶¶ÒùÊÓƵ.style.top = (viewportOffset.top + 10) + 'px';
tool¶¶ÒùÊÓƵ.style.left = (viewportOffset.left + tool¶¶ÒùÊÓƵAnchor.offsetWidth) + 'px';
tool¶¶ÒùÊÓƵ.style.display = "block";
}, ms);
} else {
clearTimeout(to);
to = setTimeout(function(){
tool¶¶ÒùÊÓƵ.style.display = "none";
}, ms);
}
}