// JavaScript Document

	var screenWidth = $(window).width();
	var screenHeight = $(window).height();
	var isLoaded = Array();
	var isVisible = 0;
	
function screenInit() {
	screenWidth = $(window).width();
	screenHeight = $(window).height();
	//$('div#text').css({'width': screenWidth+'px', 'height': screenWidth+'px'});
	$('body').css({'width': screenWidth+'px', 'height': screenWidth+'px'});	
};
	

function loadContents(id){
	if (isLoaded[id] != 1) {
		$.ajax({ 
			url: 'contents/'+id+'.php', 
			type: "GET", 
			cache: false, 
			success: function(data) { 
				$('div.screen#'+id).append(data);
			} 
		}); 
		isLoaded[id] = 1;
	}
	
}

function menuShow(choice){
	if (choice == 1) { // visa menyn
		if (isVisible != 1) {
			// menyn syns inte, ta fram den
			$('div.menu').slideDown('2000');
			isVisible = 1;
		} 
	}
	if (choice == 0) { // dölj menyn
		if (isVisible == 1) {
			// menyn syns, göm den
			$('div.menu').slideUp('2000');
			isVisible = 0;
		} 
	}
	
}



$(document).ready(function() {
	
	// att fixa när sidan laddats
	screenInit();
	$("a.expand").fancybox({'titleShow' : false, 'overlayOpacity': 1, 'overlayColor': '#000'	});
	$('ul#slider').bxSlider({ infiniteLoop: false, displaySlideQty: 5, moveSlideQty: 5	}); 

});




$(window).resize(function() {
		  
	// om webbläsaren ändrar storlek					  
    screenInit();

});


	
