$(document).ready(function(){
	
	//body ska vara minst screenHeight - (headHeight + footHeight)
	/*
	matchSize();
	$(window).resize(function(){
		matchSize();
	});
	
	bildspelsbilder = $("DIV.kdmp-bildspel IMG");
	if(bildspelsbilder.length>0){
		bildspelNext(0);
	}
	
	*/
	//alert("hej");
	$("H1").sifr(sifr);
	
});



var sifr = ({
				path: '/_SYSTEM/Site/Layout/Default/',
				font: 'erasdemi'
			});

var bildspelsbilder;
function bildspelNext(index){
	showix = index < bildspelsbilder.length ? index : 0;
	hideix = index > 0 ? index -1 : bildspelsbilder.length-1;
	nextix = index+1 < bildspelsbilder.length ? index+1 : 0;
	$(bildspelsbilder[hideix]).fadeOut(1000);
	$(bildspelsbilder[showix]).fadeIn(1000,function(){
		setTimeout(function(){
			bildspelNext(nextix);
		},2000);
	});
}

function matchSize(){
	if($("#body").outerHeight() != $(window).height() - ($("#head").outerHeight() + $("#foot").outerHeight())){
		$("#body DIV.content").css("min-height",
			$(window).height() - ($("#head").outerHeight() + $("#foot").outerHeight()) - 25
		);
	}
}
