// JavaScript Document

// C&aacute;digo


// funciones para imagenes- se refresca cuando se elimina una imagen
$(document).ready( function(){	
							
	$('#menu li').each(function(index){ 
		$(this).click(function(){			                
			$("#subcat"+index).toggle("fast");// toggle:desplegar  y volver a pegarlo fast: velocidad			   
		}); 	  
	});	
	
	$("#images a").mousemove( function(){
		var title = $(this).attr("title");
		$("#imgp").hide();
		$("#imgp").attr("src", title).fadeIn('slow'); 
	});	
	
	$("#f5").validate ( {
  	
	showErrors: function(errorMap, errorList) {
		$("#warning").html("Tu formulario contiene " + this.numberOfInvalids() + " error(es).");
		this.defaultShowErrors();
	},
	debug: false,
	errorElement: "em",
	errorContainer: $("#warning"),
	success: function(label) {
		label.text("ok!").addClass("success");
	}
  }); 
	
	
	$(".galery img").click(function(){
		$("#img_event").hide();
		$("#img_event").attr('src','aplication/public_root/imgs/catalogo/'+$(this).attr('alt')).fadeIn('slow');
	});
	
}); 

var request = false;

if (window.XMLHttpRequest) {
	request = new XMLHttpRequest();
}

function sumarDescarga(field, resul) {
	var su = Math.random()
		if (window.ActiveXObject) {
    		try {
            	request = new ActiveXObject("Msxml2.XMLHTTP");
       		 } catch(e) {
            	try {
                	request = new ActiveXObject("Microsoft.XMLHTTP");
            	} catch(e) {
                	request = false;
            	}
        	}    
		}
		 

    	if (request) {
    	    request.onreadystatechange = function (){
	
				var result = document.getElementById(resul);
			
				if (request.readyState == 4) {
					if (request.status == 200) {
						result.innerHTML = request.responseText;
					}
				} else {
					result.innerHTML = " Descarga...";
				}
			}
    	    request.open("GET", "suma_descarga.php?su="+ su +"&id=" + encodeURIComponent(field));
    	    request.send(null);
    	}	
}

function validar(){
	if(document.frm.nombre.value==""){
		alert("CUIDADO: Por favor introduzca su nombre");
		document.frm.nombre.focus();
		return false;
	}else if(document.frm.apellido.value==""){
		alert("CUIDADO:Por favor introduzca su apellido");
		document.frm.apellido.focus();
		return false;
	}else if(document.frm.telefono.value==""){
		alert("CUIDADO: Por favor escriba al menos un telefono");
		document.frm.telefono.focus();
		return false;
	}else if(document.frm.email.value==""){
		alert("CUIDADO: Por favor escriba su e-mail");
		document.frm.email.focus();
		return false;
	}else if(document.frm.mensaje.value==""){
		alert("CUIDADO: Por favor escriba el mensaje");
		document.frm.mensaje.focus();
		return false;
	}else{
		return true;	
	}
}


/*function validar_acceso(){
	if(document.f1.email.value==""){
		alert("ERROR: ingrese su email ");
		document.f1.email.focus();
		return false;
	}else if(checkemail(document.f1.email.value)== false){
		document.f1.email.value="";
		document.f1.email.focus();
		return false;
	}else if(document.f1.password.value==""){
		alert("ERROR: ingrese password ");
		document.f1.password.focus();
		return false;
	}else{
		document.f1.action="index.php?cuenta=acceso";
		document.f1.submit();
	}	
}*/

function validar_acceso(url){
	if(document.f2.email.value==""){
		alert("ERROR: ingrese su email ");
		document.f2.email.focus();
		return false;
	}else if(checkemail(document.f2.email.value)== false){
		document.f2.email.value="";
		document.f2.email.focus();
		return false;
	}else if(document.f2.password.value==""){
		alert("ERROR: ingrese password ");
		document.f2.password.focus();
		return false;
	}else{
		document.f2.action = url + "?cuenta=acceso";
		document.f2.submit();
	}	
}

function validar_acceso_left(){
	//alert(url);
	if(document.f1.email.value==""){
		alert("ERROR: ingrese su email ");
		document.f1.email.focus();
		return false;
	}else if(checkemail(document.f1.email.value)== false){
		document.f1.email.value="";
		document.f1.email.focus();
		return false;
	}else if(document.f1.password.value==""){
		alert("ERROR: ingrese password ");
		document.f1.password.focus();
		return false;
	}else{
		document.f1.action = "cuenta.php?cuenta=acceso";
		document.f1.submit();
	}	
}



