<!--

function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}
function Comprobarespacios(cadena) 
{
    var caracteres = " ";
    var i;
    var valido = false;
    
        for(i=0;i<cadena.length;i++) {
            if (caracteres.indexOf(cadena.charAt(i)) == -1) {
                valido = true;
                break;
            }
        }
    return valido;
}
function nobr(cadena) 
{

    var k;
    var valido = false;
    
        for(k=0;k<cadena.length;k++) {
            if ((cadena.indexOf('<') == -1) 
			    && (cadena.indexOf('"') == -1)
			    //&& (cadena.indexOf(';') == -1) && (cadena.indexOf('*') == -1)
				//&& (cadena.indexOf('>') == -1) && (cadena.indexOf('`') == -1)
				//&& (cadena.indexOf('|') == -1) && (cadena.indexOf('"') == -1)
				//&& (cadena.indexOf('&') == -1) 
				   
			 ) 
			{
                valido = true;
                break;
            }
        }
    return valido;
}


function Comprobarcontinuidad(cadena) 
{
    var caracteres = " ";
    var i;
    var k;
	var valido = true;
    limite = cadena.length - 21;
		  for(k=0;k<(limite+1);k++) 
		  {
            for(i=k;i<(k+21);i++)
			{
			 if (caracteres.indexOf(cadena.charAt(i)) !== -1) 
			 {
                valido = true;
                break;
             } else valido = false;
			}
		 }


	return valido;
}

function titulo(form2)
{ if (form2.titulo.value == "")
     {
        alert("El Campo de Título debe contener datos.");
        form2.titulo.select();
	    
	 }
    else if (!Comprobarespacios(form2.titulo.value))
              {
              alert("El Campo de Título debe contener datos.");
              form2.titulo.focus();
              form2.titulo.select();
			  return (false);}
    		else if (!Comprobarcontinuidad(form2.titulo.value))
              {
              alert("Por razones gráficas NO se pueden ingresar más de 20 caractéres seguidos en el Campo Título.");
              form2.titulo.focus();
              form2.titulo.select();
			  return (false);}
	
	else if (!nobr(form2.titulo.value))
	{
	alert("Por razones gráficas, los siguientes caracteres NO están habilitados \"< en algunos campos.")
			  
			  form2.titulo.focus();
              form2.titulo.select();
			  return (false);}
	
	else return (true);
}


function subtitulo(form2)
{ if (form2.subtitulo.value == "")
     {
        alert("Por razones gráficas, el Campo de Subtítulo debe contener algún dato.");
        form2.subtitulo.select();
	 }
    else if (!Comprobarespacios(form2.subtitulo.value))
              {
              alert("Por razones gráficas, el Campo de Subtítulo debe contener algún dato.");
              form2.subtitulo.focus();
              form2.subtitulo.select();
			  return (false);}
    		else if (!Comprobarcontinuidad(form2.subtitulo.value))
              {
              alert("Por razones gráficas NO se pueden ingresar más de 20 caractéres seguidos en el Subtítulo.");
              form2.subtitulo.focus();
              form2.subtitulo.select();
			  return (false);}
	
	else if (!nobr(form2.subtitulo.value))
	{
	alert("Por razones gráficas, los siguientes caracteres NO están habilitados \"< en algunos campos.")
			
              form2.subtitulo.focus();
              form2.subtitulo.select();
			  return (false);}
	
	else return (true);
}

function email(form2)
{ if (form2.email.value == "")
     {
        alert("Debes escribir un email para que los clientes puedan enviarte preguntas. Las preguntas y respuestas quedarán escritas bajo tu aviso en forma automática.");
        form2.email.select();
	    
	 }
    else if (!Comprobarespacios(form2.email.value))
              {
              alert("El Campo de Email debe contener datos.");
              form2.email.focus();
              form2.email.select();
			  return (false);}
    		else if (!Comprobarcontinuidad(form2.email.value))
              {
              alert("Por razones gráficas NO se pueden ingresar más de 30 caracteres seguidos en el Campo email.");
              form2.email.focus();
              form2.email.select();
			  return (false);}
	
	else if (!nobr(form2.email.value))
	{
	alert("Por razones gráficas, los siguientes caracteres NO están habilitados \"< en algunos campos.")
			  
			  form2.email.focus();
              form2.email.select();
			  return (false);}
	
	else return (true);
}

function contenido(form2)
{ if (form2.contenido.value == "")
     {
        alert("Escriba el Texto de su anuncio");
        form2.contenido.select();
	 }

    else if (!Comprobarespacios(form2.contenido.value))
              {
              alert("Escriba el Texto de su anuncio");
              form2.contenido.focus();
              form2.contenido.select();
			  return (false);}
	else return (true);
	
}


