﻿/*
* jQuery Copy to Clipboard Plugin
* Bill Beckelman http://beckelman.net
* 
* Dual licensed under the MIT (MIT-LICENSE.txt)
* and GPL (GPL-LICENSE.txt) licenses.
*
* Date: 2008-11-29
* Version 1.0
*
* Depends upon copy.swf file
*/

(function($) {
    $.copy = function(t) {
        if (typeof t == 'undefined') {
            t = '';
        }

        var i = '<embed src="/_assets/swf/copy.swf" FlashVars="clipboard=' +
            encodeURIComponent(t) + '" width="0" height="0" type="application/x-shockwave-flash"></embed>';

        if ($('#flashcopier').length == 0) {
            $('body').append('<div id="flashcopier">' + i + '</div>')
        }
        else {
            $('#flashcopier').html(i)
        }
    }
})(jQuery);
