function replace_all_occurrences(str,str_rep,str_fin){
	while(str.indexOf(str_rep) > -1){
		str = str.replace(str_rep,str_fin);
	}	
	return str;
}

function validar_Forma_Contactenos (theForm) {

if (replace_all_occurrences(theForm.nombre.value," ","").length == 0)
  {    
    alert("Por favor digita tu nombre.");
    theForm.nombre.focus();
    return (false);
  }
if (replace_all_occurrences(theForm.apellido.value," ","").length == 0)
  {    
    alert("Por favor digita tu apellido.");
    theForm.apellido.focus();
    return (false);
  } 
if (replace_all_occurrences(theForm.email.value," ","").length == 0)
  {    
    alert("Por favor digita tu e-mail.");
    theForm.email.focus();
    return (false);
  }

var myV = theForm.email.value;
if (myV.lastIndexOf('.')<myV.lastIndexOf('@')||myV.lastIndexOf('.')==-1||myV.lastIndexOf('@')==-1)
{
	alert("Por favor digita una direccion valida de E-mail.");
    theForm.email.focus();
    return (false);
}
if (replace_all_occurrences(theForm.comentarios.value," ","").length == 0)
  {    
    alert("Por favor digita tus Comentarios.");
    theForm.comentarios.focus();
    return (false);
  }
  
pageTracker._trackPageview('/virtual/Contactenos_institucional.asp'); 
return (true);
}

