var iMensaje = 0;

function ActivarDireccionEnvio ()
{
	var Desactivado = ! document.DatosDeEnvio.DireccionDeEnvio.checked;
	
	document.DatosDeEnvio.EnvioNombre.disabled       = Desactivado;
	document.DatosDeEnvio.EnvioDireccion.disabled    = Desactivado;
	document.DatosDeEnvio.EnvioDireccion2.disabled   = Desactivado;
	document.DatosDeEnvio.EnvioPais.disabled         = Desactivado;
	document.DatosDeEnvio.EnvioCodigoPostal.disabled = Desactivado;
	document.DatosDeEnvio.EnvioMunicipio.disabled    = Desactivado;
	document.DatosDeEnvio.EnvioProvincia.disabled    = Desactivado;
	document.DatosDeEnvio.EnvioTelefono.disabled     = Desactivado;
}


function AvanzarTicket (Avanzar)
{
	if (Avanzar)
	{	if (LineaTicket < LineasTicket.RecordCount () - 3)
		{	LineaTicket++;
			PintarTicket ();
		}
	} else 
	{	if (LineaTicket > 1)
		{	LineaTicket--;
			PintarTicket ();
		}
	}
	if ((LineaTicket < LineasTicket.RecordCount () - 3)) 
		ImageSrc ('RtTicket', '/imagenes/ticket_bajar.gif');
	else ImageSrc ('RtTicket', '/imagenes/ticket_bajar_off.gif');
	if (LineaTicket > 1) ImageSrc ('AvTicket', '/imagenes/ticket_subir.gif');
	else ImageSrc ('AvTicket', '/imagenes/ticket_subir_off.gif');
}


function AvisoLegal ()
{
	var Ventana = new TVentana ();

	Ventana.Ancho       = 550;
	Ventana.Alto        = 400;
	Ventana.Nombre      = 'AvisoLegal';
	Ventana.URL         = '/fuentes/avisolegal.php';
	Ventana.Open (true);
}


function Buscar (iOpc)
{
	var Buscar = document.Buscar.Buscar.value.Trim ();
	
	if (Buscar)
	{	LimpiarParametros ();
		Par4 = Buscar;
		Main (iOpc);
	}
}


function CambiarVerPrecios ()
{
	var Moneda = document.Precios.VerPrecio.value;
	
	if (Moneda != Mon)
	{	Mon = Moneda;
		CargarPagina ();
	}
}


function CantidadCesta (sItem, iCantidad)
{
	var	Ajax = new TAjax ();

	Ajax.onCargar = onCantidadCesta;	
	Ajax.Vars.Item			= sItem;
	Ajax.Vars.Cantidad	= iCantidad;
	Ajax.Vars.Lng				= Lng;
	Ajax.Cargar ('/fuentes/actualizarpedido.php', 'Cargando');
}


function CargarFormasDeEnvio ()
{
	var Ajax  = new TAjax ();

	Ajax.onCargar = CargarFormasDeEnvioOn;
	Ajax.Vars.Lng = Lng;
	Ajax.Cargar ('/fuentes/formasdeenvio.php', 'idCargando');
}


function CargarFormasDeEnvioOn (Peticion)
{
	var Formas = $('idFormasDeEnvio');
	var Nodo;
	
	FormasDeEnvio = DataSet (Peticion.asText (), 'FORMASDEENVIO');
	OptionSelect (Formas, 0, '');
	while (! FormasDeEnvio.Eof ())
	{	OptionSelect (Formas, FormasDeEnvio.asInteger ('Id'), FormasDeEnvio.ByName ('Descripcion'));
		FormasDeEnvio.Next ();
	}
}


function CargarFormasDePago (Subtotal)
{
	var Ajax         = new TAjax ();
	var FormaDeEnvio = document.FormasDePago.FormaDeEnvio.value.asInteger ();
	var Pagos        = document.getElementById ('idFormasDePago');

	EliminarHijos (Pagos);
	$ ('idAnotacion', 'innerHTML', '&nbsp;');
	GastosDeEnvio (Subtotal, 0, 0, 0);
	
	if (FormaDeEnvio)
	{	FormasDeEnvio.Locate ('Id', FormaDeEnvio);
		if (FormasDeEnvio.asBoolean ('Limite'))
		{	alert (Idioma (23));
			document.FormasDePago.FormaDeEnvio.value = 0;
		} else
		{	GastosDeEnvio (FormasDeEnvio.asFloat ('Total'), FormasDeEnvio.asFloat ('Gastos'), 
			               FormasDeEnvio.asFloat ('Descuento'), FormasDeEnvio.asFloat ('Seguro'));
			Ajax.onCargar = CargarFormasDePagoOn;
			Ajax.Vars.FormaDeEnvio = FormaDeEnvio;
			Ajax.Vars.Lng					 = Lng;
			Ajax.Cargar ('/fuentes/formasdepago.php');
		}
	}
}


