function voir_realisation(idBoix){	
		var elem_boix=document.getElementById('info_' + idBoix);
		if(elem_boix.style.display=="none"){
		var boix = new OpacityTween(elem_boix,OpacityTween.regularEaseIn,0,100,0.2,'px');    
		boix.onMotionStarted = function(){elem_boix.style.display="block";}
		boix.start();		
		elem_boix.style.display="block";
		}else{		
		var boix = new OpacityTween(elem_boix,OpacityTween.regularEaseIn,100,0,0.2,'px');  
		boix.start();	
		boix.onMotionFinished = function(){elem_boix.style.display="none";};
		}
		//if(direction=='left'){direction='right';}else{direction='left';}
}function voir_realisation_avec_effet_mouvement(idBoix){
		var elem_boix=document.getElementById('info_' + idBoix).style;
		if(document.getElementById('info_'+idBoix).style.top=="1000px"){
		var boix = new Tween(elem_boix,'top',Tween.regularEaseOut,500,0,2,'px');    
		boix.start();		
		}else{	
		var boix = new Tween(elem_boix,'left',Tween.regularEaseOut,0,1000,2,'px');  
		boix.start();	
		boix.onMotionFinished = function(){document.getElementById('info_' + idBoix).style.left="0px";document.getElementById('info_' + idBoix).style.top="1000px";};
		}
		//if(direction=='left'){direction='right';}else{direction='left';}
}
function voir_realisationz(id){
	if(document.getElementById('info_'+id).style.top=="1000px"){
	document.getElementById('info_'+id).style.top=0;
	}else{
	document.getElementById('info_'+id).style.top="1000px";
	}
}
function moisplus(){
	mois=mois+1;
	if(mois==13){
	mois=1;
	annee=annee+1;
	}
	var xhr=getXhr();
	xhr.onreadystatechange= function(){
		if(xhr.readyState==4 && xhr.status==200){
		var tablo=xhr.responseText; 
		var xx=tablo.split('-_-');  
	document.getElementById('calendrier_dynamique').innerHTML=xx[0];   
	document.getElementById('calendar_div').innerHTML=xx[1];  
		}
	}	
	xhr.open("POST","agenda/traitement.php",true);
	xhr.setRequestHeader('Content-Type','application/x-www-form-urlencoded');
	xhr.send("changer_mois=changer_mois&mois_a_afficher="+mois+"&annee="+annee); 
}
function moismoins(){	
	mois=mois-1;
	if(mois==0){
	mois=12;
	annee=annee-1;
	}
	var xhr=getXhr();
	xhr.onreadystatechange= function(){
		if(xhr.readyState==4 && xhr.status==200){
		var tablo=xhr.responseText; 
		var xx=tablo.split('-_-');  
	document.getElementById('calendrier_dynamique').innerHTML=xx[0];   
	document.getElementById('calendar_div').innerHTML=xx[1];   
		}
	}	
	xhr.open("POST","agenda/traitement.php",true);
	xhr.setRequestHeader('Content-Type','application/x-www-form-urlencoded');
	xhr.send("changer_mois=changer_mois&mois_a_afficher="+mois+"&annee="+annee); 
}
var precedent_jour=0; 
function showXX(a_afficher){ 
	if(document.getElementById("ajout_form_"+a_afficher).style.display=='none'){
	document.getElementById("ajout_form_"+precedent_jour).style.display='none' ;  
	document.getElementById("ajout_form_"+a_afficher).style.display='block' ; 
	} 
	precedent_jour=a_afficher;
}

