		var mbEddButton = null;

jQuery(document).ready(function ($) {

		var active_window = null; 
		
		$(document).on('click', '.maxbutton_media_button', activeButtonWindow);
		$(document).on('click', '.edd-maxbutton-field .remove-button', removeButton); 
		
		function activeButtonWindow(e)
		{
			var target = $(e.target); 
			var id = target.attr('name'); 
			active_window = id; 
		}
		
		function removeButton(e)
		{
			var target = $(e.target); 
			var id = target.data('remove'); 
			
			$('#edd-maxbutton-preview-' + id).html(''); 
			$('input[name="edd_settings[' + id + ']"]').val(0); 
			
			$(target).addClass('hidden'); 
		}
		
		mbEddButton = function(id, target)
		{
			console.log('hola chicas'); 
			console.log(active_window);
			console.log($);
			var button = $('.media-buttons .maxbutton-' + id).parents('.shortcode-container').children().clone();
			$('#edd-maxbutton-preview-' + active_window).html(button); 
			$('input[name="edd_settings[' + active_window + ']"]').val(id);
			$('.remove-button-' + active_window).removeClass('hidden'); 
			return false; 
		}
		
		
}); 