function valida_diselo(){
	if(document.f1.nombre.value==""){
		alert("ERROR: ingrese su nombre ");
		document.f1.nombre.focus()
		return false;
	}else if(document.f1.email.value==""){
		alert("ERROR: ingrese su email ");
		document.f1.email.focus()
		return false;
	}else if(document.f1.nombre_amigo.value==""){
		alert("ERROR: ingrese el nombre de su amigo ");
		document.f1.nombre_amigo.focus()
		return false;
	}else if(document.f1.email_amigo.value==""){
		alert("ERROR: ingrese el email de su amigo ");
		document.f1.email_amigo.focus()
		return false;
	}else if(document.f1.titulo.value==""){
		alert("ERROR: ingrese el titulo de mensaje ");
		document.f1.titulo.focus()
		return false;
	}else if(document.f1.mansaje.value==""){
		alert("ERROR: ingrese el mnsaje ");
		document.f1.mansaje.focus()
		return false;
	}else {
		document.f1.action="recomienda.php";
		document.f1.submit();
	}	
}

function validar_sendcontrasenia(opcion){
	if(document.cuenta.email.value==""){
		alert(" ERROR: Por favor ingrese su email ");
		document.cuenta.email.focus();
		return false
	}else if(checkemail(document.cuenta.email.value)== false){
		document.cuenta.email.value="";
		document.cuenta.email.focus();
		return false;
	}else{
		document.cuenta.action='cuenta.php?cuenta='+opcion;
		document.cuenta.submit();
	}
}


function validar_delete(){
	if(!confirm("Esta Seguro que desea Eliminar el Registro")){
		return false;	
	}else{
		return true;	
	}	
}


function validar_direccion(opcion, id){
	var doc= eval('document.direccion');
	if(doc.nombre.value==""){
		alert("ERROR: Por favor ingrese el nombre");
		doc.nombre.focus();
		return false;
	}else if(doc.apellidos.value==""){
		alert("ERROR: Por favor ingrese el apellido");
		doc.apellidos.focus();
		return false;
	}else if(doc.pais.value=="" || doc.pais.value==0){
		alert("ERROR: Por favor ingrese el pais");
		doc.pais.focus();
		return false;
	}else if(doc.direccion.value==""){
		alert("ERROR: Por favor ingrese la direcci&aacute;n");
		doc.direccion.focus();
		return false;
	}else if(doc.cp.value==""){
		alert("ERROR: Por favor ingrese el codigo postal");
		doc.cp.focus();
		return false;
	}/*else if(doc.ciudad.value==""){
		alert("ERROR: Por favor ingrese la ciudad");
		doc.ciudad.focus();
		return false;
	}*/else if(doc.estado.value==""){
		alert("ERROR: Por favor ingrese estado ");
		doc.estado.focus();
		return false;
	}else{
		doc.action="direcciones.php?&dir="+opcion+'&id_dir='+id;
		doc.submit();
	} 
}

function validar_direccion_pedido(from){
	var doc= eval('document.direccion');
	var docs= eval('document.direcciones');
	if(doc.nombre.value=="" && doc.apellidos.value==""){
		docs.action=from 
		docs.submit();
	}else{
		
		if(doc.nombre.value==""){
		alert("ERROR: Por favor ingrese el nombre");
		doc.nombre.focus();
		return false;
		}else if(doc.apellidos.value==""){
			alert("ERROR: Por favor ingrese el apellido");
			doc.apellidos.focus();
			return false;
		}else if(doc.direccion.value==""){
			alert("ERROR: Por favor ingrese la direcci&aacute;n");
			doc.direccion.focus();
			return false;
		}else if(doc.cp.value==""){
			alert("ERROR: Por favor ingrese el codigo postal");
			doc.cp.focus();
			return false;
		}else if(doc.ciudad.value==""){
			alert("ERROR: Por favor ingrese la ciudad");
			doc.ciudad.focus();
			return false;
		}else if(doc.estado.value==""){
			alert("ERROR: Por favor ingrese estado ");
			doc.ciudad.focus();
			return false;
		}else if(doc.pais.value==""){
			alert("ERROR: Por favor ingrese el pais");
			doc.pais.focus();
			return false;
		}else{
			doc.action=from ;
			doc.submit();	
		}
	} 
}

