			function sendMail (regId) {
				var formulario = document.getElementById('sendForm');

				//deberiamos comprobar que la estructura de correo es valida
				//***********************************************************

				if (formulario.mail.value.replace(' ', '') == '') {
					alert('No puedes dejarlo en blanco');
				} else {

					cadenaEnvio = "sys_sendinfo.asp?id=" + regId + "&email=" + formulario.mail.value;

					CreateXmlHttpObj();
					
					if(XmlHttpObj) {	
						XmlHttpObj.onreadystatechange = function () {
							if (XmlHttpObj.readyState == 1) {				
								document.getElementById('waiting').style.visibility = 'visible';
							}

							if(XmlHttpObj.readyState == 4) {

								if(XmlHttpObj.status == 200) {			
									document.getElementById('sqr_send').innerHTML=XmlHttpObj.responseText;
								}
								else {
									alert("Código de error: "  + XmlHttpObj.status);
								}
							}
						}
						XmlHttpObj.open("POST", cadenaEnvio, true );
						XmlHttpObj.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
						XmlHttpObj.send('');		
					}

				}
			}
			
			//===========================================================================

			function toggleSendSqr() {
				var capa = document.getElementById('sqr_send');
				var boton = document.getElementById('btn_send');
				var waiting = document.getElementById('waiting');


				if (capa.style.visibility == 'visible') {
					capa.style.visibility = 'hidden';
					boton.style.backgroundImage = 'url(/img/fixed/button_88.png)';
					waiting.style.visibility = 'hidden';
				} else {
					capa.style.visibility = 'visible';
					boton.style.backgroundImage = 'url(/img/fixed/button_88_on.png)';
				}
			}
			
			//===========================================================================
			
			function printable(regId) {
				window.open('sys_printable.asp?id=' + regId, 'pr', 'width=750,height=600,resizable=yes,status=no,menubar=no,toolbar=no,location=no,titlebar=no,directories=no,scrollbars=yes');

			}
			
			//===========================================================================

			function sendForm (valLang) {

				var formulario = document.getElementById('formulario');
				var cadenaEnvio = 'sys_procform.asp?';
				var isOk = true;

				var literales = new Array (
					'Debes rellenar los campos obligatorios',
					'¿Deseas enviar el formulario?',
					'Contactar',
					'Enviando datos',
					'Tu dois remplir les domaines obligatoires',
					'Souhaites-tu envoyer le formulaire ?',
					'Contacter',
					'En envoyant formulaire',
					'You have to fill the obligued fields',
					'Dou you want to send this form?',
					'Contact',
					'Sending form');


				//Comprobacion de campos obligatorios
				//-----------------------------------
				var obligados = 'Nombre,Telefono';
				var noRellenados = '';

				for (var i=0; i<formulario.length; i++) {
					var elemento = formulario.elements[i].name;
					var esObligado = obligados.indexOf(elemento);
					var valor = formulario.elements[i].value;

					if (valor.replace(' ', '') != '') {
						cadenaEnvio += elemento + '=' + formulario.elements[i].value + '&';
					} 
					else {
						if (esObligado >= 0) {
							isOk = false;
							noRellenados += elemento + ', ';
						}
					}
					
				}

				//Comprobacion final y envio por AJAX
				//-----------------------------------
				if (isOk) {
					if (confirm (literales[4*valLang-3])) {
						//alert('Enviando\n' + cadenaEnvio);

						CreateXmlHttpObj();
						
						if(XmlHttpObj) {	
							XmlHttpObj.onreadystatechange = function () {
								if (XmlHttpObj.readyState == 1) {				
									document.getElementById('theForm').innerHTML='<br /><h1>' + literales[4*valLang-2] + '</h1><p><br /><img src=\"img/fixed/loading_mini.gif\" border=\"0\" align=\"absmiddle\">&nbsp;&nbsp;' + literales[4*valLang-1] + '...</p>';									
								}

								if(XmlHttpObj.readyState == 4) {

									if(XmlHttpObj.status == 200) {			
										document.getElementById('theForm').innerHTML=XmlHttpObj.responseText;
									}
									else {
										alert("Código de error: "  + XmlHttpObj.status);
									}
								}
							}
							XmlHttpObj.open("POST", cadenaEnvio, true );
							XmlHttpObj.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
							XmlHttpObj.send('');		
						}

					}
				} else {
					alert(literales[4*valLang-4]);
				}

			}

			//================ AJAX Functions =======================

			function CreateXmlHttpObj() {
				try {
					XmlHttpObj = new ActiveXObject("Msxml2.XMLHTTP");
				}
				catch(e) {
					try	{
						XmlHttpObj = new ActiveXObject("Microsoft.XMLHTTP");
					} 
					catch(oc) {
						XmlHttpObj = null;
					}
				}
					
				if(!XmlHttpObj && typeof XMLHttpRequest != "undefined") {
					XmlHttpObj = new XMLHttpRequest();
				}
			}

		//============= END AJAX =======================