function CargarFormasDePagoOn (Peticion)
{
	var Pagos    = document.getElementById ('idFormasDePago');
	FormasDePago = DataSet (Peticion.asText (), 'FORMASDEPAGO');

	OptionSelect (Pagos, 0, '');
	while (! FormasDePago.Eof ())
	{	OptionSelect (Pagos, FormasDePago.asInteger ('Id'), FormasDePago.ByName ('Descripcion'));
		FormasDePago.Next ();
	}
}


function CargarPagina ()
{
	var Pars = '?Opc=' + Opc + '&Lng=' + Lng + '&Mon=' + Mon;

	if (Par1) Pars += '&Par1=' + Par1;
	if (Par2) Pars += '&Par2=' + Par2;
	if (Par4) Pars += '&Par4=' + Par4;
		
	window.location = '/index.php' + Pars;
}


function ColorDetalle (iIdArticulo, iIdColor, bDesdeColores)
{
	var Ventana = new TWindow ();
	
	Ventana.Titulo 					= 'Detalle tejido o color';
	Ventana.Vars.Lng				= Lng;
	Ventana.Vars.IdArticulo	= iIdArticulo;
	Ventana.Vars.Id					= iIdColor;
	Ventana.Vars.DesdeColores	= bDesdeColores;
	Ventana.Cargar ('/fuentes/color.php');
}


function Colores (Ident)
{
	var Ventana = new TWindow ();
	
	Ventana.Titulo   = Idioma (20);
	Ventana.Ancho    = 500;
	Ventana.Alto     = 400;
	Ventana.Vars.Lng = Lng;
	Ventana.Vars.Id	 = Ident;
	Ventana.onCargar = function () { if (iMensaje) alert (Idioma (iMensaje)); iMensaje = 0; }
	Ventana.Cargar ('/fuentes/colores.php');
}


function ColorSeleccionar (iArticulo, iColor, fIncremento)
{
	var sIncremento = FlotanteACadena (fIncremento, 2);
	var Etiqueta    = document.getElementById ('idIncremento');

	document.imgColor.src        = "/contenidos/colores/" + iColor + '-2.jpg';
	document.Comprar.Color.value = iColor;
	$('idAmpliar').href = 'javascript:ColorDetalle (' + iArticulo + ',' + iColor + ', false)';
	if (Etiqueta)
	{	if (fIncremento > 0.1)
		{	switch (Lng)
			{	case 2:  Etiqueta.innerHTML = 'Este tejido tiene un incremento de ' + sIncremento + ' &euro;';
				default: Etiqueta.innerHTML = 'Este tejido tiene un incremento de ' + sIncremento + ' &euro;';
			}
		} else Etiqueta.innerHTML = '';
	}
	TWindow.Cerrar ();
}


function Comprar (iArticulo, iOpcion)
{

	var	Ajax     = new TAjax ();
	var Cantidad = document.Comprar.Cantidad.value.asInteger ();
	var Color    = document.Comprar.Color.value.asInteger ();
	var Largo    = document.Comprar.Largo.value.asInteger ();
	var Talla    = document.Comprar.Talla.value;

	if (! Talla) alert (Idioma (19));
	else if (! Color) alert (Idioma (18));
	else if (Cantidad <= 0)
	{	alert (Idioma (1));
		document.Comprar.Cantidad.focus ();
	} else 
	{	Ajax.onCargar 			= ComprarOn;
		Ajax.Opcion   			= iOpcion;
		Ajax.Vars.Id				= iArticulo;
		Ajax.Vars.Cantidad	= Cantidad;
		Ajax.Vars.Color			= Color;
		Ajax.Vars.Largo			= Largo;
		Ajax.Vars.Talla			= Talla;
		Ajax.Cargar ('/fuentes/comprar.php');
	}
}


