function plusdept(e){
	document.getElementById("dept").style.overflow="visible";
	document.getElementById("dept").style.height="auto";
	document.getElementById("dept").style.backgroundImage="none";
	e.style.display="none";
}
function plusville(e){
	document.getElementById("ville").style.overflow="visible";
	document.getElementById("ville").style.height="auto";
	document.getElementById("ville").style.backgroundImage="none";
	e.style.display="none";
}
function plusinfos(e){
	document.getElementById("bienvenue").style.overflow="visible";
	document.getElementById("bienvenue").style.height="auto";
	e.style.display="none";
	document.getElementById("bienvenue").style.backgroundPosition="bottom right";
}
function plusannoncesaccueil(e){
	document.getElementById("annoncesaccueil").style.overflow="visible";
	document.getElementById("annoncesaccueil").style.height="auto";
	e.style.display="none";
}
function plusannoncescateg(e){
	document.getElementById("annoncescateg").style.overflow="visible";
	document.getElementById("annoncescateg").style.height="auto";
	e.style.display="none";
}

function connexioncompte() {
	if ($F('emaillog')!="" && $F('passwordlog')!=""){
		$('bouttonconnexion').disabled=true;
		var url = './index.php?actionlog=logging&email='+$F('emaillog')+'&password='+$F('passwordlog');
		var myAjax = new Ajax.Request(url, {method: 'get', onComplete: gestionReponseconnexioncompte});
	}
}
function gestionReponseconnexioncompte(xhr){
	Modalbox.show('./modals/compte_nourrice.php', {title: 'Mon compte nourrice', width: 850});
}

function checkvilles(){
	if ($F('cp').length==5){
		var url = './modals/compte_nourrice.php?action=ajax&cp='+$F('cp');
		var myAjax = new Ajax.Request(
				url, 
				{
					method: 'get', 
					onComplete: checkvillesaffvilles
				});
	}else
		$('villeid').innerHTML ="<select name=villeid class=required><option value=''>-- Ce code postal n&acute;existe pas --</option></select>";
}
function checkvillesaffvilles(xhr){
    if (xhr.status == 200)
        $('villeid').innerHTML = xhr.responseText;
    else
        $('villeid').innerHTML = xhr.status;
}


function checkemail(){
	var url = './modals/inscription.php?action=ajax&email='+$F('email');
	var myAjax = new Ajax.Request(url, {
		method: 'get', 
		onComplete: docheckemail
	});
	return false;
}
function docheckemail(xhr){
    if (xhr.status == 200){
		if (xhr.responseText!="erreur")
			Modalbox.show('./modals/inscription.php', {title: 'compte nourrice validation', width: 850,params:Form.serialize('formuinfos')});
		else
			$('erreuremail').innerHTML = "Cette adresse email existe déjà sur france-nourrice, choisissez en une autre.";
	}
	return false;
       
}
	
