// JavaScript Document
function selectGalerie(id_galerie,page){
	if(id_galerie !='selected'){
		photos = ajax('afficheGalerie.php?id_galerie='+id_galerie+'&page='+page);
		document.getElementById('galerie').innerHTML = photos;
	}
}

function selectConcours(id_annee){
	concours = ajax('selectConcours.php?id_annee='+id_annee);
	document.getElementById('selectConcours').innerHTML = concours;
	challenge = ajax('afficheChallenge.php?id_annee='+id_annee);
	document.getElementById('classementChall').innerHTML = challenge;
}

function afficheConcours(id_concours,id_annee){
	concours = ajax('afficheConcours.php?id_concours='+id_concours+'&id_annee='+id_annee);
	document.getElementById('classement').innerHTML = concours;
	document.getElementById('classementChall').style.display='none';
}

function winLink(url){
	window.open(url);
}

function ajax(fichier)
{
	if(window.XMLHttpRequest){ // FIREFOX
          xhr_object = new XMLHttpRequest();
	}
     else if(window.ActiveXObject){ // IE
        try {
				xhr_object = new ActiveXObject("Msxml2.XMLHTTP");
		}
		catch (e) {
				xhr_object = new ActiveXObject("Microsoft.XMLHTTP");
		} 
	 }
     else
          return(false);
		  
     xhr_object.open("GET", fichier, false);
     xhr_object.send(null);
     if(xhr_object.readyState == 4) return(xhr_object.responseText);
     else return(false);
}