function validar_direccion_envio(from){
	var doc= eval('document.envio');

	if(doc.nombres.value=="" && doc.apellidos.value==""){
		docs.envio=from 
		docs.submit();
	} else { 
		
		if(doc.nombres.value==""){
			alert("ERROR: Por favor ingrese los nombres");
			doc.nombre.focus();
			return false;
		}else if(doc.apellidos.value==""){
			alert("ERROR: Por favor ingrese los apellidos");
			doc.nombre.focus();
			return false;	  
		}else if(doc.email.value==""){
			alert("ERROR: Por favor ingrese el email");
			doc.nombre.focus();
			return false;	  	  
		}else if(doc.telefono.value==""){
			alert("ERROR: Por favor ingrese el tel&eacute;fono");
			doc.nombre.focus();
			return false;	  	  
		}else if(doc.direccion.value==""){
			alert("ERROR: Por favor ingrese la direccion");
			doc.nombre.focus();
			return false;	  	  
		}else if(doc.distrito.value==""){
			alert("ERROR: Por favor ingrese el distrito");
			doc.nombre.focus();
			return false;	  	  
		}else if(doc.provincia.value==""){
			alert("ERROR: Por favor ingrese la provincia");
			doc.nombre.focus();
			return false;	  	  
		}else if(doc.pais.value==""){
			alert("ERROR: Por favor ingrese el pasi");
			doc.nombre.focus();
			return false;	  	  
		}else if(doc.fechaenvio.value==""){
			alert("ERROR: Por favor seleccione la fecha de envio");
			doc.nombre.focus();
			return false;	  	  
		}else{
			//doc.envio=from ;
			doc.submit();	
			}	
	 }
}

function validar_mis_datos(opcion){
	if(document.cuenta.nombre.value==""){
		alert(" ERROR: Por favor ingrese su nombre ");
		document.cuenta.nombre.focus();
		return false
	}else if(document.cuenta.apellidos.value==""){
		alert(" ERROR: Por favor ingrese su apellido ");
		document.cuenta.apellidos.focus();
		return false
	}else if(document.cuenta.email.value==""){
		alert(" ERROR: Por favor ingrese su email ");
		document.cuenta.email.focus();
		return false
	}else if(checkemail(document.cuenta.email.value)== false){
		document.cuenta.email.focus();
		return false;
	}else if(document.cuenta.telefono.value==""){
		alert(" ERROR: Por favor ingrese su telefono ");
		document.cuenta.telefono.focus();
		return false
	}else{
		document.cuenta.action='cuenta.php?cuenta='+opcion;
		document.cuenta.submit();
	}	
}

function validar_mi_contrasenia(opcion){
	if(document.cuenta.password_actual.value==""){
		alert(" ERROR: Por favor ingrese su password actual ");
		document.cuenta.password_actual.focus();
		return false
	}else if(document.cuenta.nuevo_password.value==""){
		alert(" ERROR: Por favor ingrese su nuevo password ");
		document.cuenta.nuevo_password.focus();
		return false
	}else if(document.cuenta.confirmar_password.value==""){
		alert(" ERROR: Por favor confirme su password ");
		document.cuenta.confirmar_password.focus();
		return false
	}else if(document.cuenta.confirmar_password.value!=document.cuenta.nuevo_password.value){
		alert(" ERROR: la confirmaci&aacute;n de su password no es v&aacute;lido");
		document.cuenta.confirmar_password.focus();
		return false
	}else{
		document.cuenta.action='cuenta.php?cuenta='+opcion;
		document.cuenta.submit();
	}	
}
function validar_solicitud(opcion){
	if(document.cuenta.asunto.value==""){
		alert(" ERROR: Por favor ingrese el asunto ");
		document.cuenta.asunto.focus();
		return false
	}else if(document.cuenta.mensaje.value!=document.cuenta.nuevo_password.value){
		alert(" ERROR: Por favor ingrese el mensaje de la solicitud");
		document.cuenta.mensaje.focus();
		return false
	}else{
		document.cuenta.action='cuenta.php?cuenta='+opcion;
		document.cuenta.submit();
	}	
}
function validpsw(e) { 
	tecla = (document.all) ? e.keyCode : e.which; 
	//alert(tecla)
    if (tecla==8 || tecla==46 || tecla==13) return true; //Tecla de retroceso (para poder borrar) 
    // dejar la l&aacute;nea de patron que se necesite y borrar el resto 
    //patron =/[A-Za-z]/; // Solo acepta letras 
    //patron = /\d/; // Solo acepta n&aacute;meros
    patron = /\w/; // Acepta n&aacute;meros y letras 
    //patron = /\D/; // No acepta n&aacute;meros 
    // patron = /[\d.-]/; numeros el punto y el signo -
    te = String.fromCharCode(tecla); 
    verifica= patron.test(te);
	if(verifica==false){
		alert("El caracter que esta tratando de ingresar no se permite");		
		return false;
	}else{
		return true
	}	
	// uso  onKeyPress="return validpsw(event)"
}

