$(function(){
    $("#head .tip").each(function(){
   new Tip($(this));
  });  
})

function Tip(root){
    this.root=root;
    
    this.init();
    this.attachEvent();
}

Tip.prototype={
   init:function(){
         
 },
   attachEvent:function(){
    $('.pop').remove();
    var me=this;
    me.root.bind('mouseenter', function(){
        
        var text_this=$(this).text();
        var pos=me.root.position();
        me.root.after('<div class="pop"><div class="top"><div class="bottom"><div class="body"><p>'+text_this+'</p></div></div></div></div>');
        //$('.pop').addClass('show');
        $('.pop').animate({
            left: (pos.left+me.root.width()),
            top: pos.top
        },0, function(){
            $('.pop').slideDown(600);
        })
        
    })
    me.root.bind('mouseleave', function(){
        $('.pop').hide('slow').delay(300).hide(0).remove();
    })
   }
 } 

