
var listaImagenes = new Array('./img/castillo-slide.jpg','./img/champin-slide.jpg','./img/cocktail-slide.jpg', './img/semivin-slide.jpg');
var compras = new Array();
var productoPosicion = new Array(0,0,0,0,0,0,0,0,0);
var cantidadProducto = new Array();
var contador = 0;
var CompraActual = 0;

function quitarBarrera(){
  div = document.getElementById('prevencion');
  div.style.display = 'none';
}

function irIndex(){
	window.location="index.php";
}

function mostrarImagen(adelante) {

  div = document.getElementById('descripcion'+contador);
  div.style.display = 'none';
  if(adelante == 1){
	if(contador < listaImagenes.length-1)
		contador++;
	else
		contador = 0;
  }
  else{
	if(contador > 0)
		contador--;
	else
		contador = listaImagenes.length-1;
  }
  div2 = document.getElementById('descripcion'+contador);
  div2.style.display = 'block';
  document.images.imagenGaleria.src = listaImagenes[contador];
}

function mostrardiv(numero) {

  div = document.getElementById('flotante'+numero);
  div.style.display = 'block';
  div2 = document.getElementById('blanqueado'+numero);
  div2.style.backgroundColor = '#fffc27';
  
  for (x = 0; x < 7 && numero < 10; x++)
  {
	if(x != numero){
		div3 = document.getElementById('flotante'+x);
		div3.style.display='none';
		div4 = document.getElementById('blanqueado'+x);
		div4.style.backgroundColor = '#FDD01F';
	}
  }
}

var web_alto; 
var diferencia = new Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
function mostrarProductos(numero){
		var web_alto = $(document).height();
		div4 = document.getElementById('parteOcultaTienda'+numero);
		div4.style.display='block';	
		$('#imagenPestana'+numero).html("<a style=\"cursor:pointer;\" onclick=\"javascript:desmostrarProductos("+numero+")\"><img src=\"./img/flecha2.jpg\"></a>");
		$('.despliegue'+numero).html("<a style=\"cursor:pointer;\" onclick=\"javascript:desmostrarProductos("+numero+")\">Cerrar l&iacute;nea productos</a>");		
		$(".fondoBlanco2").height(0);
		$(".creditos2").css({top:0});
		$(".columnaMenu12").css({top:0});
		$(".columnaMenu22").css({top:0});
		$(".columnaMenu32").css({top:0});
		$(".columnaMenu42").css({top:0});
		var web_alto2 = $(document).height();
		$(".fondoBlanco2").height(web_alto2+290);
		$(".creditos2").css({top:$(document).height()+8});
		$(".columnaMenu12").css({top:$(document).height()-250});
		$(".columnaMenu22").css({top:$(document).height()-250});
		$(".columnaMenu32").css({top:$(document).height()-250});
		$(".columnaMenu42").css({top:$(document).height()-250});
		diferencia[numero] = $(document).height() - web_alto;
}

function desmostrarProductos(numero){
		div4 = document.getElementById('parteOcultaTienda'+numero);
		div4.style.display='none';	
		var resta = $(document).height() - diferencia[numero];
		$('#imagenPestana'+numero).html("<a style=\"cursor:pointer;\" onclick=\"javascript:mostrarProductos("+numero+")\"><img src=\"./img/flecha1.jpg\"></a>");
		$('.despliegue'+numero).html("<a style=\"cursor:pointer;\" onclick=\"javascript:mostrarProductos("+numero+")\">Desplegar l&iacute;nea productos</a>");	
		$(".fondoBlanco2").height(0);
		$(".creditos2").css({top:0});
		$(".columnaMenu12").css({top:0});
		$(".columnaMenu22").css({top:0});
		$(".columnaMenu32").css({top:0});
		$(".columnaMenu42").css({top:0});
		var web_alto2 = $(document).height();
		$(".fondoBlanco2").height(web_alto2+290);
		$(".creditos2").css({top:$(document).height()+8});
		$(".columnaMenu12").css({top:$(document).height()-250});
		$(".columnaMenu22").css({top:$(document).height()-250});
		$(".columnaMenu32").css({top:$(document).height()-250});
		$(".columnaMenu42").css({top:$(document).height()-250});
}

function mostrarInfo(numero, numeroProductos){

	div = document.getElementById("cuadradoInfo"+numero);
	if($("#cuadradoInfo"+numero).height()==0){
		$("#cuadradoInfo"+numero).css({top:$("#botonInfo"+numero).position().top+20});
		div.display='block';
			$("#cuadradoInfo"+numero).animate({top:$("#botonInfo"+numero).position().top - 80, height: 100, width:100}, "slow");
		comienzaCompra[numero]=1;
		for(var i =0; i < numeroProductos; i++){
			if(i != numero){
				if($("#cuadradoInfo"+i).height()>0 ){
					$("#cuadradoInfo"+i).animate({top:$("#botonInfo"+i).position().top+20, height: 0, width:0}, "slow");
					div = document.getElementById("cuadradoInfo"+i);
					div.display='none';	
				}
			}
		}
	}
	else{
		$("#cuadradoInfo"+numero).animate({top:$("#botonInfo"+numero).position().top+20, height: 0, width:0}, "slow");
		div.display='none';	
	}
}


function cerrar(numero) {

  div = document.getElementById('flotante'+numero);
  if(div.style.display == 'none'){
	div.style.display = 'block';
	div2 = document.getElementById('blanqueado'+numero);
	div2.style.backgroundColor = '#fffc27';
	for (x = 0; x < 7 && numero < 10; x++)
	{
		if(x != numero){
			div3 = document.getElementById('flotante'+x);
			div3.style.display='none';
			div4 = document.getElementById('blanqueado'+x);
			div4.style.backgroundColor = '#FDD01F';
		}
	}
  }
  else
  for (x = 0; x < 7; x++)
  {
		div3 = document.getElementById('flotante'+x);
		div3.style.display='none';
		div4 = document.getElementById('blanqueado'+x);
		div4.style.backgroundColor = '#FDD01F';
  }

}

var lista2 = new Array('./img/descarga.jpg','./img/bodega.jpg','./img/factoria-anos70.jpg', './img/factoria-2-grande.jpg', './img/factoria-historia.jpg');
var lista3 = new Array('./img/factoria-2-grande.jpg','./img/factoria-3-grande.jpg','./img/ISO-9001.jpg');

function mostrarImagenCompleta(imagen)
{
		div2 = document.getElementById('oscurecimiento');
		div2.style.display = 'block';
		div = document.getElementById('imagenGrandeMostrada');
		div.style.display = 'block';
		document.images.imagenGrandeMostrada.src = lista2[imagen];
}

function cerrarImagenCompleta()
{
		div2 = document.getElementById('oscurecimiento');
		div2.style.display = 'none';
		div = document.getElementById('imagenGrandeMostrada');
		div.style.display = 'none';
}

function mostrarImagenCompleta2(imagen)
{
		div2 = document.getElementById('oscurecimiento');
		div2.style.display = 'block';
		div = document.getElementById('imagenGrandeMostradaFactoria');
		div.style.display = 'block';
		document.images.imagenGrandeMostradaFactoria.src = lista3[imagen];
		div = document.getElementById('videoIncrustadoFactoria');
		div.style.display = 'none';
}

function cerrarImagenCompleta2()
{
		div2 = document.getElementById('oscurecimiento');
		div2.style.display = 'none';
		div = document.getElementById('imagenGrandeMostradaFactoria');
		div.style.display = 'none';
		div = document.getElementById('videoIncrustadoFactoria');
		div.style.display = 'block';
}

function aniadirProducto(numero){
	compras.push(numero);
	var frase ="Compras: ";
	for(i = 0; i < compras.length; i++){
		frase = frase+' '+compras[i];
	}
	div2 = document.getElementById('productof'+numero);
	div2.style.html = "compras";
}

	var numeroBotellas = 0;
	var precioTotal = 0;
	var listaCompras = new Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
	
function bajarProductos(){
	 $('html,body').animate({
	scrollTop: $(".previaProducto5").offset().top
	}, 2000);
}

	
function restar1(){
		var variable_post="Mi texto actualizado"; 
		 $.post("index.php", { variable: variable_post },  
		 function(data){    
			cantidadProducto[productoPosicion[0]-1]--;
			$("#cantidadProducto"+productoPosicion[0]).val(cantidadProducto[productoPosicion[0]-1]); 
			for(i = 1; i < 10; i++)
			{
				productoPosicion[i-1] = productoPosicion[i];
				$("#compra"+i).html($("#compra"+(i+1)).html()); 
				$("#menosCompra"+i).hide();
				$("#compra"+i).html($("#compra"+i).html().replace("restar"+(i+1),"restar"+i) ); 
			}
			productoPosicion[9] = 0;
			$("#compra9").html(""); 
			$("#menosCompra"+9).hide();
			$("#compra1").html($("#compra1").html().replace("+ ","") );
			precioTotal = precioTotal - listaCompras[0];
			$("#precioTotal").html(precioTotal.toFixed(2));
			for(i = 0; i < 8; i++)
			{
				listaCompras[i] = listaCompras[i+1];
			}
			listaCompras[8] = 0;
			numeroBotellas--;
		});
			if(numeroBotellas < 2){
				$("#ok").hide();
				$("#total").hide();
				$("#precioTotal").hide();
				$(".descubreLetras").animate({top:560}, "slow");
						productoPosicion[0] = 0;
		productoPosicion[1] = 0;
		productoPosicion[2] = 0;
		productoPosicion[3] = 0;
		productoPosicion[4] = 0;
		productoPosicion[5] = 0;
		productoPosicion[6] = 0;
		productoPosicion[7] = 0;
		productoPosicion[8] = 0;
		productoPosicion[9] = 0;
		cantidadProducto[0] = 0; 
		cantidadProducto[1] = 0; 
		cantidadProducto[2] = 0; 
		cantidadProducto[3] = 0; 
		cantidadProducto[4] = 0; 
		cantidadProducto[5] = 0; 
		cantidadProducto[6] = 0; 
		cantidadProducto[7] = 0; 
		cantidadProducto[8] = 0; 
		cantidadProducto[9] = 0; 
		cantidadProducto[10] = 0; 
		cantidadProducto[11] = 0; 
		for($i = 0; $i < 12; $i++){
		$("#cantidadProducto"+($i+1)).val("");
		}
			}
}

function restar2(){
		var variable_post="Mi texto actualizado"; 
		 $.post("index.php", { variable: variable_post },  
		 function(data){    
			cantidadProducto[productoPosicion[1]-1]--;
			$("#cantidadProducto"+productoPosicion[1]).val(cantidadProducto[productoPosicion[1]-1]); 
			for(i = 2; i < 10; i++)
			{
				productoPosicion[i-1] = productoPosicion[i];
				$("#compra"+i).html($("#compra"+(i+1)).html()); 
				$("#compra"+i).html($("#compra"+i).html().replace("restar"+(i+1),"restar"+i) ); 
			}
			$("#compra9").html(""); 
			productoPosicion[9] = 0;
			precioTotal = precioTotal - listaCompras[1];
			$("#precioTotal").html(precioTotal.toFixed(2));
			for(i = 1; i < 8; i++)
			{
				listaCompras[i] = listaCompras[i+1];
			}
			listaCompras[8] = 0;
			numeroBotellas--;
		});
			if(numeroBotellas < 2){
				$("#ok").hide();
				$("#total").hide();
				$("#precioTotal").hide();
			}
}

