var boxes=new Array() boxes[0] = "headerLogo"; boxes[1] = "headerTop"; boxes[2] = "headerLeft"; boxes[3] = "headerRight"; cacheImages(1); cacheImages(2); cacheImages(3); cacheImages(4); cacheImages(5); function cacheImages(imageId) { //cache the images cache = []; for(var boxId = 0; boxId < boxes.length; boxId++) { cache[i] = new Image; cache[i].src = 'http://www.fxclearing.ca/images/homepage/'+boxes[boxId]+imageId+'.jpg'; } } function logoFade(repeats, current) { if(repeats > 0) { window.setTimeout('fetchLogo(2,0,\'brtl\')', 2000 + (current * 52000)); window.setTimeout('fetchLogo(2,1,\'bltr\')', 3500 + (current * 52000)); window.setTimeout('fetchLogo(2,2,\'trbl\')', 5000 + (current * 52000)); window.setTimeout('fetchLogo(2,3,\'tlbr\')', 6500 + (current * 52000)); window.setTimeout('fetchLogo(3,0,\'brtl\')', 12000 + (current * 52000)); window.setTimeout('fetchLogo(3,1,\'bltr\')', 13500 + (current * 52000)); window.setTimeout('fetchLogo(3,2,\'trbl\')', 15000 + (current * 52000)); window.setTimeout('fetchLogo(3,3,\'tlbr\')', 16500 + (current * 52000)); window.setTimeout('fetchLogo(4,0,\'brtl\')', 22000 + (current * 52000)); window.setTimeout('fetchLogo(4,1,\'bltr\')', 23500 + (current * 52000)); window.setTimeout('fetchLogo(4,2,\'trbl\')', 25000 + (current * 52000)); window.setTimeout('fetchLogo(4,3,\'tlbr\')', 26500 + (current * 52000)); window.setTimeout('fetchLogo(5,0,\'brtl\')', 32000 + (current * 52000)); window.setTimeout('fetchLogo(5,1,\'bltr\')', 33500 + (current * 52000)); window.setTimeout('fetchLogo(5,2,\'trbl\')', 35000 + (current * 52000)); window.setTimeout('fetchLogo(5,3,\'tlbr\')', 36500 + (current * 52000)); window.setTimeout('fetchLogo(1,0,\'brtl\')', 42000 + (current * 52000)); window.setTimeout('fetchLogo(1,1,\'bltr\')', 43500 + (current * 52000)); window.setTimeout('fetchLogo(1,2,\'trbl\')', 45000 + (current * 52000)); window.setTimeout('fetchLogo(1,3,\'tlbr\')', 46500 + (current * 52000)); logoFade(repeats-1, current+1); } } function fetchLogo(imageId, boxId, dir) { //alert(boxes[boxId]+imageId+'.jpg'); //crossfade(document.getElementById(boxes[boxId]), 'http://www.fxclearing.ca/images/homepage/'+boxes[boxId]+imageId+'.jpg', '1'); crosswipe(document.getElementById(boxes[boxId]), 'http://www.fxclearing.ca/images/homepage/'+boxes[boxId]+imageId+'.jpg', '1', dir) }