function validar(form2)
{
	if (!titulo(form2)) return;
	if (!subtitulo(form2)) return;
	if (!contenido(form2)) return;
	form2.submit(form2);
}
function cambiahtml(){
	var txthtml = '<p>';
	for (x=0;x<document.form3.length;x++){
		if (document.form3.elements[x].type == 'checkbox'){
			if(document.form3.elements[x].checked){
				switch(document.form3.elements[x].name){
					case "chileanuncios":
					txthtml+='<a href="http://www.chileanuncios.cl">Chile Anuncios</a><br>';
					break;
					case "chileserviciotecnico":
					txthtml+='<a href="http://www.chileserviciotecnico.cl">Chile servicio Tecnico</a><br>';
					break;
					case "chilesoluciones":
					txthtml+='<a href="http://www.chilesoluciones.cl">Chile Soluciones</a><br>';
					break;
					case "chilenautico":
					txthtml+='<a href="http://www.chilenautico.cl">Chile Nautico</a><br>';
					break;
					case "chileoficios":
					txthtml+='<a href="http://www.chileoficios.cl">Oficios en Chile</a><br>';
					break;
					case "lineablanca":
					txthtml+='<a href="http://www.lineablanca.cl">Linea Blanca</a><br>';
					break;
					case "rentacasas":
					txthtml+='<a href="http://www.rentacasas.cl">Chile Casas</a><br>';
					break;
					case "avisosdeautos":
					txthtml+='<a href="http://www.avisosdeautos.cl">Chile Autos</a><br>';
					break;
					case "chilevalioso":
					txthtml+='<a href="http://www.chilevalioso">Turismo activo</a>';
					break;
					case "mercadofacil":
					txthtml+='<a href="http://www.mercadofacil.cl">Mercado Facil</a><br>';
					break;
					case "elvendedor":
					txthtml+='<a href="http://www.elvendedor.cl">El Vendedor</a><br>';
					break;
					case "fotonovios":
					txthtml+='<a href="http://www.fotonovios.cl">Fotografia para Novios</a><br>';
					break;
					case "altas":
					txthtml+='<a href="http://www.altas.cl">Chile Web Hosting</a><br>';
					break;
					case "tourchile":
					txthtml+='<a href="http://www.tourchile.cl">Turismo en chile</a><br>';
					break;
					case "casanovios":
					txthtml+='<a href="http://www.casanovios.cl">Chile Novios</a><br>';
					break;
					case "datoavisos":
					txthtml+='<a href="http://www.datoavisos.com.mx">Dato Avisos Mexico</a><br>';
					break;
					case "datoavisoses":
					txthtml+='<a href="http://www.datoavisos.es">Dato Avisos Venezuela</a><br>';
					break;
					case "datoavisosve":
					txthtml+='<a href="http://www.datoavisos.com.ve">Dato Avisos Venezuela</a><br>';
					break;
					case "casanoviosve":
					txthtml+='<a href="http://www.casanovios.com.ve">Avisos Novios Venezuela</a><br>';
					break;
					case "rentacasasve":
					txthtml+='<a href="http://www.rentacasas.com.ve">Renta Casas Venezuela</a><br>';
					break;
					case "mercadopersa":
					txthtml+='<a href="http://www.mercadopersa.cl">Chile Mercado Persa</a><br>';
					break;
				}
			}
		}
	}
	txthtml+= '</p>';
	document.getElementById("codhtml").value = txthtml;
}

function contacto_Validator(theForm)

{

   if (theForm.tit.value == "")

  {

    alert("Por favor ingrese un máximo de 3 palabras en el campo \"título\".");

    theForm.tit.focus();

    return (false);

  }

   if (theForm.mail.value == "")

  {

    alert("Por favor ingrese un correo electrónico válido en el campo \"Email\".");

    theForm.mail.focus();

    return (false);

  }

  if (theForm.mail.value.length < 7)

  {

    alert("Por favor ingrese al menos 7 caracteres en el campo \"Email\".");

    theForm.mail.focus();

    return (false);

  }

  var checkOK = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyzƒŠŒŽšœžŸÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõöøùúûüýþÿ0123456789_-@.";

  var checkStr = theForm.mail.value;

  var allValid = true;

  var validGroups = true;

  for (i = 0;  i < checkStr.length;  i++)

  {

    ch = checkStr.charAt(i);

    for (j = 0;  j < checkOK.length;  j++)

      if (ch == checkOK.charAt(j))

        break;

    if (j == checkOK.length)

    {

      allValid = false;

      break;

    }

  }

  if (!allValid)

  {

    alert("Por favor ingrese solo letras, numeros y \"@.\" en el campo \"Correo electrónico\".");

    theForm.mail.focus();

    return (false);

  }

  return (true);

}

			 
			 
//-->


