function show_feedback_form(model, id, div_container) {
	$.ajax({
		url : '/forms/include_form/' + model + '/' + id + '/',
		dataType : 'html',
		success : function (form_html) {
			if(form_html.length > 0) {
				$('#' + div_container).html(form_html);
			}
		}
	});
}

$("form.feedback_form input[type='submit']").live("click", function() {	
	jQuery.noticeRemove($('.notice_item_wrapper'), 400);
	
	$('#feedback_form').block({ 
		message: '<img src="/img/frontend/global/ajax_loader.gif" alt="loading" />', 
		css: { background: 'none', border: '0' } 
	}); 
	parent_form_id = $(this).parents('form').attr('id');	
	$.ajax({
		type: 'POST',
		data: $('#' + parent_form_id).serialize(),
		url: $('#' + parent_form_id).attr('action'),
		dataType: 'html',
		success: function(form_result) {			
			$('#' + parent_form_id).replaceWith(form_result);
			
			var i = 1;
			$('#' + parent_form_id + ' .error-message').each(function() {
				$(this).parent().addClass('link_' + i);
				jQuery.noticeAdd({
					text: $(this).html(),
					type: 'link_' + i
				});
				i = i + 1;
			});
		}
	});
	return false;
	$('#feedback_form').unblock(); 
});

$('.notice_item').live('mouseenter', function() {
	var myClass = $(this).attr('class');
	myClass = myClass.replace('notice_item ', '');
	
	$('div.error.' + myClass + ' input').animate({borderLeftColor: '5px #fff solid'}, 200).animate({borderLeftColor: '5px #E20030 solid'}, 200).animate({borderLeftColor: '5px #fff solid'}, 200).animate({borderLeftColor: '5px #E20030 solid'}, 200).animate({borderLeftColor: '5px #fff solid'}, 200).animate({borderLeftColor: '5px #E20030 solid'}, 200);
	
	$('div.error.' + myClass + ' select').animate({borderLeftColor: '5px #fff solid'}, 200).animate({borderLeftColor: '5px #E20030 solid'}, 200).animate({borderLeftColor: '5px #fff solid'}, 200).animate({borderLeftColor: '5px #E20030 solid'}, 200).animate({borderLeftColor: '5px #fff solid'}, 200).animate({borderLeftColor: '5px #E20030 solid'}, 200);
	
	$('div.error.' + myClass + ' textarea').animate({borderLeftColor: '5px #fff solid'}, 200).animate({borderLeftColor: '5px #E20030 solid'}, 200).animate({borderLeftColor: '5px #fff solid'}, 200).animate({borderLeftColor: '5px #E20030 solid'}, 200).animate({borderLeftColor: '5px #fff solid'}, 200).animate({borderLeftColor: '5px #E20030 solid'}, 200);
});	
