// JavaScript Document

function bgSelect() { /*fonction permettant d'avoir l'arrière plan de terrains de sports aléatoirement*/
	backgrounds = new Array();

	backgrounds[0] = new Array("img/border_bg/herbe_top.jpg", "img/border_bg/herbe_right.jpg", "img/border_bg/herbe_bas.jpg", "img/border_bg/herbe_left.jpg");

	backgrounds[1] = new Array("img/border_bg/glace_top.jpg", "img/border_bg/glace_right.jpg", "img/border_bg/glace_bas.jpg", "img/border_bg/glace_left.jpg");

	backgrounds[2] = new Array("img/border_bg/parquet_top.jpg", "img/border_bg/parquet_right.jpg", "img/border_bg/parquet_bas.jpg", "img/border_bg/parquet_left.jpg");

	backgrounds[3] = new Array("img/border_bg/sable_top.jpg", "img/border_bg/sable_right.jpg", "img/border_bg/sable_bas.jpg", "img/border_bg/sable_left.jpg");

	var test = Math.random();

	if (test > 0 && test <= 0.25) {
		document.getElementById("bg_top").src 		= backgrounds[0][0];
		document.getElementById("bg_right").src 	= backgrounds[0][1];
		document.getElementById("bg_bas").src 		= backgrounds[0][2];
		document.getElementById("bg_left").src 		= backgrounds[0][3];
	} else if (test > 0.25 && test <= 0.5) {
		document.getElementById("bg_top").src 		= backgrounds[1][0];
		document.getElementById("bg_right").src 	= backgrounds[1][1];
		document.getElementById("bg_bas").src 		= backgrounds[1][2];
		document.getElementById("bg_left").src 		= backgrounds[1][3];
	} else if (test > 0.5 && test <= 0.75) {
		document.getElementById("bg_top").src 		= backgrounds[2][0];
		document.getElementById("bg_right").src 	= backgrounds[2][1];
		document.getElementById("bg_bas").src 		= backgrounds[2][2];
		document.getElementById("bg_left").src 		= backgrounds[2][3];
	} else {
		document.getElementById("bg_top").src 		= backgrounds[3][0];
		document.getElementById("bg_right").src 	= backgrounds[3][1];
		document.getElementById("bg_bas").src 		= backgrounds[3][2];
		document.getElementById("bg_left").src 		= backgrounds[3][3];
	}
}