function restar3(){
		var variable_post="Mi texto actualizado"; 
		 $.post("index.php", { variable: variable_post },  
		 function(data){    
		 cantidadProducto[productoPosicion[2]-1]--;
		 $("#cantidadProducto"+productoPosicion[2]).val(cantidadProducto[productoPosicion[2]-1]); 
			for(i = 3; i < 10; i++)
			{
				productoPosicion[i-1] = productoPosicion[i];
				$("#compra"+i).html($("#compra"+(i+1)).html()); 
				$("#compra"+i).html($("#compra"+i).html().replace("restar"+(i+1),"restar"+i) ); 
			}
			$("#compra9").html(""); 
			productoPosicion[9] = 0;
			precioTotal = precioTotal - listaCompras[2];
			$("#precioTotal").html(precioTotal.toFixed(2));
			for(i = 2; i < 8; i++)
			{
				listaCompras[i] = listaCompras[i+1];
			}
			listaCompras[8] = 0;
			numeroBotellas--;
		});
			if(numeroBotellas < 2){
				$("#ok").hide();
				$("#total").hide();
				$("#precioTotal").hide();
			}
}

function restar4(){
		var variable_post="Mi texto actualizado"; 
		 $.post("index.php", { variable: variable_post },  
		 function(data){    
		 cantidadProducto[productoPosicion[3]-1]--;
		 $("#cantidadProducto"+productoPosicion[3]).val(cantidadProducto[productoPosicion[3]-1]); 
			for(i = 4; i < 10; i++)
			{
				productoPosicion[i-1] = productoPosicion[i];
				$("#compra"+i).html($("#compra"+(i+1)).html()); 
				$("#compra"+i).html($("#compra"+i).html().replace("restar"+(i+1),"restar"+i) ); 
			}
			$("#compra9").html(""); 
			productoPosicion[9] = 0;
			precioTotal = precioTotal - listaCompras[3];
			$("#precioTotal").html(precioTotal.toFixed(2));
			for(i = 3; i < 8; i++)
			{
				listaCompras[i] = listaCompras[i+1];
			}
			listaCompras[8] = 0;
			numeroBotellas--;
		});
			if(numeroBotellas < 2){
				$("#ok").hide();
				$("#total").hide();
				$("#precioTotal").hide();
			}
}

function restar5(){
		var variable_post="Mi texto actualizado"; 
		 $.post("index.php", { variable: variable_post },  
		 function(data){    
			cantidadProducto[productoPosicion[4]-1]--;
			$("#cantidadProducto"+productoPosicion[4]).val(cantidadProducto[productoPosicion[4]-1]); 
			for(i = 5; i < 10; i++)
			{
				productoPosicion[i-1] = productoPosicion[i];
				$("#compra"+i).html($("#compra"+(i+1)).html()); 
				$("#compra"+i).html($("#compra"+i).html().replace("restar"+(i+1),"restar"+i) ); 
			}
			$("#compra9").html(""); 
			productoPosicion[9] = 0;
			precioTotal = precioTotal - listaCompras[4];
			$("#precioTotal").html(precioTotal.toFixed(2));
			for(i = 4; i < 8; i++)
			{
				listaCompras[i] = listaCompras[i+1];
			}
			listaCompras[8] = 0;
			numeroBotellas--;
		});
			if(numeroBotellas < 2){
				$("#ok").hide();
				$("#total").hide();
				$("#precioTotal").hide();
			}
}

function restar6(){
		var variable_post="Mi texto actualizado"; 
		 $.post("index.php", { variable: variable_post },  
		 function(data){    
		 cantidadProducto[productoPosicion[5]-1]--;
		 $("#cantidadProducto"+productoPosicion[5]).val(cantidadProducto[productoPosicion[5]-1]); 
			for(i = 6; i < 10; i++)
			{
				productoPosicion[i-1] = productoPosicion[i];
				$("#compra"+i).html($("#compra"+(i+1)).html()); 
				$("#compra"+i).html($("#compra"+i).html().replace("restar"+(i+1),"restar"+i) ); 
			}
			$("#compra9").html(""); 
			productoPosicion[9] = 0;
			precioTotal = precioTotal - listaCompras[5];
			$("#precioTotal").html(precioTotal.toFixed(2));
			for(i = 5; i < 8; i++)
			{
				listaCompras[i] = listaCompras[i+1];
			}
			listaCompras[8] = 0;
			numeroBotellas--;
		});
			if(numeroBotellas < 2){
				$("#ok").hide();
				$("#total").hide();
				$("#precioTotal").hide();
			}
}

function restar7(){
		var variable_post="Mi texto actualizado"; 
		 $.post("index.php", { variable: variable_post },  
		 function(data){    
		 cantidadProducto[productoPosicion[6]-1]--;
		 $("#cantidadProducto"+productoPosicion[6]).val(cantidadProducto[productoPosicion[6]-1]); 
			for(i = 7; i < 10; i++)
			{
				productoPosicion[i-1] = productoPosicion[i];
				$("#compra"+i).html($("#compra"+(i+1)).html()); 
				$("#compra"+i).html($("#compra"+i).html().replace("restar"+(i+1),"restar"+i) ); 
			}
			$("#compra9").html(""); 
			productoPosicion[9] = 0;
			precioTotal = precioTotal - listaCompras[6];
			$("#precioTotal").html(precioTotal.toFixed(2));
			for(i = 6; i < 8; i++)
			{
				listaCompras[i] = listaCompras[i+1];
			}
			listaCompras[8] = 0;
			numeroBotellas--;
		});
			if(numeroBotellas < 2){
				$("#ok").hide();
				$("#total").hide();
				$("#precioTotal").hide();
			}
}

function restar8(){
		var variable_post="Mi texto actualizado"; 
		 $.post("index.php", { variable: variable_post },  
		 function(data){    
		 cantidadProducto[productoPosicion[7]-1]--;
		 $("#cantidadProducto"+productoPosicion[7]).val(cantidadProducto[productoPosicion[7]-1]); 
			for(i = 8; i < 10; i++)
			{
				productoPosicion[i] = productoPosicion[i+1];
				$("#compra"+i).html($("#compra"+(i+1)).html()); 
				$("#compra"+i).html($("#compra"+i).html().replace("restar"+(i+1),"restar"+i) ); 
			}
			$("#compra9").html(""); 
			productoPosicion[9] = 0;
			precioTotal = precioTotal - listaCompras[7];
			$("#precioTotal").html(precioTotal.toFixed(2));
			for(i = 7; i < 8; i++)
			{
				listaCompras[i] = listaCompras[i+1];
			}
			listaCompras[8] = 0;
			numeroBotellas--;
		});
			if(numeroBotellas < 2){
				$("#ok").hide();
				$("#total").hide();
				$("#precioTotal").hide();
			}
}

