PageSourceSearch

https://www.nipr.no/design/ikt_orkide/ikt-orkide/v2017/assets/js/scripts.js?v=v18.0.04997

js nipr.no collected 2026-10-03 01:26:02 UTC 19,282 bytes, 1 lines download raw bytes

1!function(e){"use strict";window.console=window.console||{},window.console.log=window.console.log||function(){};var t={fontSizeHelperActive:!1,lastScreenWidth:0,mobileBreakpoint:800,resizeTimer:{},siteHostName:window.location.hostname,state:"",init:function(){t.lastScreenWidth=window.innerWidth,t.setState(),t.addCssClasses(),t.bindFirstMainMenuAnchor(),t.bindMainMenu(),t.bindMainMenuToggle(),t.bindMenuSearch(),t.bindRelatedResources(),t.bindSearchBoxInput(),t.bindSearchBoxToggle(),t.bindServiceMenu(),t.bindServiceMenuWithDescription(),t.bindSkipToLinks(),t.bindSubNavigation(),t.bindToTheTop(),t.bindTranslate(),t.getContrastFromCookie(),t.registerAlertBox(),console.log("A"),document.querySelector("form").classList.contains("surnadal")?t.setSearchFieldPlaceholder("#frontpage-search-box, #search-box",{text:"Kva kan vi hjelpe deg med?",lang:"nb"},{text:"Kva kan vi hjelpe deg med?",lang:"nn"}):document.querySelector("form").classList.contains("kristiansund")||document.querySelector("form").classList.contains("sunndal")?t.setSearchFieldPlaceholder("#frontpage-search-box, #search-box",{text:"Søk i hele nettstedet",lang:"nb"},{text:"Søk i heile nettstaden",lang:"nn"}):t.setSearchFieldPlaceholder("#frontpage-search-box, #search-box",{text:"Hva kan vi hjelpe deg med?",lang:"nb"},{text:"Kva kan vi hjelpe deg med?",lang:"nn"}),t.setWebPartHeights(),t.bindToggleTopMenu(),document.getElementsByTagName("form")[0].classList.remove("no-script"),window.addEventListener("resize",t.onResize)},addCssClasses:function(){var e=document.getElementById("main-menu-toggle"),t=document.getElementById("main-menu"),n=document.getElementById("search-box-toggle"),o=document.getElementById("search-box");e&&e.classList.add("closed"),t&&t.classList.add("closed"),n&&n.classList.add("closed"),o&&o.classList.add("closed");var a=document.querySelector(".service-menu"),s=document.querySelector("#subNavigation");function i(e){if(e)for(var t,n=document.querySelectorAll("li"),o=0;o<n.length;o++)(t=n[o]).querySelector(".description")&&t.classList.add("has-description")}i(a),i(s)},closeMainMenu:function(){var e,t=document.getElementById("main-menu-toggle"),n=document.getElementById("main-menu");(e=Array.prototype.slice.call(document.getElementsByTagName("form")[0].children)).splice(0,e.indexOf(n)+1),t&&(t.classList.remove("open"),t.classList.add("closed"),t.setAttribute("aria-expanded","false")),n&&(n.classList.remove("open"),n.classList.add("closed"),n.setAttribute("aria-hidden","true"))},closeSearchBox:function(){var e=document.getElementById("search-box-toggle"),t=document.getElementById("search-box"),n=t.getElementsByTagName("input")[0];t.getElementsByTagName("input")[1],document.getElementById("header"),e&&(e.classList.add("closed"),e.classList.remove("open"),e.setAttribute("aria-expanded","false")),t&&(t.classList.add("closed"),t.classList.remove("open"),t.setAttribute("aria-hidden","true")),n&&(n.setAttribute("tabindex","-1"),n.setAttribute("aria-hidden","true"),n.setAttribute("tabindex","-1"),n.setAttribute("aria-hidden","true")),header&&header.classList.remove("search-box-open")},getCookie:function(e){for(var t=e+"=",n=decodeURIComponent(document.cookie).split(";"),o=0;o<n.length;o++){for(var a=n[o];" "==a.charAt(0);)a=a.substring(1);if(0===a.indexOf(t))return a.substring(t.length,a.length)}return""},getContrastFromCookie:function(){var e=t.getCookie("acos.tilgjengelighet.kontrast");e&&"ingen"!==e?document.body.classList.add("kontrast"):document.body.classList.remove("kontrast")},moveArticleAuthorInfoAfterIngress:function(){var e=document.getElementsByClassName("article-authorinfo-box")[0],t=document.getElementById("ingress");e&&e.length&&t&&t.parentNode.insertBefore(e,t.nextSibling)},movePublishedDateAboveTitleArchive:function(){var e=document.getElementsByClassName("artikkeloversiktmal_5")[0];if(e)for(var n,o,a,s,i=e.getElementsByClassName("artikkeloversiktrad"),l=0;l<i.length;l++)a=(o=(n=i[l].getElementsByClassName("dato")[0]).parentNode).getElementsByClassName("bilde_venstre")[0],s=o.getElementsByClassName("tittel")[0],a&&o.insertBefore(a,n),o.insertBefore(s,n.nextSibling),n.textContent=t.removeFirstWord(n.textContent)},movePublishedDateAboveTitleFrontpage:function(){var e=document.getElementsByClassName("article-list-box")[0];if(e)for(var t,n,o=e.getElementsByTagName("li"),a=0;a<o.length;a++)t=o[a].getElementsByClassName("datoPublisert")[0],(n=o[a].getElementsByClassName("imgWrapper")[0]).parentNode.insertBefore(t,n.nextSibling)},onResize:function(){window.clearTimeout(t.resizeTimer),t.resizeTimer=window.setTimeout((function(){var e=!1;t.lastScreenWidth>t.mobileBreakpoint&&window.innerWidth<t.mobileBreakpoint?(t.state="mobile",e=!0):t.lastScreenWidth<=t.mobileBreakpoint&&window.innerWidth>t.mobileBreakpoint&&(e=!0),e&&(t.bindMainMenu(),t.bindSubNavigation()),t.bindServiceMenu(!0)}),100)},openMainMenu:function(){var e,t=document.getElementById("main-menu-toggle"),n=document.getElementById("main-menu");(e=Array.prototype.slice.call(document.getElementsByTagName("form")[0].children)).splice(0,e.indexOf(n)+1),t&&(t.classList.remove("closed"),t.classList.add("open"),t.setAttribute("aria-expanded","true")),n&&(n.classList.remove("closed"),n.classList.add("open"),n.setAttribute("aria-hidden","false"))},openSearchBox:function(){var e=document.getElementById("search-box-toggle"),t=document.getElementById("search-box");if(t){var n=t.querySelector("input[type=text]"),o=t.querySelector("input[type=submit]"),a=document.getElementById("header");e&&(e.classList.remove("closed"),e.classList.add("open"),e.setAttribute("aria-expanded","true")),t&&(t.classList.remove("closed"),t.classList.add("open"),t.setAttribute("aria-hidden","false")),n&&(n.setAttribute("tabindex","0"),n.setAttribute("aria-hidden","false"),n.focus()),o&&(o.setAttribute("tabindex","0"),o.setAttribute("aria-hidden","false")),a&&a.classList.add("search-box-open")}},bindAccessibilityMenu:function(){var e=document.getElementById("accessibilityMenu");if(e){var t=e.getElementsByTagName("li")[0];t.getElementsByTagName("ul").length>0&&(t.classList.add("collapsable","closed"),t.getElementsByTagName("a")[0].addEventListener("click",(function(e){e.preventDefault(),"span"===e.target.nodeName||"SPAN"===e.target.nodeName?(e.target.parentNode.parentNode.classList.toggle("open"),e.target.parentNode.parentNode.classList.toggle("closed")):(e.target.parentNode.classList.toggle("open"),e.target.parentNode.classList.toggle("closed"))})))}}
1,registerAlertBox:function(){var e=document.getElementById("alert-box");document.getElementById("messageBox"),e&&function(n){var o="alert-box"===n.id,a=n.getElementsByClassName(".emnekart-egendefinert")[0],s=o?"global":n.id.substring(n.id.indexOf("FrontLayoutListeId_")+19)+"-"+a.getAttribute("data-id"),i=document.createElement("button");i.classList.add("close-button"),i.setAttribute("data-id",s),i.title="Skjul";var l=document.createElement("span");l.appendChild(document.createTextNode("Skjul")),i.appendChild(l),i.addEventListener("click",(function(n){var o=n.currentTarget;n.preventDefault();var a=o.getAttribute("data-id"),s=[],i=t.getCookie("notification-cookie");i&&(s=JSON.parse(i));for(var l=!1,r=0;r<s.length;r++)if(s[r]===a){l=!0;break}l||(s.push(a),e.parentNode.removeChild(e)),t.setCookie("notification-cookie",JSON.stringify(s))}));var r=i.getAttribute("data-id"),d=[],c=t.getCookie("notification-cookie");c&&(d=JSON.parse(c));for(var m=!1,u=0;u<d.length;u++)if(d[u]===r){m=!0;break}if(!m){var g=n.getElementsByClassName("Zone")[0],p=n.getElementsByClassName("webPartInnhold")[0];a=n.getElementsByClassName("emnekartEgendefinert")[0],(o?p.innerHTML.trim().length:a.innerHTML.trim().length)>0&&(n.classList.add("has-content"),g.appendChild(i))}}(e)},bindContrastButton:function(){var e=document.getElementsByClassName("js-contrast")[0];e&&e.getElementsByTagName("a")[0].addEventListener("click",(function(e){e.preventDefault(),t.toggleContrast(),t.getContrastFromCookie()}))},bindFirstMainMenuAnchor:function(){var e=document.getElementById("main-menu");e&&e.getElementsByTagName("a")[0].addEventListener("keydown",(function(e){"tab"===e.key&&e.shiftKey&&(e.preventDefault(),document.getElementById("main-menu-toggle").focus())}))},bindFontSizeButton:function(){var e=document.getElementsByClassName("js-enlarge-text")[0];if(e){var n=e.getElementsByTagName("a")[0];n.addEventListener("click",(function(e){e.preventDefault()})),n.addEventListener("focus",t.createFontSizeHelper),n.addEventListener("blur",t.removeFontSizeHelper),n.addEventListener("mouseover",t.createFontSizeHelper),n.addEventListener("mouseout",t.removeFontSizeHelper)}},bindMainMenu:function(){var e,n,o,a=document.getElementById("main-menu");if(a)if("desktop"===t.state){for(a.classList.remove("mobile"),e=a.querySelectorAll(".vListe>li"),o=0;o<e.length;o++)(n=e[o]).getElementsByTagName("ul").length>0&&(n.classList.remove("closed"),n.classList.add("collapsable","open"));var s=document.getElementsByClassName("sub-menu-collapse")[0];s&&s.parentNode.removeChild(s)}else{var i,l,r;for(a.classList.add("mobile"),e=a.querySelectorAll(".vListe>li"),o=0;o<e.length;o++)(i=(n=e[o]).getElementsByTagName("ul")[0])&&(n.classList.remove("closed"),n.classList.add("collapsable","closed"),(l=document.createElement("button")).setAttribute("type","button"),l.classList.add("sub-menu-collapse"),(r=document.createElement("span")).classList.add("visuallyhidden"),r.appendChild(document.createTextNode("Åpne/lukk undermeny")),l.appendChild(r),l.addEventListener("click",d),i.parentNode.insertBefore(l,i))}function d(e){var t=e.target,n=t.parentNode,o=t.parentNode.parentNode.parentNode.querySelectorAll("ul > li");if(n.classList.contains("open"))n.classList.add("closed"),n.classList.remove("open");else{for(var a=0;a<o.length;a++)o[a].classList.remove("open"),o[a].classList.add("closed");n.classList.remove("closed"),n.getElementsByTagName("ul").length>0&&n.classList.add("open")}}},bindMainMenuToggle:function(){var e=document.getElementById("main-menu-toggle");e.addEventListener("click",(function(e){e.preventDefault(),t.closeSearchBox(),e.target.classList.contains("open")||e.target.parentNode.classList.contains("open")?t.closeMainMenu():t.openMainMenu()})),e.addEventListener("keydown",(function(e){e.target.classList.contains("open")&&("tab"!==e.key||e.shiftKey||(e.preventDefault(),document.getElementById("main-menu").getElementsByTagName("a")[0].focus()))}))},bindMenuSearch:function(){var e=document.querySelector(".js-toggle-menu-search");e&&e.addEventListener("click",t.toggleMainMenuAndSearchBox)},bindRelatedResources:function(){var e=document.getElementById("relaterteRessurser");if(e)for(var t=e.getElementsByClassName("relaterteressurser"),n=0;n<t.length;n++)t[n].classList.add("closed"),t[n].getElementsByClassName("relaterteHeader")[0].addEventListener("click",o);function o(e){e.target.parentNode.classList.toggle("open"),e.target.parentNode.classList.toggle("closed")}},bindSearchBoxInput:function(){var e=document.getElementById("search-box").querySelector("input[type=text]");e&&e.addEventListener("keydown",(function(e){"tab"===e.key&&e.shiftKey&&(e.preventDefault(),document.getElementById("search-box-toggle").focus())}))},bindSearchBoxToggle:function(){var e=document.getElementById("search-box-toggle");e&&e.addEventListener("click",(function(e){e.preventDefault(),t.closeMainMenu(),e.target.classList.contains("open")?(e.target.classList.add("closed"),e.target.classList.remove("open"),t.closeSearchBox()):(e.target.classList.add("open"),e.target.classList.remove("closed"),t.openSearchBox())}))},bindServiceMenu:function(e){var n,o,a,s=document.getElementsByClassName("service-menu")[0];if(s){var i=s.getElementsByTagName("ul")[0];if(!e)for(o=i.getElementsByTagName("li"),a=0;a<o.length;a++)(n=o[0]).setAttribute("data-index",a);if("mobile"===t.state){var l,r=i.querySelectorAll("li.active-state");for(o=i.getElementsByTagName("li"),a=0;a<r.length;a++)l=(n=r[a]).getAttribute("data-index"),o.indexOf(n)!==l&&i.insertBefore(n,o[l])}}},bindServiceMenuWithDescription:function(){var e=document.getElementsByClassName("service-menu")[0];if(e)for(var t,n=e.getElementsByTagName("ul")[0].getElementsByTagName("li"),o=0;o<n.length;o++)(t=n[o]).childNodes[0].addEventListener("focus",a),t.childNodes[0].addEventListener("mouseover",a),t.childNodes[0].addEventListener("blur",s),t.childNodes[0].addEventListener("mouseout",s),t.childNodes[0].childNodes[0].childElementCount>2&&t.classList.add("has-description");function a(t){var n=e.getElementsByTagName("li");if("A"===t.target.nodeName||"a"===t.target.nodeName){for(var o=0;o<n.length;o++)n[o].classList.remove("active");t.target.parentNode.classList.add("active")}}function s(e){"A"!==e.target.nodeName&&"a"!==e.target.nodeName||e.target===document.activeElement||e.target.parentNode.classList.remove("active")}},bindSkipToLinks:function(){for(var e,n,o=document.body.getElementsByClassName("hidden")[0].getElementsByTagName("a"),a=0;a<o.length;
1a++)o[a].addEventListener("click",s);function s(o){var a=o.target;if(e=a.hash,o.preventDefault(),n=window.innerWidth,"#contentHovedmeny"===e){var s=document.getElementById("main-menu-toggle");s&&s.focus()}else if("#contentSok"===e)if(n<t.mobileBreakpoint){var i=document.getElementById("search-box-toggle");i&&i.focus()}else{t.openSearchBox();var l=document.querySelector("#searchBox input[type=text]");l&&l.focus()}}},bindSubNavigation:function(){var e=document.getElementsByTagName("form")[0],n=e.classList.contains("underside"),o=e.classList.contains("transportside"),a=e.classList.contains("lukket-undermeny");if(n&&!o){var s,i,l=document.getElementById("subNavigation");if(l)if("mobile"!==t.state||document.getElementById("subNavigationToggle"))l.classList.remove("open"),l.classList.remove("closed"),(s=document.getElementById("subNavigationToggle"))&&s.removeEventListener("click",t.toggleSubMenu),(i=document.getElementById("subNavigationToggleWrapper"))&&i.parentNode.removeChild(i);else{l.classList.add(a?"closed":"open"),(i=document.createElement("div")).id="subNavigationToggleWrapper",(s=document.createElement("button")).id="subNavigationToggle",s.classList.add(a?"closed":"open"),s.append(document.createTextNode(a?"Vis undermeny":"Skjul undermeny")),s.addEventListener("click",t.toggleSubMenu),i.appendChild(s);var r=document.getElementById("subNavigation");r.parentNode.insertBefore(i,r)}}},bindToggleTopMenu:function(){var e,t,n,o=document.getElementsByClassName("js-top-menu__toggle")[0],a=document.getElementById("top-menu"),s=!1;void 0!==o&&void 0!==a&&void 0!==(e=a.getElementsByClassName("top-menu")[0])&&(t=e.getElementsByClassName("webPartInnhold")[0],n=o.getElementsByTagName("span")[0],o.addEventListener("click",(function(){t.classList.toggle("open"),s=!s,o.setAttribute("aria-expanded",s),n.innerText=s?"Lukk toppmeny":"Åpne toppmeny"}),!1))},bindToTheTop:function(){var e=document.getElementsByClassName("to-the-top")[0];e&&e.addEventListener("click",(function(){var e,t,n,o;e=document.documentElement.scrollTop>0?document.documentElement:document.body,t=e.scrollTop,n=0-t,o=function(a){var s=function(e,t,n,o){return(e/=375)<1?n/2*e*e+t:-n/2*((e-=1)*(e-2)-1)+t}(a+=20,t,n);e.scrollTop=s,a<750&&setTimeout((function(){o(a)}),20)},o(0)}))},bindTranslate:function(){var e=document.getElementsByClassName("js-toggle-translate")[0],n=document.querySelector(".webPart.translate");if(void 0!==e&&null!==n){var o=e.getBoundingClientRect(),a=window.getComputedStyle(document.getElementById("upper-header-content")).marginLeft,s=parseInt(a.replace("px","")),i=o.left+o.width/2,l=o.top+o.height;n.style.left=i-s+"px",n.style.top=l+"px";var r=!1;e.addEventListener("click",d,!1),document.addEventListener("click",(function(e){r&&null===t.getClosest(e.target,".webPart.translate")&&d()}),!1)}function d(e){e&&(e.preventDefault(),e.stopPropagation()),n.classList.toggle("open"),r=!r}},getClosest:function(e,t){for(Element.prototype.matches||(Element.prototype.matches=Element.prototype.matchesSelector||Element.prototype.mozMatchesSelector||Element.prototype.msMatchesSelector||Element.prototype.oMatchesSelector||Element.prototype.webkitMatchesSelector||function(e){for(var t=(this.document||this.ownerDocument).querySelectorAll(e),n=t.length;--n>=0&&t.item(n)!==this;);return n>-1});e&&e!==document;e=e.parentNode)if(e.matches(t))return e;return null},removeFirstWord:function(e){return e.substr(e.indexOf(" ")+1)},removeFontSizeHelper:function(){document.body.removeChild(document.getElementById("wrapperbeskrivelseStorrelse")),document.body.removeChild(document.getElementById("beskrivelseStorrelse")),t.fontSizeHelperActive=!1},setCookie:function(e,t,n){if(n){var o=new Date;o.setTime(o.getTime()+24*n*60*60*1e3);var a="expires="+o.toUTCString();document.cookie=e+"="+t+";"+a+";path=/"}else document.cookie=e+"="+t+";path=/"},setState:function(){t.state=window.innerWidth<=t.mobileBreakpoint?"mobile":"desktop"},updateLangAttribute:function(){for(var e=["surnadal"],t=0;t<e.length;t++)document.querySelector("form").classList.contains(e[t])&&(document.documentElement.lang="nn")},setSearchFieldPlaceholder:function(e,t){var n,o,a=document.querySelectorAll(e);for(n=0;n<a.length;n++){var s=a[n].querySelector("input[type=text]");if("string"==typeof t)s.placeholder=t;else if(t instanceof Array){for(o=0;o<text.length;o++)if(t[o].lang===document.documentElement.lang){s.placeholder=t[o];break}s.placeholder=t[0]}else{for(o=1;o<arguments.length;o++)if(arguments[o].lang===document.documentElement.lang){s.placeholder=arguments[o].text;break}s.placeholder=arguments[1].text}}},setWebPartHeights:function(){var e=document.getElementById("Sone6000");
1if(e){var n=e.getElementsByClassName("article-carousel-box")[0],o=e.getElementsByClassName("button-menu")[0],a=e.getElementsByClassName("ArtikkelKarusell");n&&o&&("desktop"===t.state?a.offsetHeight<o.offsetHeight&&(a.style.minHeight=o.offsetHeight+"px"):(a.style.minHeight="",o.style.minHeight=""))}},toggleContrast:function(){var e=t.getCookie("acos.tilgjengelighet.kontrast");e&&"ingen"!==e?t.setCookie("acos.tilgjengelighet.kontrast","ingen",1):t.setCookie("acos.tilgjengelighet.kontrast","hoy",1)},toggleMainMenuAndSearchBox:function(){var e=document.getElementsByClassName("js-toggle-menu-search")[0],t=document.getElementById("main-menu"),n=document.getElementById("search-box");e.classList.toggle("open"),n.classList.toggle("open"),t.classList.toggle("open")},toggleSubMenu:function(e){var t=e.target,n=document.getElementById("subNavigation");e.preventDefault(),t.classList.toggle("open"),t.classList.toggle("closed"),n.classList.toggle("open"),n.classList.toggle("closed"),n.classList.contains("closed")?t.innerText="Vis undermeny":t.innerText="Skjul undermeny"},wrapElements:function(){var e,t,n,o,a=document.getElementById("middleColumn").getElementsByClassName("artikkel"),s=document.createElement("div");s.classList.add("aspect-ratio");var i=document.createElement("div");i.classList.add("table-wrapper");for(var l=0;l<a.length;l++){for(t=(e=a[l]).querySelectorAll("iframe, object, embed"),n=e.getElementsByTagName("table"),o=0;o<t.length;o++)r(t[o],s.cloneNode());for(o=0;o<n.length;o++)r(n[o],i.cloneNode())}function r(e,t){e.parentNode.insertBefore(t,e),t.appendChild(e)}}};document.addEventListener("DOMContentLoaded",t.init)}(window.jQuery);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.