//Liens double entree page Accueil
function Suite(div_cible){
	//alert(div_cible);
	var objet = document.getElementById(div_cible); // entre les deux ' tu mes le nom du div que tu veux faire apparaître !
	
	if(objet.style.display == "none" || !objet.style.display){
		
		//objet.innerHTML = "Ici le text que tu veux faire apparaître !";
		objet.style.display = "block";
		//objet.style.overflow = "hidden"; 
		//lien.innerHTML = "-";
       
        var hFinal      =     100;  //Hauteur finale (la hauteur une fois que ça aura fini de déplier !)
        var hActuel     =     0;	 	//Hauteur initiale (la hauteur dès le début !)
       
        var timer;
        var fct =        function ()
        {
                hActuel  +=       20;     //Augmente la hauteur de 20px (tu peux modifier) tous les 40ms !
				
                objet.style.height     =	 hActuel      +     'px';
				
                if( hActuel > hFinal)
                {
                        clearInterval(timer);   //Arrête le timer
                        //objet.style.overflow    =   'inherit';
                }
        };
        fct();

        
		timer = setInterval(fct,40);    //Toute les 40 ms
		
	}else if(objet.style.display == "block"){
		
		var hFinal      =     0;  //Hauteur finale (la hauteur une fois que ça aura fini de déplier !)
        var hActuel     =     100;	 	//Hauteur initiale (la hauteur dès le début !)
       
        var timer;
        var fct =        function ()
        {
                hActuel  -=   20;     //Augmente la hauteur de -20px (tu peux modifier) tous les 40ms !
				//alert(hActuel);
                objet.style.height     =	 hActuel      +     'px';
				
                if( hActuel == hFinal)
                {
                        clearInterval(timer);   //Arrête le timer
                        //objet.style.overflow    =   'inherit';
						objet.style.display     =   "none";
                }
        };
        fct();

        
		timer = setInterval(fct,40);    //Toute les 40 ms
		

		//lien.innerHTML = "+";
		
	}
}



function getXhr(){
	var xhr = null; 
	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 { // XMLHttpRequest non supporté par le navigateur 
	   alert("Votre navigateur ne supporte pas les objets XMLHTTPRequest..."); 
	   xhr = false; 
	} 
					return xhr
}
			
/**
* Méthode qui sera appelée sur le click du bouton
*/
function go(){
	var xhr = getXhr()
	// On défini ce qu'on va faire quand on aura la réponse
	xhr.onreadystatechange = function(){
		// On ne fait quelque chose que si on a tout reçu et que le serveur est ok
		if(xhr.readyState == 4 && xhr.status == 200){
				alert(xhr.responseText);
			}
	}
	xhr.open("POST","principal/validation_inscription.php",true);
	xhr.send(null);
}


function verif_login(){
	var ajax = new Ajax(url, { 
		update: reponse_validation,
		method: 'post',
		onComplete: function() {
			// when complete, we remove the spinner
			log.removeClass('ajax-loading'); 
		},
		onCancel: function() {
			// when we stop timed ajax while it's requesting
			// we forse to cancel the request, so here we
			// just remove the spinner
			log.removeClass('ajax-loading'); 
		}
	});
}

//Agrandissement Image au Survol
function agrandirimage(img){
//alert(img.src);
//img.style.zIndex='99';
//alert(img.style.position);
img.style.position='relative';
img.style.top='0px';
img.style.left='0px';
//img.style.border='2px solid white';
img.src='images/photoscadre/zoom_ap_victor.jpg';
}
function reduireimage(img){
//img.style.display='none'
img.style.position='';
img.style.top='';
img.style.left='';
img.style.border='';
img.src='images/photoscadre/ap_victor.gif';
}





window.addEvent('domready', function() {
	var list = $$('#test_zoom img');
	list.each(function(element) {
	 
		var fx = new Fx.Styles(element, {duration:200, wait:false});
	 
		element.addEvent('mouseenter', function(){
			fx.start({
				'margin-left': 5,
				'background-color': '#666',
				color: '#ff8'
			});
		});
	 
		element.addEvent('mouseleave', function(){
			fx.start({
				'margin-left': 0,
				'background-color': '#333',
				'color': '#888'
			});
		});
	 
	});
});