function muestraTabContacto(pvarPanelNro,pvarPanelPrefijo)
	{
	var wvarPanelNro=1;
	var wvarObjPanel=window.document.getElementById(pvarPanelPrefijo+wvarPanelNro);
	while(wvarObjPanel!=null)
		{
		if(wvarPanelNro!=pvarPanelNro)
			{
			wvarObjPanel.className="panelInactivoTabs";			
			}
		wvarPanelNro++;
		wvarObjPanel=window.document.getElementById(pvarPanelPrefijo+wvarPanelNro);
		}
	wvarPanelNro=1;
	wvarObjPanel=window.document.getElementById(pvarPanelPrefijo+"Tab"+wvarPanelNro);
	while(wvarObjPanel!=null)
		{
		if(wvarPanelNro!=pvarPanelNro)
			{
			wvarObjPanel.className="botonTabActivo";
			}
		wvarPanelNro++;
		wvarObjPanel=window.document.getElementById(pvarPanelPrefijo+"Tab"+wvarPanelNro);
		}
	
	wvarObjPanel=window.document.getElementById(pvarPanelPrefijo+pvarPanelNro);
	wvarObjPanel.className="panelActivoTabs";
	wvarObjPanel=window.document.getElementById(pvarPanelPrefijo+"Tab"+pvarPanelNro);
	wvarObjPanel.className="botonTabInactivo";
	}
	
	
function muestraTab(pvarPanelNro,pvarPanelPrefijo)
	{
	var wvarPanelNro=1;
	var wvarObjPanel=window.document.getElementById(pvarPanelPrefijo+wvarPanelNro);
	while(wvarObjPanel!=null)
		{
		if(wvarPanelNro!=pvarPanelNro)
			{
			wvarObjPanel.className="panelInactivoTabs";			
			}
		wvarPanelNro++;
		wvarObjPanel=window.document.getElementById(pvarPanelPrefijo+wvarPanelNro);
		}
	wvarPanelNro=1;
	wvarObjPanel=window.document.getElementById(pvarPanelPrefijo+"Tab"+wvarPanelNro);
	while(wvarObjPanel!=null)
		{
		if(wvarPanelNro!=pvarPanelNro)
			{
			wvarObjPanel.className="botonTabInactivo";
			}
		wvarPanelNro++;
		wvarObjPanel=window.document.getElementById(pvarPanelPrefijo+"Tab"+wvarPanelNro);
		}

	wvarObjPanel=window.document.getElementById(pvarPanelPrefijo+pvarPanelNro);
	wvarObjPanel.className="panelActivoTabs";
	wvarObjPanel=window.document.getElementById(pvarPanelPrefijo+"Tab"+pvarPanelNro);
	wvarObjPanel.className="botonTabActivo";
	}

