/*
+-----------------------------------------------------------------------------+
| $Id: jquery.bw.copyer.js 2009-10-06 12:37:07Z Bleakwind $
| Copy Something
| Copyright (c) 2003-2010 Bleakwind (www.weaverdream.com)
| http://www.weaverdream.com/
| Release under the GNU Lesser General Public License Version 3 (LGPLv3):
|   http://www.gnu.org/licenses/lgpl.html
+-----------------------------------------------------------------------------+
*/

(function($){
    $.fn.extend({
        bwcopyer:function(option){
            var id      = option.id     || 'bwcopyer_id',
                get     = option.get    || 'bwcopyer_get',
                ret     = option.ret    || 'bwcopyer_ret',
                icon    = option.icon   || './lib/jquery/jquery.bwcopyer.gif',
                swf     = option.swf    || './lib/jquery/jquery.bwcopyer.swf';

            //$(this).append("<div id=\"bwcopyer_button_"+id+"\"></div>");
            $(this).append("<object id=\"bwcopyer_button_"+id+"\" classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" width=\"16\" height=\"16\"><param name=\"movie\" value=\""+swf+"\" /><!--[if !IE]>--><object type=\"application/x-shockwave-flash\" data=\""+swf+"\" width=\"16\" height=\"16\"><!--<![endif]--><!--[if !IE]>--></object><!--<![endif]--></object>");

            var flashvars = {
                bwcopyer_get: get,
                bwcopyer_return: ret,
                bwcopyer_argument: id,
                bwcopyer_icon: icon
            };
            var params = {
                bgcolor: "#FFFFFF",
                scale: "noScale",
                menu: "false",
                quality: "high",
                wmode: "transparent",
                allowScriptAccess: "always"
            };
            var attributes = {
                id: "bwcopyer_"+id,
                name: "bwcopyer_"+id
            };
            swfobject.embedSWF(swf, "bwcopyer_button_"+id, "16", "16", "9.0.0", "./lib/swfobject/expressInstall.swf", flashvars, params, attributes);
        }
    });
})(jQuery);
