function showPhoto(photo) {
	var grande = $('#photogalerie img');
	var petite = $('img', $(photo));
	grande.attr('src', '/uploads'+petite.attr('src').substring(5));
	grande.attr('alt', petite.attr('alt'));
	$('#photogalerie h1').html(petite.attr('title'));
	$('#photogalerie p').html(petite.attr('alt'));
	return false;
}

function galerieChangeType() {
	var type = $('#typeRech').val();
	if(type=='1') {
		$('#articleRech').show();
		$('#joueurRech').hide();
		$('#matchRech').hide();
	}
	else if(type=='2') {
		$('#articleRech').hide();
		$('#joueurRech').show();
		$('#matchRech').hide();
	}
	else if(type=='3') {
		$('#articleRech').hide();
		$('#joueurRech').hide();
		$('#matchRech').show();
	}
	else if(type=='') {
		document.location='?type=0';
	}
}

function galerieChangeArticle() {
	id=$('#articleRech').val();
	if(id!='') {
		document.location='?type=1&id='+id;
	}
}

function galerieChangeJoueur() {
	id=$('#joueurRech').val();
	if(id!='') {
		document.location='?type=2&id='+id;
	}
}

function galerieChangeMatch() {
	var id=$('#matchRech').val();
	if(id!='') {
		document.location='?type=3&id='+id;
	}
}

function initFiltreGalerie() {
	var locat = ''+document.location;
	var reg=new RegExp("type=([0-9]+)\&id=([0-9]+)\&?", "g");
	var tab=reg.exec(locat);
	if(tab!=null) {
		var selectUsed;
		var type = tab[1];
		$('#typeRech').val(type);
		if(type=='1') selectUsed = $('#articleRech');
		else if(type=='2') selectUsed = $('#joueurRech');
		else if(type=='3') selectUsed = $('#matchRech');
		selectUsed.show();
		selectUsed.val(tab[2]);
	}
}


