function marcarOK(id){
	var cont = document.getElementById(id);
	cont.innerHTML="ok!";
	cont.className="ok";
	}

function marcarError(id,msg){
	var cont = document.getElementById(id);
	cont.innerHTML=msg;
	cont.className="error";
	}
	
function validar(){
	var nombre = document.getElementById('nombre');
	var direccion = document.getElementById('direccion');
	var localidad = document.getElementById('localidad');
	var provincia = document.getElementById('provincia');
	var codigopostal = document.getElementById('codigopostal');
	var dni = document.getElementById('dni');
	var nacimiento = document.getElementById('nacimiento');
	var email = document.getElementById('email');
	var tel = document.getElementById('tel');
	var situacionimpositiva = document.getElementById('situacionimpositiva');
	var cuit = document.getElementById('cuit');
	var conocio = document.getElementById('conocio');
	var comentario = document.getElementById('comentario');
	var error = false;
	

	//nombre
	if(nombre.value==""){
		marcarError('msg_nombre','Ingrese su nombre');
		error = true;
	}else{
		marcarOK('msg_nombre');
	}
		//direccion
	if(direccion.value==""){
		marcarError('msg_direccion','Ingrese su Direccion');
		error = true;
	}else{
		marcarOK('msg_direccion');
	}

	
	//localidad
	if(localidad.value==""){
		marcarError('msg_localidad','Ingrese su Localidad');
		error = true;
	}
	else{
		marcarOK('msg_localidad');
	}
		//provincia
	if(provincia.value==""){
		marcarError('msg_provincia','Ingrese su Provincia');
		error = true;
	}else{
		marcarOK('msg_provincia');
	}
			//codigopostal
	if(codigopostal.value==""){
		marcarError('msg_codigopostal','Ingrese su Codigo Postal');
		error = true;
	}else{
		marcarOK('msg_codigopostal');
	}
		//dni
	if(dni.value==""){
		marcarError('msg_dni','Ingrese su DNI');
		error = true;
	}else{
		marcarOK('msg_dni');
	}
		//nacimiento
	if(nacimiento.value==""){
		marcarError('msg_nacimiento','Ingrese su Fecha de Nacimiento');
		error = true;
	}else{
		marcarOK('msg_nacimiento');
	}

		//email
	if(email.value==""){
		marcarError('msg_email','Ingrese su E-Mail');
		error = true;
	}else{
		marcarOK('msg_email');
	}
			//tel
	if(tel.value==""){
		marcarError('msg_tel','Ingrese su Telefono');
		error = true;
	}else{
		marcarOK('msg_tel');
	}
		//situacionimpositiva	
	if(situacionimpositiva.selectedIndex==0){
		marcarError('msg_situacionimpositiva','Ingrese su Situacion Impositiva');
		error = true;
	}else{
		marcarOK('msg_situacionimpositiva');
	}
			//cuit
	if(cuit.value==""){
		marcarError('msg_cuit','Ingrese su CUIT');
		error = true;
	}else{
		marcarOK('msg_cuit');
	}
			//conocio	
	if(conocio.selectedIndex==0){
		marcarError('msg_conocio','Ingrese la forma en la que nos Conocio');
		error = true;
	}else{
		marcarOK('msg_conocio');
	}
			//comentario
	if(comentario.value==""){
		marcarError('msg_comentario','Ingrese su Comentario');
		error = true;
	}else{
		marcarOK('msg_comentario');
	}

	// ESTO SIEMPRE VA AL FINAL
	if(error==true){
		return false;
	} else{
		return true;
	}

}