function ComprarOn (Peticion)
{
	var Stock = DataSet (Peticion.asText (), 'STOCK');

	if (Stock.RecordCount ())
	{	if (Stock.asInteger ('Unidades') > 0)
			alert (Idioma (2) + ' ' + Stock.ByName ('Unidades') + ' ' + Idioma (3));
		else alert (Idioma (4));
	} else Main (Peticion.Opcion);
}


function ConfirmarClave (oFormulario)
{
	var Clave   = oFormulario.Clave.value.Trim ();
	var Repetir = oFormulario.Repetir.value.Trim ();

	if (Clave != Repetir)	
	{	alert (Idioma (7));
		document.DatosCliente.Clave.focus ();
		return false;
	}
	return true;
}


function DesconectarCliente ()
{
	var	Ajax = new TAjax ();

	Ajax.onCargar = CargarPagina;	
	Ajax.Cargar ('/fuentes/desconectar.php');
}


function EnviarFormPedido (Formulario)
{
	var Ajax = new TAjax ();

	if (ValidarFormulario (Formulario))
	{	if (! Formulario.Lopd.checked) alert (Idioma (31));
		else
		{	Ajax.onCargar = onEnviar;
			Ajax.Formulario (Formulario);
			Ajax.Cargar ('/fuentes/enviarpedido.php');
		}
	}
}


function FinalizarPedido (iFin, iPago)
{
	var	Ajax         = new TAjax ();
	var FormaDeEnvio = document.FormasDePago.FormaDeEnvio.value.asInteger ();
	var FormaDePago  = document.FormasDePago.FormaDePago.value.asInteger ();
	
	if (FormaDeEnvio)
	{	if (FormaDePago)
		{	Ajax.Fin  = iFin;
			Ajax.Pago = iPago;
			Ajax.Formulario (document.FormasDePago);
			Ajax.onCargar = FinalizarPedidoOn;
			Ajax.Cargar ('/fuentes/finalizarpedido.php', 'Cargando');
		} else alert (Idioma (15));
	} else alert (Idioma (16));
}


function FinalizarPedidoOn (Peticion)
{
	var Result = Peticion.asText ();

	if (Result == 'OK') Opc = Peticion.Fin;
	else if (Result == 'PAGOELECTRONICO') Opc = Peticion.Pago;
	else alert (Idioma (17));
	CargarPagina ();
}


function FormasDePago (Opcion)
{
	var	Ajax     = new TAjax ();

	if (ValidarDireccionDeEnvio ()) 
	{	Ajax.onCargar = FormasDePagoOn;
		Ajax.Formulario (document.DatosDeEnvio);
		Ajax.Opcion 				    = Opcion;
		Ajax.Vars.Observaciones = document.DatosDeEnvio.Observaciones.value.asCharCode ();
		Ajax.Cargar ('/fuentes/hayformasdepago.php', 'Cargando');
	}
}


function FormasDePagoOn (Peticion)
{
	var Result = Peticion.asText ();

	if (Result == 'NOPAGO') alert (Idioma (6));
	else if (Result == 'OK') Main (Peticion.Opcion);
}


function GastosDeEnvio (fTotal, fGastos, fDescuento, fSeguro)
{
	var ImpVale = document.FormasDePago.ImpVale.value.asFloat ();
	
	$ ('idGastosDeEnvio', 'innerHTML', FlotanteACadena (fGastos, 2));
	$ ('idDtoGastos', 'innerHTML', '-' + FlotanteACadena (fDescuento, 2));
	$ ('idSeguro', 'innerHTML', FlotanteACadena (fSeguro, 2));
	Display ('idDescuentoGastos', fDescuento > 0.01 ? 'block' : 'none');
	document.FormasDePago.Total.value     = fTotal;
	document.FormasDePago.Gastos.value    = fGastos;
	document.FormasDePago.Descuento.value = fDescuento;
	document.FormasDePago.Seguro.value    = fSeguro;
	
	if (ImpVale)
	{	if (ImpVale > fTotal) ImpVale = fTotal;
		$ ('idDtoVale', 'innerHTML', '- ' + FlotanteACadena (ImpVale, 2));
		$ ('idTotalAPagar', 'innerHTML', FlotanteACadena (fTotal - ImpVale, 2));
		document.FormasDePago.DtoVale.value     = ImpVale;
		document.FormasDePago.TotalPedido.value = fTotal - ImpVale;		
	}	 else
	{	$ ('idDtoVale', 'innerHTML', '0,00');
		$ ('idTotalAPagar', 'innerHTML', FlotanteACadena (fTotal, 2));
		document.FormasDePago.DtoVale.value     = 0;
		document.FormasDePago.TotalPedido.value = fTotal;
	}
}


