var ToolTip = {
	init: function()
	{
		$$('a.question').each(function(el){
			el.observe('mouseover', this.show_tooltip);
			el.observe('mouseout', this.hide_tooltip);
		}.bind(this));
	},
	show_tooltip: function()
	{
		var link = this;
		var par = link.parentNode;
		var tooltip = null;
		
		if ((tooltip = $(par).select('.info_box').first()) != null) {
			xy = link.positionedOffset();
			offset = link.getDimensions();
			tooltip.setStyle({top: (xy.top - 35 + 'px'), left: (xy.left + offset.width + 'px')});
			tooltip.show();
		}
		else if ((tooltip = $(par).select('.info_box_gauche').first()) != null) {
			xy = link.positionedOffset();
			offset = link.getDimensions();
			tooltip.setStyle({top: (xy.top - 35 + 'px'), left: (xy.left -  parseInt(tooltip.getStyle("width")) + 'px')});
			tooltip.show();
		}
		
		/* si IE6 on cache les select */
		if(Prototype.Browser.IE && parseInt(navigator.userAgent.substring (navigator.userAgent.indexOf("MSIE")+5)) == 6 )
		{
			$$('select').each(function(elem){
					elem.lastDisplay = elem.getStyle ('visibility');
					elem.setStyle ({visibility: 'hidden'});
			});
		}
			
	},	
	
	hide_tooltip: function()
	{
		var link = this;
		var par = link.parentNode;
		var tooltip = $(par).select('.info_box').first();
		
		if (tooltip == null)
			tooltip = $(par).select('.info_box_gauche').first();
		
		if (tooltip != null)
			tooltip.hide();
			
		
		/* si IE6 on cache les select */
		if(Prototype.Browser.IE && parseInt(navigator.userAgent.substring (navigator.userAgent.indexOf("MSIE")+5)) == 6 )
		{
			$$('select').each(function(elem){
					elem.setStyle ({visibility: elem.lastDisplay});
			});
		}
	}
}
Event.observe(window, 'load', function(){ToolTip.init();});