function restar9(){
		var variable_post="Mi texto actualizado"; 
		 $.post("index.php", { variable: variable_post },  
		 function(data){    
		 cantidadProducto[productoPosicion[8]-1]--;
		 $("#cantidadProducto"+productoPosicion[8]).val(cantidadProducto[productoPosicion[8]-1]); 
			$("#compra9").html(""); 
			productoPosicion[9] = 0;
			precioTotal = precioTotal - listaCompras[8];
			$("#precioTotal").html(precioTotal.toFixed(2));
			listaCompras[8] = 0;
			numeroBotellas--;
		});
			if(numeroBotellas < 2){
				$("#ok").hide();
				$("#total").hide();
				$("#precioTotal").hide();
			}
}

	function recargar(numero){  
		compraActual = numero;
		//document.getElementById("carrito"+numero).src = './img/carrito2.png';
		 var variable_post="Mi texto actualizado"; 
		 /// Invocamos a nuestro script PHP   
		 if(numeroBotellas < 9){
		 $.post("tienda.php", { variable: variable_post },  
		 function(data){             
		 /// Ponemos la respuesta de nuestro script en el párrafo recargado  
		 if(numeroBotellas < 1){
			$("#compra1").html("1 "+$("#listaNombres"+numero).html()+" ("+$("#listaPrecios"+numero).html()+" &euro;)<a onclick=\"javascript:restar1()\" style=\" cursor: pointer; font-weight: bold; font-size: 12px; color: orange;\" > ( - )</a>"); 
		 }  
		 else if(numeroBotellas < 2){
			$("#compra2").html("1 "+$("#listaNombres"+numero).html()+" ("+$("#listaPrecios"+numero).html()+" &euro;)<a onclick=\"javascript:restar2()\" style=\" cursor: pointer; font-weight: bold; font-size: 12px; color: orange;\" > ( - )</a>");  
		 }
		 else if(numeroBotellas < 3){
			$("#compra3").html("1 "+$("#listaNombres"+numero).html()+" ("+$("#listaPrecios"+numero).html()+" &euro;)<a onclick=\"javascript:restar3()\" style=\" cursor: pointer; font-weight: bold; font-size: 12px; color: orange;\" > ( - )</a>"); 
		 }  
		 else if(numeroBotellas < 4){
			$("#compra4").html("1 "+$("#listaNombres"+numero).html()+" ("+$("#listaPrecios"+numero).html()+" &euro;)<a onclick=\"javascript:restar4()\" style=\" cursor: pointer; font-weight: bold; font-size: 12px; color: orange;\" > ( - )</a>");  
		 }  
		 else if(numeroBotellas < 5){
			$("#compra5").html("1 "+$("#listaNombres"+numero).html()+" ("+$("#listaPrecios"+numero).html()+" &euro;)<a onclick=\"javascript:restar5()\" style=\" cursor: pointer; font-weight: bold; font-size: 12px; color: orange;\" > ( - )</a>"); 
		 }  
		 else if(numeroBotellas < 6){
			$("#compra6").html("1 "+$("#listaNombres"+numero).html()+" ("+$("#listaPrecios"+numero).html()+" &euro;)<a onclick=\"javascript:restar6()\" style=\" cursor: pointer; font-weight: bold; font-size: 12px; color: orange;\" > ( - )</a>");  
		 }  
		 else if(numeroBotellas < 7){
			$("#compra7").html("1 "+$("#listaNombres"+numero).html()+" ("+$("#listaPrecios"+numero).html()+" &euro;)<a onclick=\"javascript:restar7()\" style=\" cursor: pointer; font-weight: bold; font-size: 12px; color: orange;\" > ( - )</a>"); 
		 }  
		 else if(numeroBotellas < 8){
			$("#compra8").html("1 "+$("#listaNombres"+numero).html()+" ("+$("#listaPrecios"+numero).html()+" &euro;)<a onclick=\"javascript:restar8()\" style=\" cursor: pointer; font-weight: bold; font-size: 12px; color: orange;\" > ( - )</a>"); 
		 }  
		 else if(numeroBotellas < 9){
			$("#compra9").html("1 "+$("#listaNombres"+numero).html()+" ("+$("#listaPrecios"+numero).html()+" &euro;)<a onclick=\"javascript:restar9()\" style=\" cursor: pointer; font-weight: bold; font-size: 12px; color: orange;\" > ( - )</a>"); 
		 }  		 
		 if(numeroBotellas < 9){
		 productoPosicion[numeroBotellas] = numero+1;
		 cantidadProducto[numero]++;
		 $("#cantidadProducto"+numero).val(cantidadProducto[numero]); 
		 listaCompras[numeroBotellas] += parseFloat($("#listaPrecios"+numero).html());
		 precioTotal += parseFloat($("#listaPrecios"+numero).html());
		 $("#precioTotal").html(precioTotal.toFixed(2));
		 numeroBotellas++;
		 }
		 });
		}
	 } 

	/*function recargar1(){  
		compraActual = 1;
		 var variable_post="Mi texto actualizado"; 
		 /// Invocamos a nuestro script PHP   
		 if(numeroBotellas < 9){
		 $.post("index.php", { variable: variable_post },  
		 function(data){             
		 /// Ponemos la respuesta de nuestro script en el párrafo recargado  
		 if(numeroBotellas < 1){
			$("#compra1").html("1 caja "+$("#listaNombres1").html()+" ("+$("#listaPrecios1").html()+" &euro;)<a onclick=\"javascript:restar1()\" style=\" cursor: pointer; font-weight: bold; font-size: 12px; color: orange;\" > ( - )</a>"); 
		 }  
		 else if(numeroBotellas < 2){
			$("#compra2").html(" + 1 caja "+$("#listaNombres1").html()+" ("+$("#listaPrecios1").html()+" &euro;)<a onclick=\"javascript:restar2()\" style=\" cursor: pointer; font-weight: bold; font-size: 12px; color: orange;\" > ( - )</a>"); 
		 }
		 else if(numeroBotellas < 3){
			$("#compra3").html(" + 1 caja "+$("#listaNombres1").html()+" ("+$("#listaPrecios1").html()+" &euro;)<a onclick=\"javascript:restar3()\" style=\" cursor: pointer; font-weight: bold; font-size: 12px; color: orange;\" > ( - )</a>"); 
		 }  
		 else if(numeroBotellas < 4){
			$("#compra4").html(" + 1 caja "+$("#listaNombres1").html()+" ("+$("#listaPrecios1").html()+" &euro;)<a onclick=\"javascript:restar4()\" style=\" cursor: pointer; font-weight: bold; font-size: 12px; color: orange;\" > ( - )</a>"); 
		 }  
		 else if(numeroBotellas < 5){
			$("#compra5").html(" + 1 caja "+$("#listaNombres1").html()+" ("+$("#listaPrecios1").html()+" &euro;)<a onclick=\"javascript:restar5()\" style=\" cursor: pointer; font-weight: bold; font-size: 12px; color: orange;\" > ( - )</a>"); 
		 }  
		 else if(numeroBotellas < 6){
			$("#compra6").html(" + 1 caja "+$("#listaNombres1").html()+" ("+$("#listaPrecios1").html()+" &euro;)<a onclick=\"javascript:restar6()\" style=\" cursor: pointer; font-weight: bold; font-size: 12px; color: orange;\" > ( - )</a>");  
		 }  
		 else if(numeroBotellas < 7){
			$("#compra7").html(" + 1 caja "+$("#listaNombres1").html()+" ("+$("#listaPrecios1").html()+" &euro;)<a onclick=\"javascript:restar7()\" style=\" cursor: pointer; font-weight: bold; font-size: 12px; color: orange;\" > ( - )</a>"); 
		 }  
		 else if(numeroBotellas < 8){
			$("#compra8").html(" + 1 caja "+$("#listaNombres1").html()+" ("+$("#listaPrecios1").html()+" &euro;)<a onclick=\"javascript:restar8()\" style=\" cursor: pointer; font-weight: bold; font-size: 12px; color: orange;\" > ( - )</a>"); 
		 }  
		 else if(numeroBotellas < 9){
			$("#compra9").html(" + 1 caja "+$("#listaNombres1").html()+" ("+$("#listaPrecios1").html()+" &euro;)<a onclick=\"javascript:restar9()\" style=\"cursor: pointer; font-weight: bold; font-size: 12px; color: orange;\" > ( - )</a>"); 
		 }  		 
		 if(numeroBotellas < 9){
		 productoPosicion[numeroBotellas] = 1;
		 cantidadProducto[0]++;
		 $("#cantidadProducto1").val(cantidadProducto[0]); 
		 listaCompras[numeroBotellas] += parseFloat($("#listaPrecios1").html());
		 precioTotal += parseFloat($("#listaPrecios1").html());
		 $("#precioTotal").html(precioTotal.toFixed(2));
		 numeroBotellas++;
		 }
		 });
		}
	 } 
	 
	 function recargar2(){  
		compraActual = 2;
		 var variable_post="Mi texto actualizado";  
		 /// Invocamos a nuestro script PHP   
		 if(numeroBotellas < 9){
			 $.post("index.php", { variable: variable_post },  
			 function(data){             
			 /// Ponemos la respuesta de nuestro script en el párrafo recargado            
		 if(numeroBotellas < 1){
			$("#compra1").html("1 caja "+$("#listaNombres2").html()+" ("+$("#listaPrecios2").html()+" &euro;)<a onclick=\"javascript:restar1()\" style=\" cursor: pointer; font-weight: bold; font-size: 12px; color: orange;\" > ( - )</a>"); 
		 }  
		 else if(numeroBotellas < 2){
			$("#compra2").html(" + 1 caja "+$("#listaNombres2").html()+" ("+$("#listaPrecios2").html()+" &euro;)<a onclick=\"javascript:restar2()\" style=\" cursor: pointer; font-weight: bold; font-size: 12px; color: orange;\" > ( - )</a>"); 
		 }
		 else if(numeroBotellas < 3){
			$("#compra3").html(" + 1 caja "+$("#listaNombres2").html()+" ("+$("#listaPrecios2").html()+" &euro;)<a onclick=\"javascript:restar3()\" style=\" cursor: pointer; font-weight: bold; font-size: 12px; color: orange;\" > ( - )</a>"); 
		 }  
		 else if(numeroBotellas < 4){
			$("#compra4").html(" + 1 caja "+$("#listaNombres2").html()+" ("+$("#listaPrecios2").html()+" &euro;)<a onclick=\"javascript:restar4()\" style=\" cursor: pointer; font-weight: bold; font-size: 12px; color: orange;\" > ( - )</a>"); 
		 }  
		 else if(numeroBotellas < 5){
			$("#compra5").html(" + 1 caja "+$("#listaNombres2").html()+" ("+$("#listaPrecios2").html()+" &euro;)<a onclick=\"javascript:restar5()\" style=\" cursor: pointer; font-weight: bold; font-size: 12px; color: orange;\" > ( - )</a>"); 
		 }  
		 else if(numeroBotellas < 6){
			$("#compra6").html(" + 1 caja "+$("#listaNombres2").html()+" ("+$("#listaPrecios2").html()+" &euro;)<a onclick=\"javascript:restar6()\" style=\" cursor: pointer; font-weight: bold; font-size: 12px; color: orange;\" > ( - )</a>"); 
		 }  
		 else if(numeroBotellas < 7){
			$("#compra7").html(" + 1 caja "+$("#listaNombres2").html()+" ("+$("#listaPrecios2").html()+" &euro;)<a onclick=\"javascript:restar7()\" style=\" cursor: pointer; font-weight: bold; font-size: 12px; color: orange;\" > ( - )</a>"); 
		 }  
		 else if(numeroBotellas < 8){
			$("#compra8").html(" + 1 caja "+$("#listaNombres2").html()+" ("+$("#listaPrecios2").html()+" &euro;)<a onclick=\"javascript:restar8()\" style=\" cursor: pointer; font-weight: bold; font-size: 12px; color: orange;\" > ( - )</a>"); 
		 }  
		 else if(numeroBotellas < 9){
			$("#compra9").html(" + 1 caja "+$("#listaNombres2").html()+" ("+$("#listaPrecios2").html()+" &euro;)<a onclick=\"javascript:restar9()\" style=\" cursor: pointer; font-weight: bold; font-size: 12px; color: orange;\" > ( - )</a>"); 
		 } 
		 if(numeroBotellas < 9){
		 productoPosicion[numeroBotellas] = 2;
		 cantidadProducto[1]++;
		 $("#cantidadProducto2").val(cantidadProducto[1]); 
		 listaCompras[numeroBotellas] = parseFloat($("#listaPrecios2").html());
		 precioTotal += parseFloat($("#listaPrecios2").html());
		 $("#precioTotal").html(precioTotal.toFixed(2));
		 numeroBotellas++;
		 }
		 });
		}
	} 
	 
	 function recargar3(){ 
		compraActual = 3;	 
		 var variable_post="Mi texto actualizado";  
		 /// Invocamos a nuestro script PHP   
		 if(numeroBotellas < 9){ 
			 $.post("index.php", { variable: variable_post },  
		function(data){             
			 /// Ponemos la respuesta de nuestro script en el párrafo recargado  
		 if(numeroBotellas < 1){
			$("#compra1").html("1 caja "+$("#listaNombres3").html()+" ("+$("#listaPrecios3").html()+" &euro;)<a onclick=\"javascript:restar1()\" style=\" cursor: pointer; font-weight: bold; font-size: 12px; color: orange;\" > ( - )</a>"); 
		 }  
		 else if(numeroBotellas < 2){
			$("#compra2").html(" + 1 caja "+$("#listaNombres3").html()+" ("+$("#listaPrecios3").html()+" &euro;)<a onclick=\"javascript:restar2()\" style=\" cursor: pointer; font-weight: bold; font-size: 12px; color: orange;\" > ( - )</a>"); 
		 }
		 else if(numeroBotellas < 3){
			$("#compra3").html(" + 1 caja "+$("#listaNombres3").html()+" ("+$("#listaPrecios3").html()+" &euro;)<a onclick=\"javascript:restar3()\" style=\" cursor: pointer; font-weight: bold; font-size: 12px; color: orange;\" > ( - )</a>"); 
		 }  
		 else if(numeroBotellas < 4){
			$("#compra4").html(" + 1 caja "+$("#listaNombres3").html()+" ("+$("#listaPrecios3").html()+" &euro;)<a onclick=\"javascript:restar4()\" style=\" cursor: pointer; font-weight: bold; font-size: 12px; color: orange;\" > ( - )</a>"); 
		 }  
		 else if(numeroBotellas < 5){
			$("#compra5").html(" + 1 caja "+$("#listaNombres3").html()+" ("+$("#listaPrecios3").html()+" &euro;)<a onclick=\"javascript:restar5()\" style=\" cursor: pointer; font-weight: bold; font-size: 12px; color: orange;\" > ( - )</a>"); 
		 }  
		 else if(numeroBotellas < 6){
			$("#compra6").html(" + 1 caja "+$("#listaNombres3").html()+" ("+$("#listaPrecios3").html()+" &euro;)<a onclick=\"javascript:restar6()\" style=\" cursor: pointer; font-weight: bold; font-size: 12px; color: orange;\" > ( - )</a>"); 
		 }  
		 else if(numeroBotellas < 7){
			$("#compra7").html(" + 1 caja "+$("#listaNombres3").html()+" ("+$("#listaPrecios3").html()+" &euro;)<a onclick=\"javascript:restar7()\" style=\" cursor: pointer; font-weight: bold; font-size: 12px; color: orange;\" > ( - )</a>"); 
		 }  
		 else if(numeroBotellas < 8){
			$("#compra8").html(" + 1 caja "+$("#listaNombres3").html()+" ("+$("#listaPrecios3").html()+" &euro;)<a onclick=\"javascript:restar8()\" style=\" cursor: pointer; font-weight: bold; font-size: 12px; color: orange;\" > ( - )</a>"); 
		 }  
		 else if(numeroBotellas < 9){
			$("#compra9").html(" + 1 caja "+$("#listaNombres3").html()+" ("+$("#listaPrecios3").html()+" &euro;)<a onclick=\"javascript:restar9()\" style=\" cursor: pointer; font-weight: bold; font-size: 12px; color: orange;\" > ( - )</a>"); 
		 } 
		 if(numeroBotellas < 9){
		 	productoPosicion[numeroBotellas] = 3;
			cantidadProducto[2]++;
			$("#cantidadProducto3").val(cantidadProducto[2]); 
			listaCompras[numeroBotellas] = parseFloat($("#listaPrecios3").html());
			 precioTotal += parseFloat($("#listaPrecios3").html());
			 $("#precioTotal").html(precioTotal.toFixed(2));
			 numeroBotellas++;
		}
		 }); 
		} 
	}
	 
	 function recargar4(){  
	 compraActual = 4;
		 var variable_post="Mi texto actualizado";  
		 /// Invocamos a nuestro script PHP   
		 if(numeroBotellas < 9){
			$.post("index.php", { variable: variable_post },  
			function(data){             
			/// Ponemos la respuesta de nuestro script en el párrafo recargado  
		 if(numeroBotellas < 1){
			$("#compra1").html("1 caja "+$("#listaNombres4").html()+" ("+$("#listaPrecios4").html()+" &euro;)<a onclick=\"javascript:restar1()\" style=\" cursor: pointer; font-weight: bold; font-size: 12px; color: orange;\" > ( - )</a>"); 
		 }  
		 else if(numeroBotellas < 2){
			$("#compra2").html(" + 1 caja "+$("#listaNombres4").html()+" ("+$("#listaPrecios4").html()+" &euro;)<a onclick=\"javascript:restar2()\" style=\" cursor: pointer; font-weight: bold; font-size: 12px; color: orange;\" > ( - )</a>"); 
		 }
		 else if(numeroBotellas < 3){
			$("#compra3").html(" + 1 caja "+$("#listaNombres4").html()+" ("+$("#listaPrecios4").html()+" &euro;)<a onclick=\"javascript:restar3()\" style=\" cursor: pointer; font-weight: bold; font-size: 12px; color: orange;\" > ( - )</a>"); 
		 }  
		 else if(numeroBotellas < 4){
			$("#compra4").html(" + 1 caja "+$("#listaNombres4").html()+" ("+$("#listaPrecios4").html()+" &euro;)<a onclick=\"javascript:restar4()\" style=\" cursor: pointer; font-weight: bold; font-size: 12px; color: orange;\" > ( - )</a>"); 
		 }  
		 else if(numeroBotellas < 5){
			$("#compra5").html(" + 1 caja "+$("#listaNombres4").html()+" ("+$("#listaPrecios4").html()+" &euro;)<a onclick=\"javascript:restar5()\" style=\" cursor: pointer; font-weight: bold; font-size: 12px; color: orange;\" > ( - )</a>"); 
		 }  
		 else if(numeroBotellas < 6){
			$("#compra6").html(" + 1 caja "+$("#listaNombres4").html()+" ("+$("#listaPrecios4").html()+" &euro;)<a onclick=\"javascript:restar6()\" style=\" cursor: pointer; font-weight: bold; font-size: 12px; color: orange;\" > ( - )</a>"); 
		 }  
		 else if(numeroBotellas < 7){
			$("#compra7").html(" + 1 caja "+$("#listaNombres4").html()+" ("+$("#listaPrecios4").html()+" &euro;)<a onclick=\"javascript:restar7()\" style=\" cursor: pointer; font-weight: bold; font-size: 12px; color: orange;\" > ( - )</a>"); 
		 }  
		 else if(numeroBotellas < 8){
			$("#compra8").html(" + 1 caja "+$("#listaNombres4").html()+" ("+$("#listaPrecios4").html()+" &euro;)<a onclick=\"javascript:restar8()\" style=\" cursor: pointer; font-weight: bold; font-size: 12px; color: orange;\" > ( - )</a>"); 
		 }  
		 else if(numeroBotellas < 9){
			$("#compra9").html(" + 1 caja "+$("#listaNombres4").html()+" ("+$("#listaPrecios4").html()+" &euro;)<a onclick=\"javascript:restar9()\" style=\" cursor: pointer; font-weight: bold; font-size: 12px; color: orange;\" > ( - )</a>"); 
		 } 
		if(numeroBotellas < 9){
			productoPosicion[numeroBotellas] = 4;
			cantidadProducto[3]++;
			$("#cantidadProducto4").val(cantidadProducto[3]); 
			listaCompras[numeroBotellas] = parseFloat($("#listaPrecios4").html());
			 precioTotal += parseFloat($("#listaPrecios4").html());
			 $("#precioTotal").html(precioTotal.toFixed(2));
			 numeroBotellas++;
		}
		 });
		}
	 } 
	 
	 function recargar5(){  
		 compraActual = 5;
		 var variable_post="Mi texto actualizado";  
		 /// Invocamos a nuestro script PHP   
		 if(numeroBotellas < 9){
			 $.post("index.php", { variable: variable_post },  
			 function(data){             
			 /// Ponemos la respuesta de nuestro script en el párrafo recargado 
		 if(numeroBotellas < 1){
			$("#compra1").html("1 caja "+$("#listaNombres5").html()+" ("+$("#listaPrecios5").html()+" &euro;)<a onclick=\"javascript:restar1()\" style=\" cursor: pointer; font-weight: bold; font-size: 12px; color: orange;\" > ( - )</a>"); 
		 }  
		 else if(numeroBotellas < 2){
			$("#compra2").html(" + 1 caja "+$("#listaNombres5").html()+" ("+$("#listaPrecios5").html()+" &euro;)<a onclick=\"javascript:restar2()\" style=\" cursor: pointer; font-weight: bold; font-size: 12px; color: orange;\" > ( - )</a>"); 
		 }
		 else if(numeroBotellas < 3){
			$("#compra3").html(" + 1 caja "+$("#listaNombres5").html()+" ("+$("#listaPrecios5").html()+" &euro;)<a onclick=\"javascript:restar3()\" style=\" cursor: pointer; font-weight: bold; font-size: 12px; color: orange;\" > ( - )</a>"); 
		 }  
		 else if(numeroBotellas < 4){
			$("#compra4").html(" + 1 caja "+$("#listaNombres5").html()+" ("+$("#listaPrecios5").html()+" &euro;)<a onclick=\"javascript:restar4()\" style=\" cursor: pointer; font-weight: bold; font-size: 12px; color: orange;\" > ( - )</a>"); 
		 }  
		 else if(numeroBotellas < 5){
			$("#compra5").html(" + 1 caja "+$("#listaNombres5").html()+" ("+$("#listaPrecios5").html()+" &euro;)<a onclick=\"javascript:restar5()\" style=\" cursor: pointer; font-weight: bold; font-size: 12px; color: orange;\" > ( - )</a>"); 
		 }  
		 else if(numeroBotellas < 6){
			$("#compra6").html(" + 1 caja "+$("#listaNombres5").html()+" ("+$("#listaPrecios5").html()+" &euro;)<a onclick=\"javascript:restar6()\" style=\" cursor: pointer; font-weight: bold; font-size: 12px; color: orange;\" > ( - )</a>"); 
		 }  
		 else if(numeroBotellas < 7){
			$("#compra7").html(" + 1 caja "+$("#listaNombres5").html()+" ("+$("#listaPrecios5").html()+" &euro;)<a onclick=\"javascript:restar7()\" style=\" cursor: pointer; font-weight: bold; font-size: 12px; color: orange;\" > ( - )</a>"); 
		 }  
		 else if(numeroBotellas < 8){
			$("#compra8").html(" + 1 caja "+$("#listaNombres5").html()+" ("+$("#listaPrecios5").html()+" &euro;)<a onclick=\"javascript:restar8()\" style=\" cursor: pointer; font-weight: bold; font-size: 12px; color: orange;\" > ( - )</a>"); 
		 }  
		 else if(numeroBotellas < 9){
			$("#compra9").html(" + 1 caja "+$("#listaNombres5").html()+" ("+$("#listaPrecios5").html()+" &euro;)<a onclick=\"javascript:restar9()\" style=\" cursor: pointer; font-weight: bold; font-size: 12px; color: orange;\" > ( - )</a>"); 
		 } 
		 if(numeroBotellas < 9){
			productoPosicion[numeroBotellas] = 5;
			cantidadProducto[4]++;
			$("#cantidadProducto5").val(cantidadProducto[4]); 
			listaCompras[numeroBotellas] = parseFloat($("#listaPrecios5").html());
			 precioTotal += parseFloat($("#listaPrecios5").html());
			 $("#precioTotal").html(precioTotal.toFixed(2));
			 numeroBotellas++;
		}
		 }); 
		}
	} 
	 
	 function recargar6(){  
		 compraActual = 6;
		 var variable_post="Mi texto actualizado";  
		 /// Invocamos a nuestro script PHP   
		 if(numeroBotellas < 9){   
			 $.post("index.php", { variable: variable_post },  
			 function(data){             
			 /// Ponemos la respuesta de nuestro script en el párrafo recargado  
		 if(numeroBotellas < 1){
			$("#compra1").html("1 caja "+$("#listaNombres6").html()+" ("+$("#listaPrecios6").html()+" &euro;)<a onclick=\"javascript:restar1()\" style=\" cursor: pointer; font-weight: bold; font-size: 12px; color: orange;\" > ( - )</a>"); 
		 }  
		 else if(numeroBotellas < 2){
			$("#compra2").html(" + 1 caja "+$("#listaNombres6").html()+" ("+$("#listaPrecios6").html()+" &euro;)<a onclick=\"javascript:restar2()\" style=\" cursor: pointer; font-weight: bold; font-size: 12px; color: orange;\" > ( - )</a>"); 
		 }
		 else if(numeroBotellas < 3){
			$("#compra3").html(" + 1 caja "+$("#listaNombres6").html()+" ("+$("#listaPrecios6").html()+" &euro;)<a onclick=\"javascript:restar3()\" style=\" cursor: pointer; font-weight: bold; font-size: 12px; color: orange;\" > ( - )</a>"); 
		 }  
		 else if(numeroBotellas < 4){
			$("#compra4").html(" + 1 caja "+$("#listaNombres6").html()+" ("+$("#listaPrecios6").html()+" &euro;)<a onclick=\"javascript:restar4()\" style=\" cursor: pointer; font-weight: bold; font-size: 12px; color: orange;\" > ( - )</a>"); 
		 }  
		 else if(numeroBotellas < 5){
			$("#compra5").html(" + 1 caja "+$("#listaNombres6").html()+" ("+$("#listaPrecios6").html()+" &euro;)<a onclick=\"javascript:restar5()\" style=\" cursor: pointer; font-weight: bold; font-size: 12px; color: orange;\" > ( - )</a>"); 
		 }  
		 else if(numeroBotellas < 6){
			$("#compra6").html(" + 1 caja "+$("#listaNombres6").html()+" ("+$("#listaPrecios6").html()+" &euro;)<a onclick=\"javascript:restar6()\" style=\" cursor: pointer; font-weight: bold; font-size: 12px; color: orange;\" > ( - )</a>"); 
		 }  
		 else if(numeroBotellas < 7){
			$("#compra7").html(" + 1 caja "+$("#listaNombres6").html()+" ("+$("#listaPrecios6").html()+" &euro;)<a onclick=\"javascript:restar7()\" style=\" cursor: pointer; font-weight: bold; font-size: 12px; color: orange;\" > ( - )</a>"); 
		 }  
		 else if(numeroBotellas < 8){
			$("#compra8").html(" + 1 caja "+$("#listaNombres6").html()+" ("+$("#listaPrecios6").html()+" &euro;)<a onclick=\"javascript:restar8()\" style=\" cursor: pointer; font-weight: bold; font-size: 12px; color: orange;\" > ( - )</a>"); 
		 }  
		 else if(numeroBotellas < 9){
			$("#compra9").html(" + 1 caja "+$("#listaNombres6").html()+" ("+$("#listaPrecios6").html()+" &euro;)<a onclick=\"javascript:restar9()\" style=\" cursor: pointer; font-weight: bold; font-size: 12px; color: orange;\" > ( - )</a>"); 
		 } 
		 if(numeroBotellas < 9){
		 	productoPosicion[numeroBotellas] = 6;
			cantidadProducto[5]++;
			$("#cantidadProducto6").val(cantidadProducto[5]); 
			listaCompras[numeroBotellas] = parseFloat($("#listaPrecios6").html());
			 precioTotal += parseFloat($("#listaPrecios6").html());
			 $("#precioTotal").html(precioTotal.toFixed(2));
			 numeroBotellas++;
		}
		 }); 
		}
	}

	 function recargar7(){  
		 compraActual = 7;
		 var variable_post="Mi texto actualizado";  
		 /// Invocamos a nuestro script PHP   
		 if(numeroBotellas < 9){   
			 $.post("index.php", { variable: variable_post },  
			 function(data){             
			 /// Ponemos la respuesta de nuestro script en el párrafo recargado  
		 if(numeroBotellas < 1){
			$("#compra1").html("1 caja "+$("#listaNombres7").html()+" ("+$("#listaPrecios7").html()+" &euro;)<a onclick=\"javascript:restar1()\" style=\" cursor: pointer; font-weight: bold; font-size: 12px; color: orange;\" > ( - )</a>"); 
		 }  
		 else if(numeroBotellas < 2){
			$("#compra2").html(" + 1 caja "+$("#listaNombres7").html()+" ("+$("#listaPrecios7").html()+" &euro;)<a onclick=\"javascript:restar2()\" style=\" cursor: pointer; font-weight: bold; font-size: 12px; color: orange;\" > ( - )</a>"); 
		 }
		 else if(numeroBotellas < 3){
			$("#compra3").html(" + 1 caja "+$("#listaNombres7").html()+" ("+$("#listaPrecios7").html()+" &euro;)<a onclick=\"javascript:restar3()\" style=\" cursor: pointer; font-weight: bold; font-size: 12px; color: orange;\" > ( - )</a>"); 
		 }  
		 else if(numeroBotellas < 4){
			$("#compra4").html(" + 1 caja "+$("#listaNombres7").html()+" ("+$("#listaPrecios7").html()+" &euro;)<a onclick=\"javascript:restar4()\" style=\" cursor: pointer; font-weight: bold; font-size: 12px; color: orange;\" > ( - )</a>"); 
		 }  
		 else if(numeroBotellas < 5){
			$("#compra5").html(" + 1 caja "+$("#listaNombres7").html()+" ("+$("#listaPrecios7").html()+" &euro;)<a onclick=\"javascript:restar5()\" style=\" cursor: pointer; font-weight: bold; font-size: 12px; color: orange;\" > ( - )</a>"); 
		 }  
		 else if(numeroBotellas < 6){
			$("#compra6").html(" + 1 caja "+$("#listaNombres7").html()+" ("+$("#listaPrecios7").html()+" &euro;)<a onclick=\"javascript:restar6()\" style=\" cursor: pointer; font-weight: bold; font-size: 12px; color: orange;\" > ( - )</a>"); 
		 }  
		 else if(numeroBotellas < 7){
			$("#compra7").html(" + 1 caja "+$("#listaNombres7").html()+" ("+$("#listaPrecios7").html()+" &euro;)<a onclick=\"javascript:restar7()\" style=\" cursor: pointer; font-weight: bold; font-size: 12px; color: orange;\" > ( - )</a>"); 
		 }  
		 else if(numeroBotellas < 8){
			$("#compra8").html(" + 1 caja "+$("#listaNombres7").html()+" ("+$("#listaPrecios7").html()+" &euro;)<a onclick=\"javascript:restar8()\" style=\" cursor: pointer; font-weight: bold; font-size: 12px; color: orange;\" > ( - )</a>"); 
		 }  
		 else if(numeroBotellas < 9){
			$("#compra9").html(" + 1 caja "+$("#listaNombres7").html()+" ("+$("#listaPrecios7").html()+" &euro;)<a onclick=\"javascript:restar9()\" style=\" cursor: pointer; font-weight: bold; font-size: 12px; color: orange;\" > ( - )</a>"); 
		 } 
		 if(numeroBotellas < 9){
		 	productoPosicion[numeroBotellas] = 7;
			cantidadProducto[6]++;
			$("#cantidadProducto7").val(cantidadProducto[6]); 
			listaCompras[numeroBotellas] = parseFloat($("#listaPrecios7").html());
			 precioTotal += parseFloat($("#listaPrecios7").html());
			 $("#precioTotal").html(precioTotal.toFixed(2));
			 numeroBotellas++;
		}
		 }); 
		}
	} 

	 function recargar8(){ 
		 compraActual = 8;	 
		 var variable_post="Mi texto actualizado";  
		 /// Invocamos a nuestro script PHP   
		 if(numeroBotellas < 9){   
			 $.post("index.php", { variable: variable_post },  
			 function(data){             
			 /// Ponemos la respuesta de nuestro script en el párrafo recargado  
		 if(numeroBotellas < 1){
			$("#compra1").html("1 caja "+$("#listaNombres8").html()+" ("+$("#listaPrecios8").html()+" &euro;)<a onclick=\"javascript:restar1()\" style=\" cursor: pointer; font-weight: bold; font-size: 12px; color: orange;\" > ( - )</a>"); 
		 }  
		 else if(numeroBotellas < 2){
			$("#compra2").html(" + 1 caja "+$("#listaNombres8").html()+" ("+$("#listaPrecios8").html()+" &euro;)<a onclick=\"javascript:restar2()\" style=\" cursor: pointer; font-weight: bold; font-size: 12px; color: orange;\" > ( - )</a>"); 
		 }
		 else if(numeroBotellas < 3){
			$("#compra3").html(" + 1 caja "+$("#listaNombres8").html()+" ("+$("#listaPrecios8").html()+" &euro;)<a onclick=\"javascript:restar3()\" style=\" cursor: pointer; font-weight: bold; font-size: 12px; color: orange;\" > ( - )</a>"); 
		 }  
		 else if(numeroBotellas < 4){
			$("#compra4").html(" + 1 caja "+$("#listaNombres8").html()+" ("+$("#listaPrecios8").html()+" &euro;)<a onclick=\"javascript:restar4()\" style=\" cursor: pointer; font-weight: bold; font-size: 12px; color: orange;\" > ( - )</a>"); 
		 }  
		 else if(numeroBotellas < 5){
			$("#compra5").html(" + 1 caja "+$("#listaNombres8").html()+" ("+$("#listaPrecios8").html()+" &euro;)<a onclick=\"javascript:restar5()\" style=\" cursor: pointer; font-weight: bold; font-size: 12px; color: orange;\" > ( - )</a>"); 
		 }  
		 else if(numeroBotellas < 6){
			$("#compra6").html(" + 1 caja "+$("#listaNombres8").html()+" ("+$("#listaPrecios8").html()+" &euro;)<a onclick=\"javascript:restar6()\" style=\" cursor: pointer; font-weight: bold; font-size: 12px; color: orange;\" > ( - )</a>"); 
		 }  
		 else if(numeroBotellas < 7){
			$("#compra7").html(" + 1 caja "+$("#listaNombres8").html()+" ("+$("#listaPrecios8").html()+" &euro;)<a onclick=\"javascript:restar7()\" style=\" cursor: pointer; font-weight: bold; font-size: 12px; color: orange;\" > ( - )</a>"); 
		 }  
		 else if(numeroBotellas < 8){
			$("#compra8").html(" + 1 caja "+$("#listaNombres8").html()+" ("+$("#listaPrecios8").html()+" &euro;)<a onclick=\"javascript:restar8()\" style=\" cursor: pointer; font-weight: bold; font-size: 12px; color: orange;\" > ( - )</a>"); 
		 }  
		 else if(numeroBotellas < 9){
			$("#compra9").html(" + 1 caja "+$("#listaNombres8").html()+" ("+$("#listaPrecios8").html()+" &euro;)<a onclick=\"javascript:restar9()\" style=\" cursor: pointer; font-weight: bold; font-size: 12px; color: orange;\" > ( - )</a>"); 
		 } 
		 if(numeroBotellas < 9){
		 	productoPosicion[numeroBotellas] = 8;
			cantidadProducto[7]++;
			$("#cantidadProducto8").val(cantidadProducto[7]); 
			listaCompras[numeroBotellas] = parseFloat($("#listaPrecios8").html());
			 precioTotal += parseFloat($("#listaPrecios8").html());
			 $("#precioTotal").html(precioTotal.toFixed(2));
			 numeroBotellas++;
		}
		 }); 
		}
	} 

	 function recargar9(){  
		 compraActual = 9;
		 var variable_post="Mi texto actualizado";  
		 /// Invocamos a nuestro script PHP   
		 if(numeroBotellas < 9){   
			 $.post("index.php", { variable: variable_post },  
			 function(data){             
			 /// Ponemos la respuesta de nuestro script en el párrafo recargado  
		 if(numeroBotellas < 1){
			$("#compra1").html("1 caja "+$("#listaNombres9").html()+" ("+$("#listaPrecios9").html()+" &euro;)<a onclick=\"javascript:restar1()\" style=\" cursor: pointer; font-weight: bold; font-size: 12px; color: orange;\" > ( - )</a>"); 
		 }  
		 else if(numeroBotellas < 2){
			$("#compra2").html(" + 1 caja "+$("#listaNombres9").html()+" ("+$("#listaPrecios9").html()+" &euro;)<a onclick=\"javascript:restar2()\" style=\" cursor: pointer; font-weight: bold; font-size: 12px; color: orange;\" > ( - )</a>"); 
		 }
		 else if(numeroBotellas < 3){
			$("#compra3").html(" + 1 caja "+$("#listaNombres9").html()+" ("+$("#listaPrecios9").html()+" &euro;)<a onclick=\"javascript:restar3()\" style=\" cursor: pointer; font-weight: bold; font-size: 12px; color: orange;\" > ( - )</a>"); 
		 }  
		 else if(numeroBotellas < 4){
			$("#compra4").html(" + 1 caja "+$("#listaNombres9").html()+" ("+$("#listaPrecios9").html()+" &euro;)<a onclick=\"javascript:restar4()\" style=\" cursor: pointer; font-weight: bold; font-size: 12px; color: orange;\" > ( - )</a>"); 
		 }  
		 else if(numeroBotellas < 5){
			$("#compra5").html(" + 1 caja "+$("#listaNombres9").html()+" ("+$("#listaPrecios9").html()+" &euro;)<a onclick=\"javascript:restar5()\" style=\" cursor: pointer; font-weight: bold; font-size: 12px; color: orange;\" > ( - )</a>"); 
		 }  
		 else if(numeroBotellas < 6){
			$("#compra6").html(" + 1 caja "+$("#listaNombres9").html()+" ("+$("#listaPrecios9").html()+" &euro;)<a onclick=\"javascript:restar6()\" style=\" cursor: pointer; font-weight: bold; font-size: 12px; color: orange;\" > ( - )</a>"); 
		 }  
		 else if(numeroBotellas < 7){
			$("#compra7").html(" + 1 caja "+$("#listaNombres9").html()+" ("+$("#listaPrecios9").html()+" &euro;)<a onclick=\"javascript:restar7()\" style=\" cursor: pointer; font-weight: bold; font-size: 12px; color: orange;\" > ( - )</a>"); 
		 }  
		 else if(numeroBotellas < 8){
			$("#compra8").html(" + 1 caja "+$("#listaNombres9").html()+" ("+$("#listaPrecios9").html()+" &euro;)<a onclick=\"javascript:restar8()\" style=\" cursor: pointer; font-weight: bold; font-size: 12px; color: orange;\" > ( - )</a>"); 
		 }  
		 else if(numeroBotellas < 9){
			$("#compra9").html(" + 1 caja "+$("#listaNombres9").html()+" ("+$("#listaPrecios9").html()+" &euro;)<a onclick=\"javascript:restar9()\" style=\" cursor: pointer; font-weight: bold; font-size: 12px; color: orange;\" > ( - )</a>"); 
		 } 
		 if(numeroBotellas < 9){
			productoPosicion[numeroBotellas] = 9;
			cantidadProducto[8]++;
			$("#cantidadProducto9").val(cantidadProducto[8]); 
			listaCompras[numeroBotellas] = parseFloat($("#listaPrecios9").html());
			 precioTotal += parseFloat($("#listaPrecios9").html());
			 $("#precioTotal").html(precioTotal.toFixed(2));
			 numeroBotellas++;
		}
		 }); 
		}
	} 

	 function recargar10(){ 
		 compraActual = 10;	 
		 var variable_post="Mi texto actualizado";  
		 /// Invocamos a nuestro script PHP   
		 if(numeroBotellas < 9){   
			 $.post("index.php", { variable: variable_post },  
			 function(data){             
			 /// Ponemos la respuesta de nuestro script en el párrafo recargado 
		 if(numeroBotellas < 1){
			$("#compra1").html("1 caja "+$("#listaNombres10").html()+" ("+$("#listaPrecios10").html()+" &euro;)<a onclick=\"javascript:restar1()\" style=\" cursor: pointer; font-weight: bold; font-size: 12px; color: orange;\" > ( - )</a>"); 
		 }  
		 else if(numeroBotellas < 2){
			$("#compra2").html(" + 1 caja "+$("#listaNombres10").html()+" ("+$("#listaPrecios10").html()+" &euro;)<a onclick=\"javascript:restar2()\" style=\" cursor: pointer; font-weight: bold; font-size: 12px; color: orange;\" > ( - )</a>"); 
		 }
		 else if(numeroBotellas < 3){
			$("#compra3").html(" + 1 caja "+$("#listaNombres10").html()+" ("+$("#listaPrecios10").html()+" &euro;)<a onclick=\"javascript:restar3()\" style=\" cursor: pointer; font-weight: bold; font-size: 12px; color: orange;\" > ( - )</a>"); 
		 }  
		 else if(numeroBotellas < 4){
			$("#compra4").html(" + 1 caja "+$("#listaNombres10").html()+" ("+$("#listaPrecios10").html()+" &euro;)<a onclick=\"javascript:restar4()\" style=\" cursor: pointer; font-weight: bold; font-size: 12px; color: orange;\" > ( - )</a>"); 
		 }  
		 else if(numeroBotellas < 5){
			$("#compra5").html(" + 1 caja "+$("#listaNombres10").html()+" ("+$("#listaPrecios10").html()+" &euro;)<a onclick=\"javascript:restar5()\" style=\" cursor: pointer; font-weight: bold; font-size: 12px; color: orange;\" > ( - )</a>"); 
		 }  
		 else if(numeroBotellas < 6){
			$("#compra6").html(" + 1 caja "+$("#listaNombres10").html()+" ("+$("#listaPrecios10").html()+" &euro;)<a onclick=\"javascript:restar6()\" style=\" cursor: pointer; font-weight: bold; font-size: 12px; color: orange;\" > ( - )</a>"); 
		 }  
		 else if(numeroBotellas < 7){
			$("#compra7").html(" + 1 caja "+$("#listaNombres10").html()+" ("+$("#listaPrecios10").html()+" &euro;)<a onclick=\"javascript:restar7()\" style=\" cursor: pointer; font-weight: bold; font-size: 12px; color: orange;\" > ( - )</a>"); 
		 }  
		 else if(numeroBotellas < 8){
			$("#compra8").html(" + 1 caja "+$("#listaNombres10").html()+" ("+$("#listaPrecios10").html()+" &euro;)<a onclick=\"javascript:restar8()\" style=\" cursor: pointer; font-weight: bold; font-size: 12px; color: orange;\" > ( - )</a>"); 
		 }  
		 else if(numeroBotellas < 9){
			$("#compra9").html(" + 1 caja "+$("#listaNombres10").html()+" ("+$("#listaPrecios10").html()+" &euro;)<a onclick=\"javascript:restar9()\" style=\" cursor: pointer; font-weight: bold; font-size: 12px; color: orange;\" > ( - )</a>"); 
		 } 
		 if(numeroBotellas < 9){
		 	productoPosicion[numeroBotellas] = 10;
			cantidadProducto[9]++;
			$("#cantidadProducto10").val(cantidadProducto[9]); 
			listaCompras[numeroBotellas] = parseFloat($("#listaPrecios10").html());
			 precioTotal += parseFloat($("#listaPrecios10").html());
			 $("#precioTotal").html(precioTotal.toFixed(2));
			 numeroBotellas++;
		}
		 });  
		}
	} 
	
	function recargar11(){  
		 compraActual = 11;
		 var variable_post="Mi texto actualizado";  
		 /// Invocamos a nuestro script PHP   
		 if(numeroBotellas < 9){   
			 $.post("index.php", { variable: variable_post },  
			 function(data){             
			 /// Ponemos la respuesta de nuestro script en el párrafo recargado 
		 if(numeroBotellas < 1){
			$("#compra1").html("1 caja "+$("#listaNombres11").html()+" ("+$("#listaPrecios11").html()+" &euro;)<a onclick=\"javascript:restar1()\" style=\" cursor: pointer; font-weight: bold; font-size: 12px; color: orange;\" > ( - )</a>"); 
		 }  
		 else if(numeroBotellas < 2){
			$("#compra2").html(" + 1 caja "+$("#listaNombres11").html()+" ("+$("#listaPrecios11").html()+" &euro;)<a onclick=\"javascript:restar2()\" style=\" cursor: pointer; font-weight: bold; font-size: 12px; color: orange;\" > ( - )</a>"); 
		 }
		 else if(numeroBotellas < 3){
			$("#compra3").html(" + 1 caja "+$("#listaNombres11").html()+" ("+$("#listaPrecios11").html()+" &euro;)<a onclick=\"javascript:restar3()\" style=\" cursor: pointer; font-weight: bold; font-size: 12px; color: orange;\" > ( - )</a>"); 
		 }  
		 else if(numeroBotellas < 4){
			$("#compra4").html(" + 1 caja "+$("#listaNombres11").html()+" ("+$("#listaPrecios11").html()+" &euro;)<a onclick=\"javascript:restar4()\" style=\" cursor: pointer; font-weight: bold; font-size: 12px; color: orange;\" > ( - )</a>"); 
		 }  
		 else if(numeroBotellas < 5){
			$("#compra5").html(" + 1 caja "+$("#listaNombres11").html()+" ("+$("#listaPrecios11").html()+" &euro;)<a onclick=\"javascript:restar5()\" style=\" cursor: pointer; font-weight: bold; font-size: 12px; color: orange;\" > ( - )</a>"); 
		 }  
		 else if(numeroBotellas < 6){
			$("#compra6").html(" + 1 caja "+$("#listaNombres11").html()+" ("+$("#listaPrecios11").html()+" &euro;)<a onclick=\"javascript:restar6()\" style=\" cursor: pointer; font-weight: bold; font-size: 12px; color: orange;\" > ( - )</a>"); 
		 }  
		 else if(numeroBotellas < 7){
			$("#compra7").html(" + 1 caja "+$("#listaNombres11").html()+" ("+$("#listaPrecios11").html()+" &euro;)<a onclick=\"javascript:restar7()\" style=\" cursor: pointer; font-weight: bold; font-size: 12px; color: orange;\" > ( - )</a>"); 
		 }  
		 else if(numeroBotellas < 8){
			$("#compra8").html(" + 1 caja "+$("#listaNombres11").html()+" ("+$("#listaPrecios11").html()+" &euro;)<a onclick=\"javascript:restar8()\" style=\" cursor: pointer; font-weight: bold; font-size: 12px; color: orange;\" > ( - )</a>"); 
		 }  
		 else if(numeroBotellas < 9){
			$("#compra9").html(" + 1 caja "+$("#listaNombres11").html()+" ("+$("#listaPrecios11").html()+" &euro;)<a onclick=\"javascript:restar9()\" style=\" cursor: pointer; font-weight: bold; font-size: 12px; color: orange;\" > ( - )</a>"); 
		 } 
		 if(numeroBotellas < 9){
		 	productoPosicion[numeroBotellas] = 11;
			cantidadProducto[10]++;
			$("#cantidadProducto11").val(cantidadProducto[10]); 
			listaCompras[numeroBotellas] = parseFloat($("#listaPrecios11").html());
			 precioTotal += parseFloat($("#listaPrecios11").html());
			 $("#precioTotal").html(precioTotal.toFixed(2));
			 numeroBotellas++;
		}
		 });  
		}
	} 	

	 function recargar12(){  
		 compraActual = 12;
		 var variable_post="Mi texto actualizado";  
		 /// Invocamos a nuestro script PHP   
		 if(numeroBotellas < 9){   
			 $.post("index.php", { variable: variable_post },  
			 function(data){             
			 /// Ponemos la respuesta de nuestro script en el párrafo recargado  
		 if(numeroBotellas < 1){
			$("#compra1").html("1 caja "+$("#listaNombres12").html()+" ("+$("#listaPrecios12").html()+" &euro;)<a onclick=\"javascript:restar1()\" style=\" cursor: pointer; font-weight: bold; font-size: 12px; color: orange;\" > ( - )</a>"); 
		 }  
		 else if(numeroBotellas < 2){
			$("#compra2").html(" + 1 caja "+$("#listaNombres12").html()+" ("+$("#listaPrecios12").html()+" &euro;)<a onclick=\"javascript:restar2()\" style=\" cursor: pointer; font-weight: bold; font-size: 12px; color: orange;\" > ( - )</a>"); 
		 }
		 else if(numeroBotellas < 3){
			$("#compra3").html(" + 1 caja "+$("#listaNombres12").html()+" ("+$("#listaPrecios12").html()+" &euro;)<a onclick=\"javascript:restar3()\" style=\" cursor: pointer; font-weight: bold; font-size: 12px; color: orange;\" > ( - )</a>"); 
		 }  
		 else if(numeroBotellas < 4){
			$("#compra4").html(" + 1 caja "+$("#listaNombres12").html()+" ("+$("#listaPrecios12").html()+" &euro;)<a onclick=\"javascript:restar4()\" style=\" cursor: pointer; font-weight: bold; font-size: 12px; color: orange;\" > ( - )</a>"); 
		 }  
		 else if(numeroBotellas < 5){
			$("#compra5").html(" + 1 caja "+$("#listaNombres12").html()+" ("+$("#listaPrecios12").html()+" &euro;)<a onclick=\"javascript:restar5()\" style=\" cursor: pointer; font-weight: bold; font-size: 12px; color: orange;\" > ( - )</a>"); 
		 }  
		 else if(numeroBotellas < 6){
			$("#compra6").html(" + 1 caja "+$("#listaNombres12").html()+" ("+$("#listaPrecios12").html()+" &euro;)<a onclick=\"javascript:restar6()\" style=\" cursor: pointer; font-weight: bold; font-size: 12px; color: orange;\" > ( - )</a>"); 
		 }  
		 else if(numeroBotellas < 7){
			$("#compra7").html(" + 1 caja "+$("#listaNombres12").html()+" ("+$("#listaPrecios12").html()+" &euro;)<a onclick=\"javascript:restar7()\" style=\" cursor: pointer; font-weight: bold; font-size: 12px; color: orange;\" > ( - )</a>"); 
		 }  
		 else if(numeroBotellas < 8){
			$("#compra8").html(" + 1 caja "+$("#listaNombres12").html()+" ("+$("#listaPrecios12").html()+" &euro;)<a onclick=\"javascript:restar8()\" style=\" cursor: pointer; font-weight: bold; font-size: 12px; color: orange;\" > ( - )</a>"); 
		 }  
		 else if(numeroBotellas < 9){
			$("#compra9").html(" + 1 caja "+$("#listaNombres12").html()+" ("+$("#listaPrecios12").html()+" &euro;)<a onclick=\"javascript:restar9()\" style=\" cursor: pointer; font-weight: bold; font-size: 12px; color: orange;\" > ( - )</a>"); 
		 } 
		if(numeroBotellas < 9){
			productoPosicion[numeroBotellas] = 12;
			cantidadProducto[11]++;
			$("#cantidadProducto12").val(cantidadProducto[11]); 
			listaCompras[numeroBotellas] = parseFloat($("#listaPrecios12").html());
			 precioTotal += parseFloat($("#listaPrecios12").html());
			 $("#precioTotal").html(precioTotal.toFixed(2));
			 numeroBotellas++;
		}
		 });  
		}
	}*/
