    function Ajax(txt) {
        this.vIncorporaciones = new sack();
        this.vNoticias = new sack();

        this.Incorporaciones = function() {
	    this.vIncorporaciones.reset();
	    document.getElementById('incorporaciones').innerHTML = txt;
	    this.vIncorporaciones.onCompletion = function() {
	        //document.getElementById('incorporaciones').innerHTML = this.response.substring(7500,this.response.length-705);
		  //esto fallara si el idioma esta en ingles, porque los titulos cmabian
		
		  var str="Latest Additions to Archivo Digital UPM";
		  var str2 = "Página de inicio de Archivo Digital UPM";
		  //document.getElementById('incorporaciones').innerHTML = this.response.substring(this.response.search(str)-4,this.response.length-705);

			//antes habia 805
		  document.getElementById('incorporaciones').innerHTML = this.response.substring(this.response.lastIndexOf(str)-28,this.response.length-1100);
		  

	    }
	    this.vIncorporaciones.requestFile = 'cgi/latest';
          this.vIncorporaciones.runAJAX();
        }

        this.Noticias = function() {
	    this.vNoticias.reset();
	    document.getElementById('noticias').innerHTML = txt;
	    this.vNoticias.onCompletion = function() {
	        document.getElementById('noticias').innerHTML = this.response.substring(4310,this.response.length-89);
	    }
	    this.vNoticias.requestFile = 'cgi/news';
          this.vNoticias.runAJAX();
        }

	  this.Update = function() {
	  	//this.Noticias();
	  	this.Incorporaciones();
        }
    }
    var ajax = new Ajax('<div style="text-align:center;"><img style="vertical-align:middle;" src="/images/cargando.gif" alt="Actualizando..." />&nbsp;Obteniendo datos...</div>');