function validacaracter(e) { 
	tecla = (document.all) ? e.keyCode : e.which; 
	//alert(tecla)
    if (tecla==8 || tecla==46 || tecla==13 || tecla==32) return true; //Tecla de retroceso (para poder borrar) 
    // dejar la l&aacute;nea de patron que se necesite y borrar el resto 
    //patron =/[A-Za-z]/; // Solo acepta letras 
    //patron = /\d/; // Solo acepta n&aacute;meros
    patron = /\w/; // Acepta n&aacute;meros y letras 
    //patron = /\D/; // No acepta n&aacute;meros 
    // patron = /[\d.-]/; numeros el punto y el signo -
    te = String.fromCharCode(tecla); 
    return patron.test(te);	
	// uso  onKeyPress="return validacaracter(event)"
}

function actualiza_producto(){
	document.cesta.action="cesta.php?car=update";
	document.cesta.submit();	
}

function validnum(e) { 
	tecla = (document.all) ? e.keyCode : e.which; 
	//alert(tecla)
    if (tecla==8 || tecla==46) return true; //Tecla de retroceso (para poder borrar) 
    // dejar la l&aacute;nea de patron que se necesite y borrar el resto 
    //patron =/[A-Za-z]/; // Solo acepta letras 
    patron = /\d/; // Solo acepta n&aacute;meros
    //patron = /\w/; // Acepta n&aacute;meros y letras 
    //patron = /\D/; // No acepta n&aacute;meros 
    //patron = /[\d.-]/; numeros el punto y el signo -
    te = String.fromCharCode(tecla); 
    return patron.test(te);  
	// uso  onKeyPress="return validnum(event)"
}

$(document).ready( function(){						   
	
/*	$("#imagess a").click( function(){
		var title = $(this).attr("title");
		$("#imgp").hide();
		$("#imgp").attr("src", title).fadeIn('slow'); 
	});	*/ 	
	$("#find").click( function(){
		var keyword = $("#buscar").val()					   	
		buscar('index.php',keyword)							
	})	
		
});

function buscar(url,texto){
	document.f2.action=url+'?q='+ texto;
	document.f2.submit();
}

function procesa_admin(){
	if(document.f1.usuario.value==""){
		alert("ERROR: Por favor ingrese Usuario");
		document.f1.usuario.focus();
		return false
	}else if(document.f1.password.value==""){
		alert("ERROR: Por favor ingrese Password");
		document.f1.password.focus();
		return false;
	}
	document.f1.action="admin/validacion.php";
	document.f1.submit();
	
	} 	
	
var testresults
	function checkemail(value){
		var str = value
		var filter=/^.+@.+\..{2,3}$/

		if (filter.test(str))
			testresults=true
		else{
			alert("Por favor ingrese un e-mail valido...");
			testresults=false
		}
		return (testresults)
	}	
	
	function clave(value){
			var str = value
			var filter=/^.+@.+\..{2,3}$/

			if (filter.test(str))
				testresults=true
			else{
				alert(" Do not accept specials caracters ")
				testresults=false
			}
			return (testresults)
		}

function pedido(validacion){
	if(validacion == "envio"){
		
		var method = document.envio.tipo_envio;	
		
		
		// SE grabara las direcciones de envio
		document.envio.action="pedido.php?action=update";
		
		document.envio.action="pago.php";
		document.envio.submit();
		return true
	
		
	}else if(validacion == "pago"){
		var method = document.pago.tipo_pago;
		var seleccionado=false;
		
			if(method.checked == 1){
				selecionado=true;
				document.pago.action="confirmacion.php";
				document.pago.submit();
				return true
			}
			
		if(seleccionado==false){
			alert("Por Favor escoja un Tipo de Pago")			
		}		
	}	
}

