function KickerPages() { this.value = 0; } var mySlide = new Array( 'http://c.americanapparel.net/storefront/headers/women/lace/01_410x206.jpg' ,'http://c.americanapparel.net/storefront/headers/women/lace/03_410x206.jpg' ,'http://c.americanapparel.net/storefront/headers/women/lace/04_410x206.jpg' ,'http://c.americanapparel.net/storefront/headers/women/lace/11.jpg' ,'http://c.americanapparel.net/storefront/headers/women/lace/16_410x206.jpg' ,'http://c.americanapparel.net/storefront/headers/women/lace/26.jpg' ,'http://c.americanapparel.net/storefront/headers/women/lace/31.jpg' ,'http://c.americanapparel.net/storefront/headers/women/lace/33.jpg' ,'http://c.americanapparel.net/storefront/headers/women/lace/34.jpg' ,'http://c.americanapparel.net/storefront/headers/women/lace/410women-lace1.jpg' ,'http://c.americanapparel.net/storefront/headers/women/lace/410women-lace101.jpg' ,'http://c.americanapparel.net/storefront/headers/women/lace/410women-lace2.jpg' ,'http://c.americanapparel.net/storefront/headers/women/lace/410_new.jpg' ,'http://c.americanapparel.net/storefront/headers/women/lace/72.jpg' ,'http://c.americanapparel.net/storefront/headers/women/lace/alyssa-thong-410x206.jpg' ,'http://c.americanapparel.net/storefront/headers/women/lace/alyssa_410x206.jpg' ,'http://c.americanapparel.net/storefront/headers/women/lace/basict.jpg' ,'http://c.americanapparel.net/storefront/headers/women/lace/bodysuits_410x206.jpg' ,'http://c.americanapparel.net/storefront/headers/women/lace/bwwindow410.jpg' ,'http://c.americanapparel.net/storefront/headers/women/lace/copy (2) of skirts7.jpg' ,'http://c.americanapparel.net/storefront/headers/women/lace/copy (3) of lace2.jpg' ,'http://c.americanapparel.net/storefront/headers/women/lace/copy of new7.jpg' ,'http://c.americanapparel.net/storefront/headers/women/lace/franca_flower_410x206.jpg' ,'http://c.americanapparel.net/storefront/headers/women/lace/lace.jpg' ,'http://c.americanapparel.net/storefront/headers/women/lace/lace1.jpg' ,'http://c.americanapparel.net/storefront/headers/women/lace/lace10.jpg' ,'http://c.americanapparel.net/storefront/headers/women/lace/lace11.jpg' ,'http://c.americanapparel.net/storefront/headers/women/lace/lace12.jpg' ,'http://c.americanapparel.net/storefront/headers/women/lace/lace13.jpg' ,'http://c.americanapparel.net/storefront/headers/women/lace/lace14.jpg' ,'http://c.americanapparel.net/storefront/headers/women/lace/lace16.jpg' ,'http://c.americanapparel.net/storefront/headers/women/lace/lace2.jpg' ,'http://c.americanapparel.net/storefront/headers/women/lace/lace3.jpg' ,'http://c.americanapparel.net/storefront/headers/women/lace/lace4.jpg' ,'http://c.americanapparel.net/storefront/headers/women/lace/lace410x206.jpg' ,'http://c.americanapparel.net/storefront/headers/women/lace/lace5.jpg' ,'http://c.americanapparel.net/storefront/headers/women/lace/lace6.jpg' ,'http://c.americanapparel.net/storefront/headers/women/lace/lace7.jpg' ,'http://c.americanapparel.net/storefront/headers/women/lace/lace8.jpg' ,'http://c.americanapparel.net/storefront/headers/women/lace/lace9.jpg' ,'http://c.americanapparel.net/storefront/headers/women/lace/lacebodysuit_410.jpg' ,'http://c.americanapparel.net/storefront/headers/women/lace/out2_410x206.jpg' ,'http://c.americanapparel.net/storefront/headers/women/lace/pinkjacket410.jpg' ,'http://c.americanapparel.net/storefront/headers/women/lace/rsalc300_410.jpg' ,'http://c.americanapparel.net/storefront/headers/women/lace/rsalr300.jpg' ,'http://c.americanapparel.net/storefront/headers/women/lace/rsalr300_white.jpg' ,'http://c.americanapparel.net/storefront/headers/women/lace/skirts1.jpg' ,'http://c.americanapparel.net/storefront/headers/women/lace/wetlace410.jpg' ,'http://c.americanapparel.net/storefront/headers/women/lace/wetlacerocks410.jpg' ); var myInterval = 0; var myIntervalPause = 0; var myTimeout = 0; var myAPI; function ScrollThroughmyPages(){ myAPI.next(500); RestartmyInterval(); } function AutoScroll() { randArray(mySlide); for(var x = 0; x < mySlide.length; x++) if (x <=0) document.getElementById('myItems').innerHTML += ''; else document.getElementById('myItems').innerHTML += ''; $(function() { $("#myScrollable").myScrollable({horizontal:true}); }); if (document.getElementById('myScrollable') != null) { myAPI = $("#myScrollable").myScrollable(); myTotal = myAPI.getStatus().total; if (myTotal <= 1) { $('DIV.myNext').hide(); $('DIV.myPrev').hide(); } RestartmyInterval(); } } function RestartmyInterval() { LoadImgs(); myPause = 5000; CancelmyInterval(); myInterval = setInterval('ScrollThroughmyPages()',myPause); } function PausemyInterval(){ LoadImgs(); CancelmyInterval(); clearTimeout(myTimeout); myTimeout = setTimeout('RestartmyInterval()',5000); } function CancelmyInterval(){ LoadImgs(); clearInterval(myInterval); } function LoadImgs(){ myIndex = myAPI.getStatus().index; LoadImg(myIndex - 1); LoadImg(myIndex); LoadImg(myIndex + 1); } function LoadImg(index){ Item = document.getElementById('myItem' + index); if ( Item != null ){ if (mySlide[index] != null && Item.src != mySlide[index]) { Item.src = mySlide[index]; } } } function randArray(o){ for(var j, x, i = o.length; i; j = parseInt(Math.random() * i), x = o[--i], o[i] = o[j], o[j] = x); return o; } window.onload=AutoScroll;