// JavaScript Document
function validar(formulario,campos)
{
	if ((!campos) || (!formulario))
		return false;
	error = false;
	for (x in campos)
	{
		tmp = document.getElementById(campos[x]);
		
		if ((tmp.type == "text") || (tmp.type == "textarea"))
		{
			if (tmp.value == "")
			{
				error = true;
				tmp.className = "input_error";
			}
		}
		else if (tmp.type == "select-one")
		{
			if ((tmp.selectedIndex == 0) || (tmp.selectedIndex == null))
			{
				error = true;
				tmp.className = "input_error";
			}					
		}
	}
	if (error == true)
		alert("Por favor complete todos los campos");
	else
		formulario.submit();
}