function cambiar_direccion(opcion, from){	
	location.replace("pedido.php?pedido="+opcion+'&from='+from);	
	
}	
	
function showPic (whichpic) {
 if (document.getElementById) {
  document.getElementById('placeholder').src = whichpic.href;
  if (whichpic.title) {
   document.getElementById('desc').childNodes[0].nodeValue = whichpic.title;
  } else {
   document.getElementById('desc').childNodes[0].nodeValue = whichpic.childNodes[0].nodeValue;
  }
  return false;
 } else {
  return true;
 }
}	

/*function validar_clientes(opcion){
	
	if(document.frm_reg.nombre.value==""){
		alert(" ERROR: Por favor ingrese el nombre ");
		document.frm_reg.nombre.focus();
		return false
	}else if(document.frm_reg.apellidos.value==""){
		alert(" ERROR: Por favor ingrese el apellido ");
		document.frm_reg.apellidos.focus();
		return false	
	}else if(document.frm_reg.email.value==""){
		alert(" ERROR: Por favor ingrese el email ");
		document.frm_reg.email.focus();
		return false	
	}else if(document.frm_reg.email1.value==""){
		alert(" ERROR: Por favor ingrese la Conf. del email ");
		document.frm_reg.email1.focus();
		return false	
	}else if(checkemail(document.frm_reg.email.value)== false){
		document.frm_reg.email.value="";
		document.frm_reg.email.focus();
		return false;
	}else if(document.frm_reg.email.value!=document.frm_reg.email1.value){
		alert("ERROR: Por favor ingrese la Conf. del email correcta");
		document.frm_reg.email1.focus();
		return false;
	}else if(document.frm_reg.password.value==""){
		alert(" ERROR: Por favor ingrese el Password ");
		document.frm_reg.password.focus();
		return false	
	}else if(document.frm_reg.password_confirma.value==""){
		alert(" ERROR: Por favor ingrese la Conf. de password ");
		document.frm_reg.password_confirma.focus();
		return false	
	}else if(document.frm_reg.password.value!=document.frm_reg.password_confirma.value){
		alert(" ERROR: Por favor ingrese la Conf. de password correcta");
		document.frm_reg.password_confirma.focus();
		return false	
	}else if(document.frm_reg.direccion.value==""){
		alert(" ERROR: Por favor ingrese la Direccion ");
		document.frm_reg.direccion.focus();
		return false	
	}else if(document.frm_reg.pais.value==""){
		alert(" ERROR: Por favor seleccione el pais ");
		document.frm_reg.pais.focus();
		return false	
	}else if(document.frm_reg.pais.value==223 && document.frm_reg.provincia.value==""){
		alert(" ERROR: Por favor ingrese el estado ");
		document.frm_reg.provincia.focus();
		return false	
	}else if(document.frm_reg.poblacion.value==""){
		alert(" ERROR: Por favor ingrese la ciudad ");
		document.frm_reg.poblacion.focus();
		return false
	}else if(document.frm_reg.cp.value==""){
		alert(" ERROR: Por favor ingrese el codigo postal ");
		document.frm_reg.cp.focus();
		return false
	}else if(document.frm_reg.chkPoliticas.checked==false){
		alert(" ERROR: Por favor acepte las Políticas de Privacidad ");
		document.frm_reg.chkPoliticas.focus();
		return false
	}else{
		document.frm_reg.action='cuenta.php?cuenta='+opcion;
		document.frm_reg.submit();
	}
}
*/
function valida_detalle(id, opcion){
	var f1 = eval("document.detalle");
	var total=0;
	
	f1.action="cesta.php?prod="+id+"&car="+opcion;
	f1.submit();
}
function validar(e) { // 1
    tecla = (document.all) ? e.keyCode : e.which; // 2
    if (tecla==8) return true; // 3
    patron = /\d/; // 4
    te = String.fromCharCode(tecla); // 5
    return patron.test(te); // 6
}


