﻿/*
	VERSION:    Popper jQuery Plugin 1.0  (11-05-2008)	
	AUTHOR:     Oren Goldfinger
	REQUIRES:   jquery.js (1.2.6 or later)
	SYNTAX:     $(selector).popper(options);
	OPTIONS:
		        speed   : integer (default = 400)
	EXAMPLE:
	            $("#myId").popper();            
                $("#myId2").popper({
                    speed:400                    
                });
 */
(function($){
    $.fn.popper = function(options) 
    {        
        var opts = $.extend({                        
                        speed: 400                        
                        }, options);        
                        
        $(this).bind("mouseenter", function(){
            if( $(this).data("GoingUp") == true) return;
            if( $(this).data("marginTop") == null) $(this).data("marginTop", $(this).css("marginTop"));
            $(this).data("GoingUp", true);
            $(this).animate({ "marginTop": "0px" }, opts.speed, function(){ $(this).data("GoingUp", false); });
        });
        
        $(this).bind("mouseleave", function(){                    
            $(this).animate({ "marginTop": $(this).data("marginTop") }, opts.speed, function(){  });
        });                        
    };
})(jQuery);
