function getBookCoverImageElement() {
    var elem = null;
    if (document.getElementById) {
        elem = document.getElementById('aboutCoverImage');
    } else if (document.all) {
        elem = document.all['aboutCoverImage'];
    } else {
        elem = document.images['aboutCoverImage'];
        if (!elem) elem = document.book;
    }
    return elem;
}

function onLoadPageAbout() {
	var documents = [{oid:'s18786en', sourceFormat:'pdf', title:'WHO Global Technical Consultation: Global Standards and Tools for Influenza Surveillance', url:'http://www.who.int/influenza/resources/documents/technical_consultation/en/index.html'},{oid:'s18785en', sourceFormat:'pdf', title:'Outbreak Response and Communication Guide'},{oid:'s18784en', sourceFormat:'pdf', title:'Risk Communication Planning and Action Guide'},{oid:'s18783en', sourceFormat:'pdf', title:'Capacity Building Activities During Pandemic Influenza', url:'http://www.who.int/influenza/resources/publications/activities_pandemic_influenza/en/index.html'},
	{oid:'s18782en', sourceFormat:'pdf', title:'Use of Influenza Rapid Diagnostic Test', url:'http://www.who.int/influenza/resources/publications/influenza_rapid_test/en/index.html'},{oid:'s18781en', sourceFormat:'pdf', title:'Evolution of a Pandemic A(H1N1) 2009', url:'http://www.who.int/influenza/resources/publications/evolution_pandemic_Ah1n1/en/index.html'},{oid:'s18780en', sourceFormat:'pdf', title:'Comparative Analysis of National Pandemic Influenza Preparedness Plans', url:'http://www.who.int/influenza/resources/documents/comparative_analysis_php_2011_en/en/index.html'},
	{oid:'s18779en', sourceFormat:'pdf', title:'Pocket Book of Hospital Care for Children', url:'http://www.who.int/hiv/topics/capacity/en/'},{oid:'s18758en', sourceFormat:'pdf', title:'Assessment and Treatment in the Community During an Influenza Outbreak', url:'http://www.who.int/influenza/resources/training/en/'},{oid:'s18764en', sourceFormat:'pdf', title:'Strategy to Enhance Influenza Surveillance Worldwide', url:'http://www.cdc.gov/eid'},{oid:'s18759en', sourceFormat:'pdf', title:'Effective Training: From Start to Finish', url:'http://www.cdc.gov/globalhealth/SMDP/'},
	{oid:'s18763en', sourceFormat:'pdf', title:'Stakeholder Analysis: Introduction', url:'http://www.cdc.gov/globalhealth/SMDP/'},{oid:'s18756en', sourceFormat:'pdf', title:'Community Case Management During Influenza Outbreak: Participant&rsquo;s Handout'},{oid:'s18755en', sourceFormat:'pdf', title:'Community Case Management During Influenza Outbreak: Flip Book', url:'http://www.who.int/influenza/resources/training/en/'},{oid:'s18757en', sourceFormat:'pdf', title:'Community Case Management During Influenza Outbreak: Trainer&rsquo;s Guide', url:'http://www.who.int/influenza/resources/training/en/'},
	{oid:'s18766en', sourceFormat:'pdf', title:'WHO Regional Office for Europe Guidance for Sentinel Influenza Surveillance in Humans'},{oid:'s18761en', sourceFormat:'pdf', title:'Review of the 2010\u20132011 Winter Influenza Season, Northern Hemisphere', url:'http://www.who.int/wer/2011/wer8622/en/index.html'},{oid:'s18765en', sourceFormat:'pdf', title:'Transmission Dynamics and Impact of Pandemic Influenza A (H1N1) 2009 Virus', url:'http://www.who.int/wer/2009/wer8446/en/index.html'},{oid:'s18760en', sourceFormat:'pdf', title:'Manual for the Laboratory Diagnosis and Virological Surveillance of Influenza', url:'http://www.who.int/csr/disease/influenza/manual_diagnosis_surveillance_influenza/en/index.html'},
	{oid:'s18762en', sourceFormat:'pdf', title:'Seroepidemiological Studies of Pandemic Influenza A (H1N1) 2009 Virus'}];

    var bookCoverImage = getBookCoverImageElement();
    var bookCoverLink = gsdlGetElement('aboutCoverLink');
    var bookTitleLink = gsdlGetElement('aboutTitleLink');
    if (bookCoverImage == null || bookCoverLink == null || bookTitleLink == null)
        return;
    bookCoverImage.onError = CoverError;

    var currentDocumentIndex = (((new Date()).getTime() % 9301) + (Math.round(Math.random() * 49297))) % documents.length;
    if (currentDocumentIndex < 0 || currentDocumentIndex > documents.length)
        currentDocumentIndex = 0;
    var func = function() {
        var oid = documents[currentDocumentIndex].oid;
		var format = documents[currentDocumentIndex].sourceFormat;
        bookCoverImage.src = httpCollectionAssocImage + '/' + oid + '/cover.jpg';
        var url;
        if (typeof(documents[currentDocumentIndex].url) != 'undefined') {
            url = documents[currentDocumentIndex].url;
        } else {
            url = httpCollectionAssocImage + '/' + oid + '/' + oid + '.' + (typeof(format) != 'undefined' ? format : 'pdf');
        }
        bookCoverLink.href = url;
        bookTitleLink.href = url;
        if (bookTitleLink.textContent)
            bookTitleLink.textContent = documents[currentDocumentIndex].title;
        else if (bookTitleLink.innerText)
            bookTitleLink.innerText = documents[currentDocumentIndex].title;
        else
            bookTitleLink.innerHTML = documents[currentDocumentIndex].title;
        if (++currentDocumentIndex >= documents.length)
            currentDocumentIndex = 0;
    };
    func();
    window.setInterval(func, 5000);
}

