 function colapsarExpandir(id_a){
	var a =  document.getElementById(id_a);
	var div = document.getElementById(id_a + '-items');
	var span = document.getElementById(id_a + '-span');
	if(a.className == 'colapsado'){
		a.className = 'expandido';
		div.className = 'expandido';
		span.style.display = "none";
	}else{
		a.className = 'colapsado';
		div.className = 'colapsado';
		span.style.display = "block";
	}
}

function enviarMail(form, uri){
	var error = false;

	if(form.nombre.value == ""){
		$("err-nom-" + uri).style.display = 'block';
		error = true;
	}
	
	if(form.from.value == ""){
		$("err-email-" + uri).style.display = "block";
		error = true;
	}
	
	if(form.telefono.value == ""){
		$("err-tel-" + uri).style.display = "block";
		error = true;
	}
	
	if(form.captchaText.value == ""){
		$("err-captcha-" + uri).style.display = "block";
		error = true;
	}
	
	if(!error){
		form.submit();
	}
}

function limpiarError(id){
	document.getElementById(id).style.display = 'none';
	return
}

function VerifyEmail(email) {
	flag = true;
	if(email.indexOf('@',0)==-1 || email.indexOf(';',0)!=-1
		|| email.indexOf(' ',0)!=-1 || email.indexOf('/',0)!=-1
		|| email.indexOf(';',0)!=-1 || email.indexOf('&lt;',0)!=-1
		|| email.indexOf('&gt;',0)!=-1 || email.indexOf('*',0)!=-1
		|| email.indexOf('|',0)!=-1 || email.indexOf('`',0)!=-1
		|| email.indexOf('&amp;',0)!=-1 || email.indexOf('$',0)!=-1
		|| email.indexOf('!',0)!=-1 || email.indexOf('"',0)!=-1
		|| email.indexOf(':',0)!=-1) {
			flag = false;
		}
	return flag;
}
