var openId;

$(document).ready(function(){
	
	/* ============= NAV ============= */
	$("#nav .elite").mouseenter(function(){
		$("#nav .ouvert").stop(true, true).css("overflow", "hidden").animate({width:"111px"}, 240);
		$(this).css("overflow", "visible");
		$(this).animate({
			width: "510px"
		}, 600);
	});
	
	$("#nav .ouvert").mouseenter(function(){
		// helps to reset other menu
		$("#nav .elite").stop(true, true).css("overflow", "hidden").animate({width:"111px"}, 240);
		// makes the page hover (border top) visible
		$(this).css("overflow", "visible");
		// animates the menu "opening"
		$(this).animate({
			width: "510px"
		}, 600);
	});
	/* ============= NAV ============= */
	
	
	
	/* ============= HEBERGEMENT ============= */
	
	$('.liste_bloc .info').click(		
		function (e) {	
			// prevents a href click to be fired
			e.preventDefault();
			
			if(!$(this).parent().hasClass('on')){
				
				// close the open one
				if(openId != ''){
					$('#'+openId).find('.info span').html($('#heber-more').val());
					$('#'+openId).removeClass("on");
					$('#'+openId).children('.more').slideUp();
				}
				
				// grab id of clicked item
				openId = $(this).parent().attr("id");
				
				// changes the plus and minus symbol in the yellow box
				// $(this).children('span').css('line-height','15px').html('-');
				$(this).children('span').html('X');
				
				// adds a class to the box so it can be visible
				$(this).parent().addClass("on");
				// slides the extra info down
				$(this).parent().children('.more').slideDown();
			} else {
				/*$(this).children('span').css('line-height','18px').html('+');*/
				$(this).children('span').html($('#heber-more').val());
				$(this).parent().removeClass("on");
				$(this).parent().children('.more').slideUp();
			}
		}
	);
	
	/* ============= HEBERGEMENT ============= */	
});
	



