var _TimerCompteClient = null;
var _TimerPanierRapide = null;
var _Timer = null;

function $_(element){
	return document.getElementById(element);
}

function AffichePanierRapide(){
	CacheFormCompteClient();
	$('#PanierRapide').fadeIn('normal');
	KillTimerPanier();
	$_('FlechAccesPanier').innerHTML = "<img src='images/flech_login_haut.png' />";
}
function CachePanierRapide(){
	$('#PanierRapide').fadeOut('normal');
	$('#PanierRapide').slideUp('normal');
	$_('FlechAccesPanier').innerHTML = "<img src='images/flech_login_bas.png' />";
}

function AfficheFormCompteClient(){
		CachePanierRapide();
		$('#FormCompteClient').fadeIn('normal');
		$('#FormCompteClient').slideDown('normal');
		KillTimerMenuCompteClient();
		$_('FlechAccesCompteClient').innerHTML = "<img src='images/flech_login_haut.png' />";
}
function CacheFormCompteClient(){
	$('#FormCompteClient').fadeOut('normal');
	$('#FormCompteClient').slideUp('normal');
	$_('FlechAccesCompteClient').innerHTML = "<img src='images/flech_login_bas.png' />";
}

function KillTimerPanier(){
	if (_Timer){clearTimeout(_Timer)} 
}
function TimerPanier(){
	_Timer = setTimeout ("CachePanierRapide()", 600);
}


function KillTimerMenuCompteClient(){
	//alert ("fin lancement set timout");
	if (_TimerCompteClient){clearTimeout(_TimerCompteClient)} 
}

function TimerMenuCompteClient(){
	//alert ("lancement set timout");
	_TimerCompteClient = setTimeout ("CacheFormCompteClient()", 600);

}

function Affichage(retourajax,elementid){
	document.getElementById(elementid).innerHTML = retourajax;
}
function Affichage1(retourajax,elementid){
	document.getElementById(elementid).value = retourajax;
}
function Affichage3(retourajax,elementid){
	if (retourajax === '1'){window.location = './CaddieAffichage.html';}
}

function Affichage6(retourajax,elementid){
if (retourajax === "1"){
	alert ("Votre email à bien été inséré dans notre base! \n Vous recevrez prochainement les nouveautés du site ");
	}
}

function Modal_port(){
	tb_show('Frais de port', './calculport.php?width=515&height=365', null);
}
function Modal_image(image){
	tb_show('Esprit Discount | Photo', image, null);
}

function vide_champ(champ){
	$_(champ).value= "";
}
function ChangeInputToPassword(champ){
	$_(champ).type = "password";
	$_(champ).value = "";
}
function fn_recherche(){
	var data = $_('_recherche').value;
	window.location = "./index.php?page=_Recherche&q="+data;
}