var posX, posY;
$(document).mousemove(function(e){
	posY=e.pageY-20;
	posX=e.pageX-250;
}); 

		function ponerCarrito(numero){
			div = document.getElementById('carrito'+numero); div.style.display = 'none';
		}
function comprar(productos, numero){
		/*window.setTimeout("comenzarMovimiento()",2000);
		$("#cuadrado").show();
		repeticion = window.setInterval("movimiento()",1000);*/
		if(numeroBotellas < 1){
				/*cantidadProducto = new Array();
				for(var i=0; i < productos; i++){
					cantidadProducto[i] = 0;
					$('#cantidadProducto'+($i)).val('');
				}*/
				productoPosicion[0] = 0;
				productoPosicion[1] = 0;
				productoPosicion[2] = 0;
				productoPosicion[3] = 0;
				productoPosicion[4] = 0;
				productoPosicion[5] = 0;
				productoPosicion[6] = 0;
				productoPosicion[7] = 0;
				productoPosicion[8] = 0;
				productoPosicion[9] = 0;
		}
		if(numeroBotellas < 9){
				 div = document.getElementById('carrito'+numero);
		 div.style.display = 'block';
				div = document.getElementById('ok');
				div.style.display = 'block';
				div2 = document.getElementById('total');
				div2.style.display = 'block';
				div2 = document.getElementById('precioTotal');
				div2.style.display = 'block';
				$("#cuadrado"+compraActual).css({position:"absolute", top:posY, left:posX/*, */});
				$("#cuadrado"+compraActual).animate({top:posY - 10, opacity: .5, width:50, height:50},  "fast");
				$("#cuadrado"+compraActual).animate({top:posY , opacity: .5, width:50, height:50},  "fast");
				$("#cuadrado"+compraActual).animate({top:posY - 10, opacity: .5, width:50, height:50},  "fast");
				/*$("#cuadrado"+compraActual).animate({top:posY - 52.57, left:posX - 52.57},  "fast");
				$("#cuadrado"+compraActual).animate({top:posY, left:posX - 75},  "fast");
				$("#cuadrado"+compraActual).animate({top:posY + 52.57, left:posX - 52.57},  "fast");
				$("#cuadrado"+compraActual).animate({top:posY + 75, left:posX},  "fast");
				$("#cuadrado"+compraActual).animate({top:posY + 52.57, left:posX + 52.57},  "fast");
				$("#cuadrado"+compraActual).animate({top:posY, left:posX + 75},  "fast");
				$("#cuadrado"+compraActual).animate({top:posY - 52.57, left:posX + 52.57},  "fast");
				$("#cuadrado"+compraActual).animate({top:posY - 75, left:posX},  "fast");*/
				/*$("#cuadrado"+compraActual).animate({top:$("#cuadrado"+compraActual).top + 8.79, left:$("#cuadrado"+compraActual).left - 21.21, width:100, height:100, opacity: 1}, "slow");*/
				$("#cuadrado"+compraActual).animate({top:130, left:685, width:100, height:100, opacity: 1}, "slow");
				$("#cuadrado"+compraActual).animate({opacity: 0}, "slow");
				for(var i=0; i < productos; i++){
					if(compraActual==i)
						$("#cuadrado"+compraActual).animate({top:$("#cuadradoAUX"+compraActual).offset().top, left:$("#cuadradoAUX"+compraActual).offset().left, width:26, height:26}, "fast");
				}
				//document.getElementById("carrito"+numero).src = './img/carrito.png';
				setTimeout("ponerCarrito("+numero+")",2000);	
		 
		}
		
}

