jQuery.fn.x = function(n) {
     var result = null;
     this.each(function() {
         var o = this;
         if (n === undefined) {
             var x = 0;
             if (o.offsetParent) {
                 while (o.offsetParent) {
                     x += o.offsetLeft;
                     o = o.offsetParent;
                 }
             }
             if (result === null) {
                 result = x;
             } else {
                 result = Math.min(result, x);
             }
         } else {
             o.style.left = n + 'px';
         }
     });
     return result;
};

jQuery.fn.y = function(n) {
     var result = null;
     this.each(function() {
         var o = this;
         if (n === undefined) {
             var y = 0;
             if (o.offsetParent) {
                 while (o.offsetParent) {
                     y += o.offsetTop;
                     o = o.offsetParent;
                 }
             }
             if (result === null) {
                 result = y;
             } else {
                 result = Math.min(result, y);
             }
         } else {
             o.style.top = n + 'px';
         }
     });
     return result;
};

$(document).ready(function() {
   $('#home #divrecursosHumanos').hide();
   $('#home #recursosHumanos').mouseover(function(){
		$(this).siblings('#divrecursosHumanos').show().css({'position':'absolute','top':($(this).y() + 10 )+'px','left':($(this).x() - 100 )+'px'});
		$('#home #divrecursosHumanos').mouseleave(function(){ $(this).hide() });
   });

   $('#home #divtrabajadores').hide();
   $('#home #trabajadores').mouseover(function(){
		$(this).siblings('#divtrabajadores').show().css({'position':'absolute','top':$(this).y()+'px','left':($(this).x() - 100 )+'px'});
		$('#home #divtrabajadores').mouseleave(function(){ $(this).hide() });
   });

   $('#home #divempresas').hide();
   $('#home #empresas').mouseover(function(){
		$(this).siblings('#divempresas').show().css({'position':'absolute','top':$(this).y()+'px','left':($(this).x() - 100 )+'px'});
		$('#home #divempresas').mouseleave(function(){ $(this).hide() });
   });
   
   
});
