jQuery.fn.pause = function(duration) {
    jQuery(this).animate({
        dummy: 1
    }, duration);
    return this;
};

var timer;
var popup;


jQuery(document).ready(function() {

    jQuery(".wps-intext").mouseover(
        function() {
            clearTimeout(timer);
            position = jQuery(this).position();
            outerHeight = jQuery(this).outerHeight();

            popup = jQuery('#' + this.id + '-popup');

            popup.css('top',position.top+outerHeight);
            popup.css('left',position.left);
            popup.show();
        }
        );

    jQuery(".wps-intext").mouseleave(
        function() {
            popup = jQuery('#' + this.id + '-popup');
            timer = setTimeout("popup.fadeOut('fast')", 200);
        }
    );

    jQuery(".wps-intext-popup").mouseover(
        function() {
            clearTimeout(timer);
            popup = jQuery('#' + this.id);            
        }
    );

    jQuery(".wps-intext-popup").mouseleave(
        function() {
            popup = jQuery('#' + this.id);
            timer = setTimeout("popup.fadeOut('fast')", 300);
        }
    );
        
});