function comprar2(){
		div = document.getElementById('ok');
		div.style.display = 'block';
		div2 = document.getElementById('total');
		div2.style.display = 'block';
		div2 = document.getElementById('precioTotal');
		div2.style.display = 'block';
} 	

	function movimiento()
	{
	  $("#cuadrado").position().left += 10; 
	}
	 

$(document).ready(function(){
		//DD_roundies.addRule('.fondoBlancoCSS3', '50px 0 0 50px', true);
		//var web_alto2 = $(document).height();
		//$(".fondoBlanco2").height(web_alto2+290);
		//$(".creditos2").css({top:$(document).height()+8});
		$(".columnaMenu12").css({top:$(document).height()-250});
		$(".columnaMenu22").css({top:$(document).height()-250});
		$(".columnaMenu32").css({top:$(document).height()-250});
		$(".columnaMenu42").css({top:$(document).height()-250});
		$("#mostrarDescripcion1").click(function(){$("#descripcionProducto1").show("slow")});
		$("#mostrarDescripcion1").click(function(){$("#descripcionProducto21").show("fast")});
		$("#mostrarDescripcion1").click(function(){$("#quitarDescripcion1").show()});
		$("#mostrarDescripcion1").click(function(){$("#mostrarDescripcion1").hide()});
		$("#quitarDescripcion1").click(function(){$("#descripcionProducto1").hide("slow")});
		$("#quitarDescripcion1").click(function(){$("#descripcionProducto21").hide("fast")});
		$("#quitarDescripcion1").click(function(){$("#quitarDescripcion1").hide()});
		$("#quitarDescripcion1").click(function(){$("#mostrarDescripcion1").show()});
		
		$("#mostrarDescripcion2").click(function(){$("#descripcionProducto2").show("slow")});
		$("#mostrarDescripcion2").click(function(){$("#descripcionProducto22").show("fast")});
		$("#mostrarDescripcion2").click(function(){$("#quitarDescripcion2").show()});
		$("#mostrarDescripcion2").click(function(){$("#mostrarDescripcion2").hide()});
		$("#quitarDescripcion2").click(function(){$("#descripcionProducto2").hide("slow")});
		$("#quitarDescripcion2").click(function(){$("#descripcionProducto22").hide("fast")});
		$("#quitarDescripcion2").click(function(){$("#quitarDescripcion2").hide()});
		$("#quitarDescripcion2").click(function(){$("#mostrarDescripcion2").show()});
		
		$("#mostrarDescripcion3").click(function(){$("#descripcionProducto3").show("slow")});
		$("#mostrarDescripcion3").click(function(){$("#descripcionProducto23").show("fast")});
		$("#mostrarDescripcion3").click(function(){$("#quitarDescripcion3").show()});
		$("#mostrarDescripcion3").click(function(){$("#mostrarDescripcion3").hide()});
		$("#quitarDescripcion3").click(function(){$("#descripcionProducto3").hide("slow")});
		$("#quitarDescripcion3").click(function(){$("#descripcionProducto23").hide("fast")});
		$("#quitarDescripcion3").click(function(){$("#quitarDescripcion3").hide()});
		$("#quitarDescripcion3").click(function(){$("#mostrarDescripcion3").show()});
		
		$("#mostrarDescripcion4").click(function(){$("#descripcionProducto4").show("slow")});
		$("#mostrarDescripcion4").click(function(){$("#descripcionProducto24").show("fast")});
		$("#mostrarDescripcion4").click(function(){$("#quitarDescripcion4").show()});
		$("#mostrarDescripcion4").click(function(){$("#mostrarDescripcion4").hide()});
		$("#quitarDescripcion4").click(function(){$("#descripcionProducto4").hide("slow")});
		$("#quitarDescripcion4").click(function(){$("#descripcionProducto24").hide("fast")});
		$("#quitarDescripcion4").click(function(){$("#quitarDescripcion4").hide()});
		$("#quitarDescripcion4").click(function(){$("#mostrarDescripcion4").show()});
		
		$("#mostrarDescripcion5").click(function(){$("#descripcionProducto5").show("slow")});
		$("#mostrarDescripcion5").click(function(){$("#descripcionProducto25").show("fast")});
		$("#mostrarDescripcion5").click(function(){$("#quitarDescripcion5").show()});
		$("#mostrarDescripcion5").click(function(){$("#mostrarDescripcion5").hide()});
		$("#quitarDescripcion5").click(function(){$("#descripcionProducto5").hide("slow")});
		$("#quitarDescripcion5").click(function(){$("#descripcionProducto25").hide("fast")});
		$("#quitarDescripcion5").click(function(){$("#quitarDescripcion5").hide()});
		$("#quitarDescripcion5").click(function(){$("#mostrarDescripcion5").show()});
		
		
		$("#mostrarDescripcion6").click(function(){$("#descripcionProducto6").show("slow")});
		$("#mostrarDescripcion6").click(function(){$("#descripcionProducto26").show("fast")});
		$("#mostrarDescripcion6").click(function(){$("#quitarDescripcion6").show()});
		$("#mostrarDescripcion6").click(function(){$("#mostrarDescripcion6").hide()});
		$("#quitarDescripcion6").click(function(){$("#descripcionProducto6").hide("slow")});
		$("#quitarDescripcion6").click(function(){$("#descripcionProducto26").hide("fast")});
		$("#quitarDescripcion6").click(function(){$("#quitarDescripcion6").hide()});
		$("#quitarDescripcion6").click(function(){$("#mostrarDescripcion6").show()});
		
		$("#mostrarDescripcion7").click(function(){$("#descripcionProducto7").show("slow")});
		$("#mostrarDescripcion7").click(function(){$("#descripcionProducto27").show("fast")});
		$("#mostrarDescripcion7").click(function(){$("#quitarDescripcion7").show()});
		$("#mostrarDescripcion7").click(function(){$("#mostrarDescripcion7").hide()});
		$("#quitarDescripcion7").click(function(){$("#descripcionProducto7").hide("slow")});
		$("#quitarDescripcion7").click(function(){$("#descripcionProducto27").hide("fast")});
		$("#quitarDescripcion7").click(function(){$("#quitarDescripcion7").hide()});
		$("#quitarDescripcion7").click(function(){$("#mostrarDescripcion7").show()});
		
		$("#mostrarDescripcion8").click(function(){$("#descripcionProducto8").show("slow")});
		$("#mostrarDescripcion8").click(function(){$("#descripcionProducto28").show("fast")});
		$("#mostrarDescripcion8").click(function(){$("#quitarDescripcion8").show()});
		$("#mostrarDescripcion8").click(function(){$("#mostrarDescripcion8").hide()});
		$("#quitarDescripcion8").click(function(){$("#descripcionProducto8").hide("slow")});
		$("#quitarDescripcion8").click(function(){$("#descripcionProducto28").hide("fast")});
		$("#quitarDescripcion8").click(function(){$("#quitarDescripcion8").hide()});
		$("#quitarDescripcion8").click(function(){$("#mostrarDescripcion8").show()});
		
		$("#mostrarDescripcion9").click(function(){$("#descripcionProducto9").show("slow")});
		$("#mostrarDescripcion9").click(function(){$("#descripcionProducto29").show("fast")});
		$("#mostrarDescripcion9").click(function(){$("#quitarDescripcion9").show()});
		$("#mostrarDescripcion9").click(function(){$("#mostrarDescripcion9").hide()});
		$("#quitarDescripcion9").click(function(){$("#descripcionProducto9").hide("slow")});
		$("#quitarDescripcion9").click(function(){$("#descripcionProducto29").hide("fast")});
		$("#quitarDescripcion9").click(function(){$("#quitarDescripcion9").hide()});
		$("#quitarDescripcion9").click(function(){$("#mostrarDescripcion9").show()});
		
		$("#mostrarDescripcion10").click(function(){$("#descripcionProducto10").show("slow")});
		$("#mostrarDescripcion10").click(function(){$("#descripcionProducto210").show("fast")});
		$("#mostrarDescripcion10").click(function(){$("#quitarDescripcion10").show()});
		$("#mostrarDescripcion10").click(function(){$("#mostrarDescripcion10").hide()});
		$("#quitarDescripcion10").click(function(){$("#descripcionProducto10").hide("slow")});
		$("#quitarDescripcion10").click(function(){$("#descripcionProducto210").hide("fast")});
		$("#quitarDescripcion10").click(function(){$("#quitarDescripcion10").hide()});
		$("#quitarDescripcion10").click(function(){$("#mostrarDescripcion10").show()});
		
		$("#mostrarDescripcion11").click(function(){$("#descripcionProducto11").show("slow")});
		$("#mostrarDescripcion11").click(function(){$("#descripcionProducto211").show("fast")});
		$("#mostrarDescripcion11").click(function(){$("#quitarDescripcion11").show()});
		$("#mostrarDescripcion11").click(function(){$("#mostrarDescripcion11").hide()});
		$("#quitarDescripcion11").click(function(){$("#descripcionProducto11").hide("slow")});
		$("#quitarDescripcion11").click(function(){$("#descripcionProducto211").hide("fast")});
		$("#quitarDescripcion11").click(function(){$("#quitarDescripcion11").hide()});
		$("#quitarDescripcion11").click(function(){$("#mostrarDescripcion11").show()});
		
		$("#mostrarDescripcion12").click(function(){$("#descripcionProducto12").show("slow")});
		$("#mostrarDescripcion12").click(function(){$("#descripcionProducto212").show("fast")});
		$("#mostrarDescripcion12").click(function(){$("#quitarDescripcion12").show()});
		$("#mostrarDescripcion12").click(function(){$("#mostrarDescripcion12").hide()});
		$("#quitarDescripcion12").click(function(){$("#descripcionProducto12").hide("slow")});
		$("#quitarDescripcion12").click(function(){$("#descripcionProducto212").hide("fast")});
		$("#quitarDescripcion12").click(function(){$("#quitarDescripcion12").hide()});
		$("#quitarDescripcion12").click(function(){$("#mostrarDescripcion12").show()});
});

