
$(function()
{var self=this;this.top=$('#section-top');this.top.find('.toggle-drawer').eq(0).click(function(e)
{(e.preventDefault)?e.preventDefault():e.returnValue=false;var toggler=$(this);if(!self.top.is(':animated'))
{var expanded=(self.top.height()==71)?true:false,toHeight=(expanded)?34:71,animDuration=(expanded)?250:100,togglerText=(expanded)?'Logg inn':'Lukk';self.top.animate({height:toHeight+'px'},{duration:animDuration,complete:function()
{$(this).find('.c').toggleClass('expanded collapsed');toggler.find('.text').text(togglerText);}});self.top.find('.categories').animate({paddingTop:(expanded)?15:25+'px'},animDuration);}});});$(function()
{if($.browser.msie)
{$('#main-menu > li').mouseenter(function()
{$(this).addClass('hover');}).mouseleave(function()
{$(this).removeClass('hover');});}
if($.browser.opera||$.browser.msie)
{var self=this;this.listWidth=[0,0,0,0];$('#main-menu .sub').each(function(i)
{var listWidth=0;$(this).find('li a').each(function()
{var anchorWidth=$(this).width();if(anchorWidth>self.listWidth[i])
self.listWidth[i]=anchorWidth;}).css('width',self.listWidth[i]+'px').find('span').css('width',self.listWidth[i]+'px').end().find('li').css('width',self.listWidth[i]+'px').end().css('width',self.listWidth[i]+'px');});}
$('#form-178').find('li').each(function(i)
{var oddeven=(i%2==0)?'odd':'even';if(i<6)
$(this).addClass('text half '+oddeven);else if(i==6)
$(this).addClass('text '+oddeven);});});$(function()
{var wrap=$('.side-news'),artCount=wrap.find('.art').length,scrollLength=84,scrollSpeed=250,limitUp=0,limitDown=(artCount-1)*scrollLength*-1;if(artCount>1)
{$('<span>',{'class':'controls rel hid'}).appendTo(wrap.find('h2'));$('<a>',{'class':'up abs hid clear hide','href':'#','click':function(e)
{(e.preventDefault)?e.preventDefault():e.returnValue=false;var scroller=wrap.find('.arts'),scrollerTop=$(scroller).css('top').replace(/px/gi,'');if(scrollerTop<limitUp&&!scroller.is(':animated'))
{scroller.animate({top:(parseInt(scrollerTop)+scrollLength)+'px'},{duration:scrollSpeed,complete:function()
{var scrollerTop=wrap.find('.arts').css('top').replace(/px/gi,'');if(scrollerTop==limitUp)
$(e.target).addClass('hide');$(e.target).siblings().removeClass('hide');}});}}}).appendTo(wrap.find('.controls'));$('<a>',{'class':'down abs hid clear','href':'#','click':function(e)
{(e.preventDefault)?e.preventDefault():e.returnValue=false;var scroller=wrap.find('.arts'),scrollerTop=$(scroller).css('top').replace(/px/gi,'');if(scrollerTop>limitDown&&!scroller.is(':animated'))
{scroller.animate({top:(parseInt(scrollerTop)-scrollLength)+'px'},{duration:scrollSpeed,complete:function()
{var scrollerTop=wrap.find('.arts').css('top').replace(/px/gi,'');if(scrollerTop==limitDown)
$(e.target).addClass('hide');$(e.target).siblings().removeClass('hide');}});}}}).appendTo(wrap.find('.controls'));wrap.find('.arts').css('height',(scrollLength*artCount)+'px').toggleClass('rel abs bottom').wrap('<div class="scroll-area bottom rel hid clear" />').find('.art').css('height','64px');}});