function popup_lostpassword() {
	if ($('popup_lostpassword').style.display == "none")
	{
		$('lostpassword_clearsite').style.display = "block";
		$('lostpassword_clearsite').style.width = document.documentElement.scrollWidth + "px";
		if (document.documentElement.scrollHeight < document.documentElement.clientHeight)
		{
			$('lostpassword_clearsite').style.height = document.documentElement.clientHeight + "px";
		}
		else
		{
			$('lostpassword_clearsite').style.height = document.documentElement.scrollHeight + "px";
		}

		if ($('popup_lostpassword_confirm').style.display == "block")
		{
			$('popup_lostpassword_confirm').style.display = "none";
			$('popup_lostpassword_form').style.display = "block";
		}
		
		$('popup_lostpassword').style.display = "block";
	}
	else
	{
		$('lostpassword_clearsite').style.display = "none";
		$('popup_lostpassword').style.display = "none";
		$('lostpassword_clearsite').style.width = "0px";
		$('lostpassword_clearsite').style.height = "0px";
	}
}

function popup_lostpassword_confirm() {
	var mail = $('lostpassword_email').value;
	
	var req = new AJAX.Request(Request.get('basepath') + '/index/api_send_lost_password/' + mail + '/', {
		method : 'POST',
		asynchronous : true,
		parameters : [],
		json : true,
		onComplete : function(response)
		{
			if(response.responseJSON.result)
			{
				if ($('popup_lostpassword_confirm').style.display == "none")
				{
					$('popup_lostpassword_form').style.display = "none";
					$('popup_lostpassword_confirm').style.display = "block";
				}
			}
		}
	});
}

function englishSoon() {
	if ($('top_english_soon').style.display == "none")
	{
		$('top_english_soon').style.display = "block"
	}
	setTimeout(function() {$('top_english_soon').style.display = "none"}, 2500);
}

function setType(newItem,texte) 
{
	var txtValue = document.getElementById(newItem);
	if(!txtValue.value || txtValue.value == texte) {
		txtValue.value = "";
	}
}
function resetType(newItem,texte) 
{
	var txtValue = document.getElementById(newItem);
	if(!txtValue.value) {
		txtValue.value = texte;
	} 
}
