/* 
 This file was generated by Dashcode.  
 You may edit this file to customize your widget or web page 
 according to the license.txt file included in the project.
 */

var listController = {
    // This object acts as a controller for the list UI.
    // It implements the dataSource methods for the list.
    
    numberOfRows: function() {
        // The List calls this dataSource method to find out how many rows should be in the list.
        return parks.length;
    },
    
    prepareRow: function(rowElement, rowIndex, templateElements) {
        // The List calls this dataSource method for every row.  templateElements contains references to all elements inside the template that have an id. We use it to fill in the text of the rowTitle element.
        if (templateElements.rowTitle) {
            templateElements.rowTitle.innerText = parks[rowIndex].name;
        }

        // We also assign an onclick handler that will cause the browser to go to the detail page.
        var self = this;
        var handler = function() {
            var park = parks[rowIndex];
            detailController.setPark(park);
            var browser = document.getElementById('browser').object;
            // The Browser's goForward method is used to make the browser push down to a new level.  Going back to previous levels is handled automatically.
            browser.goForward(document.getElementById('detailLevel'), park.name);
        };
        rowElement.onclick = handler;
    }
};

var detailController = {
    // This object acts as a controller for the detail UI.
    
    setPark: function(park) {
        this._park = park;
        this._representedObject = park.name;
        
        // When the park is set, this controller also updates the DOM for the detail page appropriately.  As you customize the design for the detail page, you will want to extend this code to make sure that the correct information is populated into the detail UI.
        var detailTitle = document.getElementById('detailTitle');
        detailTitle.innerHTML = this._park.name;
        var detailLocation = document.getElementById('detailLocation');
        detailLocation.innerHTML = this._park.location;
        var detailDescription = document.getElementById('detailDescription');
        detailDescription.innerHTML = "En el sitio web de <A Href='" + this._park.link + "'>" + this._park.name + "</A> usted encontrará: " + this._park.abstract ;
    }
    
};

//
// Function: load()
// Called by HTML body element's onload event when the web application is ready to start
//
function load()
{
    dashcode.setupParts();
}

// Sample data.  Some applications may have static data like this, but most will want to use information fetched remotely via XMLHttpRequest.
var parks = [
    { name: "Registro Académico", location: "Notas, Horarios, Formatos, Noticias", link: "http://registroacademico.unisabana.edu.co:8080/horarios/jsp/loginAcaEst.jsp", abstract: "Sección de estudiantes y docentes - Notas y horarios, Cursos vacaciones, Noticias, Descarga de formatos, Trámites de registro académico, Reglamento de estudiantes" }, 
    { name: "Virtual Sabana", location: "Cursos, Webconference", link: "http://virtual.unisabana.edu.co", abstract: "Trabajo independiente de los estudiantes mediado por las Tecnologías de la Información y la Comunicación (TIC)" }, 
    { name: "Correo Electrónico ", location: "Mensajes, Agenda, Calendario", link: "https://webmail.unisabana.edu.co", abstract: "Proyecto NunTIUS, trabajo colaborativo y punto de encuentro de la comunidad universitaria", abstract: "Proyecto NunTIUS" }, 
    { name: "Biblioteca", location: "Catálogo, Asesoría, Colecciones", link: "http://biblioteca.unisabana.edu.co", abstract: "Apoyo al desarrollo académico a través de la gestión, administración y difusión de la información" }, 
    { name: "Actualidad Universitaria", location: "Noticias, Actividades Académicas", link: "http://www.actualidaduniversitaria.net", abstract: "Estrará informado de todas las actividades que se generan en la comunidad universitaria" }, 
    { name: "Visita Virtual", location: "Campus", link: "http://www.unisabana.edu.co/visita/mapa_campus/mapa.htm", abstract: "Visita virtual por el campus universitario" },  
];

function RA_miGestorClick(event)
{
    // Insertar código aquí
}

