/* LAB.js (LABjs :: Loading And Blocking JavaScript)
    v2.0.3 (c) Kyle Simpson
    MIT License
*/
(function(w){var m=w.$LAB,W="UseLocalXHR",X="AlwaysPreserveOrder",V="AllowDuplicates",a="CacheBust",b="BasePath",c=/^[^?#]*\//.exec(location.href)[0],d=/^\w+\:\/\/\/?[^\/]+/.exec(c)[0],j=document.head||document.getElementsByTagName("head"),n=(w.opera&&Object.prototype.toString.call(w.opera)=="[object Opera]")||("MozAppearance" in document.documentElement.style),R=document.createElement("script"),e=typeof R.preload=="boolean",S=e||(R.readyState&&R.readyState=="uninitialized"),f=!S&&R.async===true,p=!S&&!f&&!n;function g(i){return Object.prototype.toString.call(i)=="[object Function]"}function h(i){return Object.prototype.toString.call(i)=="[object Array]"}function v(i,q){var o=/^\w+\:\/\//;if(/^\/\/\/?/.test(i)){i=location.protocol+i}else{if(!o.test(i)&&i.charAt(0)!="/"){i=(q||"")+i}}return o.test(i)?i:((i.charAt(0)=="/"?d:c)+i)}function T(i,q){for(var o in i){if(i.hasOwnProperty(o)){q[o]=i[o]}}return q}function x(i){var q=false;for(var o=0;o<i.scripts.length;o++){if(i.scripts[o].ready&&i.scripts[o].exec_trigger){q=true;i.scripts[o].exec_trigger();i.scripts[o].exec_trigger=null}}return q}function U(i,q,o,r){i.onload=i.onreadystatechange=function(){if((i.readyState&&i.readyState!="complete"&&i.readyState!="loaded")||q[o]){return}i.onload=i.onreadystatechange=null;r()}}function k(i){i.ready=i.finished=true;for(var o=0;o<i.finished_listeners.length;o++){i.finished_listeners[o]()}i.ready_listeners=[];i.finished_listeners=[]}function Q(i,q,o,r,s){setTimeout(function(){var t,y=q.real_src,u;if("item" in j){if(!j[0]){setTimeout(arguments.callee,25);return}j=j[0]}t=document.createElement("script");if(q.type){t.type=q.type}if(q.charset){t.charset=q.charset}if(s){if(S){o.elem=t;if(e){t.preload=true;t.onpreload=r}else{t.onreadystatechange=function(){if(t.readyState=="loaded"){r()}}}t.src=y}else{if(s&&y.indexOf(d)==0&&i[W]){u=new XMLHttpRequest();u.onreadystatechange=function(){if(u.readyState==4){u.onreadystatechange=function(){};o.text=u.responseText+"\n//@ sourceURL="+y;r()}};u.open("GET",y);u.send()}else{t.type="text/cache-script";U(t,o,"ready",function(){j.removeChild(t);r()});t.src=y;j.insertBefore(t,j.firstChild)}}}else{if(f){t.async=false;U(t,o,"finished",r);t.src=y;j.insertBefore(t,j.firstChild)}else{U(t,o,"finished",r);t.src=y;j.insertBefore(t,j.firstChild)}}},0)}function l(){var i={},s=S||p,q=[],r={},o;i[W]=true;i[X]=false;i[V]=false;i[a]=false;i[b]="";function t(z,B,A){var C;function D(){if(C!=null){C=null;k(A)}}if(r[B.src].finished){return}if(!z[V]){r[B.src].finished=true}C=A.elem||document.createElement("script");if(B.type){C.type=B.type}if(B.charset){C.charset=B.charset}U(C,A,"finished",D);if(A.elem){A.elem=null}else{if(A.text){C.onload=C.onreadystatechange=null;C.text=A.text}else{C.src=B.real_src}}j.insertBefore(C,j.firstChild);if(A.text){D()}}function u(A,z,B,D){var C,E,F=function(){z.ready_cb(z,function(){t(A,z,C)})},G=function(){z.finished_cb(z,B)};z.src=v(z.src,A[b]);z.real_src=z.src+(A[a]?((/\?.*$/.test(z.src)?"&_":"?_")+~~(Math.random()*1000000000)+"="):"");if(!r[z.src]){r[z.src]={items:[],finished:false}}E=r[z.src].items;if(A[V]||E.length==0){C=E[E.length]={ready:false,finished:false,ready_listeners:[F],finished_listeners:[G]};Q(A,z,C,((D)?function(){C.ready=true;for(var H=0;H<C.ready_listeners.length;H++){C.ready_listeners[H]()}C.ready_listeners=[]}:function(){k(C)}),D)}else{C=E[0];if(C.finished){G()}else{C.finished_listeners.push(G)}}}function y(){var z,A=T(i,{}),B=[],C=0,H=false,D;function E(J,K){J.ready=true;J.exec_trigger=K;I()}function F(J,L){J.ready=J.finished=true;J.exec_trigger=null;for(var K=0;K<L.scripts.length;K++){if(!L.scripts[K].finished){return}}L.finished=true;I()}function I(){while(C<B.length){if(g(B[C])){try{B[C++]()}catch(J){}continue}else{if(!B[C].finished){if(x(B[C])){continue}break}}C++}if(C==B.length){H=false;D=false}}function G(){if(!D||!D.scripts){B.push(D={scripts:[],finished:true})}}z={script:function(){for(var J=0;J<arguments.length;J++){(function(K,M){var L;if(!h(K)){M=[K]}for(var N=0;N<M.length;N++){G();K=M[N];if(g(K)){K=K()}if(!K){continue}if(h(K)){L=[].slice.call(K);L.unshift(N,1);[].splice.apply(M,L);N--;continue}if(typeof K=="string"){K={src:K}}K=T(K,{ready:false,ready_cb:E,finished:false,finished_cb:F});D.finished=false;D.scripts.push(K);u(A,K,D,(s&&H));H=true;if(A[X]){z.wait()}}})(arguments[J],arguments[J])}return z},wait:function(){if(arguments.length>0){for(var J=0;J<arguments.length;J++){B.push(arguments[J])}D=B[B.length-1]}else{D=false}I();return z}};return{script:z.script,wait:z.wait,setOptions:function(J){T(J,A);return z}}}o={setGlobalDefaults:function(z){T(z,i);return o},setOptions:function(){return y().setOptions.apply(null,arguments)},script:function(){return y().script.apply(null,arguments)},wait:function(){return y().wait.apply(null,arguments)},queueScript:function(){q[q.length]={type:"script",args:[].slice.call(arguments)};return o},queueWait:function(){q[q.length]={type:"wait",args:[].slice.call(arguments)};return o},runQueue:function(){var z=o,B=q.length,A=B,C;for(;--A>=0;){C=q.shift();z=z[C.type].apply(null,C.args)}return z},noConflict:function(){w.$LAB=m;return o},sandbox:function(){return l()}};return o}w.$LAB=l();(function(i,q,o){if(document.readyState==null&&document[i]){document.readyState="loading";document[i](q,o=function(){document.removeEventListener(q,o,false);document.readyState="complete"},false)}})("addEventListener","DOMContentLoaded")})(this);jQuery.cookie=function(c,g,d){if(arguments.length>1&&String(g)!=="[object Object]"){d=jQuery.extend({},d);if(g===null||g===undefined){d.expires=-1}if(typeof d.expires==="number"){var a=d.expires,f=d.expires=new Date();f.setDate(f.getDate()+a)}g=String(g);return(document.cookie=[encodeURIComponent(c),"=",d.raw?g:encodeURIComponent(g),d.expires?"; expires="+d.expires.toUTCString():"",d.path?"; path="+d.path:"",d.domain?"; domain="+d.domain:"",d.secure?"; secure":""].join(""))}d=g||{};var e,b=d.raw?function(h){return h}:decodeURIComponent;return(e=new RegExp("(?:^|; )"+encodeURIComponent(c)+"=([^;]*)").exec(document.cookie))?b(e[1]):null};var dateFormat=function(){var d=/d{1,4}|m{1,4}|yy(?:yy)?|([HhMsTt])\1?|[LloSZ]|"[^"]*"|'[^']*'/g,b=/\b(?:[PMCEA][SDP]T|(?:Pacific|Mountain|Central|Eastern|Atlantic) (?:Standard|Daylight|Prevailing) Time|(?:GMT|UTC)(?:[-+]\d{4})?)\b/g,c=/[^-+\dA-Z]/g,a=function(f,e){f=String(f);e=e||2;while(f.length<e){f="0"+f}return f};return function(h,q,u){var i=dateFormat;if(arguments.length==1&&Object.prototype.toString.call(h)=="[object String]"&&!/\d/.test(h)){q=h;h=undefined}h=h?new Date(h):new Date;if(isNaN(h)){throw SyntaxError("invalid date")}q=String(i.masks[q]||q||i.masks["default"]);if(q.slice(0,4)=="UTC:"){q=q.slice(4);u=true}var e=u?"getUTC":"get",f=h[e+"Date"](),g=h[e+"Day"](),n=h[e+"Month"](),v=h[e+"FullYear"](),k=h[e+"Hours"](),p=h[e+"Minutes"](),t=h[e+"Seconds"](),l=h[e+"Milliseconds"](),r=u?0:h.getTimezoneOffset(),j={d:f,dd:a(f),ddd:i.i18n.dayNames[g],dddd:i.i18n.dayNames[g+7],m:n+1,mm:a(n+1),mmm:i.i18n.monthNames[n],mmmm:i.i18n.monthNames[n+12],yy:String(v).slice(2),yyyy:v,h:k%12||12,hh:a(k%12||12),H:k,HH:a(k),M:p,MM:a(p),s:t,ss:a(t),l:a(l,3),L:a(l>99?Math.round(l/10):l),t:k<12?"a":"p",tt:k<12?"am":"pm",T:k<12?"A":"P",TT:k<12?"AM":"PM",Z:u?"UTC":(String(h).match(b)||[""]).pop().replace(c,""),o:(r>0?"-":"+")+a(Math.floor(Math.abs(r)/60)*100+Math.abs(r)%60,4),S:["th","st","nd","rd"][f%10>3?0:(f%100-f%10!=10)*f%10]};return q.replace(d,function(m){return m in j?j[m]:m.slice(1,m.length-1)})}}();dateFormat.masks={"default":"ddd mmm dd yyyy HH:MM:ss",shortDate:"m/d/yy",mediumDate:"mmm d, yyyy",longDate:"mmmm d, yyyy",fullDate:"dddd, mmmm d, yyyy",shortTime:"h:MM TT",mediumTime:"h:MM:ss TT",longTime:"h:MM:ss TT Z",isoDate:"yyyy-mm-dd",isoTime:"HH:MM:ss",isoDateTime:"yyyy-mm-dd'T'HH:MM:ss",isoUtcDateTime:"UTC:yyyy-mm-dd'T'HH:MM:ss'Z'"};dateFormat.i18n={dayNames:["Sön","Mån","Tis","Ons","Tor","Fre","Lör","Söndag","Måndag","Tisdag","Onsdag","Torsdag","Fredag","Lördag"],monthNames:["Jan","Feb","Mar","Apr","Maj","Jun","Jul","Aug","Sep","Okt","Nov","Dec","Januari","Februari","Mars","April","Maj","Juni","Juli","Augusti","September","Oktober","November","December"]};Date.prototype.format=function(a,b){return dateFormat(this,a,b)};RB.namespace("RB.extend");RB.extend=function(c,d){var e;for(e in d){if(d.hasOwnProperty(e)){c[e]=d[e]}}};RB.namespace("RB.protectForm");RB.protectForm=function(){var a=$("div.form");if(a.length===0){return}a.each(function(){var b=$(this),d=b.find("input[type=submit]").closest(".row"),c=b.next();if(d.length===1&&c.length===1&&c.hasClass("protection row")){d.detach();d.insertAfter(c)}})};$(document).ready(RB.protectForm);RB.globals.spinnerOpts={lines:12,length:7,width:4,radius:10,color:"#fff",speed:1,trail:60,shadow:false};RB.globals.isEnglish=(document.documentElement.getAttribute("lang")==="en");RB.namespace("RB.util");RB.util=(function(){function c(h,f){f=f||true;document.head=document.head||document.getElementsByTagName("head");var g=document.createElement("script");if(f){g.async=true}g.src=h;document.head.appendChild(g)}function e(f){if(typeof f!=="string"){return""}return f.replace(/^\s+|\s+$/g,"")}function d(j,g){var f,h;g=g||25;if(typeof j!=="string"){return""}f=j.split("");if(f.length>g){for(h=f.length;h>0;h-=1){if(h>g){f.length=h}else{if(" "===f[h]){f.length=h;break}}}f.push("…")}return f.join("")}function b(f,h){var g;for(g=0;g<f.length;g+=1){if(f[g]===h){return true}}return false}function a(){if(!location.hash&&!self.pageYOffset){setTimeout(function(){window.scrollTo(0,1)},1)}}return{load:c,trim:e,shorten:d,inArray:b,hideURLbar:a}}());RB.namespace("RB.log");RB.log=function(b,a){if(typeof console==="undefined"){return}b=b||"";a=a||"";console.log(b)};(function(){var a=RB.modules.get();if(a.length>0){$LAB.script(a)}}());(function(){var a=$("#printlink");if(a.length>0){a.find("a").click(function(b){b.preventDefault();window.print()})}}());(function(){if($("#addthis").length>0){RB.util.load("http://s7.addthis.com/js/250/addthis_widget.js#username=riksbanken",true)}}());if(RB.globals.gaid){var _gaq=_gaq||[];_gaq.push(["_setAccount",RB.globals.gaid]);_gaq.push(["_trackPageview"]);(function(){var a=("https:"===document.location.protocol?"https://ssl":"http://www")+".google-analytics.com/ga.js";RB.util.load(a,true)}())}var _gaq=_gaq||[];RB.namespace("RB.analytics");RB.analytics=(function(){var a=$("#aspnetForm"),c,d,e,b={};d=function(g,f,i){try{_gaq.push(["_trackEvent",g,f,i])}catch(h){}};b.orderform=function(){$("#modal-orderform a.order, #inline-orderform a.order").parent().siblings("td.reportname").find("a").each(function(g,f){$(f).click(function(){d("Beställ publikation","Nedladdning",$(this).text())})});a.submit(function(){var g=0,f;$("#modal-orderform table.itemlist input[type=text]").each(function(){f=parseInt($(this).val(),10);g+=isNaN(f)?0:f});d("Beställ publikation","Beställning","Antal: "+g)})};b.chat=function(f){d("Chatt","Skickat meddelande","Status: "+f)};b.search=function(f){d("search","zerohits",f)};b.sweaExport=function(f){f.find("input").click(function(){d("SWEA","Öppna som","Filtyp: "+$(this).val())})};b.mailto=function(){var f=$(location).attr("href");$("#main").find("a").each(function(){var g=jQuery(this).attr("href");if(g&&g.match(/^mailto\:/i)){$(this).click(function(){var h=g.replace(/^mailto\:/i,"");_gaq.push(["_trackEvent","email",f,h])})}})};e=function(g,f){if(b.hasOwnProperty(g)){b[g](f)}};c=function(){var f=$("#main div.export-icons");if(f.length>0){b.sweaExport(f)}b.mailto()};return{init:c,trackEvent:e}}());$(document).ready(function(){if(RB.globals.gaid){RB.analytics.init()}});
