function voto(id,voto){
	new Ajax.Updater('vote_'+id,'/_voto.php?id='+id+'&voto='+voto);	
}

function lcoment(){
	
	identrada = document.getElementById('identrada').value;
	nombre = document.getElementById('form_nombre').value;
	email = document.getElementById('form_email').value;
	comentario = document.getElementById('form_comentario').value;
		
	new Ajax.Updater('comentar','/_comentar.php?submit=ok&identrada='+identrada+'&nombre='+nombre+'&email='+email+'&comentario='+comentario);	
}


function votar(idenc,idvoto){
	
	new Ajax.Updater('encuesta','/_encuesta.php?submit=ok&idenc='+idenc+'&idvoto='+idvoto);	

}

function ir_ciudad(ciudad){
	
	document.location = '/schools/'+ciudad;
	
}

function reload_map(mapaa){
    var map = null;
    var geocoder = null;
 
    function initialize() {
      if (GBrowserIsCompatible()) {
        map = new GMap2(document.getElementById("mapa_escuela2"));
        geocoder = new GClientGeocoder();		
        map.setUIToDefault();
		geocoder.getLatLng(mapaa,
          function(point) {
            if (!point) {
				//document.getElementById('mapa_escuela').style.display = "none";
            } else {
              map.setCenter(point, 15);
              var marker = new GMarker(point);
              map.addOverlay(marker);
            }
          }
        );
      }
    }
	initialize();
}

function reload_video(video){
	
	new Ajax.Updater('div_video','/_video.php?video='+video);	
    
}

ant = 0;
function actualizar_mapa(e,valor){
	evento = e.keyCode;
	//alert(valor);
	url = "act_mapa('"+valor+"')";
	if(ant==1){
		clearTimeout(time);
	}
	time = setTimeout(url,1000);
	ant = 1;
	//alert(evento);
	//reload_map($('mapa').value);
}


ant2 = 0;
function actualizar_video(e,valor){
	evento = e.keyCode;
	//alert(valor);
	url = "act_video('"+valor+"')";
	if(ant2==1){
		clearTimeout(time);
	}
	time = setTimeout(url,1000);
	ant2 = 1;
	//alert(evento);
	//reload_map($('mapa').value);
}


function act_mapa(valor){

	reload_map(valor);
	
}


function act_video(valor){


	reload_video(valor);
	
}