function ValidateContacto(theForm)
{
var i;
var dato;
var indicetipoconsulta;

if(typeof(theForm.rut_completo) != "undefined")
	{
	if(!theForm.rut_completo.value)
		{
		alert("Debe ingresar su RUT");
		theForm.rut_completo.focus();
		return false;
		}
	}

if(typeof(theForm.nombre) != "undefined")
	{
	if(!theForm.nombre.value)
		{
		alert("Debe ingresar su Nombre");
		theForm.nombre.focus();
		return false;
		}
	}
	
  if(typeof(theForm.apellido_paterno) != "undefined")
	{
	if(!theForm.apellido_paterno.value)
		{
		alert("Debe ingresar su Apellido Paterno");
		theForm.apellido_paterno.focus();
		return false;
		}
	}
	
  if(typeof(theForm.apellido_materno) != "undefined")
	{
	if(!theForm.apellido_materno.value)
		{
		alert("Debe ingresar su Apellido Materno");
		theForm.apellido_materno.focus();
		return false;
		}
	}

  if(typeof(theForm.email) != "undefined")
	{
	if(!valida_Email(theForm.email,true))
		{
		theForm.email.focus();
		return false;
		}
	}

  if(typeof(theForm.telefono) != "undefined")
	{
	if(!valida_Telefono(theForm.telefono,true))
		{
		theForm.telefono.focus();
		return false;
		}
	}
	

  if(typeof(theForm.rut_completo) != "undefined")
	{
	if(!theForm.rut_completo.value)
		{
		alert("Debe ingresar su RUT");
		theForm.rut_completo.focus();
		return false;
		}
    
	var rut_completo;
    rut_completo = theForm.rut_completo.value;
    rut_completo = removeChar(rut_completo,'-');
    theForm.rut_completo.value = removeChar(rut_completo,'.');
	if (!checkRut2(theForm.rut_completo,'Rut de cliente invalido',true))
		{
		theForm.rut_completo.focus();
		return false;
		} 
		var rut_aux = theForm.rut_completo.value;
		var rut
		rut  = rut_aux.substr(0,rut_aux.indexOf("."));
		rut_aux = rut_aux.substr(rut_aux.indexOf(".")+1,rut_aux.length);
		rut += rut_aux.substr(0,rut_aux.indexOf("."));
		rut_aux = rut_aux.substr(rut_aux.indexOf(".")+1,rut_aux.length);
		rut += rut_aux.substr(0,rut_aux.indexOf("-"));
		
		theForm.rut.value = rut
		theForm.digito_verificador.value = rut_aux.substr(rut_aux.indexOf("-")+1,rut_aux.length);
	}


	if(typeof(theForm.email) != "undefined")
		{
		if(!theForm.email.value)
			{
			alert("Debe ingresar su E-mail");
			theForm.email.focus();
			return false;
			}

		if (!isEmail(theForm.email.value))
			{
			alert("La dirección de E-mail no es válida.");
			theForm.email.focus();
			return false;
			}  
		}

		if(typeof(theForm.telefono) != "undefined")
			{
			if(!theForm.telefono.value)
				{
				alert("Debe ingresar su Teléfono");
				theForm.telefono.focus();
				return false;
				}
			}
		
		if(typeof(theForm.direccion) != "undefined")
			{
			if(!theForm.direccion.value)
				{
				alert("Debe ingresar su Dirección");
				theForm.direccion.focus();
				return false;
				}
			}

		if(typeof(theForm.comuna) != "undefined")
			{
			indicetipoconsulta = theForm.comuna.selectedIndex;
			if(!indicetipoconsulta)
				{
				alert("Debe elegir su Comuna");
				theForm.comuna.focus();
				return false;
				}
			}

		if(typeof(theForm.ciudad) != "undefined")
			{
			if(!theForm.ciudad.value)
				{
				alert("Debe ingresar su Ciudad");
				theForm.ciudad.focus();
				return false;
				}
			}

		if(typeof(theForm.pais) != "undefined")
			{
			if(!theForm.pais.value)
				{
				alert("Debe ingresar su País");
				theForm.pais.focus();
				return false;
				}
			}

		if(typeof(theForm.empresa) != "undefined")
			{
			if(!theForm.empresa.value)
				{
				alert("Debe ingresar su Empresa");
				theForm.empresa.focus();
				return false;
				}
			}
		
		if(typeof(theForm.consulta) != "undefined")
			{
			valuetipoconsulta = theForm.consulta.value;
			if(valuetipoconsulta == '0' || valuetipoconsulta == "")
				{
				alert("Debe elegir su Tipo de Consulta");
				theForm.consulta.focus();
				return false;
				}
			if(valuetipoconsulta=='1')
				theForm.doAction.value = "enviarClave";
			else
				theForm.doAction.value = "enviarContacto";
			}
		
		if(typeof(theForm.tema) != "undefined")
			{
			if(!theForm.tema.value)
				{
				alert("Debe ingresar un Tema");
				theForm.tema.focus();
				return false;
				}
			}
		
		if(typeof(theForm.mensajeH) != "undefined")
			{
			if(!theForm.mensajeH.value)
				{
				alert("Debe ingresar un Mensaje");
				theForm.mensajeH.focus();
				return false;
				}
			if(theForm.mensajeH.value.length>=2000)
				{
				alert("El mensaje tiene como máximo 2000 carácteres.")
				theForm.mensajeH.value = theForm.mensajeH.value.substring(0,1999);
				return false;
				}
			}
		 				
		//INICIO: Validacion de caracteres extraños
                //"!#$%^&*()=+{}[]\\;?><'"
		theForm.mensajeH.value=ReplaceAll(theForm.mensajeH.value,"%","");		
		theForm.mensajeH.value=ReplaceAll(theForm.mensajeH.value,"!","");
		theForm.mensajeH.value=ReplaceAll(theForm.mensajeH.value,"#","");
		theForm.mensajeH.value=ReplaceAll(theForm.mensajeH.value,"$","");
		theForm.mensajeH.value=ReplaceAll(theForm.mensajeH.value,"^","");
		theForm.mensajeH.value=ReplaceAll(theForm.mensajeH.value,"&","");
		theForm.mensajeH.value=ReplaceAll(theForm.mensajeH.value,"*","");
		theForm.mensajeH.value=ReplaceAll(theForm.mensajeH.value,"(","");
		theForm.mensajeH.value=ReplaceAll(theForm.mensajeH.value,")","");
		theForm.mensajeH.value=ReplaceAll(theForm.mensajeH.value,"=","");
		theForm.mensajeH.value=ReplaceAll(theForm.mensajeH.value,"+","");
		theForm.mensajeH.value=ReplaceAll(theForm.mensajeH.value,"{","");
		theForm.mensajeH.value=ReplaceAll(theForm.mensajeH.value,"}","");				
		theForm.mensajeH.value=ReplaceAll(theForm.mensajeH.value,"[","");
		theForm.mensajeH.value=ReplaceAll(theForm.mensajeH.value,"]","");
		theForm.mensajeH.value=ReplaceAll(theForm.mensajeH.value,"/","");	
		theForm.mensajeH.value=ReplaceAll(theForm.mensajeH.value,";","");
		theForm.mensajeH.value=ReplaceAll(theForm.mensajeH.value,"?","");
		theForm.mensajeH.value=ReplaceAll(theForm.mensajeH.value,">","");
		theForm.mensajeH.value=ReplaceAll(theForm.mensajeH.value,"<","");
		theForm.mensajeH.value=ReplaceAll(theForm.mensajeH.value,"'","");
		//FIN: Validacion de caracteres extraños
		
		theForm.mensaje.value = theForm.mensajeH.value;		
		
		if(typeof(theForm.nombre) != "undefined")
			{
			theForm.nombre.value = ValidateContactoPost(theForm, theForm.nombre.value);
			}
		if(typeof(theForm.apellido_paterno) != "undefined")
			{
			theForm.apellido_paterno.value 	= ValidateContactoPost(theForm, theForm.apellido_paterno.value);
			}
		if(typeof(theForm.apellido_materno) != "undefined")
			{
			theForm.apellido_materno.value 	= ValidateContactoPost(theForm, theForm.apellido_materno.value);
			}
		if(typeof(theForm.direccion) != "undefined")
			{
			theForm.direccion.value = ValidateContactoPost(theForm, theForm.direccion.value);
			}
		if(typeof(theForm.telefono) != "undefined")
			{
			theForm.telefono.value = ValidateContactoPost(theForm, theForm.telefono.value);
			}
		if(typeof(theForm.ciudad) != "undefined")
			{
			theForm.ciudad.value = ValidateContactoPost(theForm, theForm.ciudad.value);
			}
		if(typeof(theForm.empresa) != "undefined")
			{
			theForm.empresa.value = ValidateContactoPost(theForm, theForm.empresa.value);
			}
		if(typeof(theForm.tema) != "undefined")
			{
			theForm.tema.value = ValidateContactoPost(theForm, theForm.tema.value);
			}
		if(typeof(theForm.mensajeH) != "undefined")
			{
			theForm.mensajeH.value = ValidateContactoPost(theForm, theForm.mensajeH.value);
			}
		
		if(theForm.email.value!=theForm.email_reg.value && theForm.email_reg.value!="")
			{
			if(window.confirm("Estimado Cliente, el mail ingresado es distinto al registrado en nuestras bases, ¿Desea actualizar sus datos?"))
				{
				theForm.email_act.value="S";
				}
			else{
				theForm.email_act.value="N";
				}
			}

		var LargoTxtCaptcha = theForm.txtCaptcha.value;
		if(theForm.txtCaptcha.value == "")
			{
			alert("Ingrese Código de Verificación.");
			theForm.txtCaptcha.focus();
			return false;			
			}
		if(LargoTxtCaptcha.length != "6")
			{
			alert("El Código de Verificación Debe Contener 6 Caracteres");
			theForm.txtCaptcha.focus();
			return false;			
			}
		if(typeof(theForm.txtCaptcha) != "undefined")
			{
			if(!theForm.txtCaptcha.value)
				{
				alert("Código de Verificación Inválido");
				theForm.txtCaptcha.focus();
				return false;
				}
			}
			
	theForm.submit();
}

