function puntuar(puntos,idmapa,idcapa)
{
	var url = 'puntuar.php?idmapa=' + idmapa + "&puntos=" + puntos ;
	xmlhttp.open("GET",url,true);
//	window.open (url)
	xmlhttp.onreadystatechange=function() {
	if (xmlhttp.readyState==4) {
		data = xmlhttp.responseText;
		alert('Gracias por votar el curso y ayudarnos!!!');
		//document.getElementById('vota' + idcapa).style.visibility='hidden'
	}
	}
	xmlhttp.setRequestHeader('Accept','message/x-jl-formresult');
	xmlhttp.send(null);
	
	return false;	
}
var enviar ='no';
function comprobar(){
	var msgerror='';
	if (document.datos.nombre.value=='') 
		msgerror = '* Nombre completo\n';
	if (document.datos.email.value=='') 
		msgerror = msgerror +'* Email\n';
	if (document.datos.comentario.value=='') 
		msgerror = msgerror +'* Comentario\n';
	if (msgerror!=''){
		alert('Los siguientes campos son obligatorios:\n\n'+msgerror);
		return false;
		}
	else
	{
			var url = 'codigo.php?codigo=' + document.datos.codigo.value;
			//window.open (url);
			xmlhttp.open("GET",url,true);
			xmlhttp.onreadystatechange=function() {
			if (xmlhttp.readyState==4) {
				var res = xmlhttp.responseText;
				if (res=='yes')
					document.datos.submit();
				else
					{
					alert('Código incorrecto');
					return false;
					}
				}}
			 xmlhttp.setRequestHeader('Accept','message/x-jl-formresult');
			 xmlhttp.send(null);
			return false;

	}


}

