function getAnchor() {
	var arr = window.location.href.split("#");
	
	if (arr.length > 1) {
		return arr[arr.length - 1];
	} else {
		return false;
	}
}

function handleBrowserResize() {
	$("div#footer").css({position:"static"});
	$("div#menu").css({position:"static"});
	
	if ($(window).height() > $("div#container").height()) {
		$("div#footer").css({position:"absolute", bottom:0, left:0});
		$("div#menu").css({position:"absolute", bottom:$("div#footer").height(), left:0});
	}
}

function handleMosaiqueResize() {
	$("div#content").height(
		$(this).height() - $("div#header").height() - $("div#menu").height() - $("div#footer").height()
	);
}

function initVoxPop() {
	$("p.warning").hide();
	
	$("input[type!=text]").change(function() {
		if ($(this).attr("checked")) {
			$(this).parent().find("input.text").focus();
		} else {
			$(this).parent().find("input.text").val("");
		}
	});
	
	$("input[type=text]").click(function() {
		$(this).parent().find("input[type!=text]").attr("checked", "checked");
		return false;
	});
	
	$("p.continuer a").click(goToNextQuestion);
	
	$("div.question").hide();
	$("div.question:eq(" + activeQuestion + ")").show();
}
		
function goToNextQuestion() {
	var nextQuestion = activeQuestion + 1;
	
	if (!$("div.question:eq(" + activeQuestion + "):has(input:checked)").length) {
		$("p.warning").show(250);
		
		return false;
	} else {
		$("p.warning").hide();
	}
	
	$("div.question:eq(" + activeQuestion + ")").fadeOut(250);
	
	activeQuestion++;
	
	$("div.question:eq(" + activeQuestion + ")").delay(250).fadeIn(250);
	
	if (activeQuestion + 1 >= totalQuestion) {
		$(this).hide();
	}
	
	return false;
}