function vacio(q) { //busca caracteres que no sean espacio en blanco en una cadena 
	for ( i = 0; i < q.length; i++ ) {  
    	if ( q.charAt(i) != " " ) {  
         	return true  
       	}  
  	}  
	return false  
} 

function validarContacto()
{
   var nombre = document.getElementById('nombre2');
   var apellidos = document.getElementById('apellidos2');
   var empresa = document.getElementById('empresa2');
   var correo = document.getElementById('mail2');
   var telefono = document.getElementById('telefono2');
   var asunto = document.getElementById('asunto2');
   var descripcion = document.getElementById('descripcion2');
   var respuesta = true;
   var mensaje = "";
   patronCorreo = /[\w-\.]{3,}@([\w-]{2,}\.)*([\w-]{2,}\.)[\w-]{2,4}/;
   patronTelefono = /^\d{9}$/;	//nueve d\u00edgitos consecutivos sin espacios ni guiones entre las cifras
   if(vacio(nombre.value) == false) {
      	mensaje +="- You must to enter your name\n";
		nombre.focus();
      	respuesta = false;
   }
	if(vacio(apellidos.value) == false) {
    	mensaje +="- You must to enter your surname\n";
		apellidos.focus();
      	respuesta = false;
   }
   	if(vacio(asunto.value) == false) {
    	mensaje +="- You must to enter an issue\n";
		asunto.focus();
      	respuesta = false;
   }

   if(vacio(correo.value) == false) {
      	mensaje +="- You must to enter your e-mail \n";
		correo.focus();
      	respuesta = false;
   } else if (!patronCorreo.test(correo.value)) {
      	mensaje +="- Invalid email address \n";
		correo.focus();
      	respuesta = false;
   }
   
    if(vacio(telefono.value) == true) {//numero de telefono no obligatorio
      	if (!patronTelefono.test(telefono.value)) {
      		mensaje +="- Invalid phone number\n";
			telefono.focus();
      		respuesta = false;
		}
   }   

    if(vacio(descripcion.value) == false) {
      	mensaje += "- You must to enter a message\n";
		descripcion.focus();
      	respuesta = false;
   }
   if(!respuesta) {
      	alert("The following errors have been found: \n" + "_______________________________________________________" + 
		"\n\n" + mensaje + "_______________________________________________________");
   } else {
      	respuesta = confirm( "Are you sure you want to send this data?");
		document.forms.contacto.submit();
   }

   return respuesta;
} 