function ValidateContactoMisCuentas()
{
var i;
var dato;
var indicetipoconsulta;
var theForm = document.getElementById("ContactoMisCuentas")

	if(typeof(theForm.nombre) != "undefined")
		{
		if(!theForm.nombre.value)
			{
			alert("Debe ingresar su Nombre");
			theForm.nombre.focus();
			return false;
			}
		}
	
	if(typeof(theForm.apellido_paterno) != "undefined")
		{
		if(!theForm.apellido_paterno.value)
			{
			alert("Debe ingresar su Apellido Paterno");
			theForm.apellido_paterno.focus();
			return false;
			}
		}
	
	if(typeof(theForm.apellido_materno) != "undefined")
		{
		if(!theForm.apellido_materno.value)
			{
			alert("Debe ingresar su Apellido Materno");
			theForm.apellido_materno.focus();
			return false;
			}
		}

	if(typeof(theForm.rut_completo) != "undefined")
		{
		if(!theForm.rut_completo.value)
			{
			alert("Debe ingresar su RUT");
			theForm.rut_completo.focus();
			return false;
			}
		var rut_completo;
    
		rut_completo = theForm.rut_completo.value;
		rut_completo = removeChar(rut_completo,'-');
		theForm.rut_completo.value = removeChar(rut_completo,'.');
		//if (!checkFormRUT(theForm,'rut','digito_verificador','rut_completo')){
		if (!checkRut2(theForm.rut_completo,'Rut de cliente invalido',true))
			{
			theForm.rut_completo.focus();
			return false;
			}
			var rut_aux = theForm.rut_completo.value;
			var rut
			rut  = rut_aux.substr(0,rut_aux.indexOf("."));
			rut_aux = rut_aux.substr(rut_aux.indexOf(".")+1,rut_aux.length);
			rut += rut_aux.substr(0,rut_aux.indexOf("."));
			rut_aux = rut_aux.substr(rut_aux.indexOf(".")+1,rut_aux.length);	
			rut += rut_aux.substr(0,rut_aux.indexOf("-"));
			
			theForm.rut.value = rut
			theForm.digito_verificador.value = rut_aux.substr(rut_aux.indexOf("-")+1,rut_aux.length);
		}


		if(typeof(theForm.email) != "undefined")
			{
			if(!theForm.email.value)
				{
				alert("Debe ingresar su E-mail");
				theForm.email.focus();
				return false;
				}
			if (!isEmail(theForm.email.value))
				{
				alert("La dirección de E-mail no es válida.");
				theForm.email.focus();
				return false;
				}
			}

		if(typeof(theForm.telefono) != "undefined")
			{
			if(!theForm.telefono.value)
				{
				alert("Debe ingresar su Teléfono");
				theForm.telefono.focus();
				return false;
				}
   
			if (!isPositiveInteger(theForm.telefono.value))
				{
				alert("Su número de Teléfono debe ser un campo numérico.");
				theForm.telefono.value="";
				theForm.telefono.focus();
				return false;
				}
			}
  
		if(typeof(theForm.direccion) != "undefined")
			{
			if(!theForm.direccion.value)
				{
				alert("Debe ingresar su Dirección");
				theForm.direccion.focus();
				return false;
				}
			}	

		if(typeof(theForm.comuna) != "undefined")
			{  
			indicetipoconsulta = theForm.comuna.selectedIndex;
			if(!indicetipoconsulta)
				{
				alert("Debe elegir su Comuna");
		    	theForm.comuna.focus();
		    	return false;
				}  
			}

		if(typeof(theForm.ciudad) != "undefined")
			{
			if(!theForm.ciudad.value)
				{
				alert("Debe ingresar su Ciudad");
				theForm.ciudad.focus();
				return false;
				}
			}	

		if(typeof(theForm.pais) != "undefined")
			{
			if(!theForm.pais.value)
				{
				alert("Debe ingresar su País");
				theForm.pais.focus();
				return false;
				}
			}	        

		if(typeof(theForm.empresa) != "undefined")
			{
			if(!theForm.empresa.value)
				{
				alert("Debe ingresar su Empresa");
				theForm.empresa.focus();
				return false;
				}    
			}	    

		if(typeof(theForm.consulta) != "undefined")
			{  
			//indicetipoconsulta = theForm.consulta.selectedIndex;
			valuetipoconsulta = theForm.consulta.options[theForm.consulta.selectedIndex].value;
			if(valuetipoconsulta == '0')
				{
				alert("Debe elegir su Tipo de Consulta");
				theForm.consulta.focus();
				return false; 
				}
			//if(indicetipoconsulta==1){ 
			if(valuetipoconsulta=='1') // 1:Solicitud de Clave
				theForm.doAction.value = "enviarClave";	
			else
				theForm.doAction.value = "enviarContacto";
			}
			
			if(typeof(theForm.tema) != "undefined")
				{
				if(!theForm.tema.value)
					{
					alert("Debe ingresar un Tema");
					theForm.tema.focus();
					return false;
					}
				}

			if(typeof(theForm.mensajeH) != "undefined")
				{
				if(!theForm.mensajeH.value)
					{
					alert("Debe ingresar un Mensaje");
					theForm.mensajeH.focus();
					return false;
					} 
				if(theForm.mensajeH.value.length>=2000)
					{
					alert("El mensaje tiene como máximo 2000 carácteres.")
					theForm.mensajeH.value = theForm.mensajeH.value.substring(0,1999);
					return false;
					}
				}
			
			//INICIO: Validacion de caracteres extraños
                        //"!#$%^&*()=+{}[]\\;?><'"
				theForm.mensajeH.value=ReplaceAll(theForm.mensajeH.value,"%","");		
				theForm.mensajeH.value=ReplaceAll(theForm.mensajeH.value,"!","");
				theForm.mensajeH.value=ReplaceAll(theForm.mensajeH.value,"#","");
				theForm.mensajeH.value=ReplaceAll(theForm.mensajeH.value,"$","");
				theForm.mensajeH.value=ReplaceAll(theForm.mensajeH.value,"^","");
				theForm.mensajeH.value=ReplaceAll(theForm.mensajeH.value,"&","");
				theForm.mensajeH.value=ReplaceAll(theForm.mensajeH.value,"*","");
				theForm.mensajeH.value=ReplaceAll(theForm.mensajeH.value,"(","");
				theForm.mensajeH.value=ReplaceAll(theForm.mensajeH.value,")","");
				theForm.mensajeH.value=ReplaceAll(theForm.mensajeH.value,"=","");
				theForm.mensajeH.value=ReplaceAll(theForm.mensajeH.value,"+","");
				theForm.mensajeH.value=ReplaceAll(theForm.mensajeH.value,"{","");
				theForm.mensajeH.value=ReplaceAll(theForm.mensajeH.value,"}","");				
				theForm.mensajeH.value=ReplaceAll(theForm.mensajeH.value,"[","");
				theForm.mensajeH.value=ReplaceAll(theForm.mensajeH.value,"]","");
				theForm.mensajeH.value=ReplaceAll(theForm.mensajeH.value,"/","");	
				theForm.mensajeH.value=ReplaceAll(theForm.mensajeH.value,";","");
				theForm.mensajeH.value=ReplaceAll(theForm.mensajeH.value,"?","");
				theForm.mensajeH.value=ReplaceAll(theForm.mensajeH.value,">","");
				theForm.mensajeH.value=ReplaceAll(theForm.mensajeH.value,"<","");
				theForm.mensajeH.value=ReplaceAll(theForm.mensajeH.value,"'","");
			//FIN: Validacion de caracteres extraños
							
			theForm.mensaje.value = theForm.mensajeH.value;
			
			if(typeof(theForm.nombre) != "undefined")
				{
				theForm.nombre.value = ValidateContactoPost(theForm, theForm.nombre.value);
				}
			if(typeof(theForm.apellido_paterno) != "undefined")
				{
				theForm.apellido_paterno.value 	= ValidateContactoPost(theForm, theForm.apellido_paterno.value);
				}
			if(typeof(theForm.apellido_materno) != "undefined")
				{
				theForm.apellido_materno.value 	= ValidateContactoPost(theForm, theForm.apellido_materno.value);
				}
			if(typeof(theForm.direccion) != "undefined")
				{
				theForm.direccion.value = ValidateContactoPost(theForm, theForm.direccion.value);
				}
			if(typeof(theForm.telefono) != "undefined")
				{
				theForm.telefono.value = ValidateContactoPost(theForm, theForm.telefono.value);
				}
			if(typeof(theForm.ciudad) != "undefined")
				{
				theForm.ciudad.value = ValidateContactoPost(theForm, theForm.ciudad.value);
				}
			if(typeof(theForm.empresa) != "undefined")
				{
				theForm.empresa.value = ValidateContactoPost(theForm, theForm.empresa.value);
				}
			if(typeof(theForm.tema) != "undefined")
				{
				theForm.tema.value = ValidateContactoPost(theForm, theForm.tema.value);
				}
			if(typeof(theForm.mensajeH) != "undefined")
				{
				theForm.mensajeH.value = ValidateContactoPost(theForm, theForm.mensajeH.value); 
				}
		
		theForm.submit();
		//return true;
}



