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

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

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

function CargarPagina ()
{
	var Pars = '?Opc=' + Opc + '&Lng=' + Lng;
	if(Par1) Pars += "&Par1=" + Par1;
	window.location = '/index.php' + Pars;
	
}

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


function InitMenu ()
{
	$ ('idMenu-' + Opc1 + Opc2 , 'className', 'Seleccionado');
	$ ('idOpc-' + Opc1 , 'className', 'Seleccionado');
}

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

	Ventana.Ancho      = 470;
	Ventana.Alto       = 510;
	Ventana.Nombre     = 'Ayudenos';
	Ventana.URL        = '/fuentes/ayudenos.php?Lng=' + Lng;
	Ventana.Open (true);
}


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

	if (ValidarFormulario (Formulario))
	{	Ajax.onCargar = function () { $ ('idFormulario', 'style.display', 'none'); $ ('idEnvioOK', 'style.display', 'block'); }		
		Ajax.Formulario (Formulario);
		Ajax.Cargar ('/fuentes/enviarcontacto.php');
	}
}


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

	if (ValidarFormulario (Formulario))
	{	Ajax.onCargar = function (Peticion) 
										{	if (Peticion.asText () == 'OK') CargarPagina ();
											else alert ("Código de cliente o clave incorrectos.\nRecuerde que la clave es sensible\na mayúsculas y minúsculas");}
		Ajax.Vars.Usuario = Formulario.Usuario.value.Trim ();
		Ajax.Vars.Clave   = Formulario.Clave.value.Trim ();
		
		Ajax.Cargar ('/fuentes/identificarusuario.php', 'Cargando');
	}
}


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

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


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

	if (ValidarFormulario (Formulario))
	{	Ajax.onCargar = function () { $ ('idFormulario', 'style.display', 'none'); $ ('idEnvioOK', 'style.display', 'block'); }		
		Ajax.Formulario (Formulario);
		Ajax.Cargar ('/fuentes/enviartecnica.php', 'Cargando');
	}
}

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

	if (ValidarFormulario (Formulario))
	{	Ajax.onCargar = function () { $ ('idFormulario', 'style.display', 'none'); $ ('idEnvioOK', 'style.display', 'block'); }		
		Ajax.Formulario (Formulario);
		Ajax.Cargar ('/fuentes/enviarayudenos.php');
	}
}

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

	Ventana.Ancho       = 570;
	Ventana.Alto        = 330;
	Ventana.Nombre      = 'Localizacion';
	Ventana.URL         = '/plantillas/localizacion.html';
	Ventana.Open (true);
}

function FlashMapa ()
{ 
	document.write ('<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000"');
	document.write ('codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0"');
	document.write ('width="545" height="305" id="Mapa" align="middle">');
	document.write ('<param name="allowScriptAccess" value="sameDomain" />');
	document.write ('<param name="movie" value="/swf/mapa.swf" />');
	document.write ('<param name="quality" value="high" /><param name="wmode" value="transparent" />');
	document.write ('<param name="bgcolor" value="#ffffff" />');
	document.write ('<embed src="/swf/mapa.swf" quality="high" wmode="transparent" bgcolor="#ffffff"');
	document.write ('width="545" height="305" name="Mapa" align="middle" ');
	document.write ('allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />');
	document.write ('</object>');
}