

jQuery.copy = function(data) { return jQuery.fn.copy.call({}, data); };
jQuery.fn.copy = function(delimiter) {
    // Get Previous Object List
    var self = this,

    // Capture or Create Div for SWF Object
    flashcopier = (function(fid) {
        return document.getElementById(fid) || (function() {
            var divnode    = document.createElement('div');
                divnode.id = fid;
            document.body.appendChild(divnode);
            return divnode;
        })();
    })('_flash_copier'),

    // Capture our jQuery Selected Data and Scrub
    data = jQuery.map(self, function(bit) {
        return typeof bit === 'object' ? bit.value ||
                      bit.innerHTML.replace(/<.+>/g, '') : '';
    }).join( delimiter || '' ).replace(/^\s+|\s+$/g, '') || delimiter,

    // Define SWF Object with our Captured Data
    divinfo = '<embed src="jquery.copy.swf" FlashVars="clipboard='
            + encodeURIComponent(data)
            + '" width="0" height="0" '
            + 'type="application/x-shockwave-flash"></embed>';

    // Create SWF Object with Defined Data Above
    flashcopier.innerHTML = divinfo;

    // Return Previous Object List
    return self;
};


