﻿/*弹出层*/
(function($) {
    jQuery.fn.extend({
        Popup: function(options) {
            return this.each(function() {

                var target = options.target;
                window.jq_popup_timer = null;
                var pThis = $(this);

                target.css("position", "absolute");

                target.mouseover(function() {
										  
					if ( target.css("display") == "none" )
                   		target.show();
						
                    if (window.jq_popup_timer != null) {
                        window.clearTimeout(window.jq_popup_timer);
                        window.jq_popup_timer = null;
                    }
                });

                target.mouseout(function() {
					window.jq_popup_timer = window.setTimeout(function() { target.hide(); }, 200);
				});

                $(this).mouseover(function() {
                    target.show();
                    target.css("left", pThis.offset().left + options.left + "px");
                    target.css("top", pThis.offset().top + pThis.height() + options.top + "px");
                    if (window.jq_popup_timer != null) {
                        window.clearTimeout(window.jq_popup_timer);
                        window.jq_popup_timer = null;
                    }
                });

                $(this).mouseout(function() {
                    
					window.jq_popup_timer = window.setTimeout(function() { target.hide(); }, 200);
                });
            });
        }
    });
})(jQuery);