function GastosFormaDePago (Subtotal)
{
	$ ('idAnotacion', 'innerHTML', '&nbsp;');
	GastosDeEnvio (Subtotal, 0, 0, 0);

	if (FormasDePago.Locate ('Id', document.FormasDePago.FormaDePago.value))
	{	$ ('idAnotacion', 'innerHTML', FormasDePago.ByName ('Texto') + '&nbsp;');
		GastosDeEnvio (FormasDePago.asFloat ('Total'), FormasDePago.asFloat ('Gastos'),
		               FormasDePago.asFloat ('Descuento'), FormasDePago.asFloat ('Seguro'));
	}	else if (FormasDeEnvio.Locate ('Id', document.FormasDePago.FormaDeEnvio.value))
		GastosDeEnvio (FormasDeEnvio.asFloat ('Total'), FormasDeEnvio.asFloat ('Gastos'),
		               FormasDePago.asFloat ('Descuento'), FormasDeEnvio.asFloag ('Descuento'));
}


function GuiaDeVuelos ()
{
	var Ventana = new TWindow ();

  Ventana.Ancho 	 = 595;
  Ventana.Alto  	 = 410;
  Ventana.Vars.Lng = Lng;
  Ventana.Cargar ('/fuentes/guiadevuelos.php');
}


function IdentificarCliente (Formulario)
{
	var	Ajax = new TAjax ();

	if (ValidarFormulario (Formulario))
	{	Ajax.onCargar = onIdentificarCliente;	
		Ajax.Vars.Codigo = Formulario.Codigo.value.Trim ();
		Ajax.Vars.Clave	 = Formulario.Clave.value.Trim ();
		Ajax.Cargar ('/fuentes/identificarcliente.php', 'Cargando');
	}
}


function InicializarPais (Control, Pais)
{
	var i = Control.length - 1;
	
	while (i >= 0 && Control.options [i].value != Pais) i--;
	if (i >= 0) Control.selectedIndex = i;
}


function InicializarTipo (oControl, sTipo)
{
	if (sTipo != '')
	{	for (var i = oControl.length - 1; i >= 0; i--)
	 		if (oControl [i].value == sTipo) oControl [i].checked = true;
	 }
}


function LoadMain ()
{
	document.Precios.VerPrecio.value = Mon;
	$ ('idMen-' + Opc, 'className', 'Seleccionado');
}


function Lopd ()
{
	var Ventana = new TVentana ();

	Ventana.Ancho       = 550;
	Ventana.Alto        = 300;
	Ventana.Nombre      = 'ProteccionDatos';
	Ventana.URL         = '/fuentes/avisolegal.php?Lopd=1';
	Ventana.Open (true);
}


function Main (iOpcion)
{
	Opc = iOpcion;
	
	CargarPagina ();
}


function Medidas (iMedida)
{
	var Ventana = new TWindow ();
	
	Ventana.Titulo   		= Idioma (22);
	Ventana.Ancho    		= 610;
	Ventana.Alto     		= 490;
	Ventana.Vars.Lng 		= Lng;
	Ventana.Vars.Medida = iMedida;
	Ventana.Cargar  ('/fuentes/medidas.php');
}


function Suscribir (oFormulario)
{
	var Ajax = new TAjax ()
	
	if (ValidarFormulario (oFormulario))
	{	Ajax.onCargar 	= function () { oFormulario.Email.value = ''; };
		Ajax.Vars.Email	= oFormulario.Email.value.Trim ();
		Ajax.Vars.Lng		= Lng;
		Ajax.Cargar ('/fuentes/suscribir.php');
	}
}


function onCantidadCesta (Peticion)
{
	var Datos = DataSet (Peticion.asText (), 'STOCK', 'CESTA');

	if (Datos [0].RecordCount ())
	{	if (Datos [0].asInteger ('Items') == 0) Main (0);
		else if (Datos [0].asInteger ('Unidades') > 0)
			alert (Idioma (2) + ' ' + Stock.ByName ('Unidades') + ' ' + Idioma (3));
		else alert (Idioma (4));
	} else
	{ $ ('idCesta', 'innerHTML', Datos [1].ByName ('HTML'));
		$ ('idTotalCesta', 'innerHTML', Datos [1].ByName ('TotalCesta'));
	}
}	




