Event.observe(window,'load',function(){
	var annuaire = new Annuaire();	
});


var Annuaire = Class.create({

	initialize: function() 
	{
    	this.description = $('more_description');
    	this.bloc = $('bloc_description');
    	this.state = true ;
    	this.affiche = "Tout afficher";
    	this.masque = "Masquer";
    	this.valueDefault = "200px";
    	this.valueEdit = 'auto';
    	this.init();
	},
	
	init: function()
	{
		var t = this ;
		if(this.description != undefined)
		Event.observe(this.description,'click',this.checkAffiche.bindAsEventListener(this));		
	},
	
	checkAffiche: function()
	{
		if(this.state)
		{
			this.description.update(this.masque) ;
			this.bloc.style.height = this.valueEdit ;
			this.state = false ;
		}
		else
		{
			this.description.update(this.affiche) ;
			this.bloc.style.height = this.valueDefault ;
			this.state = true ; 
		}	
		
	}
});

function addEngine(bool) 
{
	var win = new Window({	className: "alphacube",
						width:700, 
						url: "../popup/helpToolsBarre.php?redir="+bool,
						height:450, 
						destroyOnClose: true, 
						recenterAuto:false
					}); 
	win.showCenter(); 

	if($('proposeToolBar') != undefined && $('proposeToolBar') != null)
	{
		$('proposeToolBar').remove();

	}
	
	new Ajax.Request('ajax.php',
	{
		method:'get',
		parameters:'action=AjoutToolbar'
	});	

}

function notAddEngine()
{
	new Ajax.Request('ajax.php',
	{
		method:'get',
		parameters:'action=refuseAjoutToolbar'
	});
			
	if($('proposeToolBar') != undefined && $('proposeToolBar') != null)
	{
		$('proposeToolBar').remove();
	}	

}
