function showExtra() {
	$(".subpage_extra").show();
	$(".subpage_extra").animate(
	{ left : '60em' //left : '12.7em'
	},
	{ duration : 250,
	  easing : 'swing'
	}
	);

}

function hideExtra() {
	$(".subpage_extra").animate(
	{ left : '0em' //left : '-60em'
	},
	{ duration : 250,
	  easing : 'swing'
	}
	);

}

function showPage() {
	
	$(".subpage_main").animate(
	{ left : '15.9em'
	},
	{ duration : 500,
	  easing : 'swing',
	  complete: function() {
      showExtra()
    }
	}

	);

}

function hidePage() {
	$(".subpage_main").animate(
	{ left : '-30em'
	},
	{ duration : 250,
	  easing : 'swing'
	}
	);

}

function setBackgroundSize() {
	$documentWidth = $(document).width().toString();
	$documentWidth = $documentWidth+'px';
	$(".startpage_cont").css({'background-size':$documentWidth+'px'});
}



$(document).ready(function() {
	
	//Control column height
	//$menuHeight = $(".menu_cont").height();
	$subMainHeight = $(".subpage_main").height();
	$subExtraHeight = $(".subpage_extra").height();
	/*
	if ($menuHeight > $subMainHeight) { 
	$(".subpage_main").css({'height' : $menuHeight});
	$(".subpage_cont").css({'height' : $menuHeight});
	}
	*/
	if ($subMainHeight > $subExtraHeight) {
	$(".subpage_extra").css({'height' : $subMainHeight});
	$(".subpage_cont").css({'height' : $subMainHeight});
	}
	
	else if ($subMainHeight < $subExtraHeight) {
	$subExtraHeight2 = $subExtraHeight + 100;
	$(".subpage_main").css({'height' : $subExtraHeight2});
	$(".subpage_cont").css({'height' : $subExtraHeight2});
	$(".subpage_extra").css({'height' : $subExtraHeight2});

	}

	
	showPage();
	
	
	/*Språkväljare*/
	$(".lang_select .lang_link").bind("mouseenter", function() {
	$startSrc = $(this).find('img').attr('src');
	$hoverSrc = $(this).attr('rel');
	$(this).find('img').attr('src',$hoverSrc);
		$(this).bind("mouseleave", function() {
		$(this).find('img').attr('src',$startSrc);
		});

	});
	
	
	/*Språk popup*/
	$(".lang_post").find(".lang_flag").find("img").hide();
	$(".lang_post").bind("mouseenter", function() {
	$(this).find(".lang_popup").fadeIn('fast');
	$(this).find(".lang_flag").find("img").show();
		$(this).bind("mouseleave", function() {
		$(this).find(".lang_popup").fadeOut('fast').addClass('active');
		$(this).find(".lang_flag").find("img").hide();
		});
	});



	
		
});



