var id;

$(document).ready(function()
{
        var currentMousePos = { x: -1, y: -1 };

        $('.juidfield').focus(function()
        {
                id = $(this).attr('id');
                var left = $('.juidfield').offset().left;
                
                $.get("scripts/proposal.php", {uid:id}, function(data)
                        {
                                $("#results").html(data);
                                $("#results").css("top",currentMousePos.y-80);
                                $("#results").css("left",currentMousePos.x-220);
                                $("#results").css("display","block");
                        });
        });
      
        $('.juidfield').keydown(function()
        {
               $("#results").css("display","none");
        });

        $(document).mousemove(function(event)
        {
                currentMousePos.x = event.pageX;
                currentMousePos.y = event.pageY;
        });
        
        
});


function SetValue(data)
{
        $('#'+id).val(data);
        $("#results").css("display","none");
}
