$(document).ready(function() {
						   
	jQuery.each($("#footer ul li.title a"),function() {
				
		title =  $(this).attr("title");
		lang =  $(this).attr("lang");
		$("#footer").before( '<div class="nicetitle '+lang+'">'+title+'</div>' );
				
	});
	
	jQuery.each($("#footer ul li.title a"),function() {
		$(this).mouseover(function(){
								   
			position = $(this).findPos();
			posy = position.y;
			posx = position.x;
				
			lang =  $(this).attr("lang");
			
			if( lang=="he" || lang=="ar" ){
				$(".nicetitle").hide();				   
				$('.'+lang).show();
				
				$(".nicetitle").css({
					left: posx - 300,
					top:posy-40,
					height:18
				})
			}
			
		});	
		
		$(this).mouseout(function(){
				$(".nicetitle").hide();				   
		});	
								   
	});
	
});

//extension jquery pour position d'un element
jQuery.fn.extend({
   findPos : function() {
       obj = $(this).get(0);
       var curleft = obj.offsetLeft || 0;
       var curtop = obj.offsetTop || 0;
       while (obj = obj.offsetParent) {
                curleft += obj.offsetLeft
                curtop += obj.offsetTop
       }
       return {x:curleft,y:curtop};
   }
});