$(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").first().before($('<span class="link">Les mer</span>').click(function(){
		$(".hideBlock").css("display","block");
		$(this).remove();
	}));

/* hvem_er_vi */
	
	$(".ressurs").css("display","none");
	$(".ressurs").slideDown();
	
	$(".bildeRessurs div").live("click",function(){
	$(this).parent().parent().children("div.profil").html($(this).html());
	});
	

/* footerfixer 
	$("#footer").css("top",(document.getElementById('hele').offsetHeight-$("#footer").css("height")-$("#footer").css("border-bottom-width"))+"px");
});

/* våre ressurser imagechange */

	$("#medarbeidere").css("display","none");
	$(".ressursBilde").after('<div class="profil"><img/><span class="navn"></span><div class="text"></div>')
	$(".ressursBilde .linker").hover(function(){
		$(this).parent().parent().children(".profil").slideDown("slow");
		$(this).children("a").css("opacity","0.4");
	});
	$(".ressursBilde .linker a").hover(function(){
			if($(this).attr("tall")!=''){
				$(this).parent().children("a").removeClass("glass");
				$(this).addClass("glass");
				source = $("#medarbeidere li").eq($(this).attr("tall"));
				x = $(this).parent().parent().parent().children(".profil");
				x.children("img").attr("src",source.children("img").attr("src"));
				x.children(".navn").html(source.children("h3").html());
				x.children(".text").html(source.children("p").html());
			}
		});

	$(".ressurs a").click(function(){
		return false;
	});
});
