$(document).ready(function(){	
/* defined list hide function */
	$("dd").not(".open").each(function () { 
		$(this).removeClass("show").css("display","none");
	});
/*	$("dl").each( function(){
		$(this).children("dt:first").addClass("activ");
		$(this).children("dd:first").css("display","block");;
	});*/
	
	$("dl dt").click(function(){
		if($(this).next("dd").css('display')=="none"){
			$(this).parent().children("dt").each(function () {
				$(this).removeClass("activ");
			});
			$(this).addClass("activ");
			$(this).parent().children("dd").each(function () {
				$(this).slideUp();
			});
			$(this).next("dd").slideDown();
		}
		else $(this).next("dd").slideUp();
	});
	
/*block hider*/

	$("#hideBlock").css("display","none").before($('<span class="link">Les mer</span>').click(function(){
		$("#hideBlock").css("display","block");
		$(this).remove();
	}));

/* hvem_er_vi */
	
	$(".ressurs").css("display","none");
	$(".hvem_er_vi a:first").addClass("meny_active");
	$(".hvem_er_vi a").click(function(){
		$(".ressurs").slideUp();
		$('#'+$(this).attr("rel")).slideDown();
		$(".hvem_er_vi a").removeClass("meny_active");
		$(this).addClass("meny_active");
		return false;
	});
	$(".ressurs:first").slideDown();
	
	
	

/* footerfixer 
	$("#footer").css("top",(document.getElementById('hele').offsetHeight-$("#footer").css("height")-$("#footer").css("border-bottom-width"))+"px");
});

/* våre ressurser imagechange */

	$(".ressursBilde .linker").hover(function(){
		$(this).parent().parent().children(".profil").slideDown("slow");
		$(this).children("a").css("opacity","0.4").hover(function(){
			if($(this).attr("href")!=''){
				$(this).parent().children("a").removeClass("glass");
				$(this).addClass("glass");
				x = $(this).parent().parent().parent().children(".profil");
				x.children("img").attr("src",$(this).attr("href"))
				x.children(".navn").html($(this).attr("navn"));
				x.children(".jobb").html($(this).attr("jobb"));
				x.children(".tlf").html("tlf: "+$(this).attr("tlf"));
			}
		});
	});

	$(".ressurs a").click(function(){
		return false;
	});
});