function onIdentificarCliente (Peticion)
{
	var Resultado = Peticion.asText ();
	
	if (Resultado == 'OK') CargarPagina ();
	else alert (Idioma (5));
}


function onRegistrarCliente (Peticion)
{
	var Result = Peticion.asText ();

	if (Result == 'OK') Main (Peticion.Opcion);
	else if (Result == 'NOLOGIN') alert (Idioma (8));
	else if (Result == 'NOCLAVE') alert (Idioma (9));
	else if (Result == 'NOEMAIL') alert (Idioma (10));
	else if (Result == 'LOGINDUPLICADO') alert (Idioma (11));
	else if (Result == 'EMAILDUPLICADO') alert (Idioma (12));
	else alert (Idioma (13));
}


function onVerTicket (Peticion)
{
	var MAXLINEAS = 4;

	LineasTicket = DataSet (Peticion.asText (), 'TICKET');
	var Etiqueta = document.getElementById ('idLineasTicket');
	var Lineas   = LineasTicket.RecordCount ();

	if (Etiqueta && Lineas)
	{	LineaTicket = 0;
		if (Lineas > 4) LineaTicket = Lineas - 3;
		PintarTicket ();
	}
}


function PedidoInmediato ()
{
	var Ventana = new TWindow ();

	Ventana.Titulo 		= Idioma (24);
	Ventana.Ancho 		= 595;
  Ventana.Alto  		= 410;
  Ventana.Vars.Lng	= Lng;
  Ventana.Cargar ('/fuentes/pedidoinmediato.php');
}


function PedirClave (oFormulario)
{
	var Ajax = new TAjax ();

	if (ValidarFormulario (oFormulario))
	{	Ajax.onCargar 	= PedirClaveOn;
		Ajax.Vars.Email	= oFormulario.Email.value;
		Ajax.Cargar ('/fuentes/enviarclaves.php', 'idCargandoRecuperar');
	}
}


function PedirClaveOn (Peticion)
{
	if (Peticion.asText () == 'OK')
	{	Display ('idRecordarClave', 'none'); 
		Display ('idRecordarOK', 'block');
	} else  alert (Idioma (10));
}


function PintarTicket ()
{
	var f         = 0;
	var Div       = null;
	var Aux       = null;
	var Etiqueta  = document.getElementById ('idLineasTicket');

	if (Etiqueta)
	{	Etiqueta.innerHTML = '';
		LineasTicket.RecNo (LineaTicket);
		while (! LineasTicket.Eof () && f++ < 4)
		{	Div = document.createElement ('div');
			Div.className = 'Articulo';
			Aux = document.createElement ('div');
			Aux.className = 'Cantidad';
			Aux.innerHTML = LineasTicket.ByName ('Cantidad') + ',';
			Div.appendChild (Aux);
			Aux = document.createElement ('div');
			Aux.className = 'Nombre';
			Aux.innerHTML = LineasTicket.ByName ('Descripcion');
			Div.appendChild (Aux);
			Aux = document.createElement ('div');
			Aux.className = 'Precio';
			Aux.innerHTML = LineasTicket.ByName ('Importe') + ' &euro;';
			Div.appendChild (Aux);
			Etiqueta.appendChild (Div);
			LineasTicket.Next ();
		}
	}
}


function RecordarClave ()
{
	var Ventana        = new TWindow ()

	Ventana.Titulo 	 = Idioma (26);
	Ventana.Ancho  	 = 500;
	Ventana.Alto   	 = 370;
  Ventana.Vars.Lng = Lng;
	Ventana.Cargar ('/fuentes/recordarclave.php');
}


function RegistrarCliente (oFormulario, iOpcion)
{
	var Ajax = new TAjax ();
		
	if (ValidarFormulario (oFormulario) && ConfirmarClave (oFormulario))
	{	if (oFormulario.Aceptar.checked)
		{	Ajax.Opcion 	= iOpcion;
			Ajax.onCargar = onRegistrarCliente;
			Ajax.Vars.Lng	= Lng;
			Ajax.Formulario (oFormulario);
			Ajax.Cargar ('/fuentes/datoscliente.php', 'Cargando');
		} else alert (Idioma (14));
	}
}


function setMensaje (iId)
{
	iMensaje = iId;
}


