function submit_ajax_form(form_object)
{
    	var options = { 
		//target:        '#output1',   // target element(s) to be updated with server response 
		//beforeSubmit:  showRequest,  // pre-submit callback 
		success:       function(responseText, statusText, xhr, $form){
			parsed_response = json_parse(responseText);
			$(form_object).replaceWith(parsed_response.form_html);
			$.triggerReady();
		},  // post-submit callback 
			 
		// other available options: 
		url:       'ajax.php'    // override for form's 'action' attribute 
		//type:      type        // 'get' or 'post', override for form's 'method' attribute 
		//dataType:  null        // 'xml', 'script', or 'json' (expected server response type) 
		//clearForm: true        // clear all form fields after successful submit 
		//resetForm: true        // reset the form after successful submit 
			 
		// $.ajax options can be used here too, for example: 
		//timeout:   3000 
   	};
	$(form_object).ajaxSubmit(options); 
}

$.getReadyList = function() {
	if(this.readyList != null) { this.myreadylist = [].concat(this.readyList); }
	return this.myreadylist;
};

$(document).ready(function() {
	readylist = $.getReadyList();
});

$.triggerReady = function() {
	$(readylist).each(function(){this();});
}


function process_delete_entry(link, refresh_table, custom_callback_f)
{
	ajax_link = link.href;
	base_link = $('base').attr('href');
	ajax_link = ajax_link.replace(base_link, '');
	$.ajax({
	        method: "get", 
		url: "ajax.php", 
		data: "_seo_url="+ajax_link,
		success: function(responseText) {
			parsed_response = json_parse(responseText);
			if (refresh_table)
			{
				$(refresh_table).replaceWith(parsed_response['refresh_table']);
			}
			if (custom_callback_f)
			{
				custom_callback_f();
			}
		}
	});	
}

function profileSubsectionDeleteCallback()
{
	is_profile_subsection_enabled("div.register_seeker2_div_experience", "div.experience_entries_list table.search_res tbody", "#display_position");
	is_profile_subsection_enabled("div.register_seeker2_div_education", "div.education_entries_list table.search_res tbody", "#display_education");
	if($('div.experience_entries_list table.search_res tbody').length==0)
	{
		$('div.experience_entries_list').css('display', 'none');
	}
	if($('div.education_entries_list table.search_res tbody').length==0)
	{
		$('div.education_entries_list').css('display', 'none');
	}
}

