// JavaScript Document
 // This is a list of titles (separated by commas)
        var _titles = new Array
	    (
		    "Hotel Missoni",
		    "Westfield Shopping Centre",
		    "University of Nottingham Jubilee Campus",
		    "Poundbury Fire Station",
		    "Liverpool Ferry Terminal ",
			"Queen Margaret University campus",
			"Shrewsbury Theatre Severn",
			"Woodlands Manor mixed-use block",
			"One Park West",
			"Union Plaza"
		

	    );

        var _subTitles = new Array
	    (
	        "Critics check out Edinburgh’s new luxury hotel",
	        "Is the west London mall a shopper's dream or nightmare?",
	        "Make's technicolour campus divides opinions",
	        "Discussions heat up over Prince Charles's fire station",
	        "Choppy waters for Merseyside terminal",
			"Low marks for Scottish university campus",
			"New theatre too dramatic for some",
			"Feeling blue about Belfast development",
			"Is this Liverpool One building a hero or a zero?",
			"Aberdeen office complex elicits strong opinions"
			
			);

        // This is a list of the image URLs (separated by commas)
        var _imageUrls = new Array
        (
            "http://www.bdonline.co.uk/Pictures/web/r/g/w/Missoni.jpg",
            "http://www.bdonline.co.uk/Pictures/web/g/p/n/Westfieldx440.jpg",
            "http://www.bdonline.co.uk/Pictures/web/n/n/f/Jubilee_campusx440.jpg",
			"http://www.bdonline.co.uk/Pictures/web/h/g/y/Pounbury_fire_station.jpg", 
            "http://www.bdonline.co.uk/Pictures/web/b/m/k/Liverpool_ferry_buildingx440.jpg",
			"http://www.bdonline.co.uk/Pictures/web/v/d/j/qmuc_slide.jpg",
			"http://www.bdonline.co.uk/Pictures/web/b/w/w/Shrewsbury_theatrex440.jpg",
			"http://www.bdonline.co.uk/Pictures/web/t/p/q/Woodland_Manor_apptsx440.jpg",
			"http://www.bdonline.co.uk/Pictures/web/h/c/x/One_Park_West_Chavasse_Park_Liverpool_One_slide.jpg",
			"http://www.bdonline.co.uk/Pictures/web/p/w/c/Union_plazax440.jpg"

           
        );

        // This is a list of the stories (separated by commas)
        // They can contain HTML
        // For readability you might want to split one of them over multiple lines, like this:
        // "first bit of the story" +
        // " and the second bit of the story"
        var _stories = new Array
        (
            "<p> Architect: Allan Murray Architects <br> Location: Edinburgh <br> Completed: 2009 </p> <p> Nominators' venom about the building is clear — 'a great lump of unimaginative building in a sensitive area', says one. Ouch! But would any building satisfy some of Edinburgh’s fervent heritage lobby?  </p>",
	        "<p>Architect: Westfield in-house team <br> Location: Shepherd’s Bush, London <br> Completed: 2009 </p> <p> Nominator Darren Lewis is pithy in his assessment of the building as an 'oversized box of artificial spending'. True perhaps, but is really bad enough to win? </p> ",
	        "<p>Architect: Make <br> Location: Nottingham <br> Completed: 2009 </p> <p> 'More wrenchingly ugly in real life than the photos give credit,' says Jim. 'Simply horrific,' says TD. </p> <p> Unfair? Add your voice below. </p> ",
			"<p>Design inspired by: Prince Charles <br> Location: Poundbury, Dorset <br> Completed: 2009 </p> <p> Its critic simply quotes the Guardian: 'a dumpy neoclassical Georgian palace with three garage doors attached to it. It's the Parthenon meets Brookside.' Its other nominator branded it ‘a collection of pasty sand-coloured brick and inelegant glazing’. </p> ",
"<p>Architect: Hamilton Architects <br> Location: Liverpool Pier Head <br> Completed: 2008 </p> <p> Hamilton Architects' Liverpool Pier Head Ferry Terminal has been upsetting some residents, with David opining that it’s 'bad enough in isolation but alongside the classic listed buildings it sticks out like a sore thumb.'</p>",
"<p>Architect: Dyer Associates <br> Location: East Lothian, Scotland <br> Completed: 2008 </p> <p> Dyer Associate's East Lothian campus receives a scathing put down from David: 'No hallowed spires of academia here! Rather Nissen huts of nihilism!' </p>",
"<p>Architect: Austin Smith Lord <br> Location: Frankwell Quay, Shrewsbury <br> Completed: 2009</p> <p> ‘Why use one material when there are so many to chose from? The new cultural heart for Shrewsbury, fitting in seamlessly with the tudor buildings of the area, what a perfect solution to the 'flood plain' issue,' says Derek Draper. </p> <p>Should we give pull the curtain on this one or give it an ovation? </p>",
"<p> Architect: Coogan and Co <br> Location: Belfast	<br> Completed: 2009 </p> <p>‘An utter eyesore on the skyline of Belfast!' says Matt Coe. 'I shall not insult your intelligence and explain why I think this building should be nominated for the Carbuncle Cup 2009.' </p>",
"<p> Architect: Pelli Clarke Pelli <br> Location: Chavasse Park, Liverpool <br> Completed: 2008 </p> <p>Bemoaning the fate of the buildings demolished to make space for the new Liverpool One development, Wayne Colquhoun laments: ‘They promised us Iconic and have given us Ichronic, they promised us world class architecture … a Cesar Pelli and have given us a caesar salad.'</p>",
"<p> Architect: Halliday Fraser Munro <br> Location: Aberdeen <br> Completed: 2008 </p> <p> ‘A prime example of a building so ugly, so simple and unimaginative, so out of scale that it has become a scar in the landscape of the granite city,’ says nominator Andrew Mackintosh. </p> <p> He adds: 'I know in the north we are a little behind the times, but this THING makes it look like modernism has just came into fashion, bad, fake modernism at that!'</p> "

     	
 
					
        );
		
		//this is the alt text for the images
		
		var _altTexts = new Array