function validarContactoEspanish()
{
   var nombre = document.getElementById('nombre3');
   var apellidos = document.getElementById('apellidos3');
   var empresa = document.getElementById('empresa3');
   var correo = document.getElementById('mail4');
   var telefono = document.getElementById('telefono3');
   var asunto = document.getElementById('asunto3');
   var descripcion = document.getElementById('descripcion3');
   var respuesta = true;
   var mensaje = "";
   patronCorreo = /[\w-\.]{3,}@([\w-]{2,}\.)*([\w-]{2,}\.)[\w-]{2,4}/;
   patronTelefono = /^\d{9}$/;	//nueve d\u00edgitos consecutivos sin espacios ni guiones entre las cifras
   if(vacio(nombre.value) == false) {
      	mensaje +="- Debe introducir su Nombre\n";
		nombre.focus();
      	respuesta = false;
   }
	if(vacio(apellidos.value) == false) {
    	mensaje +="- Debe introducir sus Apellidos\n";
		apellidos.focus();
      	respuesta = false;
   }
   	if(vacio(asunto.value) == false) {
    	mensaje +="- Debe introducir un asunto\n";
		asunto.focus();
      	respuesta = false;
   }

   if(vacio(correo.value) == false) {
      	mensaje +="- Debe introducir su correo electr\u00f3nico \n";
		correo.focus();
      	respuesta = false;
   } else if (!patronCorreo.test(correo.value)) {
      	mensaje +="- Direcci\u00f3n de correo no v\u00e1lida\n";
		correo.focus();
      	respuesta = false;
   }
   
    if(vacio(telefono.value) == true) {//numero de telefono no obligatorio
      	if (!patronTelefono.test(telefono.value)) {
      		mensaje +="- N\u00famero de Tel\u00e9fono no v\u00e1lido\n";
			telefono.focus();
      		respuesta = false;
		}
   }   

    if(vacio(descripcion.value) == false) {
      	mensaje += "- Debe introducir un mensaje\n";
		descripcion.focus();
      	respuesta = false;
   }
   if(!respuesta) {
      	alert("Se han cometido los siguientes errores: \n" + "_______________________________________________________" + 
		"\n\n" + mensaje + "_______________________________________________________");
   } else {
      	respuesta = confirm( "\u00bfEsta seguro de que desea enviar estos datos?");
		document.forms.contactoEspanish.submit();
   }

   return respuesta;
} 