function pedido(validacion){
		if(validacion == "envio"){
			var method = document.envio.tipo_envio;
			var seleccionado=false;
			//for(i = 0; i < method.length; i++){
			if(method.checked == 1){
				selecionado=true;
				document.envio.action="pago.php";
				document.envio.submit();
				return true
			}
					//}	
			if(seleccionado==false){
					alert("Por Favor escoja un Tipo de Envio")			
			}	
		}else if(validacion == "pago"){
					var method = document.pago.tipo_pago;
					var seleccionado=false;
					for(i = 0; i < method.length; i++){
						if(method[i].checked == 1){
							selecionado=true;
							document.pago.action="confirmacion.php";
							document.pago.submit();
							return true
						}
					}	
					if(seleccionado==false){
						alert("Por Favor escoja un Tipo de Pago")			
					}		
				}	
			}
			
function cambiar_direccion(opcion, from){	
		location.replace("pedido.php?pedido="+opcion+'&from='+from);	
}

function busca(){
	url='index.php';
	texto=document.frm_search.query.value;
	if(texto=="" || texto==" Search"){
		alert("Ingrese un criterio para la busqueda");	
		document.frm_search.query.focus();
		return false;
	}else{
		document.frm_search.action=url+'?cat=0&q='+ texto;
		document.frm_search.submit();
	}
}

function ver_codigo_postal(id){
	archivo="codigo.php?id="+id;
	$("#ver").load(archivo);
}

function ver_codigo_estado(id){
	archivo="estado.php?id="+id;
	$("#ver").load(archivo);
}



function ver_boton_enviar(id){
	alert(id);
	if(id==1){
		newV = 0 ;
	}else{
		newV = 1 ;
	}
	document.getElementById("chkMail").value=newV;
	archivo="page_method.php?id="+id;
	$("#capa_btn").load(archivo);
}

function chk_verifica(id){
	if(id==1){
		newV = 0 ;
		document.getElementById("capa_btn").style.display='none';
	}else{
		newV = 1 ;
		document.getElementById("capa_btn").style.display='';
	}
	
	document.getElementById("chkMail").value=newV;
	
	if(document.getElementById("chkMail").checked==true){
		if(!confirm("Est&aacute; opci&aacute;n se toma en cuenta si reside fuera de USA , su pedido ser&aacute; transferido directamente al Administrador Web , nos estaremos comunicando con usted a la brevedad para darle los costos asociado a su pedido.")){
			return false;	
		}else{
			//location.replace(url+'?id='+id+'&opcion='+opcion);			
			location.href='procesar_pago.php';
		}
	}
}

function validar_form(){
	if(document.f5.nombre.value==""){
		alert("CUIDADO: Por favor introduzca su nombre");
		document.f5.nombre.focus();
		return false;
	}else if(document.f5.apellidos.value==""){
		alert("CUIDADO: Por favor introduzca su apellido");
		document.f5.apellidos.focus();
		return false;
	}else if(document.f5.email.value==""){
		alert("CUIDADO: Por favor introduzca su email");
		document.f5.email.focus();
		return false;
	}else if(document.f5.mensaje.value==""){
		alert("CUIDADO: Por favor introduzca su mensaje");
		document.f5.mensaje.focus();
		return false;
	}else{
			
	}	
}

function ver_arte(){
	//archivo="arte_chulucanas.php";
	$('#historia').hide('slow');
	$('#arte').show('slow');
	//$("#change").load(archivo);
	
}

function ver_historia(){
	//archivo="historia_chulucanas.php";
	$('#arte').hide('slow');
	$('#historia').show('slow');
	//$("#change").load(archivo);
	
}

function shipping(){
window.open('shipping.php?flag=1' , "impuestos" ,"width=620,height=230 , scrollbars=1");
}

function impuestos(){
window.open('impuestos.php?flag=1' , "impuestos" ,"width=620,height=30 , scrollbars=1");
}

/*function calcular(){
	totalprod = document.getElementById("totalpro").value ;
	alert(totalprod);
	for(g=0;g<totalprod;g++){
		//var cantidad = document.getElementById('canti'+g).value;
		if((document.getElementById('canti'+g).value)>(document.getElementById('stock'+g).value)){
			alert("Info: La cantidad seleccionada excede el stock disponible. Por el momento contamos con "+document.getElementById('stock'+g).value+" unidades disponibles.");
			document.getElementById('canti'+g).value = document.getElementById('stock'+g).value;
		}
	}
}*/
