/**************************************************************

	enelnombredelARTE.com

**************************************************************/

	$(document).ready(function(){



		/*###########################################
		## Acceso a clientes > Login
		###########################################*/
		
		$("form[name='login_cliente']").submit(function(){
			
			$().ajaxStart(function(){
				$('#responseLoginCliente').hide();
			}).ajaxStop(function(){
				$('#login').fadeOut(300, function(){
					$('#responseLoginCliente').fadeIn(150, function(){
						setTimeout("$('#responseLoginCliente').fadeOut(150, function(){$('#login').fadeIn(150);});", 1500);
					});
				});
			});
			
			$.ajax({
				type: 'POST',
				url: 'require/funciones/funciones-forms.php',
				data: $(this).serialize(),
				success: function(data){
					$('#responseLoginCliente').html(data);
				}
			})
			return false;
		});




		/*###########################################
		## Acceso a clientes > Recordar password
		###########################################*/
		
		$("form[name='recordar_password']").submit(function(){
			
			$().ajaxStart(function(){
				$('#responseRemindPass').hide();
			}).ajaxStop(function(){
				$('#remind_pass').fadeOut(300, function(){
					$('#responseRemindPass').fadeIn(150, function(){
						setTimeout("$('#responseRemindPass').fadeOut(150, function(){$('#remind_pass').fadeIn(150);});", 1500);
					});
				});
			});
			
			$.ajax({
				type: 'POST',
				url: 'require/funciones/funciones-forms.php',
				data: $(this).serialize(),
				success: function(data){
					$('#responseRemindPass').html(data);
				}
			})
			return false;
		});




		/*###########################################
		## Perfil > Editar datos
		###########################################*/
		
		$("form[name='editar_perfil']").submit(function(){
			
			$().ajaxStart(function(){
				$('#responseEditarPerfil').hide();
			}).ajaxStop(function(){
				$('#buttonEditarPerfil').fadeOut(300, function(){
					$('#responseEditarPerfil').fadeIn(150, function(){
						setTimeout("$('#responseEditarPerfil').fadeOut(150, function(){$('#buttonEditarPerfil').fadeIn(150);});", 1500);
					});
				});
			});
			
			$.ajax({
				type: 'POST',
				url: 'require/funciones/funciones-forms.php',
				data: $(this).serialize(),
				success: function(data){
					$('#responseEditarPerfil').html(data);
				}
			})
			return false;
		});




		/*###########################################
		## Perfil > Registrar cuenta usuario
		###########################################*/
		
		$("form[name='registrar_perfil']").submit(function(){
			$().ajaxStart(function(){
				$('#responseRegistrarPerfil').hide();
			}).ajaxStop(function(){
				$('#buttonRegistrarPerfil').fadeOut(300, function(){
					$('#responseRegistrarPerfil').fadeIn(150, function(){
						setTimeout("$('#responseRegistrarPerfil').fadeOut(150, function(){$('#buttonRegistrarPerfil').fadeIn(150);});", 1500);
					});
				});
			});
			
			$.ajax({
				type: 'POST',
				url: 'require/funciones/funciones-forms.php',
				data: $(this).serialize(),
				success: function(data){
					$('#responseRegistrarPerfil').html(data);
				}
			})
			return false;
		});




		/*###########################################
		## Contacto > Enviar mensaje
		###########################################*/
		
		$("form[name='contacto']").submit(function(){
			
			$().ajaxStart(function(){
				$('#responseContacto').hide();
			}).ajaxStop(function(){
				$('#buttonContacto').fadeOut(300, function(){
					$('#responseContacto').fadeIn(150, function(){
						setTimeout("$('#responseContacto').fadeOut(150, function(){$('#buttonContacto').fadeIn(150);});", 1500);
					});
				});
			});
			
			$.ajax({
				type: 'POST',
				url: 'require/funciones/funciones-forms.php',
				data: $(this).serialize(),
				success: function(data){
					$('#responseContacto').html(data);
				}
			})
			return false;
		});




		/*###########################################
		## Segundamano > Contactar con el vendedor
		###########################################*/
		
		$("form[name='contactar_vendedor']").submit(function(){
			
			$().ajaxStart(function(){
				$('#responseEnviarInteres').hide();
			}).ajaxStop(function(){
				$('#buttonEnviarInteres').fadeOut(300, function(){
					$('#responseEnviarInteres').fadeIn(150, function(){
						setTimeout("$('#responseEnviarInteres').fadeOut(150, function(){$('#buttonEnviarInteres').fadeIn(150);});", 1500);
					});
				});
			});
			
			$.ajax({
				type: 'POST',
				url: 'require/funciones/funciones-forms.php',
				data: $(this).serialize(),
				success: function(data){
					$('#responseEnviarInteres').html(data);
				}
			})
			return false;
		});
		
		
		
		
		/*###########################################
		## Merchandising > Comprar producto
		###########################################*/
		
		$("form[name='comprar_producto']").submit(function(){
			$().ajaxStart(function(){
				$('#responseComprarProducto').hide();
			}).ajaxStop(function(){
				$('#buttonComprarProducto').fadeOut(300, function(){
					$('#responseComprarProducto').fadeIn(150, function(){
						setTimeout("$('#responseComprarProducto').fadeOut(150, function(){$('#buttonComprarProducto').fadeIn(150);});", 1500);
					});
				});
			});
			
			$.ajax({
				type: 'POST',
				url: 'require/funciones/funciones-forms.php',
				data: $(this).serialize(),
				success: function(data){
					$('#responseComprarProducto').html(data);
				}
			})
			return false;
		});




		/*###########################################
		## Checkout > Solicitud de imágenes
		###########################################*/
		
		$("form[name='checkout']").submit(function(){
			$().ajaxStart(function(){
				$('#responseCheckout').hide();
			}).ajaxStop(function(){
				$('#buttonCheckout').fadeOut(300, function(){
					$('#responseCheckout').fadeIn(150, function(){
						setTimeout("$('#responseCheckout').fadeOut(150, function(){$('#buttonCheckout').fadeIn(150);});", 1500);
					});
				});
			});
			
			$.ajax({
				type: 'POST',
				url: 'require/funciones/funciones-forms.php',
				data: $(this).serialize(),
				success: function(data){
					$('#responseCheckout').html(data);
				}
			})
			return false;
		});
		
		
		
		
		/*###########################################
		## Checkout > Solicitud de otras imágenes
		###########################################*/
		
		$("form[name='checkout_otras']").submit(function(){
			$().ajaxStart(function(){
				$('#responseCheckout').hide();
			}).ajaxStop(function(){
				$('#buttonCheckout').fadeOut(300, function(){
					$('#responseCheckout').fadeIn(150, function(){
						setTimeout("$('#responseCheckout').fadeOut(150, function(){$('#buttonCheckout').fadeIn(150);});", 1500);
					});
				});
			});
			
			$.ajax({
				type: 'POST',
				url: 'require/funciones/funciones-forms.php',
				data: $(this).serialize(),
				success: function(data){
					$('#responseCheckout').html(data);
				}
			})
			return false;
		});

		
		
	}); // close document.ready();
