/*
 * JavaScript Debug - v0.4 - 6/22/2010
 * http://benalman.com/projects/javascript-debug-console-log/
 * 
 * Copyright (c) 2010 "Cowboy" Ben Alman
 * Dual licensed under the MIT and GPL licenses.
 * http://benalman.com/about/license/
 * 
 * With lots of help from Paul Irish!
 * http://paulirish.com/
 */
window.debug=(function(){var k=this,b=Array.prototype.slice,e=k.console,j={},g,h,o=9,d=["error","warn","info","debug","log"],n="assert clear count dir dirxml exception group groupCollapsed groupEnd profile profileEnd table time timeEnd trace".split(" "),l=n.length,a=[];while(--l>=0){(function(p){j[p]=function(){o!==0&&e&&e[p]&&e[p].apply(e,arguments)}})(n[l])}l=d.length;while(--l>=0){(function(p,q){j[q]=function(){var s=b.call(arguments),r=[q].concat(s);a.push(r);f(r);if(!e||!m(p)){return}e.firebug?e[q].apply(k,s):e[q]?e[q](s):e.log(s)}})(l,d[l])}function f(p){if(g&&(h||!e||!e.log)){g.apply(k,p)}}j.setLevel=function(p){o=typeof p==="number"?p:9};function m(p){return o>0?o>p:d.length+o<=p}j.setCallback=function(){var q=b.call(arguments),p=a.length,r=p;g=q.shift()||null;h=typeof q[0]==="boolean"?q.shift():false;r-=typeof q[0]==="number"?q.shift():p;while(r<p){f(a[r++])}};return j})();(function(){var a=false,b=/xyz/.test(function(){xyz})?/\b_super\b/:/.*/;this.Class=function(){};Class.extend=function(h){var g=this.prototype;a=true;var f=new this();a=false;for(var e in h){f[e]=typeof h[e]=="function"&&typeof g[e]=="function"&&b.test(h[e])?(function(j,k){return function(){var m=this._super;this._super=g[j];var l=k.apply(this,arguments);this._super=m;return l}})(e,h[e]):h[e]}function d(){if(!a&&this.init){this.init.apply(this,arguments)}}d.prototype=f;d.constructor=d;d.extend=arguments.callee;return d}})();(function(a){a.plugin=function(d,b){a.fn[d]=function(f){var e=Array.prototype.slice.call(arguments,1);return this.each(function(){var g=a.data(this,d);if(g){g[f].apply(g,e)}else{g=a.data(this,d,new b(f,this))}})}}}(jQuery));
/* Copyright (c) 2010 Brandon Aaron (http://brandonaaron.net)
 * Dual licensed under the MIT (MIT_LICENSE.txt)
 * and GPL Version 2 (GPL_LICENSE.txt) licenses.
 *
 * Version: 1.1.1
 * Requires jQuery 1.3+
 * Docs: http://docs.jquery.com/Plugins/livequery
 */