function showXX2(show_X){ 
	if(document.getElementById("jour_"+show_X).style.display=='block'){
	document.getElementById("ajout_form_"+show_X).style.display='none' ; 
	document.getElementById("jour_"+show_X).style.display='none' ; 
	}else{
	document.getElementById("ajout_form_"+show_X).style.display='block'; 
	document.getElementById("jour_"+show_X).style.display='block'; 
	document.getElementById("ajout_form_"+show_X).style.visibility='visible'; 
	document.getElementById("jour_"+show_X).style.visibility='visible'; 
	}	
	if(precedent_jour!="" && precedent_jour!="jour_"+show_X){
	document.getElementById("ajout_form_"+precedent_jour).style.display='none' ; 
	document.getElementById("jour_"+precedent_jour).style.display='none' ; 
	} 
	precedent_jour=show_X;
}	
function ajouter_aux_favoris() {
if ( navigator.appName != 'Microsoft Internet Explorer' )
{ window.sidebar.addPanel("Création Site Internet : Too-Web.fr","http://www.Too-Web.fr",""); }
else { window.external.AddFavorite("http://www.Too-Web.fr","Création Site Internet : Too-Web.fr"); } 
}
//CONTACT//
function formulaire_de_contact(){
	document.getElementById('contacter').innerHTML="<strong>Veuillez patienter pendant l'envoi du mail..</strong>"; 
	var contact_commune=document.getElementById('contact_commune').value;
	var contact_nom=document.getElementById('contact_nom').value;
	var contact_from=document.getElementById('contact_from').value;
	var contact_txtmsg=document.getElementById('contact_txtmsg').value; 
	var contact_fonction=document.getElementById('contact_fonction').value; 
	var contact_portable=document.getElementById('contact_portable').value; 
	var xhr=getXhr();    
	if(contact_from=="" || contact_nom=="" || contact_txtmsg=="" || contact_portable==""){
		document.getElementById('contacter').innerHTML="";
		alert("Erreur: Le formulaire n'a pas ete envoye, veuillez verifier le champs email.");
	}else{
		xhr.onreadystatechange= function(){
		if(xhr.readyState==4 && xhr.status==200){   
			document.location.href="merci.php"; 
		}
		}  
	xhr.open("POST","traitement.php",true); 
	xhr.setRequestHeader('Content-Type','application/x-www-form-urlencoded'); 
	xhr.send("formulaire_de_contact=formulaire_de_contact&contact_nom="+contact_nom+"&contact_commune="+contact_commune+"&contact_fonction="+contact_fonction+"&contact_portable="+contact_portable+"&contact_from="+contact_from+"&contact_txtmsg="+contact_txtmsg); 
	}	 
}

/**************************************************
	LA FONCTION AJAX !! NE PAS TOUCHER MERCI
**************************************************/
function getXhr(){
	if(window.XMLHttpRequest){ //Firefox et autres
		xhr=new XMLHttpRequest();
	}
	else if(window.ActiveXObject){  // Internet Explorer
	try{
		xhr= new ActiveXObject("Msxml2.XMLHTTP");
		} catch (e){
		xhr = new ActiveXObject("Microsoft.XMLHTTP");
		}
	}else { //XMLHTTP request non suppor?par le navigatuer
		alert("Votre navigateur ne supporte pas les objets XMLHTTPRequest..");
		xhr=false;
	}
		return xhr;
}
/**************************************************
	AFFICHER / CACHER LES DIV DU CONTACT
**************************************************/ 	
function aff_faq(show_X){
	if(document.getElementById("off_puce_"+show_X).style.display=='none'){
	document.getElementById("on_puce_"+show_X).style.display='none'; 
	document.getElementById("off_puce_"+show_X).style.display='block'; 
	}else{
	document.getElementById("off_puce_"+show_X).style.display='none'; 
	document.getElementById("on_puce_"+show_X).style.display='block'; 
	}
}
function puce(show_X){
	if(document.getElementById("off_puce_"+show_X).style.display=='none'){
	document.getElementById("on_puce_"+show_X).style.display='none'; 
	document.getElementById("off_puce_"+show_X).style.display='block'; 
	}else{
	document.getElementById("off_puce_"+show_X).style.display='none'; 
	document.getElementById("on_puce_"+show_X).style.display='block'; 
	}
}		
function pucetitre(show_X){
	if(document.getElementById("off_pucetitre_"+show_X).style.display=='none'){
	document.getElementById("on_pucetitre_"+show_X).style.display='none'; 
	document.getElementById("off_pucetitre_"+show_X).style.display='block'; 
	}else{
	document.getElementById("off_pucetitre_"+show_X).style.display='none'; 
	document.getElementById("on_pucetitre_"+show_X).style.display='block'; 
	}
}	
function showX(show_X){
	if(document.getElementById(show_X).style.display=='none'){
	document.getElementById(show_X).style.display='block'; 
	document.getElementById(show_X).style.visibility='visible'; 
	}else{
	document.getElementById(show_X).style.display='none'; 
	}
}		
function hideX(hide_X){
document.getElementById(hide_X).style.display='none' ; 
} 
