// JavaScript Document
$(document).ready(function(){
$("#fCuestionarioImagen").validate({
		submitHandler: function() {
			$("#fCuestionarioImagen").ajaxSubmit({
				beforeSubmit:  showRequest,  // pre-submit callback 
				success:       showResponse  // post-submit callback
				});
		
		},
		highlight: function(element, errorClass) {
	     $(element).addClass('errorClass');
		},
		unhighlight: function(element, errorClass){
		$(element).removeClass('errorClass');
		}
    });

	$("#loading").ajaxStart(function(){
	$("#enviar").attr("disable","true");
	   $(this).show();
	 });
	

	function showRequest(formData, jqForm, options) { 

	} 

	// post-submit callback 
	function showResponse(responseText, statusText)  { 
		$("#loading").hide("slow");
		$("#response").show("slow").append(responseText).fadeTo(3000, 1).fadeOut(2000);
		$("#enviar").attr("disable","false");
	}
});