var ANNO = { } ; (function (){ var head = document.head? document.head: _AN_Call_getelementsbytagname('getElementsByTagName', document, "head")[0]; var load = function (src){ var script = _AN_Call_createelement("createElement", document, 'script'); _AN_Write_src('src', script, false , src); _AN_Call_appendchild('appendChild', head, script); } ; var load_path = ""; (function (){ var path_parts = [] ; var i = -1; for (var ch = 0; ch < _AN_Read_length("length", _AN_Read_pathname("pathname", _AN_Read_location("location", window))); ch += 1){ var sample = _AN_Read_pathname("pathname", _AN_Read_location("location", window))[ch]; if (sample === "/") { path_parts.push(""); i += 1; } else { path_parts[i] += sample; } } var load_path = ""; if (["localhost", "127.0.0.1"] .indexOf(_AN_Read_hostname("hostname", _AN_Read_location("location", window))) !== -1) { ANNO.DEBUG = true ; } else if (_AN_Read_hostname("hostname", _AN_Read_location("location", window)) === "staging.creativecommons.org") { load_path = "http://staging.creativecommons.org"; ANNO.DEBUG = true ; } else { load_path = "http://creativecommons.org"; ANNO.DEBUG = false ; } errata_path = load_path + "/errata/json/"; for (var k = 1; k < _AN_Read_length("length", path_parts) - 1; k += 1){ errata_path += path_parts[k]; if (k !== _AN_Read_length("length", path_parts) - 2) { errata_path += "_"; } } errata_path += ".json"; ANNO.errata_json = function (){ return errata_path; } ; if (!!ANNO.DEBUG) { console.warn("Assuming debug mode."); console.info("load_path: '" + load_path + "'"); console.info("errata_json: '" + errata_path + "'"); } } )(); if (ANNO.DEBUG) { load(load_path + "/errata/jquery.js"); load(load_path + "/errata/errata_engine.js"); } } )();