// ///////////////////////////////////////////////////////////////////////////////
var BotonNTR_Visible = false;
// ///////////////////////////////////////////////////////////////////////////////
function MostrarBotonNTR(){
	if (BotonNTR_Visible == false){
		$('#boton_ntr').fadeIn('slow');
		BotonNTR_Visible = true;
		$('#etq1').focus();
	}
}
// ///////////////////////////////////////////////////////////////////////////////
function OcultarBotonNTR(){
	if (BotonNTR_Visible == true){
		//$('#boton_ntr').fadeOut('slow');
		//BotonNTR_Visible = false;
	}
}
// ///////////////////////////////////////////////////////////////////////////////
function HacerBusqueda(){
	if ($('#txt').attr('value') != ''){
		document.location.href = 'busqueda.asp?txt=' + $('#txt').attr('value');
	}
}
// ///////////////////////////////////////////////////////////////////////////////
function AumentarTamanyo(idElemento) {
	var elemento;
	if (document.all){
		elemento = document.all[idElemento];
	}else{
		elemento = document.getElementById(idElemento);
	}
	if (!elemento.style.fontSize) {
		//primera vez que se intenta aumentar el tamaño del texto
		elemento.style.fontSize =  '120%';
	} else {
		var fsize =  elemento.style.fontSize;
		if (fsize.indexOf(" & chr(34) & "%" & chr(34) & ")) {
			// el valor está indicado en porcentaje:
			fsize =  fsize.substring(0,fsize.indexOf("%"))
			fsize =  Number(fsize)+factor_reduccion;
				if(fsize >=  max_size){
					alert("No se puede aumentar más.")
				}else{
					elemento.style.fontSize =  (fsize+'%');
				}
		}
	}
}
// //////////////////////////////////////////////////////////////////////////////////////
function ReducirTamanyo(idElemento) {
	var elemento;
	if (document.all){
		elemento = document.all[idElemento];
	}else{
		elemento = document.getElementById(idElemento);
	}
	if (!elemento.style.fontSize) {
		//primera vez que se intenta reducir el tamaño del texto
		elemento.style.fontSize =  '80%';
	} else {
		var fsize =  elemento.style.fontSize;
		if (fsize.indexOf("%")) {
			// el valor está indicado en porcentaje:
			fsize =  fsize.substring(0,fsize.indexOf("%"))
			fsize =  Number(fsize)-factor_reduccion;
			if(fsize <=  min_size){
				alert("No se puede reducir más.")
			}else{
				elemento.style.fontSize =  (fsize+'%');
			}
		}
	}
}
// //////////////////////////////////////////////////////////////////////////////////////
function RecuperarTamanyo(idElemento) {
	var elemento;
	if (document.all){
		elemento = document.all[idElemento];
	}else{
		elemento = document.getElementById(idElemento);
	}
	elemento.style.fontSize = '100%';
}
// //////////////////////////////////////////////////////////////////////////////////////
var max_size =  250;
var min_size =  50;
var factor_reduccion = 50;
var tamagnoLetras =  100;
// //////////////////////////////////////////////////////////////////////////////////////
function EmailValido(email) {
         AtPos = email.indexOf('@');
         StopPos = email.lastIndexOf('.');
         Message = ''

         if (email == '') {
            Message = 'Email incorrecto' + '\n'
         }

         if (AtPos == -1 || StopPos == -1) {
            Message = 'Email incorrecto'
         }

         if (StopPos < AtPos) {
            Message = 'Email incorrecto'
         }

         if (StopPos - AtPos == 1) {
            Message = 'Email incorrecto'
         }
		 
		 if ((Message != '') && (email != '')){
		 	alert(Message);
		 }
		 
         return (Message == '');
}
// //////////////////////////////////////////////////////////////////////////////////////
function TodoListo(){
	return ((document.login.email.value != '') && (document.login.clave.value != ''));
}
// //////////////////////////////////////////////////////////////////////////////////////
function cliente(obj){
	var direccion = '';
	if (obj.etq1.value == ''){
		alert('Por favor, introduzca un c\u00f3digo de sesi\u00f3n v\u00e1lido para conectar con el operador.');
	}else{
		direccion = 'https://www.islonline.net/start/ISLLightClient?no_instructions=1&cmdline=--on-load+%22main%3Fpos%3Drighttop%22+--on-connect+%22desktop%3Fshow%26control%26admin%3Drestart%22--on-load+%22main%3Flogo%3Dhttp%3A%2F%2Fwww.conectarme.es%2Fimagenes%2Flogo.bmp%22--on-load+%22main%3Ficonize%22--silent+--auto-close+--connect ' + obj.etq1.value; 
		window.open(direccion);
	}
}
// //////////////////////////////////////////////////////////////////////////////////////