var Pic = new Array(); // picture file name var PicW = new Array(); // picture width var PicH = new Array(); // picture height var PicC = new Array(); // picture comment var preLoad = new Array(); Pic[0] = 'photos/20100404_rws/IMG_6282.JPG'; PicW[0] = 640; PicH[0] = 480; PicC[0] = '  '; preLoad[0] = new Image(); Pic[1] = 'photos/20100404_rws/IMG_6283.JPG'; PicW[1] = 640; PicH[1] = 480; PicC[1] = '  '; preLoad[1] = new Image(); Pic[2] = 'photos/20100404_rws/IMG_6284.JPG'; PicW[2] = 640; PicH[2] = 480; PicC[2] = '  '; preLoad[2] = new Image(); Pic[3] = 'photos/20100404_rws/IMG_6285.JPG'; PicW[3] = 480; PicH[3] = 640; PicC[3] = '  '; preLoad[3] = new Image(); Pic[4] = 'photos/20100404_rws/IMG_6286.JPG'; PicW[4] = 480; PicH[4] = 640; PicC[4] = '  '; preLoad[4] = new Image(); Pic[5] = 'photos/20100404_rws/IMG_6287.JPG'; PicW[5] = 480; PicH[5] = 640; PicC[5] = '  '; preLoad[5] = new Image(); Pic[6] = 'photos/20100404_rws/IMG_6288.JPG'; PicW[6] = 480; PicH[6] = 640; PicC[6] = '  '; preLoad[6] = new Image(); Pic[7] = 'photos/20100404_rws/IMG_6289.JPG'; PicW[7] = 640; PicH[7] = 480; PicC[7] = '  '; preLoad[7] = new Image(); Pic[8] = 'photos/20100404_rws/IMG_6290.JPG'; PicW[8] = 480; PicH[8] = 640; PicC[8] = '  '; preLoad[8] = new Image(); Pic[9] = 'photos/20100404_rws/IMG_6291.JPG'; PicW[9] = 640; PicH[9] = 480; PicC[9] = '  '; preLoad[9] = new Image(); Pic[10] = 'photos/20100404_rws/IMG_6292.JPG'; PicW[10] = 480; PicH[10] = 640; PicC[10] = '  '; preLoad[10] = new Image(); Pic[11] = 'photos/20100404_rws/IMG_6293.JPG'; PicW[11] = 640; PicH[11] = 480; PicC[11] = '  '; preLoad[11] = new Image(); Pic[12] = 'photos/20100404_rws/IMG_6294.JPG'; PicW[12] = 640; PicH[12] = 480; PicC[12] = '  '; preLoad[12] = new Image(); Pic[13] = 'photos/20100404_rws/IMG_6295.JPG'; PicW[13] = 480; PicH[13] = 640; PicC[13] = '  '; preLoad[13] = new Image(); Pic[14] = 'photos/20100404_rws/IMG_6296.JPG'; PicW[14] = 640; PicH[14] = 480; PicC[14] = '  '; preLoad[14] = new Image(); Pic[15] = 'photos/20100404_rws/IMG_6297.JPG'; PicW[15] = 640; PicH[15] = 480; PicC[15] = '  '; preLoad[15] = new Image(); Pic[16] = 'photos/20100404_rws/IMG_6298.JPG'; PicW[16] = 640; PicH[16] = 480; PicC[16] = '  '; preLoad[16] = new Image(); Pic[17] = 'photos/20100404_rws/IMG_6299.JPG'; PicW[17] = 480; PicH[17] = 640; PicC[17] = '  '; preLoad[17] = new Image(); Pic[18] = 'photos/20100404_rws/IMG_6300.JPG'; PicW[18] = 640; PicH[18] = 480; PicC[18] = '  '; preLoad[18] = new Image(); Pic[19] = 'photos/20100404_rws/IMG_6301.JPG'; PicW[19] = 640; PicH[19] = 480; PicC[19] = '  '; preLoad[19] = new Image(); Pic[20] = 'photos/20100404_rws/IMG_6302.JPG'; PicW[20] = 640; PicH[20] = 480; PicC[20] = '  '; preLoad[20] = new Image(); Pic[21] = 'photos/20100404_rws/IMG_6303.JPG'; PicW[21] = 480; PicH[21] = 640; PicC[21] = '  '; preLoad[21] = new Image(); Pic[22] = 'photos/20100404_rws/IMG_6304.JPG'; PicW[22] = 640; PicH[22] = 480; PicC[22] = '  '; preLoad[22] = new Image(); Pic[23] = 'photos/20100404_rws/IMG_6305.JPG'; PicW[23] = 480; PicH[23] = 640; PicC[23] = '  '; preLoad[23] = new Image(); Pic[24] = 'photos/20100404_rws/IMG_6306.JPG'; PicW[24] = 640; PicH[24] = 480; PicC[24] = '  '; preLoad[24] = new Image(); Pic[25] = 'photos/20100404_rws/IMG_6308.JPG'; PicW[25] = 640; PicH[25] = 480; PicC[25] = '  '; preLoad[25] = new Image(); Pic[26] = 'photos/20100404_rws/IMG_6310.JPG'; PicW[26] = 640; PicH[26] = 480; PicC[26] = '  '; preLoad[26] = new Image(); Pic[27] = 'photos/20100404_rws/IMG_6311.JPG'; PicW[27] = 480; PicH[27] = 640; PicC[27] = '  '; preLoad[27] = new Image(); Pic[28] = 'photos/20100404_rws/IMG_6312.JPG'; PicW[28] = 480; PicH[28] = 640; PicC[28] = '  '; preLoad[28] = new Image(); Pic[29] = 'photos/20100404_rws/IMG_6313.JPG'; PicW[29] = 480; PicH[29] = 640; PicC[29] = '  '; preLoad[29] = new Image(); Pic[30] = 'photos/20100404_rws/IMG_6314.JPG'; PicW[30] = 640; PicH[30] = 480; PicC[30] = '  '; preLoad[30] = new Image(); Pic[31] = 'photos/20100404_rws/IMG_6315.JPG'; PicW[31] = 640; PicH[31] = 480; PicC[31] = '  '; preLoad[31] = new Image(); Pic[32] = 'photos/20100404_rws/IMG_6316.JPG'; PicW[32] = 640; PicH[32] = 480; PicC[32] = '  '; preLoad[32] = new Image(); Pic[33] = 'photos/20100404_rws/IMG_6317.JPG'; PicW[33] = 480; PicH[33] = 640; PicC[33] = '  '; preLoad[33] = new Image(); Pic[34] = 'photos/20100404_rws/IMG_6318.JPG'; PicW[34] = 480; PicH[34] = 640; PicC[34] = '  '; preLoad[34] = new Image(); Pic[35] = 'photos/20100404_rws/IMG_6319.JPG'; PicW[35] = 480; PicH[35] = 640; PicC[35] = '  '; preLoad[35] = new Image(); Pic[36] = 'photos/20100404_rws/IMG_6320.JPG'; PicW[36] = 640; PicH[36] = 480; PicC[36] = '  '; preLoad[36] = new Image(); Pic[37] = 'photos/20100404_rws/IMG_6321.JPG'; PicW[37] = 640; PicH[37] = 480; PicC[37] = '  '; preLoad[37] = new Image(); Pic[38] = 'photos/20100404_rws/IMG_6322.JPG'; PicW[38] = 480; PicH[38] = 640; PicC[38] = '  '; preLoad[38] = new Image(); Pic[39] = 'photos/20100404_rws/IMG_6323.JPG'; PicW[39] = 640; PicH[39] = 480; PicC[39] = '  '; preLoad[39] = new Image(); Pic[40] = 'photos/20100404_rws/IMG_6324.JPG'; PicW[40] = 640; PicH[40] = 480; PicC[40] = '  '; preLoad[40] = new Image(); Pic[41] = 'photos/20100404_rws/IMG_6325.JPG'; PicW[41] = 640; PicH[41] = 480; PicC[41] = '  '; preLoad[41] = new Image(); Pic[42] = 'photos/20100404_rws/IMG_6326.JPG'; PicW[42] = 480; PicH[42] = 640; PicC[42] = '  '; preLoad[42] = new Image(); Pic[43] = 'photos/20100404_rws/IMG_6327.JPG'; PicW[43] = 640; PicH[43] = 480; PicC[43] = '  '; preLoad[43] = new Image(); Pic[44] = 'photos/20100404_rws/IMG_6328.JPG'; PicW[44] = 640; PicH[44] = 480; PicC[44] = '  '; preLoad[44] = new Image(); Pic[45] = 'photos/20100404_rws/IMG_6329.JPG'; PicW[45] = 480; PicH[45] = 640; PicC[45] = '  '; preLoad[45] = new Image(); Pic[46] = 'photos/20100404_rws/IMG_6330.JPG'; PicW[46] = 480; PicH[46] = 640; PicC[46] = '  '; preLoad[46] = new Image(); Pic[47] = 'photos/20100404_rws/IMG_6331.JPG'; PicW[47] = 480; PicH[47] = 640; PicC[47] = '  '; preLoad[47] = new Image(); Pic[48] = 'photos/20100404_rws/IMG_6332.JPG'; PicW[48] = 480; PicH[48] = 640; PicC[48] = '  '; preLoad[48] = new Image(); Pic[49] = 'photos/20100404_rws/IMG_6333.JPG'; PicW[49] = 480; PicH[49] = 640; PicC[49] = '  '; preLoad[49] = new Image(); Pic[50] = 'photos/20100404_rws/IMG_6334.JPG'; PicW[50] = 480; PicH[50] = 640; PicC[50] = '  '; preLoad[50] = new Image(); Pic[51] = 'photos/20100404_rws/IMG_6335.JPG'; PicW[51] = 480; PicH[51] = 640; PicC[51] = '  '; preLoad[51] = new Image(); Pic[52] = 'photos/20100404_rws/IMG_6336.JPG'; PicW[52] = 480; PicH[52] = 640; PicC[52] = '  '; preLoad[52] = new Image(); Pic[53] = 'photos/20100404_rws/IMG_6337.JPG'; PicW[53] = 480; PicH[53] = 640; PicC[53] = '  '; preLoad[53] = new Image(); Pic[54] = 'photos/20100404_rws/IMG_6338.JPG'; PicW[54] = 480; PicH[54] = 640; PicC[54] = '  '; preLoad[54] = new Image(); Pic[55] = 'photos/20100404_rws/IMG_6339.JPG'; PicW[55] = 640; PicH[55] = 480; PicC[55] = '  '; preLoad[55] = new Image(); Pic[56] = 'photos/20100404_rws/IMG_6340.JPG'; PicW[56] = 480; PicH[56] = 640; PicC[56] = '  '; preLoad[56] = new Image(); Pic[57] = 'photos/20100404_rws/IMG_6341.JPG'; PicW[57] = 480; PicH[57] = 640; PicC[57] = '  '; preLoad[57] = new Image(); Pic[58] = 'photos/20100404_rws/IMG_6342.JPG'; PicW[58] = 640; PicH[58] = 480; PicC[58] = '  '; preLoad[58] = new Image(); Pic[59] = 'photos/20100404_rws/IMG_6343.JPG'; PicW[59] = 640; PicH[59] = 480; PicC[59] = '  '; preLoad[59] = new Image(); Pic[60] = 'photos/20100404_rws/IMG_6344.JPG'; PicW[60] = 640; PicH[60] = 480; PicC[60] = '  '; preLoad[60] = new Image(); Pic[61] = 'photos/20100404_rws/IMG_6345.JPG'; PicW[61] = 640; PicH[61] = 480; PicC[61] = '  '; preLoad[61] = new Image(); Pic[62] = 'photos/20100404_rws/IMG_6346.JPG'; PicW[62] = 640; PicH[62] = 480; PicC[62] = '  '; preLoad[62] = new Image(); Pic[63] = 'photos/20100404_rws/IMG_6347.JPG'; PicW[63] = 640; PicH[63] = 480; PicC[63] = '  '; preLoad[63] = new Image(); Pic[64] = 'photos/20100404_rws/IMG_6349.JPG'; PicW[64] = 640; PicH[64] = 480; PicC[64] = '  '; preLoad[64] = new Image(); Pic[65] = 'photos/20100404_rws/IMG_6350.JPG'; PicW[65] = 640; PicH[65] = 480; PicC[65] = '  '; preLoad[65] = new Image(); Pic[66] = 'photos/20100404_rws/IMG_6351.JPG'; PicW[66] = 640; PicH[66] = 480; PicC[66] = '  '; preLoad[66] = new Image(); Pic[67] = 'photos/20100404_rws/IMG_6352.JPG'; PicW[67] = 640; PicH[67] = 480; PicC[67] = '  '; preLoad[67] = new Image(); // alert("111 preLoadPic ix = "+0+":::"+preLoad[0].name); // Set slideShowSpeed (milliseconds) var slideShowSpeed = 5000 // Agent sniffer shamelessly 'stolen' from the excellent X library from cross-browser.com var xOp7=false,xOp5or6=false,xIE4Up=false,xNN4=false,xUA=navigator.userAgent.toLowerCase(); if(window.opera){ xOp7=(xUA.indexOf('opera 7')!=-1 || xUA.indexOf('opera/7')!=-1); if (!xOp7) xOp5or6=(xUA.indexOf('opera 5')!=-1 || xUA.indexOf('opera/5')!=-1 || xUA.indexOf('opera 6')!=-1 || xUA.indexOf('opera/6')!=-1); } else if(document.layers) xNN4=true; else {xIE4Up=document.all && xUA.indexOf('msie')!=-1 && parseInt(navigator.appVersion)>=4;} // Duration of crossfade (seconds) var crossFadeDuration = 1 // Specify the image files var t = -1; var pos = 0; var posNext = 0; var status_slideshow = 0; var count_entry = 0; var html; function preLoadPic(index) { if (index >= 0 && index < Pic.length) { if (preLoad[index].src == "") { preLoad[index].src = "albums/"+Pic[index]; // alert("preLoadPic ix = "+index); // alert("preLoadPic"); } } else { Alert("Error : invalid index."); } } function startSlideShow() { if (Pic.length == 0) { // No picture to start slide show. Alert("Error : Pic.length is less than or equal to 0."); } else if (t == -1) { // Only when the slide show has not been started, // then start it. posNext = pos; if ((posNext+1) < Pic.length) { // Can increment var pos. Thus increment. posNext++; } else if ((posNext +1) >= Pic.length) { // Cannot increment var pos. Thus restart from beginning. posNext = 0; } status_slideshow = 1; count_entry = 0; playSlideShow(); window.status='Starting Slide Show ... '+window.status; } } function playSlideShow() { if (Pic.length <= 0) { endSlideShow(); Alert("Error : Pic.length is less than or equal to 0."); return; } if (preLoad[posNext].src == "") { endSlideShow(); Alert("Error : preLoad[posNext].src is empty"); return; } if (! preLoad[posNext].complete) { // The next picture is not completely loaded. if (count_entry == 3) { // Already attempted 3 times. Abort. endSlideShow(); window.status='Slide show halted. Connection speed is too slow.'; Alert("Error : Connection speed is too slow for slide show."); } else { window.status='Loading Picture '+(posNext+1)+' of '+Pic.length+', '+Pic[posNext]; if (count_entry > 0) { window.status = window.status + ', '+count_entry; } if (t == -1) { t = window.setInterval('playSlideShow();', 3000); // alert("timer started"); } } count_entry++; } else { // The next picture has been completely loaded. // Show the next picture pos = posNext; count_entry = 0; changeSlide(); window.status='Showing Picture '+(pos+1)+' of '+Pic.length; if (status_slideshow != 0 && (posNext+1) < Pic.length) { // Slide show is being played. // Preload the next picture. posNext++; preLoadPic(posNext); if (t == -1) { // Although it is now in the slide show mode, but // the timer has not been started. Thus, start it. t = window.setInterval('playSlideShow();', 3000); } } else { // Slide show is not being played OR slide show has ended. if (status_slideshow != 0) { window.status=window.status+', '+'Slide Show Ended.'; } endSlideShow(); } if (status_slideshow == 0) { // Not in slide show mode. // Also preload the next and the prev photo if ((pos+1) < Pic.length) preLoadPic(pos+1); if (pos > 0) preLoadPic(pos-1); } } } function endSlideShow() { if (t != -1) { window.clearInterval(t); t = -1; } // window.status=''; status_slideshow = 0; } function changeSlide() { if (xIE4Up) { if (document.all) { //document.images.SlideShow.style.filter= "blendTrans(duration=crossFadeDuration)" document.all.SlideShow.style.filter="blendTrans(duration=1)"; document.all.SlideShow.filters.blendTrans.Apply(); } } writeInnerHTML(); if (xIE4Up) { if (document.all) { document.all.SlideShow.filters.blendTrans.Play(); } } displayComment(); return true; } function writeInnerHTML() { html = ""; html += "\n"; html += "\n"; html += "
\n"; html += " 0) { posNext = pos - 1; playSlideShow(); } } function firstPhoto() { endSlideShow(); posNext = 0; playSlideShow(); } function lastPhoto() { endSlideShow(); if (Pic.length > 0) { posNext = Pic.length - 1; playSlideShow(); } } function gotoPhoto(num) { endSlideShow(); if (num > 0 && num <= Pic.length) { pos = num - 1; if (preLoad[pos].src == "" || ! preLoad[pos].complete) { // The next picture is not completely loaded. preLoadPic(pos); writeInnerHTML(); displayComment(); } else { changeSlide(); } // Also preload the next and the prev photo if ((pos+1) < Pic.length) preLoadPic(pos+1); if (pos > 0) preLoadPic(pos-1); } } function displayComment() { html = "Album 51 : 2010 April 04, Resort World Sentosa
"; html += "Photo "+(pos+1)+" of "+Pic.length+"
"; html += PicC[pos]; html += "
"; document.getElementById("TitleAndComments").innerHTML = html; } function load() { displayComment(); // Display the first picture. gotoPhoto(1); // Preload the last picture. if (Pic.length>0) preLoadPic(Pic.length-1); }