function vote4me(id){
	if(!isNaN(id) && id>0)
	{
	BID = "uid";
	var URL = "/outils/vote4me.php?vid="+id;
	document.getElementById(BID).className="PhotosVote";
	document.getElementById(BID).style.display="block";
	loadXHR(URL,"GET",BID,new Array('display','HTML'));
	}
}

function GetEmptyVote(){
	document.getElementById(BID).className="";
	document.getElementById(BID).style.display="none";
	document.getElementById(BID).innerHTML="";
}

function checkUploadPhoto(){
// Selection de la race 
	if(_Elem('race').selectedIndex==0){
	alert(_textAlert['select_race']);
	FocusOn('race');
	return false;
	}

// Selection de l'image
	if(_Elem('photo').value==""){
	alert(_textAlert['select_image']);
	FocusOn('photo');
	return false;
	}	
	
// Verification a priori du format de l'image
	
	var extension = _Elem('photo').value.substring(_Elem('photo').value.lastIndexOf('.'),_Elem('photo').value.length);		
	if((extension.toLowerCase() !='.jpg')&&(extension.toLowerCase() !='.jpeg'))
	{
	_Elem('photo').style.backgroundColor="#e0e0e0";
	alert(_textAlert['textPePbImage']+extension.toLowerCase());
	return false;
	}

//	Verification du texte de complément.
	if(_Elem('texte').value.length<=5){
	alert(_textAlert['photo_content']);
	FocusOn('texte');
	return false;
	}	
			
// Envoi de l'image
	myForm = _Elem('pds');
	displayTmpIframe('_exec','uid','none');
	myForm.action = "/outils/UploadPhoto.php";
	myForm.target = "_exec";
//	myForm.target = "blank";
	myForm.submit();
}

function affichePhotoDexpo(id){
	BID = "uid";
	var URL = "/outils/affichePhotoDexpo.php?uid="+id;
	document.getElementById(BID).className="AffichePhotoDexpo";
	document.getElementById(BID).style.display="block";
		if(loadXHR(URL,"GET",BID,new Array('display','HTML'))=="XHRKO")
		{ // Le navigateur ne gere pas le XHR
		document.getElementById(BID).innerHTML="POET";
		}	
}

