function chequeo_consulta() {
	if (document.consulta.nombre.value == "" || document.consulta.correo.value == "" || document.consulta.consulta.value == "") {
		alert("Please, fill in all mandatory fields");
		return false;
	}
	strEmail = document.consulta.correo.value;
	if ((strEmail.indexOf("@") != -1) && (strEmail.indexOf(".") != -1)){
		// return true;
	} else {
		alert("Invalid email format");
		return false;
	}
	if (document.consulta.captcha.value == "") {
		alert("Please, fill in the security code");
		return false;
	}
	return true;
}

function chequeo_comentario() {
	if (document.comentar.nombre.value == "" || document.comentar.email.value == "" || document.comentar.comentario.value == "") {
		alert("All fields are mandatory");
		return false;
	}
	strEmail = document.comentar.email.value;
	if ((strEmail.indexOf("@") != -1) && (strEmail.indexOf(".") != -1)){
		// return true;
	} else {
		alert("Invalid email format");
		return false;
	}
	if (document.comentar.captcha.value == "") {
		alert("Please, fill in the security code");
		return false;
	}
	return true;
}

function nuevoAjax() {
	var xmlhttp=false;
	try {
		xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
	} catch (e) {
		try {
			xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
		} catch (E) {
			xmlhttp = false;
		}
	}
	if (!xmlhttp && typeof XMLHttpRequest!='undefined') {
		xmlhttp = new XMLHttpRequest();
	}
	return xmlhttp;
} 

function ajax(tipo,fichero) {
	var tipo,fichero;
	ajax = nuevoAjax();
	ajax.open("GET", "_ajax.php?q=" + tipo + "&id=" + fichero, true);
	/*
	ajax.onreadystatechange=function() {
		if (ajax.readyState == 4) {
			// contenedor.innerHTML = ajax.responseText;
		}
	}
	*/
	ajax.send(null);
}
