var spnsrLogos = new Array(); var spnsrURLs = new Array(); var sponsorID = 0;spnsrLogos[0] = "/images/sponsors/quicknav/firedesign.png";spnsrURLs[0] = "http://www.firedesign.co.nz";spnsrLogos[1] = "/images/sponsors/quicknav/buff.jpg";spnsrURLs[1] = "http://www.buffnz.co.nz";spnsrLogos[2] = "/images/sponsors/quicknav/webfox.png";spnsrURLs[2] = "http://www.webfox.co.nz";spnsrLogos[3] = "/images/sponsors/quicknav/bartercard.png";spnsrURLs[3] = "http://www.bartercard.co.nz";spnsrLogos[4] = "/images/sponsors/quicknav/taranakieng.jpg";spnsrURLs[4] = "http://www.taranakieng.co.nz";spnsrLogos[5] = "/images/sponsors/quicknav/thompsons.png";spnsrURLs[5] = "http://www.thompsons.co.nz";spnsrLogos[6] = "/images/sponsors/quicknav/karenkay.png";spnsrURLs[6] = "http://www.actors.co.nz";spnsrLogos[7] = "/images/sponsors/quicknav/govettquillium.jpg";spnsrURLs[7] = "http://www.thelawyers.co.nz";spnsrLogos[8] = "/images/sponsors/quicknav/kendallnorth.png";spnsrURLs[8] = "http://";spnsrLogos[9] = "/images/sponsors/quicknav/mobilize.png";spnsrURLs[9] = "http://";spnsrLogos[10] = "/images/sponsors/quicknav/bigmedia.jpg";spnsrURLs[10] = "http://www.bigmedia.co.nz";spnsrLogos[11] = "/images/sponsors/quicknav/manukaboosta.png";spnsrURLs[11] = "http://www.manukaboosta.co.nz";spnsrLogos[12] = "/images/sponsors/quicknav/steelformers.png";spnsrURLs[12] = "http://www.steelformers.co.nz";spnsrLogos[13] = "/images/sponsors/quicknav/hth.png";spnsrURLs[13] = "http://";spnsrLogos[14] = "/images/sponsors/quicknav/cityfitness.png";spnsrURLs[14] = "http://www.cityfitness.co.nz";spnsrLogos[15] = "/images/sponsors/quicknav/eecp.png";spnsrURLs[15] = "http://www.eecp.co.nz";spnsrLogos[16] = "/images/sponsors/quicknav/red8.png";spnsrURLs[16] = "http://www.red8.co.nz";spnsrLogos[17] = "/images/sponsors/quicknav/northface.png";spnsrURLs[17] = "http://www.thenorthface.com"; function preLoadSponsor() { if (spnsrLogos.length == (sponsorID + 1)) { sponsorID = 0; } /*pre load next sponsor*/ var objImage = document.createElement('img'); /*we can't set the display = none as IE cant get its dimensions*/ objImage.style.visibility = 'hidden'; objImage.setAttribute('id','nextSponsor'); objImage.src = spnsrLogos[sponsorID]; document.getElementById('sponsors').appendChild(objImage); /*wait before we change the sponsors over*/ rotateSponsors.delay(5.0); } /*this should be executed no less than 2.0 seconds after rotateSponsors to clean up and get ready for the next rotate*/ function tidyUp() { /*if last next sponsor still around, change to current so we can load a new one*/ if (divObj = document.getElementById('nextSponsor')) { document.getElementById('currentSponsor').setAttribute('id', 'oldSponsor'); $('oldSponsor').remove(); divObj.setAttribute('id', 'currentSponsor'); } } function rotateSponsors(objImage) { var objImage = document.getElementById('nextSponsor'); /*support IE's crappy alpha transparency support*/ var browser = ''; if (browser == 'ie7') { objImage.style.backgroundColor = '#535353'; } if (browser == 'ie6') { objImage.style.backgroundColor = '#A5A5A5'; } /*lets center it*/ if (objImage.width < 130) { objImage.style.marginLeft = ((130 - objImage.width) / 2) + 'px'; } else { objImage.style.marginLeft = '3px'; } if (objImage.height < 90) { objImage.style.marginTop = (((90 - objImage.height) / 2) - 3) + 'px'; } /*now that we have adjusted the position lets put the styles back how they should be, damn IE*/ objImage.style.display = 'none'; objImage.style.visibility = 'visible'; new Effect.Appear('nextSponsor', {duration:2.0}); new Effect.Fade('currentSponsor', {duration:2.0}); sponsorID++; /*now preload the next*/ tidyUp.delay(2.0); preLoadSponsor(); } //preLoadSponsor.delay(1.0);