2 "screenshot-stationlist.png" : "The Station List View",
3 "screenshot-stationview.png" : "The Station Departures View",
4 "screenshot-stationlist-menu.png" : "The Station List Menu",
5 "screenshot-stationview-menu.png" : "The Station Departures Menu",
8 function dismiss_picture()
10 var parent = this.parentNode;
11 parent.style.opacity = 0.0;
12 parent.style.visibility = 'hidden';
13 parent.display = 'none';
16 function present_picture()
18 var display = document.getElementById('picture-display');
19 parent.display = 'block';
20 display.style.visibility = 'visible';
21 display.style.opacity = 1.0;
22 display.style.left = (window.width - display.width) / 2;
23 display.style.top = (window.height - display.height) / 2;
24 var picture = document.getElementById('picture-display-picture');
25 picture.setAttribute('src', this.getAttribute('src'));
28 function generate_div(value, index, array)
30 var screenshots = document.getElementById('screenshot-list');
31 var screenshotDiv = document.createElement('div');
32 screenshotDiv.setAttribute('class', 'screenshot');
34 var p1Element = document.createElement('div');
35 var p2Element = p1Element.cloneNode(true);
37 var aElement = document.createElement('img');
38 aElement.setAttribute('src', index);
39 if (aElement.addEventListener) {
40 aElement.addEventListener('click', present_picture, true);
41 } else if (aElement.attachEvent) {
42 aElement.attachEvent('onclick', show_picture);
45 var imgElement = document.createElement('img');
46 imgElement.setAttribute('src', index);
48 var captionElement = document.createTextNode(value);
50 p1Element.appendChild(aElement);
51 aElement.appendChild(imgElement);
52 p2Element.appendChild(captionElement);
54 screenshotDiv.appendChild(p1Element);
55 screenshotDiv.appendChild(p2Element);
56 screenshots.appendChild(screenshotDiv);
59 function build_screenshot_list()
61 for (var key in screenshots)
62 generate_div(screenshots[key], key, screenshots);
64 var element = document.getElementById('picture-display-picture');
65 if (element.addEventListener) {
66 element.addEventListener('click', dismiss_picture, false);
67 } else if (element.attachEvent) {
68 window.attachEvent('onclick', dismiss_picture);
72 if (window.addEventListener) {
73 window.addEventListener('load', build_screenshot_list, false);
74 } else if (window.attachEvent) {
75 window.attachEvent('onload', build_screenshot_list);