function ValeRegalo ()
{
	if (document.FormasDePago.Vales.value)
	{	var Aux = document.FormasDePago.Vales.value.split ('|');
		document.FormasDePago.Vale.value    = Aux [0];
		document.FormasDePago.ImpVale.value = Aux [1];
	} else
	{	document.FormasDePago.Vale.value    = 0;
		document.FormasDePago.ImpVale.value = 0;
	}
	
	GastosDeEnvio (document.FormasDePago.Total.value.asFloat (), document.FormasDePago.Gastos.value.asFloat (),
	               document.FormasDePago.Descuento.value.asFloat (), document.FormasDePago.Seguro.value.asFloat ());
}


function VerTicket ()
{
	var Ajax = new TAjax ();
	
	Ajax.onCargar = onVerTicket;
	Ajax.Cargar ('/fuentes/ticket.php');
}



//////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////

function LimpiarParametros ()
{
	Par1 = 0;
	Par2 = 0;
	Par4 = '';
}


function CambiarIdioma (Idioma)
{
	Lng = Idioma;
	CargarPagina ();
}


function CambiarIdiomaOpinion (Idioma)
{
	Par1 = 0;
	Par2 = Idioma;
	CargarPagina ();
}



function onRollOutFila (Fila)
{
	Fila.style.backgroundColor = '';
}


function onRollOverFila (Fila)
{
	Fila.style.backgroundColor = '#F6F4F9';
}


function ProteccionDatos ()
{
	var Ventana = new TVentana ();

	Ventana.Ancho       = 550;
	Ventana.Alto        = 300;
	Ventana.Nombre      = 'AvisoLegal';
	Ventana.URL         = '/fuentes/avisolegal.php?Lopd=1';
	Ventana.Open (true);
}

function Pregunta (iId)
{
	TEfectos.prototype.Incremento  = 15;
	
	idEfecto ('idPregunta' + iId).Vertical();
}
	

function ValidarDireccionDeEnvio ()
{
return true;
	if (document.DatosDeEnvio.DireccionDeEnvio.checked)
		return (ValidarFormulario (document.DatosDeEnvio) && ValidarProvinciaEnvio ())
	return (true);		
}




function EnviarContacto (Formulario)
{
	var Ajax = new TAjax ();

	if (ValidarFormulario (Formulario))
	{	if (! Formulario.Lopd.checked) alert (Idioma (31));
		else
		{	Ajax.onCargar = onEnviar;
			Ajax.Formulario (Formulario);
			Ajax.Cargar ('/fuentes/enviarcontacto.php');
		}
	}
}

function EnviarAtencion (Formulario)
{
	var Ajax = new TAjax ();

	if (ValidarFormulario (Formulario))
	{	if (! Formulario.Lopd.checked) alert (Idioma (31));
		else
		{	Ajax.onCargar = onEnviar;
			Ajax.Formulario (Formulario);
			Ajax.Cargar ('/fuentes/enviaratencion.php');
		}
	}
}

function EnviarCalidad (Formulario)
{
	var Ajax = new TAjax ();

	if (ValidarFormulario (Formulario))
	{	Ajax.onCargar = onEnviar;
		Ajax.Formulario (Formulario);
		Ajax.Cargar ('/fuentes/enviarcalidad.php');
	}
}

function EnviarFormAmiga (Formulario)
{
	var Ajax = new TAjax ();

	if (ValidarFormulario (Formulario))
	{	if (! Formulario.Lopd.checked) alert (Idioma (31));
		else
		{	Ajax.onCargar = onEnviar;
			Ajax.Formulario (Formulario);
			Ajax.Vars.Lng	= Lng;
			Ajax.Cargar ('/fuentes/enviaramiga.php');
		}
	}
}

function onEnviar (Peticion)
{
	Display ('idFormulario', 'none');
	Display ('idEnvioOK', 'block');
}


function GuiaDeTallas (iId, sDescripcion)
{
	var Ventana = new TWindow ();

	if (iId > 0)
	{	Ventana.Titulo   				 = Idioma (21);
		Ventana.Ancho    				 = 640;
		Ventana.Alto     				 = 510;
		Ventana.Vars.Lng				 = Lng;
		Ventana.Vars.Guia				 = iId;
		Ventana.Vars.Descripcion = sDescripcion;

		Ventana.Cargar  ('/fuentes/guiadetallas.php');
	}
}


function EnviarAmiga ()
{
	var Ventana = new TWindow ();

	Ventana.Titulo = Idioma (25);
  Ventana.Ancho = 595;
  Ventana.Alto  = 410;
  Ventana.Vars.Lng	= Lng;
  Ventana.Cargar ('/fuentes/enviaramigaventana.php');
}



