function form_submit()
{
	var f = $('#survey');
	var v = f.validate({
		errorElement: 'span',
		errorPlacement: function(error, element) {
			error.appendTo( element.parent() );
		}
	});
	
	//.parent().prev().children()

	if(f.valid()){
		$.post(f.attr('action'),f.serialize(),module.form_handle,"html");
		var obj = $(f).find('input[type="submit"]');
		obj.attr('value','Sending');
		obj.attr('disabled','disabled');
	}
};
/*
module.form_handle = function(data,textStatus)
{
	var f = $(this.elem).find('form.validate');
	if(textStatus == "success"){
		$(f).slideUp();
		$(this.elem).find('div.response').append(data);
	}
};
*/

function survey()
{
	$('#submit').bind('click', function () {
		form_submit();
		return false;
	});
};

jQuery(function($) {
	survey();
});