$(document).ready(function(){ 
						   
	// Jump Steps
	// Submit the Form
	jQuery(".jump_steps").bind("click", function(){
	
		var which_step = jQuery(this).attr('id');
		jQuery('#jump_step').val(which_step);
		
		// Submit the Form
		jQuery("form#form_steps").submit();
		return false;
			
	});
	
	// Save Preview and Export
	$(".preview").bind("click", function(){
	
		$('#jump_step').val('preview');
		
		// Submit the Form
		$("form#form_steps").submit();
		return false;
			
	});
	
	$(".export").bind("click", function(){
	
		$('#jump_step').val('export');
		
		// Submit the Form
		$("form#form_steps").submit();
		return false;
			
	});
	

	// Add Another Bullet
	$("a.new_bullet").livequery("click", function(){
	
		// Get Current Bullet Number
		var bullet_counter = $('#bullet_counter').val();
		
		var html =			'<div class="bullet bullet_generic" id="bullet_' + bullet_counter + '" style="display: none;">';
		html +=				'	<a href="#" class="delete_bullet_generic delete delete_bullet" name="' + bullet_counter + '">[x]</a>';
		html +=				'	<input type="text" name="bullet[]" id="new_bullet_input_' + bullet_counter + '" class="textfield" />';
		html +=				'</div>';
		
		$("#bullet_container").append(html);
		
		$('#bullet_' + bullet_counter).fadeIn('slow');
		
		// Set Focus
		$('#new_bullet_input_' + bullet_counter).focus();
		
		// Increase Bullet Counter
		$('#bullet_counter').val( parseInt(bullet_counter) + parseInt(1) );
		
		return false;

	});
	
	// Delete Generic Bullets
	$("a.delete_bullet_generic").livequery("click", function(){
	
		var answer = confirm('Are you sure you want to delete this bullet?  This action cannot be undone.')
		if (!answer){
			
			return false;
			
		}
	
		var bullet_id = $(this).attr("name");
		
		$('#bullet_' + bullet_id).fadeOut('slow', function() {
			$('#bullet_' + bullet_id).remove();
		});
	
		return false;

	});
	
	// Delete Specific Bullet
	$("a.delete_bullet_specific").livequery("click", function(){
		
		var answer = confirm('Are you sure you want to delete this bullet?  This action cannot be undone.')
		if (!answer){
			
			return false;
			
		}
	
		var bullet_id = $(this).attr("name");
		
		var dataString = 'bullet_id=' + bullet_id;
		$.ajax({
			type: "POST",
			url: "/resume/create/delete_bullet/",
			data: dataString
		});
					
		$('#bullet_' + bullet_id).fadeOut('slow', function() {
			$('#bullet_' + bullet_id).remove();
		});
	
		return false;

	});
	
});
