function ouvrirMenuRes() {
	$('#menuResultats').slideDown("slow");
}

function fermerMenuRes() {
	$('#menuResultats').slideUp("slow");
}

function ouvrirDetailMatch(divAMontrer,bouton) {
	$(divAMontrer).show("slow");
}

function ouvrirDetailMatch(idDiv,idBouton) {
	$(idDiv).show("slow");
	$(idBouton).html("&nbsp;&nbsp;&nbsp;Fermer les d&eacute;tails&nbsp;&nbsp;&nbsp;");
	$(idBouton).attr("onClick",'javascript:fermerDetailMatch("'+idDiv+'","'+idBouton+'")');
}

function fermerDetailMatch(idDiv,idBouton) {
	$(idDiv).hide("slow");
	$(idBouton).html("&nbsp;&nbsp;&nbsp;D&eacute;tail des matchs&nbsp;&nbsp;&nbsp;");
	$(idBouton).attr("onClick",'javascript:ouvrirDetailMatch("'+idDiv+'","'+idBouton+'")');
}

function charger(bool) {
	if (bool) {
		$('#load').show();
	}else{
		$('#load').hide();
	}
}

function verifChaine(chaine) {
	if (trim(chaine)) {
		return false;
	}else{
		return true;
	}
}

function verifMail(mailteste) {
	var reg = new RegExp('^[a-z0-9]+([_|\.|-]{1}[a-z0-9]+)*@[a-z0-9]+([_|\.|-]{1}[a-z0-9]+)*[\.]{1}[a-z]{2,6}$', 'i');

	if(reg.test(mailteste))	{
		return(true);
	} else {
		return(false);
	}
}

function verifUrl(url) {
	var reg = new RegExp("^(http://|https://)");
	return (reg.exec(url)!=null);
}

function trim(str) {
	str = str.replace(/^\s*|\s*$/,"");
	if (str.length<=0) {
		return true;
	}else{
		return false;
	}
}

function changerCouleurLigne(obj,nb){
	if (nb==0) {
		obj.style.backgroundColor = "#454545";
	}else if (nb==1){
		obj.style.backgroundColor = "#353535";
	}else if (nb==2){
		obj.style.backgroundColor = "#353535";
	}
}

var lastId=null;

function afficherBox(id) {
	cacherBox(lastId);
	$("#contenuBox"+id).show("slow");
	$("#fleche"+id).attr("src",'styles/images/fleche_haut.png');
	$("#fleche"+id).attr("onClick",'cacherBox("'+id+'")');
	lastId = id;
}

function cacherBox(id) {
	$("#contenuBox"+id).hide();
	$("#fleche"+id).attr("src",'styles/images/fleche_bas.png');
	$("#fleche"+id).attr("onClick",'afficherBox("'+id+'")');
}