function ValidateContacto2(theForm)
{
var i;
var dato;
var indicetipoconsulta;

	if(typeof(theForm.nombre) != "undefined")
		{
		if(!theForm.nombre.value)
			{
			alert("Debe ingresar su Nombre");
			theForm.nombre.focus();
			return false;
			}
		}
	
	if(typeof(theForm.apellido_paterno) != "undefined")
		{
		if(!theForm.apellido_paterno.value)
			{
			alert("Debe ingresar su Apellido Paterno");
			theForm.apellido_paterno.focus();
			return false;
			}
		}	
	
	if(typeof(theForm.apellido_materno) != "undefined")
		{
		if(!theForm.apellido_materno.value)
			{
			alert("Debe ingresar su Apellido Materno");
			theForm.apellido_materno.focus();
			return false;
			}
		}

	if(typeof(theForm.rut_completo) != "undefined")
		{
		if(!theForm.rut_completo.value)
			{
			alert("Debe ingresar su RUT");
			theForm.rut_completo.focus();
			return false;
			}
		var rut_completo;
		var rut = theForm.rut.value; 
		var dig = theForm.digito_verificador.value; 
		rut_completo = theForm.rut_completo.value;
		//rut_completo = removeChar(rut_completo,'-');
		//theForm.rut_completo.value = removeChar(rut_completo,'.');
		//if (!checkFormRUT(theForm,'rut','digito_verificador','rut_completo')){
		if (!checkRut2(theForm.rut_completo,'Rut de usuario invalido',true))
			{
			theForm.rut_completo.focus();
			return false;
			} 
		else
			{
			rut_completo = theForm.rut_completo.value;
			rut  = rut_completo.substr(0,rut_completo.indexOf("."));
			rut_completo = rut_completo.substr(rut_completo.indexOf(".")+1,rut_completo.length);
			rut += rut_completo.substr(0,rut_completo.indexOf("."));
			rut_completo = rut_completo.substr(rut_completo.indexOf(".")+1,rut_completo.length);	
			rut += rut_completo.substr(0,rut_completo.indexOf("-"));
		  	dig = rut_completo.substr(rut_completo.indexOf("-")+1,rut_completo.length);

			theForm.rut.value = rut;
			theForm.digito_verificador.value = dig;
			}
	}
	
	if(typeof(theForm.email) != "undefined")
		{
		if(!theForm.email.value)
			{
			alert("Debe ingresar su E-mail");
			theForm.email.focus();
			return false;
			}
	
	    if (!isEmail(theForm.email.value))
			{
			alert("La dirección de E-mail no es válida.");
			theForm.email.focus();
			return false;
			}
		}

	if(typeof(theForm.telefono) != "undefined")
		{
		if(!theForm.telefono.value)
			{
			alert("Debe ingresar su Teléfono");
			theForm.telefono.focus();
			return false;
			}
   
		if (!isPositiveInteger(theForm.telefono.value))
			{
			alert("Su número de Teléfono debe ser un campo numérico.");
			theForm.telefono.value="";
			theForm.telefono.focus();
			return false;
			}  
		}
  
	if(typeof(theForm.direccion) != "undefined")
		{
		if(!theForm.direccion.value)
			{
			alert("Debe ingresar su Dirección");
			theForm.direccion.focus();
			return false;
			}
		}

	if(typeof(theForm.comuna) != "undefined")
		{  
		indicetipoconsulta = theForm.comuna.selectedIndex;
		if(!indicetipoconsulta)
			{
			alert("Debe elegir su Comuna");
			theForm.comuna.focus();
			return false;
			}  
		}

	if(typeof(theForm.ciudad) != "undefined")
		{
		if(!theForm.ciudad.value)
			{
			alert("Debe ingresar su Ciudad");
			theForm.ciudad.focus();
			return false;
			}
		}	
	
	if(typeof(theForm.pais) != "undefined")
		{
		if(!theForm.pais.value)
			{
			alert("Debe ingresar su País");
			theForm.pais.focus();
			return false;
			}
		}	        

	if(typeof(theForm.empresa) != "undefined")
		{
		if(!theForm.empresa.value)
			{
			alert("Debe ingresar su Empresa");
			theForm.empresa.focus();
			return false;
			}    
		}	    

	if(typeof(theForm.consulta) != "undefined")
		{  
		//indicetipoconsulta = theForm.consulta.selectedIndex;
		valuetipoconsulta = theForm.consulta.options[theForm.consulta.selectedIndex].value;
		if(valuetipoconsulta == '0')
			{
			alert("Debe elegir su Tipo de Consulta");
			theForm.consulta.focus();
			return false; 
		}
		//if(indicetipoconsulta==1){ 
		if(valuetipoconsulta=='1') // 1:Solicitud de Clave
			theForm.doAction.value = "enviarClave";	
		else
			theForm.doAction.value = "enviarContacto";	
		}
  
	if(typeof(theForm.tema) != "undefined")
		{
		if(!theForm.tema.value)
			{
			alert("Debe ingresar un Tema");
			theForm.tema.focus();
			return false;
		} 
	}	

	if(typeof(theForm.mensaje) != "undefined")
		{
		if(!theForm.mensaje.value)
			{
			alert("Debe ingresar un Mensaje");
			theForm.mensaje.focus();
			return false;
			} 
		if(theForm.mensaje.value.length>=2000)
			{
			alert("El mensaje tiene como máximo 2000 carácteres.")
			theForm.mensaje.value = theForm.mensaje.value.substring(0,1999);
			return false;
			}
		}
	
	theForm.submit();
	//return true;
}
function ReplaceAll(Source,stringToFind,stringToReplace){

  var temp = Source;

    var index = temp.indexOf(stringToFind);

        while(index != -1){

            temp = temp.replace(stringToFind,stringToReplace);

            index = temp.indexOf(stringToFind);

        }

        return temp;
}

/*
String.prototype.ReplaceAll = function(stringToFind,stringToReplace){
    var temp = this;
    var index = temp.indexOf(stringToFind);
        while(index != -1){
            temp = temp.replace(stringToFind,stringToReplace);
            index = temp.indexOf(stringToFind);
        }
        return temp;
    }
*/
