
//Script for fancybox pop-up
$(document).ready(function() {
	
$(".info_small").fancybox({
 'width' : 300,
 'height' : 300,
 'autoScale': false,
 'type' : 'iframe'
 });

$(".qbPopup").fancybox({
 'width' : 300,
 'autoScale': true,
 'showCloseButton' : false,
 'title' : "Undersøkelse",
 'type' : 'iframe'
 });

$(".info_large").fancybox({
 'width' : 680,
 'height' : 330,
 'autoScale': false,
 'type' : 'iframe'
 });

$(".info_huge").fancybox({
 'width' : 800,
 'height' : 600,
 'autoScale': false,
 'type' : 'iframe',
 'scrolling' : 'auto'
 });
});

//Script for Spørsmål og svar, accordion
$(document).ready(function(){
	
	
$(".accordionList h3:first").addClass("active");
	$(".accordionList .mainField").hide();

	$(".accordionList h3").click(function(){
		$(this).next(".mainField").slideToggle("fast")
		.siblings(".mainField:visible").slideUp("fast");
		$(this).toggleClass("active");
		$(this).siblings("h3").removeClass("active");
	});

});

//Script for forbrukerinformasjon, accordion
/* 
$(document).ready(function(){	
$(".forbruker h1:first").addClass("active");
	$(".forbruker p").hide();

	$(".forbruker h1").click(function(){
		$(this).next("p").slideToggle("fast")
		.siblings("p:visible").slideUp("fast");
		$(this).toggleClass("active");
		$(this).siblings("h1").removeClass("active");
	});
});
*/

//Script for å "skjule" e-post adresser
function skipe(e, c) {
var b = "lto:"
var d = "@"
var a = "mai"
window.open(a + b + c + d + e) 
} 

//Equalhights
(function($) {
	$.fn.equalHeights = function(minHeight, maxHeight) {
		tallest = (minHeight) ? minHeight : 0;
		this.each(function() {
			if($(this).height() > tallest) {
				tallest = $(this).height();
			}
		});
		if((maxHeight) && tallest > maxHeight) tallest = maxHeight;
		return this.each(function() {
			$(this).height(tallest).css("overflow","auto");
		});
	}
})(jQuery);

$(document).ready(function() {
	$(".box1").equalHeights(170,300);
});

$(document).ready(function() {
	$(".news-box").equalHeights(170,300);
});
