var baseurl = "http://mysimplyperfect.com/inc/splash/"; var images = ["56a020.jpg","cb8166.jpg","6f60d0.jpg","4996a8.jpg","257e5a.jpg","18d6bf.jpg","36e3a0.jpg","d285cf.jpg","456dfe.jpg","9a15d9.jpg","4c94ac.jpg","36b668.jpg","979275.jpg","4097b9.jpg","c7d55e.jpg","b98d99.jpg","1540e7.jpg","9ea94d.jpg","f4b15c.jpg","777135.jpg","cab439.jpg","774f94.jpg","ba1674.jpg","6df07c.jpg","3d0b2c.jpg","5f0e6b.jpg","2d0efa.jpg","07672e.jpg","cd975b.jpg","8bcdbd.jpg","0e0850.jpg","5fca82.jpg","2e9531.jpg","5f7641.jpg","f873fd.jpg","b454f4.jpg","cfdab5.jpg","a35191.jpg","733a61.jpg","ccc9e9.jpg","97cf91.jpg","4a8be7.jpg","189f2e.jpg","3a7692.jpg","ebefd6.jpg","3fedcb.jpg","2f3dc4.jpg","60620f.jpg","32a1e6.jpg","2feddc.jpg","340943.jpg","54a53f.jpg","e58ee0.jpg","52cc32.jpg","74e9ac.jpg","e0d2b2.jpg","4345d9.jpg","5f0e7a.jpg","e53a29.jpg","e0a26e.jpg","fd9a2d.jpg","586238.jpg","c5065b.jpg","d38452.jpg","68040d.jpg","afe8d3.jpg","80705b.jpg","706d01.jpg","a062e3.jpg","7ac563.jpg","da9416.jpg","dac116.jpg","4ec086.jpg","d45dff.jpg","1dc38c.jpg","1c4da1.jpg","e5bfbb.jpg","eb0aef.jpg","581d49.jpg","c201a2.jpg","a84012.jpg","57c1f9.jpg","b8f6e1.jpg","a381d1.jpg","24cf26.jpg","dd9552.jpg","8b3e97.jpg","94c5a3.jpg","7ac7a7.jpg","13f5dd.jpg","f65bee.jpg","1a4a42.jpg","92455b.jpg","e79974.jpg","77ffb8.jpg","a84106.jpg","49f5ec.jpg","8bf90e.jpg","7d4aa0.jpg","5d1708.jpg","8ea25b.jpg","89a115.jpg","4ec030.jpg","50d384.jpg","223e94.jpg","e01155.jpg","5a6109.jpg","77d5c8.jpg","1f44c2.jpg","08b54c.jpg","fd72d7.jpg","198a60.jpg","4dfd89.jpg","00c30e.jpg","b7f661.jpg","f79386.jpg","215a4f.jpg","b694ce.jpg","f82444.jpg","922942.jpg","21e299.jpg","91ee4c.jpg","ed9991.jpg","d3c724.jpg","3d18bd.jpg","d6791f.jpg","3a2838.jpg","ce486b.jpg","0691c8.jpg","e7b708.jpg","20a484.jpg","51127d.jpg","846ab6.jpg","3f76f6.jpg","e74224.jpg","782dac.jpg","fe7d35.jpg","70999d.jpg","18ab24.jpg","10c498.jpg"]; // preload first 20 images for (var i=0; i < images.length; i++) { $('')[0].src = baseurl + images[i]; if (i === 20) { break; } } function prependBaseUrl(a) { for(var i=0; i < a.length; i++) { a[i] = baseurl + a[i]; } return a; } function getImage() { var image = images.shift(); return baseurl + image; } function getImages() { var image = images.shift(); images.push(image); return prependBaseUrl(images.slice(0)); } function initSplash() { $("#field1 p").backstretch(getImages()); $("#field2 p").backstretch(getImages()); $("#field3 p").backstretch(getImages()); $("#field4 p").backstretch(getImages()); $("#field5 p").backstretch(getImages()); $("#field6 p").backstretch(getImages()); $("#field7 p").backstretch(getImages()); $("#field8 p").backstretch(getImages()); $("#field9 p").backstretch(getImages()); $("#field10 p").backstretch(getImages()); } function initSplashTop() { $("#field4 p").backstretch(getImage()); $("#field5 p").backstretch(getImage()); $("#field7 p").backstretch(getImage()); $("#field8 p").backstretch(getImage()); $("#field9 p").backstretch(getImage()); $("#field10 p").backstretch(getImage()); }