/* 
 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;
        }
		
		if (templateElements.rowArrow) {
			templateElements.img.src = parks[rowIndex].img;
        }
		
		

        // 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);
			tc_log(park.track);
		
			
        };
        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.
		
		if(this._park.name == "Der neue Ford Fiesta"){
			 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 = "Mit seiner stylischen neuen Karrosserie und dem aufsehenerregenden Innenraum verk&ouml;rpert der Ford Fiesta den Stil der Zeit.<br><h3>Exterieur:</h3><p>Mit seinem Ford kinetic Design setzt der neue Ford Fiesta Ma&szlig;st&auml;be im Kleinwagensegment. Seine dynamische Linienf&uuml;hrung erinnert an ein Coup&eacute; und verleiht ihm eine kraftvolle und athletische Erscheinung, die sich in jedem Detail wiederfindet, zum Beispiel in dem sportlichen K&uuml;hlergrill oder den Seitenspiegeln mit integrierten Blinkleuchten. W&auml;hlen Sie Ihre Lieblingsau&szlig;enfarbe aus einem sensationellen Spektrum an  Lackierungen. </p><p><img src='fiestabilder/fiesta-n37.jpg' width='320' height='213'/></p><h3>Technologie:  </h3> Bluetooth&reg;-Schnittstelle, USB- und AUX-Anschluss, Sprachsteuerung sowie ein Multifunktionsdisplay, unter anderem f&uuml;r Telefon- und Titel-Informationen.</p><p><img src='fiestabilder/fiesta-n44.jpg'  width='241' height='320'></p><h3>Interieur</h3><p>Freuen Sie sich auf ein futuristisches Interieur mit hohem Spa&szlig;faktor: Daf&uuml;r sorgen z.B. hochmoderne Entertainment- und Kommunikationstechnologien, die keine W&uuml;nsche offen lassen. Absolutes Highlight ist die neue Mittelkonsole, die nicht nur optisch an ein Mobiltelefon erinnert, denn &uuml;ber das gro&szlig;e Multifunktionsdisplay und die gut erreichbaren Bedienelemente lassen sich das Audiosystem, das Mobiltelefon sowie viele weitere Fahrzeugfunktionen intuitiv steuern. Mit der gro&szlig;en Auswahl hochwertiger Materialien und modisch inspirierten Farben haben Sie zudem die M&ouml;glichkeit, Ihren neuen Ford Fiesta ganz nach Ihren W&uuml;nschen zu gestalten.<br><br><img src='fiestabilder/fiesta-n40.jpg' width='320' height='239'>";
			return;
		}
		
		if(this._park.name == "News"){
			 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 = "<p>Nur f&uuml;r kurze Zeit haben Sie die Chance, in Ihrem s.oliver Shop* ein <b>&bdquo;Exclusive Shopping&ldquo;</b> zu gewinnen.</p><p>Sie brauchen nur im Store eine einfache Frage richtig zu beantworten und schon erhalten Sie f&uuml;r sich und Ihre Begleitung eine VIP Karte f&uuml;r das Shopping-Event (jeweils Samstagabend). Bei cooler Live-DJ-Musik, leichten Snacks und erfrischenden Drinks k&ouml;nnen Sie exklusiv nach Ladenschluss shoppen. Und das Beste: Sie bekommen 15 % auf alles!</p><p>M&ouml;chten Sie im Anschluss weiterziehen und Party machen? Ein Make-up-Artist stylt Sie nach Ihren W&uuml;nschen!</p><p>Die Tour-Termine im s.Oliver Shop:</p><p><b>15.10. - 18.10.2008**</b></p><p><a href='http://maps.google.com/maps?f=q&hl=de&geocode=&q=Hamburg,+Spitaler+Stra%C3%9Fe+10-12+&sll=37.0625,-95.677068&sspn=45.553578,75.9375&ie=UTF8&t=h&z=16&iwloc=addr!'>Hamburg, Spitaler Stra&szlig;e 10-12</a> </p><p><a href='http://maps.google.com/maps?f=q&hl=de&geocode=&q=Bielefeld,+Bahnhofstra%26szlig%3Be+2+&sll=37.0625,-95.677068&sspn=45.553578,75.9375&ie=UTF8&t=h&z=16&iwloc=addr'>Bielefeld, Bahnhofstra&szlig;e 2 </a></p><p><a href='http://maps.google.com/maps?f=q&hl=de&q=Ludgeristra%C3%9Fe+81,+Altstadt+48143+M%C3%BCnster,+M%C3%BCnster,+Nordrhein-Westfalen,+Deutschland&sll=52.023615,8.532682&sspn=0.008688,0.018539&ie=UTF8&cd=1&geocode=FZXVGAMdW2J0AA&t=h&z=16&iwloc=addr'>M&uuml;nster, Ludgeriestra&szlig;e 81 </a></p><p><a href='http://maps.google.com/maps?f=q&hl=de&geocode=&q=Dortmund,+Westenhellweg+12-14&sll=51.959189,7.627355&sspn=0.008701,0.018539&ie=UTF8&t=h&z=16&iwloc=addr'>Dortmund, Westenhellweg 12-14 </a></p><p><b>22.10.- 25.10.2008**</b></p><p><a href='http://maps.google.com/maps?f=q&hl=de&geocode=&q=K%C3%B6ln,+Schildergasse+32-34&sll=51.514291,7.465995&sspn=0.008787,0.018539&ie=UTF8&t=h&z=16&iwloc=addr'>K&ouml;ln, Schildergasse 32-34</a></p><p><a href='http://maps.google.com/maps?f=q&hl=de&geocode=&q=Essen,+Limbeckerstra%C3%9Fe+55&sll=50.936501,6.955114&sspn=0.008898,0.018539&ie=UTF8&t=h&z=16&iwloc=addr'>Essen, Limbeckerstra&szlig;e 55</a></p><p><a href='http://maps.google.com/maps?f=q&hl=de&geocode=&q=Saarbr%C3%BCcken,+Bahnhofstra%C3%9Fe+71-73&sll=51.457701,7.008891&sspn=0.008798,0.018539&ie=UTF8&t=h&z=16&iwloc=addr'>Saarbr&uuml;cken, Bahnhofstra&szlig;e 71-73 </a></p><p><a href='http://maps.google.com/maps?f=q&hl=de&geocode=&q=Mannheim,+Planken+O7,+11%2F12+&sll=49.236393,6.992861&sspn=0.009219,0.018539&ie=UTF8&t=h&z=16&iwloc=addr'>Mannheim, Planken O7, 11/12 </a></p><p><b>29.10.- 01.11.2008**</b></p><p><a href='http://maps.google.com/maps?f=q&hl=de&geocode=&q=Berlin,+Kurf%C3%BCrstendamm+18-24+&sll=49.486846,8.468593&sspn=0.009172,0.018539&ie=UTF8&t=h&z=16&iwloc=addr'>Berlin, Kurf&uuml;rstendamm 18-24 </a></p><p><a href='http://maps.google.com/maps?f=q&hl=de&q=Petersstra%C3%9Fe+36,+Leipzig+04109+Leipzig,+Leipzig,+Sachsen,+Deutschland&sll=52.503864,13.331135&sspn=0.008594,0.018539&ie=UTF8&cd=1&geocode=FelZDwMdA9O8AA&t=h&z=16&iwloc=addr'>Leipzig, Peterstra&szlig;e 32-36, Ecke Schlossgasse </a></p><p><a href='http://maps.google.com/maps?f=q&hl=de&geocode=&q=Frankfurt+am+Main+Limescorso+14&sll=50.133454,8.65654&sspn=0.072403,0.148315&ie=UTF8&ll=50.156899,8.632722&spn=0.009046,0.018539&t=h&z=16&iwloc=cent'>Frankfurt am Main, im NWZ, Limescorso 14</a></p><p><b>05.11.- 08.11.2008**</b></p><p><a href='http://maps.google.com/maps?f=q&hl=de&geocode=&q=Stuttgart,+K%C3%B6nigstra%C3%9Fe+46&sll=50.156899,8.632722&sspn=0.009046,0.018539&ie=UTF8&t=h&z=16&iwloc=addr'>Stuttgart, K&ouml;nigstra&szlig;e 46</a></p><p><a href='http://maps.google.com/maps?f=q&hl=de&geocode=&q=W%C3%BCrzburg,+Sch%C3%B6nbornstra%C3%9Fe+7&sll=48.775967,9.175935&sspn=0.009305,0.018539&ie=UTF8&t=h&z=16&iwloc=addr'>W&uuml;rzburg, Sch&ouml;nbornstra&szlig;e 7</A></p><p><a href='http://maps.google.com/maps?f=q&hl=de&geocode=&q=n%C3%BCrnberg+breite+gasse+45&sll=48.138058,11.571516&sspn=0.009422,0.018539&ie=UTF8&t=h&z=16&iwloc=addr'>N&uuml;rnberg, Breite Gasse 45</a></p><p><a href='http://maps.google.com/maps?f=q&hl=de&geocode=&q=M%C3%BCnchen,+F%C3%A4rbergraben+1,&sll=49.450042,11.075041&sspn=0.009179,0.018539&ie=UTF8&t=h&z=16&iwloc=addr'>M&uuml;nchen, F&auml;rbergraben 1, Ecke Kaufinger Stra&szlig;e</a></p><p> ** an den Aktionstagen in der Zeit von 12.00 bis 20.00 Uhr ";
			return;
		}
		if(this._park.name == "iPhone Wallpapers"){
			 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 = "<p>Fiesta Squeeze </p><p align='center'><a href='squeeze.html' target='_blank'><img src='Images/fiesta_squeeze_small.jpg' alt='squeeze' width='160' height='240' align='middle' /></a></p><p>Fiesta Now!</p><p align='center'><a href='fiesta_now.html' target='_blank'><img src='Images/Fiesta_sf_style_sm.jpg' alt='nowstyle' width='160' height='240' /></a></p><p>Fiesta Hotmagenta</p><p align='center'><a href='hotmagenta.html' target='_blank'><img src='Images/fiesta_hotmagenta_sm.jpg' alt='hotmagenta' width='160' height='242' /></a></p><br>";
		return;
		
		
		
		}
		if(this._park.name == "Videos"){
			 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 = "<a href='LHD/LHD-iPhone.m4v'><b>Fiesta Video</b> zum abspielen klicken.<br><br><img src='LHD/LHD-poster.jpg' width='320'></a><br><br><a href='LHD/Ford_Fiesta_Launch_4x3_30s_ohneDatum_OM170908SS1140FL1TR-iPhone.m4v'><b>Fiesta TV Spot</b> zum abspielen klicken.<br><br><img src='LHD/Ford_Fiesta_Launch_4x3_30s.jpg' width='320'><br><br></a><br>";
		return;
		
			}
		if(this._park.name == "Join us"){
			 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 = "<div><div class='iList'><li><a href='http://twitter.com/mittenimjetzt'><img src='Images/twitter_icon.png' height='29' /><em>Follow us @ Twitter</em></a></li><li><a href='http://myspace.com/mittenimjetzt'><img src='Images/myspace_icon.png' height='29' /><em>Freund werden bei Myspace</em></a></li><li><a href='http://www.facebook.com/pages/Ford-Fiesta/26691730418?ref=mf'><img src='Images/facebook_icon.png' height='29' /><em>Fan werden bei Facebook</em></a></li></ul></div></div>";
		return;
		
		}
		
    }
    
};

//
// 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: "Der neue Ford Fiesta", location: "<img src='fiestabilder/fiesta-n19.jpg'> <br>Lernen Sie den neuen Ford Fiesta kennen",img:"Images/fiesta_icon.png",track:"/DE/Ford_Fiesta/iPhone/Fiesta" }, 
    { name: "News", location: "<img src='Images/news_icon2.png' width='33px' height='32px'><br>Exklusive Shopping!" ,img:"Images/news_icon2.png",track:"/DE/Ford_Fiesta/iPhone/News"}, 
    { name: "iPhone Wallpapers", location: "<img src='Images/jetzt_icon.png' width='33px' height='32px'><br>Klick zum Download",img:"Images/jetzt_icon.png" ,track:"/DE/Ford_Fiesta/iPhone/Mitten_im_Jetzt"}, 
    { name: "Videos", location: "<img src='Images/download_icon.png' width='33px' height='32px'><br>",img:"Images/download_icon.png" ,track:"/DE/Ford_Fiesta/iPhone/Videos"},
	{ name: "Join us", location: "<img src='Images/join_us_icon.png' width='33px' height='32px'><br>",img:"Images/join_us_icon.png",track:"/DE/Ford_Fiesta/iPhone/Join_us" }
	];
