

	$(function(){
		$('#create-new-tag').click(function(){
			var new_tag = $('#create-new-tag-name').val();
			if ( new_tag != '' ){
				$.ajax({
					url: "/apps/forum/addons/tagManager/js/trigger.ajax.php", type: 'GET', dataType: 'text',
					data: { new_tag: escape(new_tag), option: 'new_tag', post: $('#create-new-tag-post').val() },
					success: function(response){
						if ( response != '' ){
							$('#post-box-tags').html(response);}
					}
				});
				return false;
			}
		});
		
		$('#post-box-tags').delegate('input[type=checkbox]', 'click', function(){
			$.ajax({
				url: "/apps/forum/addons/tagManager/js/trigger.ajax.php", type: 'GET', dataType: 'text',
				data: { status: $(this).is(':checked'), option: 'manage_tag', post: $('#create-new-tag-post').val(), tag: $(this).val() },
				success: function(response){
				}
			});
		});
	});
