﻿$(document).ready(function(){
	
	var hauteurtotale = 660;

	//Connaitre la hauteur de son ecran
	function getClientHeight () {
		if(jQuery.browser.msie) {
			return document.documentElement.offsetHeight;
		}
		else
		return window.innerHeight;
	}

	var hauteurEcran = getClientHeight();
	
	if(hauteurEcran < hauteurtotale) {
		$('#bgblack').height(hauteurtotale);
	} else {
		$('#bgblack').height(hauteurEcran);
	}
	
	$("#regl").click(function () {
		if($.browser.msie && jQuery.browser.version<7){
			$("#dateCar").fadeOut("fast");
		}
		$("#bgblack").fadeIn("slow");
		$("#popregl").fadeIn("slow");

	});
	
	$("#regl2").click(function () {
		if($.browser.msie && jQuery.browser.version<7){
			$("#dateCar").fadeOut("fast");
		}
		$("#bgblack").fadeIn("slow");
		$("#popregl").fadeIn("slow");

	});


	$("#closeRegl").click(function () {

		
		if($.browser.msie && jQuery.browser.version<7){
			$("#bgblack").fadeOut("slow"); 
			$("#popregl").fadeOut("slow", function(){$("#dateCar").fadeIn("fast")});
		}
		else {
			$("#bgblack").fadeOut("slow"); 
			$("#popregl").fadeOut("slow");
		}
	});

	
	$("#credits").click(function () {
		$("#bgblack").fadeIn("slow");
		$("#popcredits").fadeIn("slow");
	});

	$("#closeCredits").click(function () {
		$("#bgblack").fadeOut("slow");
		$("#popcredits").fadeOut("slow");
	});
	

	$("#clerror").click(function () {
		$("#poperror").fadeOut("slow");
	});
	
	
	
	

});

