var timeout    = 500;
var closetimer = 50;
var ddmenuitem = 0;

function ddmenu_open(){
	ddmenu_canceltimer();
	   ddmenu_close();
	   ddmenuitem = $(this).find('ul').css('visibility', 'visible');
}

function ddmenu_close(){
	if(ddmenuitem) ddmenuitem.css('visibility', 'hidden');
}

function ddmenu_timer(){
	closetimer = window.setTimeout(ddmenu_close, timeout);
}

function ddmenu_canceltimer(){
	if(closetimer){
		window.clearTimeout(closetimer);
			closetimer = null;
}}
 
$(document).ready(function(){
	//$('#menu_haut UL LI:first SPAN').addClass('first');
	//$('#menu_haut UL LI:last SPAN').addClass('last');
	// $('#menu_haut > UL > li').bind('mouseover', ddmenu_open)
	// $('#menu_haut > UL > li').bind('mouseout',  ddmenu_timer)
});

$(document).ready(function(){
//	$('a[title]').qtip({ style: { name: 'cream', tip: true } })
	$('.detail').qtip({
		style: { 
			width: 300,
			padding: 5,
			background: '#622181',
			color: 'white',
			fontWeight: 'bold',
			fontSize:'10pt',
			textAlign: 'center',
			border: {
			 width: 7,
			 radius: 5,
			 color: '#622181'
			},
			
			tip: 'topMiddle',
			name: 'dark' // Inherit the rest of the attributes from the preset dark style
		},
		content: { text:false, prerender: true},
   		position: {corner: {target: 'bottomMiddle', tooltip: 'topMiddle'}},
	   show: 'mouseover',
	   hide: 'mouseout'
	});
	
});

	document.onclick = ddmenu_close;



