
	function validateEmail(sEmail)
	{
		var splitted = sEmail.match("^(.+)@(.+)$");
		if(splitted == null) return false;
		if(splitted[1] != null )
		{
		  var regexp_user=/^\"?[\w-_\.]*\"?$/;
		  if(splitted[1].match(regexp_user) == null) return false;
		}
		if(splitted[2] != null)
		{
		  var regexp_domain=/^[\w-\.]*\.[A-Za-z]{2,4}$/;
		  if(splitted[2].match(regexp_domain) == null) 
		  {
			var regexp_ip =/^\[\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}\]$/;
			if(splitted[2].match(regexp_ip) == null) return false;
		  }
		  return true;
		}
	return false;
	}
	function ValidarTexto()
	{
		if (window.event.keyCode==34 || window.event.keyCode==39 || window.event.keyCode==38 || window.event.keyCode==44 || window.event.keyCode==59)
		{
			event.returnValue = false;
		}
	}
	function ValidarContacto()
	{
		if (document.forma.sNombre.value.length == 0)
		{
			alert("Favor de llenar el campo \"Nombre\".");
			document.forma.sNombre.focus();
			return;
		}
		if (document.forma.sEmpresa.value.length == 0)
		{
			alert("Favor de llenar el campo \"Empresa\".");
			document.forma.sEmpresa.focus();
			return;
		}
		if (validateEmail(document.forma.sEmail.value)==false)
		{
			alert("Favor de llenar el campo \"Email\" correctamente.");
			document.forma.sEmail.focus();
			return;
		}
		if (document.forma.sTelefono.value.length == 0)
		{
			alert("Favor de llenar el campo \"Teléfono\".");
			document.forma.sTelefono.focus();
			return;
		}
		if (document.forma.sAsunto.value == "")
		{
			alert("Favor de seleccionar un asunto.");
			document.forma.sAsunto.focus();
			return;
		}
		if (document.forma.sComentario.value.length == 0)
		{
			alert("Favor de llenar el campo \"Comentarios\".");
			document.forma.sComentario.focus();
			return;
		}
		document.forma.submit();
	}
	function LimpiarForma()
	{
		document.forma.sNombre.value = "";
		document.forma.sEmpresa.value = "";
		document.forma.sEmail.value = "";
		document.forma.sTelefono.value = "";
		document.forma.sAsunto.selectedIndex = 0;
		document.forma.sComentario.value = "";
	}
