// --------------------------------------------------------------------------------- // Done by Paul Knecht in 2010 // This is N O T published under a Creative Common license: // So don't copy without permission! // --------------------------------------------------------------------------------- // --------------------------------------------------------------------------------- // Preloading first photos of each category // --------------------------------------------------------------------------------- prePics = new Array(); function preload() { categories = new Array('france', 'munich', 'israel', 'jordan', 'portraits'); for(var i = 0; i < categories.length; i++) { prePics[i] = new Image(); prePics[i].src = 'img/'+categories[i]+'/1.jpg'; } } // --------------------------------------------------------------------------------- // Loading Arrays with photos, sizes and comments // --------------------------------------------------------------------------------- var pics = new Array('1.jpg', '2.jpg', '3.jpg', '4.jpg', '5.jpg', '6.jpg', '7.jpg', '8.jpg', '9.jpg'); var picsWidth = new Array('900', '401', '900', '401', '900', '401', '900', '401', '900'); var picsComment = new Array('Refugees in Calais (France), hiding in the dunes as they want to reach England.', 'An old line-keeper\'s lodge serves some refugees in Calais as a provisory home.', 'Preparing food ...', '... after spending a whole day washing and drying clothes in the sea.', 'Teenagers acquire adulthood very soon during their \"trip\" to England.', 'Washing at a lake before going to the food distribution at the habor.', 'Tent of refugees in Paris.

In a tent, there\'s a man.
In his sleeping bag he sees the sparkling lights from passing cars.
Covered with a blanket he\'s hoping that there is a FUTURE.', 'Refugees in the evening on their way back to the \"jungle\", their sleeping place in the dunes.', 'Refugees who got hurt try to survive but are unable to attempt an escape to England.'); // --------------------------------------------------------------------------------- // Loading photo and comment // --------------------------------------------------------------------------------- function getPic() { if(window.location.hash) { var picNr = parseInt(window.location.hash.substr(1)); document.getElementById('picture').src = 'img/france/'+picNr+'.jpg'; document.getElementById('descr').innerHTML = picsComment[picNr-1]; document.getElementById('prev').onclick = function onclick(event) { goTo(picNr-1) }; document.getElementById('next').onclick = function onclick(event) { goTo(picNr+1) }; } else { var picNr = 1; document.getElementById('picture').src = 'img/france/1.jpg'; document.getElementById('descr').innerHTML = picsComment[0] document.getElementById('prev').onclick = function onclick(event) { goTo(picNr-1) }; document.getElementById('next').onclick = function onclick(event) { goTo(picNr+1) }; } document.getElementById('france').style.color = '#000'; posArrow(); preloadPics(picNr); } // --------------------------------------------------------------------------------- // Positioning arrows // --------------------------------------------------------------------------------- function posArrow() { if(window.location.hash) var picNr = parseInt(window.location.hash.substr(1)); else var picNr = 1; document.getElementById('arrows').style.width = (Math.ceil(document.getElementById('blind').width/900*(picsWidth[picNr-1])/(document.getElementById('blind').width/100)))+'%'; hideArrow(picNr); } // --------------------------------------------------------------------------------- // Navigating between photos in a category // --------------------------------------------------------------------------------- function goTo(picNr) { document.getElementById('picture').src = 'img/france/'+picNr+'.jpg'; document.getElementById('descr').innerHTML = picsComment[picNr-1]; window.location.hash = picNr; document.getElementById('arrows').style.width = (Math.ceil(document.getElementById('blind').width/900*(picsWidth[picNr-1])/(document.getElementById('blind').width/100)))+'%'; document.getElementById('prev').onclick = function onclick(event) { goTo(picNr-1) }; document.getElementById('next').onclick = function onclick(event) { goTo(picNr+1) }; hideArrow(picNr); preloadPics(picNr); } // --------------------------------------------------------------------------------- // Hiding arrows, ifthere's no next or prev. photos // --------------------------------------------------------------------------------- function hideArrow(picNr) { if(picNr == 1) { document.getElementById('prev').onclick = function onclick(event) {}; document.getElementById('prev').style.visibility = "hidden"; } else if(picNr == pics.length) { document.getElementById('next').onclick = function onclick(event) {}; document.getElementById('next').style.visibility = "hidden"; } else { document.getElementById('prev').style.visibility = "visible"; document.getElementById('next').style.visibility = "visible"; } } // --------------------------------------------------------------------------------- // Preloading photos // --------------------------------------------------------------------------------- pic00 = new Array(); function preloadPics(picNr) { if(window.location.hash) var actPicNr = parseInt(window.location.hash.substr(1)); else var actPicNr = 1; if(picNr <= actPicNr+2 & picNr+1 <= pics.length) { pic00[parseInt(picNr)+1] = new Image(); pic00[parseInt(picNr)+1].src = 'img/france/'+(parseInt(picNr)+1)+'.jpg'; preloadDone(parseInt(picNr)+1); } } function preloadDone(picNr) { if(pic00[picNr].complete) { preloadPics(picNr); } else { preloadTimer = window.setTimeout("preloadDone("+picNr+")",100); } }