function validarPedidoIngles()
{
   var name = document.getElementById('name');
   var address = document.getElementById('address');
   var city = document.getElementById('city');
   var county = document.getElementById('county');
   var postcode = document.getElementById('postcode');
   var country = document.getElementById('country');
   var phone = document.getElementById('phone');
   var email = document.getElementById('email');
   var respuesta = true;
   var mensaje = "";
   patronCorreo = /[\w-\.]{3,}@([\w-]{2,}\.)*([\w-]{2,}\.)[\w-]{2,4}/;
   patronTelefono = /^\d{9}$/;	//nueve d\u00edgitos consecutivos sin espacios ni guiones entre las cifras
   if(vacio(name.value) == false) {
      	mensaje +="- You must to enter your name\n";
		name.focus();
      	respuesta = false;
   }
   if(vacio(address.value) == false) {
      	mensaje +="- You must to enter your address\n";
		address.focus();
      	respuesta = false;
   }
   if(vacio(city.value) == false) {
      	mensaje +="- You must to enter your city\n";
		city.focus();
      	respuesta = false;
   }
   if(vacio(county.value) == false) {
      	mensaje +="- You must to enter your county\n";
		county.focus();
      	respuesta = false;
   }
   
   if(vacio(postcode.value) == false) {
      	mensaje +="- You must to enter your postCode\n";
		postcode.focus();
      	respuesta = false;
   }
   
   if(vacio(country.value) == false) {
      	mensaje +="- You must to enter your country\n";
		country.focus();
      	respuesta = false;
   }
  

   if(vacio(email.value) == false) {
      	mensaje +="- You must to enter your e-mail\n";
		email.focus();
      	respuesta = false;
   } else if (!patronCorreo.test(email.value)) {
      	mensaje +="- the e-mail is not correct\n";
		email.focus();
      	respuesta = false;
   }

   if(!respuesta) {
      	alert("Se han cometido los siguientes errores: \n" + "_______________________________________________________" + 
		"\n\n" + mensaje + "_______________________________________________________");
   } else {
      	respuesta = confirm( "\u00bfEsta seguro de que desea enviar estos datos?");
		document.forms.contacto.submit();
   }

   return respuesta;
} 

function validarPedido()
{
   var nombre = document.getElementById('nombrePedido');
   var dni = document.getElementById('DNIpedido');
   var cp = document.getElementById('cpPedido');
   var localidad = document.getElementById('localidadPedido');
   var provincia = document.getElementById('provinciaPedido');
   var telefono = document.getElementById('telefonoPedido');
   var mail = document.getElementById('mailPedido');
   var direccion = document.getElementById('direccionPedido');
   var respuesta = true;
   var mensaje = "";
   patronCorreo = /[\w-\.]{3,}@([\w-]{2,}\.)*([\w-]{2,}\.)[\w-]{2,4}/;
   patronTelefono = /^\d{9}$/;	//nueve d\u00edgitos consecutivos sin espacios ni guiones entre las cifras
   if(vacio(nombre.value) == false) {
      	mensaje +="- Debe introducir su Nombre\n";
		nombre.focus();
      	respuesta = false;
   }
	if(vacio(dni.value) == false) {
    	mensaje +="- Debe introducir su DNI\n";
		dni.focus();
      	respuesta = false;
   }
   	if(vacio(cp.value) == false) {
    	mensaje +="- Debe introducir su C.P.\n";
		cp.focus();
      	respuesta = false;
   }
   

   if(vacio(mail.value) == false) {
      	mensaje +="- Debe introducir su correo electr\u00f3nico \n";
		mail.focus();
      	respuesta = false;
   } else if (!patronCorreo.test(mail.value)) {
      	mensaje +="- Direcci\u00f3n de correo no v\u00e1lida\n";
		mail.focus();
      	respuesta = false;
   }

    if(vacio(telefono.value) == true) {//numero de telefono no obligatorio
      	if (!patronTelefono.test(telefono.value)) {
      		mensaje +="- N\u00famero de Tel\u00e9fono no v\u00e1lido\n";
			telefono.focus();
      		respuesta = false;
		}
   }   

    if(vacio(direccion.value) == false) {
      	mensaje += "- Debe introducir su direcci\u00f3\n";
		direccion.focus();
      	respuesta = false;
   }
   
    if(vacio(provincia.value) == false) {
      	mensaje += "- Debe introducir su provincia\n";
		provincia.focus();
      	respuesta = false;
   }

   if(!respuesta) {
      	alert("Se han cometido los siguientes errores: \n" + "_______________________________________________________" + 
		"\n\n" + mensaje + "_______________________________________________________");
   } else {
      	respuesta = confirm( "\u00bfEsta seguro de que desea enviar estos datos?");
		document.forms.contacto.submit();
   }

   return respuesta;
} 


/*$(document).ready(function (){
		//Aqui asignamos el click al elemento <a>
			$(".botonCarrito").click(function (){
			if(numeroBotellas < 9){
				$("#cuadrado"+compraActual).animate({top:520, left:690, width:100, height:100, opacity: 1}, "slow");
				$("#cuadrado"+compraActual).animate({opacity: 0}, "slow");
				if(compraActual==1)
					$("#cuadrado"+compraActual).animate({top:705, left:15, width:26, height:26}, "fast");
				else if(compraActual==2)
					$("#cuadrado"+compraActual).animate({top:705, left:215, width:26, height:26}, "fast");
				else if(compraActual==3)
					$("#cuadrado"+compraActual).animate({top:705, left:415, width:26, height:26}, "fast");
			}
		});
	}); */
	

