///============================= EFFET INTERFACE DU PUBLIPACK ============================ 



// Ouvre et ferme ID  (utiliser pour admin formu d'ajout)
function open_close(id){
	new Effect.toggle(id,'BLIND',{duration:0.7}); return false;
}


// Change le contenu d'un ID par un autre (txtDebut par txtRemplace)
var countCI = 0;
function changeIntitule(id,txtDebut,txtRemplace){
	if(countCI == 0){
		countCI = 1;
		document.getElementById(id).innerHTML = txtRemplace;
	}
	else{
		countCI = 0;
		document.getElementById(id).innerHTML = txtDebut;
	}
}



// Monte et baisse la barre admin du haut
var countBa1 = 0;
function BarreAdminMove(id)
{
	if(countBa1 == 0){
		countBa1 = 1;
	new Effect.MoveBy(id, -22, 0, {duration:1, fps:25, from:0.0, to:1.0});
	}
	else{
		countBa1 = 0;
	new Effect.MoveBy(id, 22, 0, {duration:1, fps:25, from:0.0, to:1.0});
	alert();
	}
}

//fx focus
function focuspocus(id,color1,color2){
	new Effect.Highlight(id, {duration:0.3, fps:25, from:0.0, to:1, startcolor:color1, endcolor:color2, restorecolor:color2});
}
function focuspocus_off(id,color1,color2){
	new Effect.Highlight(id, {duration:0.3, fps:25, from:0.0, to:1, startcolor:color1, endcolor:color2, restorecolor:color2});
}



// Monte et baisse le footer
var countFooter = 0;
function FooterUp(){

	 if (navigator.appName=="Microsoft Internet Explorer"){
		if(countFooter == 0){
			countFooter = 1;
		document.getElementById("footer").style.bottom = "0px"; return false;
		}
		else{
			countFooter = 0;
		document.getElementById("footer").style.bottom = "-60px"; return false;
		alert();
		}
	}
	
	else{
		if(countFooter == 0){
			countFooter = 1;
	new Effect.MoveBy('footer', -88, 0, {duration:1, fps:25, from:0.0, to:1.0});
		}
		else{
			countFooter = 0;
	new Effect.MoveBy('footer', 88, 0, {duration:1, fps:25, from:0.0, to:1.0});
		alert();
		}
	}

}


/////////////////////////////////////////////////////////
// ANIM DU MENU GAUCHE
	function displayGauche(){
		$('gauche').style.display = 'none';
	}
	
function animgauche(){
	new Effect.Appear('gauche', {delay:0.5,duration:0.5, fps:25, from:0.0, to:1.0});
	//new Effect.MoveBy('gauche', 0, 0, {delay:0.5,duration:0.5, fps:25, transition:Effect.Transitions.sinoidal, from:0.0, to:1.0});
	FlecheMenuGaucheRight();
}

function animgaucheDisp(){
	new Effect.Appear('gauche', {duration:0.5, fps:25, from:1.0, to:0.0});
	new Effect.BlindUp('gauche', {delay:0.5,duration:0, fps:25, from:0.0, to:1.0});
	//new Effect.MoveBy('gauche', 0, -190, {duration:0.5, fps:25, transition:Effect.Transitions.sinoidal, from:0.0, to:1.0});
	FlecheMenuGaucheLeft();
}


// affiche et désaffiche
var countGauche1 = 0;
function GaucheMove()
{
	if(countGauche1 == 0){
		countGauche1 = 1;
		animgaucheDisp();
	}
	else{
		countGauche1 = 0;
		animgauche();
	}
}


//fleche menu gauche
function FlecheMenuGaucheRight(){
	new Effect.Appear('gaucheMove', {delay:0.5,duration:0.5, fps:25, from:0.0, to:1.0});
	new Effect.MoveBy('gaucheMove', 0, 190, {delay:0.5,duration:0.2, fps:25, transition:Effect.Transitions.sinoidal, from:0.0, to:1.0});
}
function FlecheMenuGaucheLeft(){
	new Effect.MoveBy('gaucheMove', 0, -190, {duration:0.2, fps:25, transition:Effect.Transitions.sinoidal, from:0.0, to:1.0});
}
