function KickerPages() { this.value = 0; } var mySlide = new Array( 'http://c.americanapparel.net/storefront/headers/women/Skirts/14.jpg' ,'http://c.americanapparel.net/storefront/headers/women/Skirts/19.jpg' ,'http://c.americanapparel.net/storefront/headers/women/Skirts/20.jpg' ,'http://c.americanapparel.net/storefront/headers/women/Skirts/24.jpg' ,'http://c.americanapparel.net/storefront/headers/women/Skirts/28.jpg' ,'http://c.americanapparel.net/storefront/headers/women/Skirts/30.jpg' ,'http://c.americanapparel.net/storefront/headers/women/Skirts/410new.jpg' ,'http://c.americanapparel.net/storefront/headers/women/Skirts/410women-skirts10.jpg' ,'http://c.americanapparel.net/storefront/headers/women/Skirts/410_new.jpg' ,'http://c.americanapparel.net/storefront/headers/women/Skirts/chiffonskirt1_410.jpg' ,'http://c.americanapparel.net/storefront/headers/women/Skirts/copy (2) of skirts7.jpg' ,'http://c.americanapparel.net/storefront/headers/women/Skirts/copy of collaredshirts2.jpg' ,'http://c.americanapparel.net/storefront/headers/women/Skirts/copy of new.jpg' ,'http://c.americanapparel.net/storefront/headers/women/Skirts/copy of skirts5.jpg' ,'http://c.americanapparel.net/storefront/headers/women/Skirts/eliana_410x206.jpg' ,'http://c.americanapparel.net/storefront/headers/women/Skirts/franca_410x206.jpg' ,'http://c.americanapparel.net/storefront/headers/women/Skirts/header410.jpg' ,'http://c.americanapparel.net/storefront/headers/women/Skirts/img_5776_1.jpg' ,'http://c.americanapparel.net/storefront/headers/women/Skirts/kali_410x206.jpg' ,'http://c.americanapparel.net/storefront/headers/women/Skirts/knit_410x206.jpg' ,'http://c.americanapparel.net/storefront/headers/women/Skirts/lace.jpg' ,'http://c.americanapparel.net/storefront/headers/women/Skirts/longskirt410.jpg' ,'http://c.americanapparel.net/storefront/headers/women/Skirts/new-5.jpg' ,'http://c.americanapparel.net/storefront/headers/women/Skirts/new8.jpg' ,'http://c.americanapparel.net/storefront/headers/women/Skirts/rsalc300_410.jpg' ,'http://c.americanapparel.net/storefront/headers/women/Skirts/rsans311.jpg' ,'http://c.americanapparel.net/storefront/headers/women/Skirts/rsans312_410.jpg' ,'http://c.americanapparel.net/storefront/headers/women/Skirts/rsatd300-2.jpg' ,'http://c.americanapparel.net/storefront/headers/women/Skirts/skirt4_410.jpg' ,'http://c.americanapparel.net/storefront/headers/women/Skirts/skirts-1.jpg' ,'http://c.americanapparel.net/storefront/headers/women/Skirts/skirts.jpg' ,'http://c.americanapparel.net/storefront/headers/women/Skirts/skirts1.jpg' ,'http://c.americanapparel.net/storefront/headers/women/Skirts/skirts10.jpg' ,'http://c.americanapparel.net/storefront/headers/women/Skirts/skirts11.jpg' ,'http://c.americanapparel.net/storefront/headers/women/Skirts/skirts13.jpg' ,'http://c.americanapparel.net/storefront/headers/women/Skirts/skirts18.jpg' ,'http://c.americanapparel.net/storefront/headers/women/Skirts/skirts19.jpg' ,'http://c.americanapparel.net/storefront/headers/women/Skirts/skirts20.jpg' ,'http://c.americanapparel.net/storefront/headers/women/Skirts/skirts22_410.jpg' ,'http://c.americanapparel.net/storefront/headers/women/Skirts/skirts8.jpg' ,'http://c.americanapparel.net/storefront/headers/women/Skirts/skirts99.jpg' ,'http://c.americanapparel.net/storefront/headers/women/Skirts/skirts_410.jpg' ,'http://c.americanapparel.net/storefront/headers/women/Skirts/women-skirts-1.jpg' ,'http://c.americanapparel.net/storefront/headers/women/Skirts/women-skirts1.jpg' ,'http://c.americanapparel.net/storefront/headers/women/Skirts/women-skirts2.jpg' ,'http://c.americanapparel.net/storefront/headers/women/Skirts/women-skirts3.jpg' ,'http://c.americanapparel.net/storefront/headers/women/Skirts/women-skirts8.jpg' ,'http://c.americanapparel.net/storefront/headers/women/Skirts/women-skirts98.jpg' ,'http://c.americanapparel.net/storefront/headers/women/Skirts/_f9r3123b.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;