(function(a){a.extend(a.fn,{livequery:function(f,e,d){var b=this,g;if(a.isFunction(f)){d=e,e=f,f=undefined}a.each(a.livequery.queries,function(h,j){if(b.selector==j.selector&&b.context==j.context&&f==j.type&&(!e||e.$lqguid==j.fn.$lqguid)&&(!d||d.$lqguid==j.fn2.$lqguid)){return(g=j)&&false}});g=g||new a.livequery(this.selector,this.context,f,e,d);g.stopped=false;g.run();return this},expire:function(f,e,d){var b=this;if(a.isFunction(f)){d=e,e=f,f=undefined}a.each(a.livequery.queries,function(g,h){if(b.selector==h.selector&&b.context==h.context&&(!f||f==h.type)&&(!e||e.$lqguid==h.fn.$lqguid)&&(!d||d.$lqguid==h.fn2.$lqguid)&&!this.stopped){a.livequery.stop(h.id)}});return this}});a.livequery=function(b,e,g,f,d){this.selector=b;this.context=e;this.type=g;this.fn=f;this.fn2=d;this.elements=[];this.stopped=false;this.id=a.livequery.queries.push(this)-1;f.$lqguid=f.$lqguid||a.livequery.guid++;if(d){d.$lqguid=d.$lqguid||a.livequery.guid++}return this};a.livequery.prototype={stop:function(){var b=this;if(this.type){this.elements.unbind(this.type,this.fn)}else{if(this.fn2){this.elements.each(function(d,e){b.fn2.apply(e)})}}this.elements=[];this.stopped=true},run:function(){if(this.stopped){return}var e=this;var f=this.elements,d=a(this.selector,this.context),b=d.not(f);this.elements=d;if(this.type){b.bind(this.type,this.fn);if(f.length>0){a.each(f,function(g,h){if(a.inArray(h,d)<0){a.event.remove(h,e.type,e.fn)}})}}else{b.each(function(){e.fn.apply(this)});if(this.fn2&&f.length>0){a.each(f,function(g,h){if(a.inArray(h,d)<0){e.fn2.apply(h)}})}}}};a.extend(a.livequery,{guid:0,queries:[],queue:[],running:false,timeout:null,checkQueue:function(){if(a.livequery.running&&a.livequery.queue.length){var b=a.livequery.queue.length;while(b--){a.livequery.queries[a.livequery.queue.shift()].run()}}},pause:function(){a.livequery.running=false},play:function(){a.livequery.running=true;a.livequery.run()},registerPlugin:function(){a.each(arguments,function(d,e){if(!a.fn[e]){return}var b=a.fn[e];a.fn[e]=function(){var f=b.apply(this,arguments);a.livequery.run();return f}})},run:function(b){if(b!=undefined){if(a.inArray(b,a.livequery.queue)<0){a.livequery.queue.push(b)}}else{a.each(a.livequery.queries,function(d){if(a.inArray(d,a.livequery.queue)<0){a.livequery.queue.push(d)}})}if(a.livequery.timeout){clearTimeout(a.livequery.timeout)}a.livequery.timeout=setTimeout(a.livequery.checkQueue,20)},stop:function(b){if(b!=undefined){a.livequery.queries[b].stop()}else{a.each(a.livequery.queries,function(d){a.livequery.queries[d].stop()})}}});a.livequery.registerPlugin("append","prepend","after","before","wrap","attr","removeAttr","addClass","removeClass","toggleClass","empty","remove","html");a(function(){a.livequery.play()})})(jQuery);var NP=NP||{};(function(a){NP.Sticky=Class.extend({options:{offsetTop:20,bottomLimit:false,mode:"fixed"},element:null,startPos:0,wrapperPos:0,dummy:null,init:function(b,d){this.options=a.extend({},this.options,b);this.element=a(d);this.startPos=a(d).offset();this.wrapperPos=a(d).parent().offset();this.dummy=this.createDummy();this.dummy.insertBefore(this.element);this.scroll();a(window).scroll(this.scroll.bind(this))},createDummy:function(){return dummy=a("<div />").css({height:this.element.outerHeight(),"margin-bottom":this.element.css("margin-bottom")})},scroll:function(){var d=a(window).scrollTop();if(this.options.bottomLimit){var b=(this.options.bottomLimit-this.element.height())-(this.options.offsetTop*2);if(d>b){this.element.css("top",((d-b)-this.options.offsetTop)*-1);return}}if(d>(this.startPos.top-this.options.offsetTop)){this.makeFixed()}else{if(d<=this.startPos.top){this.makeFluid()}}},makeFixed:function(){if(this.options.mode=="fixed"&&this.element.css("position")!=="fixed"){this.dummy.show();this.element.css({position:"fixed",top:this.options.offsetTop})}if(this.options.mode=="absolute"){this.element.css({position:"absolute",top:(a(window).scrollTop()-this.wrapperPos.top)+this.options.offsetTop})}},makeFluid:function(){this.dummy.hide();this.element.css({position:"static",top:"auto"})}});a.plugin("sticky",NP.Sticky)}(jQuery));var NP=NP||{};(function(a){a(window).load(function(){a(".np-mod-article aside").itemHider({childSelector:".fw-bd > .fw-row",compareTo:a("div.np-body")});a("div.fw-mod-stillinger .fw-imgWrap img, div.fw-mod-lesernes img").each(function(){a(this).css({position:"absolute",top:(a(this).parent().height()/2)-(a(this).height()/2)}).parent().css("position","relative")});a("div.fw-mod-lesernes img").each(function(){a(this).css({position:"absolute",left:(a(this).parent().width()/2)-(a(this).width()/2)}).parent().css("position","relative")});a("div.fw-mod").not(".fw-right").children(".fw-inner").children(".fw-bd").equalHeights();var d=a("div.ad-col-right .size-180x500:last");var b="fixed";if(a("body").parent().hasClass("ipad")||a("body").parent().hasClass("iphone")){b="absolute"}a("div.ad-col-right .size-180x500:last").sticky({bottomLimit:a("footer").offset().top,mode:b})});a(function(){a("a.fw-hasMegamenu").megamenu();if(typeof NP.ready=="object"){for(i in NP.ready){if(typeof NP.ready[i]=="function"){NP.ready[i].call()}}}a("img.fb_button_wrap").after('<div class="fb-like" data-send="false" data-width="380" data-show-faces="false" data-action="recommend"></div>');a("img.fb_button_wrap").remove();window.___gcfg={lang:"no"};(function(){var b=document.createElement("script");b.type="text/javascript";b.async=true;b.src="https://apis.google.com/js/plusone.js";var d=document.getElementsByTagName("script")[0];d.parentNode.insertBefore(b,d)})();(function(g,b,h){var f,e=g.getElementsByTagName(b)[0];if(g.getElementById(h)){return}f=g.createElement(b);f.id=h;f.src="//connect.facebook.net/nb_NO/all.js#xfbml=1";e.parentNode.insertBefore(f,e)}(document,"script","facebook-jssdk"));a(".imagecomparison").imagecomparison();a("a.fw-hasPopup").popup();a("a.np-buyPhoto").livequery(function(){a(this).popup({contentType:"iframe"})});if(a.browser.msie){a(".fw-overlayButton").each(function(){var d=a(this),b=a("<span />",{"class":"fw-overlayButton-playicon"}),e=a("<span />",{"class":"fw-overlayButton-end"});if(d.hasClass("fw-videoButton")){d.append(b)}d.append(e)})}a("a.fw-feedAppend").fetchContent();a("div.fw-carousel").carousel({loop:true});a("div.fw-articleCarousel").carousel({loop:true,itemsVisible:1});window.onblur=function(){window.blurred=true};window.onfocus=function(){window.blurred=false};a("#radioonlyoneday").click(function(){a("#onlyonedaydates").slideDown();a("#radiorepeateddays").attr("checked",false);a("#radioonlyoneday").attr("checked",true);a("#repeateddaysdates").slideUp()});a("#radiorepeateddays").click(function(){a("#repeateddaysdates").slideDown();a("#radioonlyoneday").attr("checked",false);a("#radiorepeateddays").attr("checked",true);a("#onlyonedaydates").slideUp()})});if(!Function.prototype.bind){Function.prototype.bind=function(b){if(typeof this!=="function"){throw new TypeError("Function.prototype.bind - what is trying to be fBound is not callable")}var g=Array.prototype.slice.call(arguments,1),f=this,d=function(){},e=function(){return f.apply(this instanceof d?this:b||window,g.concat(Array.prototype.slice.call(arguments)))};d.prototype=this.prototype;e.prototype=new d();return e}}}(jQuery));var NP=NP||{};(function(a){NP.Overlay=Class.extend({options:{className:"fw-overlay",removeOnClick:true,onHide:function(){}},container:false,gui:false,init:function(d,b){this.options=a.extend({},this.options,d);if(!b){b=a("body")}this.container=b;this.buildGUI()},show:function(){this.container.append(this.gui.hide());this.resize();this.gui.fadeIn("fast")},hide:function(){this.gui.fadeOut("fast",function(){this.gui.detach()}.bind(this));this.options.onHide()},buildGUI:function(){a(window).resize(this.resize.bind(this));this.gui=a("<div />",{"class":this.options.className,css:{position:"absolute",top:"0",left:"0",width:"100%","z-index":"10000"}}).click(this.click.bind(this))},resize:function(){this.gui.css({width:a("body").width(),height:a(document).height()})},click:function(){if(this.options.removeOnClick){this.hide()}}});a.plugin("overlay",NP.Overlay)}(jQuery));var NP=NP||{};(function(a){NP.Popup=Class.extend({options:{content:"",contentType:"auto",overlay:true,overlayClickHides:true,positionX:"screenCenter",positionY:"screenCenter",width:"auto",height:"auto",cache:true,classWrapper:"fw-mod fw-mod-popup",classInner:"fw-inner",classHeader:"fw-hd",classBody:"fw-bd",classFooter:"fw-ft",classOverlay:"fw-overlay",classCloseBtn:"fw-popupClose",classOverlay:"fw-overlay",errorLoading:"Kunne ikke laste innholdet. Vennligst forsøk på nytt senere."},trigger:false,overlay:false,visible:false,init:function(b,d){this.options=a.extend({},this.options,b);this.trigger=a(d);this.options.width=this.trigger.data("width")||this.options.width;this.options.height=this.trigger.data("height")||this.options.height;this.trigger.click(function(f){this.show();f.preventDefault()}.bind(this));if(this.trigger.hasClass("np-useiframe")){this.options.contentType="iframe"}a(window).resize(this.resize.bind(this));this.buildGUI()},show:function(){if(this.options.cache&&this.gui.body.html()==""){}else{this.beforeShow();this.determineContentType();this.getContent()}if(this.options.overlay){if(typeof NP.Overlay==="function"){this.overlay=new NP.Overlay({className:this.options.classOverlay,onHide:this.hide.bind(this)});this.overlay.show()}else{debug.error("Overlay class (NP.Overlay) is missing.")}}a("body").append(this.gui.wrapper);this.position();a("body").keydown(this.keypress.bind(this));if(this.options.contentType=="selector"||this.options.contentType=="dom"||this.options.contentType=="html"){this.position()}this.visible=true;this.afterShow()},hide:function(){this.beforeHide();this.gui.wrapper.detach();if(!this.options.cache){this.setLoadingIndicator()}a("body").unbind("keydown",this.keypress);this.visible=false;this.afterHide()},gui:false,buildGUI:function(){var b=this,d={wrapper:a("<div/>",{"class":this.options.classWrapper}),inner:a("<div/>",{"class":this.options.classInner}),header:a("<div/>",{"class":this.options.classHeader}),body:a("<div/>",{"class":this.options.classBody}),footer:a("<div/>",{"class":this.options.classFooter}),overlay:a("<div/>",{"class":this.options.classOverlay}),closeBtn:a("<a />",{"class":this.options.classCloseBtn,html:"&times;",click:function(){if(b.overlay){b.overlay.hide()}else{b.hide()}}})};this.gui=d;this.setLoadingIndicator();this.gui.inner.append(d.header,d.body,d.footer);this.gui.wrapper.append(d.inner)},setLoadingIndicator:function(){this.gui.header.empty();this.gui.body.html(a('<img src="/img/loading_big.gif" style="margin: 14px 20px 16px 14px"/>'))},determineContentType:function(){var b=this.trigger.attr("href");if(this.options.contentType==="iframe"){this.options.content=b}if((this.options.content===""||this.options.contentType==="selector")&&(b[0]=="#"&&b.length>1)){this.options.content=b;this.options.contentType="selector"}if((this.options.content===""||this.options.contentType==="url")&&(typeof b!=="undefined")){this.options.contentType="url";this.options.content=b;if(this.isExternal(this.options.content)){this.options.contentType="iframe"}}},isExternal:function(b){host=window.location.host;if(b.substring(0,4)!=="http"){return false}if(b.indexOf(host)==7){return false}else{return true}},getContent:function(){var d=false;switch(this.options.contentType){case"iframe":var b=a("<iframe />",{src:this.options.content}),e=this;if(this.options.height!=="auto"){b.css("height",this.options.height)}if(this.options.width!=="auto"){b.css("width",this.options.width)}if(this.options.height!=="auto"&&this.options.width!=="auto"){b.attr("scrolling","no")}b.load(function(){e.position()});this.setContent(b);break;case"url":a.ajax(this.options.content,{success:function(g,h,f){this.setContent(g);this.position()}.bind(this),error:function(f,h,g){this.setContent(this.options.errorLoading);this.position();debug.error("Loading of ajax content failed.",f,h,g)}.bind(this)});break;case"selector":d=a(this.options.content);if(d.length>0){this.setContent(d)}break;case"dom":d=a(this.content);if(d.length>0){this.setContent(this.content.html())}break;case"html":this.setContent(this.content);break}},setContent:function(b,d){if(!d){d="body"}if(a.inArray(d,["header","body","footer","inner","wrapper"])===-1){debug.error("Target has to be either header, body, footer, inner or wrapper");return false}if(typeof this.gui[d]==="object"){this.gui[d].html(b);this.gui.header.append(this.gui.closeBtn);return true}else{debug.error("Nothing to set content on.")}return false},position:function(){var d=0,b=0;switch(this.options.positionX){case"screenCenter":d=(a("body").width()/2)-(this.gui.wrapper.width()/2);break}switch(this.options.positionY){case"screenCenter":b=((a(window).height()/2)+a(window).scrollTop())-(this.gui.wrapper.height()/2);break}b=Math.max(0,b);this.gui.wrapper.css({left:d,top:b})},keypress:function(b){if(b.keyCode===27){if(this.options.overlay){this.overlay.hide()}else{this.hide()}}},resize:function(){this.position()},beforeShow:function(){},afterShow:function(){},beforeHide:function(){},afterHide:function(){}});a.plugin("popup",NP.Popup)}(jQuery));var NP=NP||{};(function(a){NP.Megamenu=NP.Popup.extend({beforeShow:function(){this.position();this.options.classOverlay="fw-megamenuOverlay"},position:function(){var d=this.trigger.offset(),b=(d.left+(this.trigger.width()/2)-(this.gui.wrapper.width()/2))+7,e=(d.top+this.trigger.height())+4;x_safe=Math.min(b,a(window).width()-this.gui.wrapper.width());x_safe=Math.max(0,x_safe);this.gui.arrow.css("left",(this.gui.wrapper.width()/2)+(b-x_safe)+"px");this.gui.wrapper.css({left:x_safe,top:e})},buildGUI:function(){this._super();this.gui.arrow=a("<div />",{"class":"fw-megamenuArrow"});this.gui.header.append(this.gui.arrow)}});a.plugin("megamenu",NP.Megamenu)}(jQuery));Number.prototype.pxToEm=String.prototype.pxToEm=function(b){b=jQuery.extend({scope:"body",reverse:false},b);var f=(this=="")?0:parseFloat(this);var e;var d=function(){var h=document.documentElement;return self.innerWidth||(h&&h.clientWidth)||document.body.clientWidth};if(b.scope=="body"&&$.browser.msie&&(parseFloat($("body").css("font-size"))/d()).toFixed(1)>0){var g=function(){return(parseFloat($("body").css("font-size"))/d()).toFixed(3)*16};e=g()}else{e=parseFloat(jQuery(b.scope).css("font-size"))}var a=(b.reverse==true)?(f*e).toFixed(2)+"px":(f/e).toFixed(2)+"em";return a};(function(a){a.fn.equalHeights=function(b){a(this).each(function(){var d=0,g=a(this).children(),f=false,e=[];g.each(function(h){var l=0,k=0,j=a(this).children();j.each(function(){l+=a(this).height()});l+=(j.length-1)*20;if(l>d){d=l}e[h]={articles:j.length,colHeight:l}});g.each(function(h){var j=(d-e[h].colHeight)/e[h].articles;a(this).children().each(function(){a(this).find(".fw-inner:first").height(a(this).height()+j)})});return this})}}(jQuery));var NP=NP||{};(function(a){NP.Carousel=Class.extend({options:{itemsVisible:4,slideWidth:false,slideHeight:false,innerContainerSelector:"ul",childSelector:"li",speed:600,autoScroll:5000,loop:true,loopMode:"infinite",pauseOnHover:true},current:0,itemsTotal:0,interval:false,outerContainer:false,innerContainer:false,slides:false,gui:{},init:function(b,d){this.options=a.extend({},this.options,b);this.outerContainer=a(d);this.innerContainer=this.outerContainer.find(this.options.innerContainerSelector);this.slides=this.innerContainer.children(this.options.childSelector);this.itemsTotal=this.slides.length;if(!this.options.slideWidth){this.options.slideWidth=this.slides.eq(0).width()}if(!this.options.slideHeight){this.options.slideHeight=this.slides.eq(0).height()}this.buildGUI();if(typeof this.options.autoScroll==="number"){if(this.itemsTotal>this.options.itemsVisible){this.outerContainer.mouseenter(this.mouseover.bind(this));this.outerContainer.mouseleave(this.mouseout.bind(this));this.play()}else{this.gui.next.remove();this.gui.prev.remove()}}},buildGUI:function(){this.outerContainer.css({overflow:"hidden",position:"relative",height:this.options.slideHeight,width:this.options.slideWidth*this.options.itemsVisible});this.innerContainer.css({position:"absolute",left:0,top:0,width:this.options.slideWidth*this.itemsTotal});this.gui.prev=a('<a href="#" class="fw-carousel-prev fw-arrow-left" title="Forrige">Forrige</a>').click(function(b){b.preventDefault();this.prev()}.bind(this));this.gui.next=a('<a href="#" class="fw-carousel-next fw-arrow-right" title="Neste">Neste</a>').click(function(b){b.preventDefault();this.next()}.bind(this));this.outerContainer.append(this.gui.prev,this.gui.next)},play:function(){if(this.options.autoScroll){var b=this.options.autoScroll,d=100;this.interval=setInterval(function(){if(window.blurred){return}b-=d;if(b<=0){b=this.options.autoScroll;this.next()}}.bind(this),d)}},mouseover:function(){this.outerContainer.addClass("fw-hover");if(this.options.autoScroll&&this.options.pauseOnHover){this.stop()}},mouseout:function(){this.outerContainer.removeClass("fw-hover");if(this.options.autoScroll&&this.options.pauseOnHover){this.play()}},stop:function(){clearTimeout(this.interval).bind(this)},next:function(){var f=this.current+this.options.itemsVisible,d=null,b=null,e=null;if(this.options.loop){switch(this.options.loopMode){case"infinite":if(this.itemsTotal>this.options.itemsVisible){f=this.current+this.options.itemsVisible,b=this.options.childSelector+":lt("+f+")",e=this.innerContainer.find(b);this.innerContainer.append(e.clone());this.innerContainer.css("width",this.innerContainer.children().length*this.options.slideWidth)}break;case"rewind":if(f>=this.itemsTotal){f=0}break}}else{if(this.current>=this.itemsTotal-1){return}}this.show(f,e)},prev:function(){var f=this.current-this.options.itemsVisible,b=this.options.childSelector+":gt("+this.options.itemsVisible+")",d=this.innerContainer.find(b),e=null;if(this.options.loop){switch(this.options.loopMode){case"infinite":e=this.innerContainer.find(this.options.childSelector).slice(this.itemsTotal-this.options.itemsVisible);this.innerContainer.prepend(e.clone());this.innerContainer.css({width:this.innerContainer.children().length*this.options.slideWidth,left:0-(this.options.slideWidth*(this.options.itemsVisible))});f=0;break;case"rewind":if(f<0){f=Math.max(this.options.itemsVisible,this.itemsTotal-this.options.itemsVisible)}break}}else{if(this.current<=0){return}}this.show(f,e)},show:function(d,b){var e=this;this.innerContainer.stop();this.innerContainer.animate({left:-(this.options.slideWidth*d)},this.options.speed,"swing",function(){if(b){e.innerContainer.css({left:0,width:e.innerContainer.children().length*e.options.slideWidth});e.current=0;b.remove()}});this.current=d}});a.plugin("carousel",NP.Carousel)}(jQuery));var NP=NP||{};(function(a){NP.ItemHider=Class.extend({options:{minimumVisible:1,childSelector:false,compareTo:false,threshold:0},items:null,wrapper:null,init:function(b,d){this.options=a.extend({},this.options,b);this.wrapper=a(d);if(!this.options.childSelector){this.items=this.wrapper.children()}else{this.items=this.wrapper.find(this.options.childSelector)}debug.log(this.items);this.hideItems()},hideItems:function(){var e=(this.options.compareTo.height()-this.wrapper.height())-this.options.threshold,b=this.items.length-1,d=null;if(e<0){for(b;b>=0;b--){if((e>0)||(b+1<=this.options.minimumVisible)){return}d=a(this.items[b]);e=e+d.height();d.remove()}}}});a.plugin("itemHider",NP.ItemHider)}(jQuery));var NP=NP||{};(function(a){NP.Tabs=Class.extend({options:{activeClass:"fw-active"},tabs:null,container:null,init:function(d,b){var e=this;this.options=a.extend({},this.options,d);this.container=a(b);this.tabs=this.container.find("a");this.tabs.click(function(f){f.preventDefault();e.show(this)});this.show(this.tabs[0])},extractHash:function(d){var b=d.match(/#(.+)/gi);return(b)?b[0]:false},show:function(d){var b=null;a.each(this.tabs,function(e,f){b=a(this.extractHash(a(f).attr("href")));if(d==f){a(b).show();a(f).addClass(this.options.activeClass)}else{a(b).hide();a(f).removeClass(this.options.activeClass)}}.bind(this))}});a.plugin("tabs",NP.Tabs)}(jQuery));var NP=NP||{};(function(a){NP.Poll=Class.extend({options:{url:false},init:function(b,d){this.options=a.extend(this.options,b);this.container=a(d);this.container.data("poll",this);this.attachEvents();this.loadView("url",this.options.url)},attachEvents:function(){var b=this;this.container.delegate(".fw-pollSwitchView","click",function(d){d.preventDefault();b.loadView("url",this.attr("href"))});this.container.delegate("input[type=radio]","click",function(g){var d=a(this.form),f=d.serialize();g.preventDefault();a.ajax({type:"POST",url:d.attr("action"),cache:false,data:f,success:function(e){b.loadView("html",e)}})})},loadView:function(b,d){var e=this;if(b=="url"){a.ajax({url:d,success:function(f){e.container.html(f)}})}else{e.container.html(d)}}});a.plugin("poll",NP.Poll)}(jQuery));var NP=NP||{};(function(a){NP.Video=Class.extend({options:{lampUrlBase:"http://video.eddainteraktiv.no",siteId:false,id:false},init:function(b,d){this.options=a.extend(this.options,b);this.container=a(d);this.attachEvents();this.play()},attachEvents:function(){var b=this;if(a.cookie("edda_video_rated_"+this.options.id)!="true"){this.container.delegate(".fw-recommend a","click",function(d){d.preventDefault();b.rate()})}else{this.disableRating()}},play:function(){DrVideo.API.play(this.options.id,"video-player")},rate:function(){var d=this;var b=d.options.lampUrlBase+"?siteId="+d.options.siteId+"&action=rate&value="+d.options.id;a.ajax({dataType:"json",url:b,success:function(e){d.updateRating(e);d.disableRating()}})},updateRating:function(b){this.container.find(".fw-recommend span").html(b.rating+" anbefalinger")},disableRating:function(){this.container.undelegate(".fw-recommend a","click");this.container.find(".fw-recommend a").html("Du har anbefalt denne videoen");a.cookie("edda_video_rated_"+this.options.id,"true",{expires:7})}});a.plugin("video",NP.Video)}(jQuery));var NP=NP||{};(function(a){NP.FetchContent=Class.extend({options:{url:false,target:false,mode:"append",loadingClass:"fw-loading",offsetVariable:"offset",offset:0,increase:9},parentIsTarget:false,init:function(b,d){var e=this;this.element=a(d);this.options=a.extend({},this.options,b);if(!e.options.url&&d.tagName.toLowerCase()=="a"){e.options.url=a(d).attr("href")}if(!e.options.target){e.options.target=a(d).parent();e.parentIsTarget=true}if(!isNaN(e.element.data("increase"))){e.options.increase=e.element.data("increase")}this.attachEvents()},attachEvents:function(){var b=this;this.element.click(function(d){d.preventDefault();b.element.addClass(b.options.loadingClass);b.getContent()})},getContent:function(){var d=this,b=d.options.offset+d.options.increase;a.ajax({type:"GET",url:this.options.url,cache:false,data:d.options.offsetVariable+"="+b,success:function(e){d.setContent(e);d.element.removeClass(d.options.loadingClass);d.options.offset=b},error:function(){debug.error("Could not load data in NP.Fetch_Content");d.element.removeClass(d.options.loadingClass)}})},setContent:function(b){var d=this;b=a.trim(b);if(b===""){d.element.fadeOut();return false}b=a(b);switch(this.options.mode){case"append":a(b).appendTo(this.options.target);if(this.parentIsTarget){this.element.appendTo(this.options.target)}break;default:this.options.target.html(b);if(this.parentIsTarget){this.element.appendTo(this.options.target)}break}}});a.plugin("fetchContent",NP.FetchContent)}(jQuery));(function(a){NP.ZuprZlide=Class.extend({options:{width:780,startImg:0,replace:true,height:400,derivative:"derivative_article_980",container:document.body,onBeforeInject:function(){}},init:function(f,e,b){this.options=a.extend({},this.options,b);if(!this.options.container){this.options.container=f[0]}this.currentImg=this.options.startImg;this.collection=this.makeCollection(f,e);var d=this.buildGUI();this.options.onBeforeInject();if(this.options.container.get(0).nodeName=="IMG"){d.replaces(this.options.container)}else{if(this.options.replace){this.options.container.empty()}d.prependTo(this.options.container)}},next:function(){var b=(this.collection[this.currentImg+1])?this.currentImg+1:0;this.goTo(b);this.currentImg=b},prev:function(){var b=(this.collection[this.currentImg-1])?this.currentImg-1:this.collection.length;this.goTo(b);this.currentImg=b},goTo:function(e){if(!this.collection[e]){e=0}var d=this.collection[e];var b=a("<img />",{src:d.img,alt:d.descr.text});a(this.gui.img).replaceWith(b);this.gui.img=b;this.gui.descr.html(d.descr.html);this.gui.xofx.find("strong:first").text(e+1)},buildGUI:function(){var f=a('<div class="np-ZuprZlide" />');var l=a("<div />",{"class":"np-cont",css:{height:this.options.height+2}}).prependTo(f);var k=a("<div />",{"class":"np-imgWrap",title:"Trykk for neste bilde"}).prependTo(l).click(function(m){m.preventDefault();this.next()}.bind(this));var g=a("<img />",{src:this.collection[this.currentImg].img}).prependTo(k);var j=a("<div />",{"class":"fw-imgCaption",css:{opacity:0.7},html:this.collection[this.currentImg].descr.html}).appendTo(f);var d=a("<div />",{css:{opacity:0.7},"class":"np-slideNav"}).appendTo(f);var b=a("<p />",{html:"Viser bilde <strong>"+(this.currentImg+1)+"</strong> av <strong>"+this.collection.length+"</strong> bilder","class":"np-xofx"}).appendTo(d);var h=a("<a />",{html:"Neste bilde","class":"np-next"}).appendTo(d).click(function(m){m.preventDefault();this.next()}.bind(this));var e=a("<a />",{html:"Forrige bilde","class":"np-prev"}).appendTo(d).click(function(m){m.preventDefault();this.prev()}.bind(this));f.mouseenter(function(){j.animate({opacity:1});d.animate({opacity:1})});f.mouseleave(function(){j.animate({opacity:0.6});d.animate({opacity:0.6})});this.gui={img:g,descr:j,html:f,next:h,prev:e,xofx:b};debug.log(f);return f},makeCollection:function(e,b){var d=[];e.each(function(f,g){d.push({img:this.fixImgURL(g,this.options.width,this.options.height),descr:{html:a(b[f]).html(),text:a(b[f]).text()}})}.bind(this));return d},fixImgURL:function(d,e,b){return a(d).attr("src").replace("derivative_article_480",this.options.derivative)}})}(jQuery));var NP=NP||{};(function(a){NP.GoogleMap=Class.extend({options:{lat:65.385147,lng:13.579102,zoom:4},init:function(b,d){this.options=a.extend({},this.options,b);this.element=this.options.tagId;this.initMap();this.addMarker()},initMap:function(){this.latlng=new google.maps.LatLng(this.options.lat,this.options.lng);var b={zoom:this.options.zoom,center:this.latlng,mapTypeId:google.maps.MapTypeId.ROADMAP};this.map=new google.maps.Map(document.getElementById(this.element),b)},addMarker:function(){var b=new google.maps.Marker({position:this.latlng,map:this.map,icon:"/img/icons/google_map_marker.png"})}});a.plugin("googleMap",NP.GoogleMap)}(jQuery));
/*
 * jQuery UI 1.8.16
 *
 * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
 * Dual licensed under the MIT or GPL Version 2 licenses.
 * http://jquery.org/license
 *
 * http://docs.jquery.com/UI
 */
(function(a,e){a.ui=a.ui||{};if(a.ui.version){return}a.extend(a.ui,{version:"1.8.16",keyCode:{ALT:18,BACKSPACE:8,CAPS_LOCK:20,COMMA:188,COMMAND:91,COMMAND_LEFT:91,COMMAND_RIGHT:93,CONTROL:17,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,INSERT:45,LEFT:37,MENU:93,NUMPAD_ADD:107,NUMPAD_DECIMAL:110,NUMPAD_DIVIDE:111,NUMPAD_ENTER:108,NUMPAD_MULTIPLY:106,NUMPAD_SUBTRACT:109,PAGE_DOWN:34,PAGE_UP:33,PERIOD:190,RIGHT:39,SHIFT:16,SPACE:32,TAB:9,UP:38,WINDOWS:91}});a.fn.extend({propAttr:a.fn.prop||a.fn.attr,_focus:a.fn.focus,focus:function(f,g){return typeof f==="number"?this.each(function(){var h=this;setTimeout(function(){a(h).focus();if(g){g.call(h)}},f)}):this._focus.apply(this,arguments)},scrollParent:function(){var f;if((a.browser.msie&&(/(static|relative)/).test(this.css("position")))||(/absolute/).test(this.css("position"))){f=this.parents().filter(function(){return(/(relative|absolute|fixed)/).test(a.curCSS(this,"position",1))&&(/(auto|scroll)/).test(a.curCSS(this,"overflow",1)+a.curCSS(this,"overflow-y",1)+a.curCSS(this,"overflow-x",1))}).eq(0)}else{f=this.parents().filter(function(){return(/(auto|scroll)/).test(a.curCSS(this,"overflow",1)+a.curCSS(this,"overflow-y",1)+a.curCSS(this,"overflow-x",1))}).eq(0)}return(/fixed/).test(this.css("position"))||!f.length?a(document):f},zIndex:function(j){if(j!==e){return this.css("zIndex",j)}if(this.length){var g=a(this[0]),f,h;while(g.length&&g[0]!==document){f=g.css("position");if(f==="absolute"||f==="relative"||f==="fixed"){h=parseInt(g.css("zIndex"),10);if(!isNaN(h)&&h!==0){return h}}g=g.parent()}}return 0},disableSelection:function(){return this.bind((a.support.selectstart?"selectstart":"mousedown")+".ui-disableSelection",function(f){f.preventDefault()})},enableSelection:function(){return this.unbind(".ui-disableSelection")}});a.each(["Width","Height"],function(h,f){var g=f==="Width"?["Left","Right"]:["Top","Bottom"],j=f.toLowerCase(),l={innerWidth:a.fn.innerWidth,innerHeight:a.fn.innerHeight,outerWidth:a.fn.outerWidth,outerHeight:a.fn.outerHeight};function k(o,n,m,p){a.each(g,function(){n-=parseFloat(a.curCSS(o,"padding"+this,true))||0;if(m){n-=parseFloat(a.curCSS(o,"border"+this+"Width",true))||0}if(p){n-=parseFloat(a.curCSS(o,"margin"+this,true))||0}});return n}a.fn["inner"+f]=function(m){if(m===e){return l["inner"+f].call(this)}return this.each(function(){a(this).css(j,k(this,m)+"px")})};a.fn["outer"+f]=function(m,n){if(typeof m!=="number"){return l["outer"+f].call(this,m)}return this.each(function(){a(this).css(j,k(this,m,true,n)+"px")})}});function d(h,f){var l=h.nodeName.toLowerCase();if("area"===l){var k=h.parentNode,j=k.name,g;if(!h.href||!j||k.nodeName.toLowerCase()!=="map"){return false}g=a("img[usemap=#"+j+"]")[0];return !!g&&b(g)}return(/input|select|textarea|button|object/.test(l)?!h.disabled:"a"==l?h.href||f:f)&&b(h)}function b(f){return !a(f).parents().andSelf().filter(function(){return a.curCSS(this,"visibility")==="hidden"||a.expr.filters.hidden(this)}).length}a.extend(a.expr[":"],{data:function(h,g,f){return !!a.data(h,f[3])},focusable:function(f){return d(f,!isNaN(a.attr(f,"tabindex")))},tabbable:function(h){var f=a.attr(h,"tabindex"),g=isNaN(f);return(g||f>=0)&&d(h,!g)}});a(function(){var f=document.body,g=f.appendChild(g=document.createElement("div"));a.extend(g.style,{minHeight:"100px",height:"auto",padding:0,borderWidth:0});a.support.minHeight=g.offsetHeight===100;a.support.selectstart="onselectstart" in g;f.removeChild(g).style.display="none"});a.extend(a.ui,{plugin:{add:function(g,h,k){var j=a.ui[g].prototype;for(var f in k){j.plugins[f]=j.plugins[f]||[];j.plugins[f].push([h,k[f]])}},call:function(f,h,g){var k=f.plugins[h];if(!k||!f.element[0].parentNode){return}for(var j=0;j<k.length;j++){if(f.options[k[j][0]]){k[j][1].apply(f.element,g)}}}},contains:function(g,f){return document.compareDocumentPosition?g.compareDocumentPosition(f)&16:g!==f&&g.contains(f)},hasScroll:function(j,g){if(a(j).css("overflow")==="hidden"){return false}var f=(g&&g==="left")?"scrollLeft":"scrollTop",h=false;if(j[f]>0){return true}j[f]=1;h=(j[f]>0);j[f]=0;return h},isOverAxis:function(g,f,h){return(g>f)&&(g<(f+h))},isOver:function(l,g,k,j,f,h){return a.ui.isOverAxis(l,k,f)&&a.ui.isOverAxis(g,j,h)}})})(jQuery);jQuery.cookie=function(e,f,b){if(arguments.length>1&&String(f)!=="[object Object]"){b=jQuery.extend({},b);if(f===null||f===undefined){b.expires=-1}if(typeof b.expires==="number"){var h=b.expires,d=b.expires=new Date();d.setDate(d.getDate()+h)}f=String(f);return(document.cookie=[encodeURIComponent(e),"=",b.raw?f:encodeURIComponent(f),b.expires?"; expires="+b.expires.toUTCString():"",b.path?"; path="+b.path:"",b.domain?"; domain="+b.domain:"",b.secure?"; secure":""].join(""))}b=f||{};var a,g=b.raw?function(j){return j}:decodeURIComponent;return(a=new RegExp("(?:^|; )"+encodeURIComponent(e)+"=([^;]*)").exec(document.cookie))?g(a[1]):null};function css_browser_selector(p){var a=p.toLowerCase(),j=function(b){return a.indexOf(b)>-1},k="gecko",n="webkit",q="safari",d="opera",e="mobile",f=document.documentElement,l=[(!(/opera|webtv/i.test(a))&&/msie\s(\d)/.test(a))?("ie ie"+RegExp.$1):j("firefox/2")?k+" ff2":j("firefox/3.5")?k+" ff3 ff3_5":j("firefox/3.6")?k+" ff3 ff3_6":j("firefox/3")?k+" ff3":j("gecko/")?k:j("opera")?d+(/version\/(\d+)/.test(a)?" "+d+RegExp.$1:(/opera(\s|\/)(\d+)/.test(a)?" "+d+RegExp.$2:"")):j("konqueror")?"konqueror":j("blackberry")?e+" blackberry":j("android")?e+" android":j("chrome")?n+" chrome":j("iron")?n+" iron":j("applewebkit/")?n+" "+q+(/version\/(\d+)/.test(a)?" "+q+RegExp.$1:""):j("mozilla/")?k:"",j("j2me")?e+" j2me":j("iphone")?e+" iphone":j("ipod")?e+" ipod":j("ipad")?e+" ipad":j("mac")?"mac":j("darwin")?"mac":j("webtv")?"webtv":j("win")?"win"+(j("windows nt 6.0")?" vista":""):j("freebsd")?"freebsd":(j("x11")||j("linux"))?"linux":"","js"];c=l.join(" ");f.className+=" "+c;return c}css_browser_selector(navigator.userAgent);var NP=NP||{};(function(a){NP.ImageComparison=Class.extend({options:{wrapperClass:"imageComparisonWrapper",beforeSelector:".before",afterSelector:".after",animate:true,addStyles:false},init:function(d,b){this.options=a.extend({},this.options,d);this.container=a(b);if(!a(".imagecomparison").length){return}this.before=this.container.find(this.options.beforeSelector);this.after=this.container.find(this.options.afterSelector);if(this.before==0||this.after.length==0){return}this.beforeImg=this.before.find("img");this.afterImg=this.after.find("img");if(this.beforeImg==0||this.afterImg==0){return}this.setup();this.imagecontainer=this.container.find(".imagecompImages");this.imagecontainer.bind("mousemove",this.mouseMoveEvent.bind(this))},setup:function(){var b=this;this.container.append('<div class="splitter"></div>');this.splitter=this.container.find(".splitter");this.width=this.beforeImg.width();this.height=this.beforeImg.height();this.container.css("height",this.height);this.splitter.css("height",this.height);this.container.css("width",this.width);this.container.addClass(this.options.wrapperClass);this.container.append('<p class="buttons"><a class="first fw-buttonPrimary"><span>Før</span></a><a class="last fw-buttonPrimary"><span>Etter</span></a></p>');this.buttoncontainer=this.container.find(".buttons");this.buttoncontainer.css("padding-top",this.height+7);this.buttoncontainer.find(".first").click(function(d){b.showFirst()});this.buttoncontainer.find(".last").click(function(d){b.showLast()})},mouseMoveEvent:function(d){var b=d.pageX-this.container.offset().left;this.goTo(b)},goTo:function(d){var e=(d=="last"||d=="first")?true:false;var b=this.width-this.splitter.width();if(d<0){d=0}if(d>b){d=b}this.splitter.css("left",d);this.before.css("width",d)},showFirst:function(){var b=this.width-this.splitter.width();this.splitter.css("left",b);this.before.css("width",b)},showLast:function(){this.splitter.css("left",0);this.before.css("width",0)}});a.plugin("imagecomparison",NP.ImageComparison)}(jQuery));