(
"Allan Murray's Missoni Hotel in Edinburgh",
"Westfield Shopping Centre",
"Cannes was as full of glitz as ever",
"Reid Jubb Brown's Haymarket Metro station",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
""   
);

//these captions will appear below the images

var _ImageCaptions = new Array
(
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
""
);


var _ImageThumbs = new Array 
(
            "http://www.bdonline.co.uk/Pictures/web/r/g/w/Missoni.jpg",
            "http://www.bdonline.co.uk/Pictures/web/g/p/n/Westfieldx440.jpg",
            "http://www.bdonline.co.uk/Pictures/web/n/n/f/Jubilee_campusx440.jpg",
            "http://www.bdonline.co.uk/Pictures/web/h/g/y/Pounbury_fire_station.jpg", 
			"http://www.bdonline.co.uk/Pictures/web/b/m/k/Liverpool_ferry_buildingx440.jpg",
			"http://www.bdonline.co.uk/Pictures/web/v/d/j/qmuc_slide.jpg",
			"http://www.bdonline.co.uk/Pictures/web/b/w/w/Shrewsbury_theatrex440.jpg",
			"http://www.bdonline.co.uk/Pictures/web/t/p/q/Woodland_Manor_apptsx440.jpg",
			"http://www.bdonline.co.uk/Pictures/web/h/c/x/One_Park_West_Chavasse_Park_Liverpool_One_slide.jpg",
			"http://www.bdonline.co.uk/Pictures/web/p/w/c/Union_plazax440.jpg"
);


var thumbnailWidth = "50";
var thumbnailHeight = "40";

        function showStory(index) {
            document.getElementById("recessionTitle").innerHTML = _titles[index];
            document.getElementById("recessionSubTitle").innerHTML = _subTitles[index];
            document.getElementById("recessionImage").src = _imageUrls[index];
            document.getElementById("recessionStory").innerHTML = _stories[index];
			document.getElementById("recessionImage").alt = _altTexts[index];
			document.getElementById("ImageCaptions").innerHTML = _ImageCaptions[index];
        }

        function initPage() {
            var panes = document.getElementById("recessionLinks");

            // Preloading images to achieve better responsiveness when the user mouses over links
            for (var i = 0; i < _imageUrls.length; i++) {
                var img = new Image();
                img.src = _imageUrls[i];
            }

            // Builds up the list of links and adds event handlers
            for (i = 0; i < _titles.length; i++) {
                var link = document.createElement("a");

                var linkImage = document.createElement("img");
                
                var linkImageUrl = document.createAttribute("src");
                linkImageUrl.value = _ImageThumbs[i];
                linkImage.attributes.setNamedItem(linkImageUrl);

                var linkImageWidth = document.createAttribute("width");
                linkImageWidth.value = thumbnailWidth;
                linkImage.attributes.setNamedItem(linkImageWidth);

                var linkImageHeight = document.createAttribute("height");
                linkImageHeight.value = thumbnailHeight;
                linkImage.attributes.setNamedItem(linkImageHeight);

                var toolTip = document.createAttribute("title");
                toolTip.value = _titles[i];
                link.attributes.setNamedItem(toolTip);
                
                link.appendChild(linkImage);

                var href = document.createAttribute("href");
                href.value = "javascript:void(0);";
                link.attributes.setNamedItem(href);

                var cssClass = document.createAttribute("class");
                cssClass.value = "story";
                link.attributes.setNamedItem(cssClass);

                link.onclick = new Function("showStory(" + i + ");");

                panes.appendChild(link);
            }

            showStory(0);
        }

