function ajaxFunction(loc){
			var ajaxRequest;  // The variable that makes Ajax possible!
			
			try{
				// Opera 8.0+, Firefox, Safari
				ajaxRequest = new XMLHttpRequest();
			} catch (e){
				// Internet Explorer Browsers
				try{
					ajaxRequest = new ActiveXObject("Msxml2.XMLHTTP");
				} catch (e) {
					try{
						ajaxRequest = new ActiveXObject("Microsoft.XMLHTTP");
					} catch (e){
						// Something went wrong
						alert("Your browser broke!");
						return false;
					}
				}
			}
			// Create a function that will receive data sent from the server
			ajaxRequest.onreadystatechange = function(){
				if(ajaxRequest.readyState == 4){
					document.getElementById("megusta").innerHTML="<strong>"+ajaxRequest.responseText+"</strong>";
				}
			}
			ajaxRequest.open("GET", "../../actionAjax.php?loc="+loc+"&time="+new Date(), true);
			ajaxRequest.send(null); 
		}

function puntua(elemento){
	var loc = document.location.href;
	loc=loc.substring(loc.indexOf("public/actividades/")+19);
	loc=loc.split("/actividad").join("");
	loc=loc.split(".php").join("");
	ajaxFunction(loc);
	}

function display_grupo(id)
{
	if(id == 1){
		document.getElementById("grupal").style.display = "block";
	}else if(id == 2){
		document.getElementById("grupal").style.display = "none";
	}
}
function alguna_actividad()
{
	var form = document.forms[0];
	var todos = document.getElementsByTagName('input');
	var x;
	var d = 0;
	for(x=0;x<todos.length;x++){
		if(todos[x].type=="radio" && todos[x].checked){
			d = d + 1;
		}
	}
	if(d == 0){
		alert("Debe seleccionar al menos una actividad.");return false;
	}
	return true;
}
function vacio(q)
{  
	for ( i = 0; i < q.length; i++ ) {  
		if ( q.charAt(i) != " " ) {  
			return true;  
		}  
	}  
	return false; 
}
function compruebaidea(form){
	var t1=form.nombre.value;
	if(vacio(t1) == false) {
		window.alert("Debe introducir su nombre.");
		form.nombre.focus(); form.nombre.select(); return false;
	}
	var t3=form.correo.value;
	if(vacio(t3) == false) {
		window.alert("Debe introducir un e-mail de contacto.");
		form.correo.focus(); form.correo.select(); return false;
	}
	var t4=form.idea.value;
	if(vacio(t4) == false) {
		window.alert("Debe introducir una idea.");
		form.idea.focus(); form.idea.select(); return false;
	}
	return true;
}
function comentariocomp(form){
	var t1=form.nombre.value;
	if(vacio(t1) == false) {
		window.alert("Debe introducir su nombre.");
		form.nombre.focus(); form.nombre.select(); return false;
	}
	var t3=form.correo.value;
	if(vacio(t3) == false) {
		window.alert("Debe introducir un e-mail de contacto.");
		form.correo.focus(); form.correo.select(); return false;
	}
	var t4=form.comentario.value;
	if(vacio(t4) == false) {
		window.alert("Debe introducir un comentario.");
		form.comentario.focus(); form.comentario.select(); return false;
	}
	return true;
}
