How to bring a jQuery object into a function?
<p>I have this jQuery object which I need to pull into a function, is this possible?  Please see the code snippet:</p>

<pre><code>    var input;
    jQuery('.upload').live('click', function()
    {
    input = jQuery(this).find(".image-path");
    tb_show(title, 'media-upload.php?type=image&amp;amp;TB_iframe=true');

    return false;
    }); 

    window.send_to_editor = function( html ) 
    {
         if (input)
         {
              console.log(input); // works and defined at this point...
              var data {
              action: "doFunction"
              };
              jQuery.post( ajaxurl, data, function( response ) 
              {
                   console.log(input); // does not work, not defined...why??
                   input.val(response); // this gives me input.val(response) is not a function
              });
         }
    }
</code></pre>
