function valRegistro()
{
	var pas1 = document.getElementById('paswordzita');
	var pas2 = document.getElementById('repetida');
	var actividad = document.getElementById('ractividad');
	var otro = document.getElementById('otro');
	
	if (pas1.value != pas2.value)
	{
		alert('Las contrase\xF1as no coinciden.');	
		return;
	}
	
	if ((actividad.options[actividad.selectedIndex].value == -1) && (otro.value == ""))
	{
		otro.className = 'input_error';
		alert('Por favor ingrese otra actividad.');
		return;
	}
	
	var userMail = document.getElementById('remail');
	if (validate_email(userMail) == false)
	{
		alert('Por favor ingrese un e-mail valido.');
		userMail.className = 'input_error';
		return;
	}
	
	
	var campos = Array('ruser','rnombre', 'rcuit', 'rdireccion', 'rtelefono', 'remail', 'ractividad');
	
	validar('frmRegistro',campos);
}

function validate_email(field)
{
	with (field)
	  {
	  apos=value.indexOf("@");
	  dotpos=value.lastIndexOf(".");
	  if (apos<1||dotpos-apos<2)
		{ return false;}
	  else { return true; }
	  }
}

var cliente = 0;

function setCliente(sino)
{
	cliente = sino;	
}

function valContacto()
{
	var actividad = document.getElementById('actividad_2');
	var otro = document.getElementById('otro_2');
	var empresa = document.getElementById('empresa_2');
	
	if ((cliente == 1) && (empresa.value == ""))
	{
		empresa.className = 'input_error';
		alert('Por favor ingrese la empresa.');
		return;
	}
	
	if ((actividad.options[actividad.selectedIndex].value == -1) && (otro.value == ""))
	{
		otro.className = 'input_error';
		alert('Por favor ingrese otra actividad.');
		return;
	}
	
	var campos = Array('nombre_2', 'apellido_2', 'email_2', 'actividad_2', 'comentario_2');
	
	validar('frmContacto',campos);
}
