function KickerPages() { this.value = 0; } var mySlide = new Array( 'http://c.americanapparel.net/storefront/headers/women/Shorts/1.jpg' ,'http://c.americanapparel.net/storefront/headers/women/Shorts/10.jpg' ,'http://c.americanapparel.net/storefront/headers/women/Shorts/11.jpg' ,'http://c.americanapparel.net/storefront/headers/women/Shorts/14.jpg' ,'http://c.americanapparel.net/storefront/headers/women/Shorts/17.jpg' ,'http://c.americanapparel.net/storefront/headers/women/Shorts/18_410x206.jpg' ,'http://c.americanapparel.net/storefront/headers/women/Shorts/2.jpg' ,'http://c.americanapparel.net/storefront/headers/women/Shorts/410.jpg' ,'http://c.americanapparel.net/storefront/headers/women/Shorts/410women-shorts.jpg' ,'http://c.americanapparel.net/storefront/headers/women/Shorts/410women-shorts1.jpg' ,'http://c.americanapparel.net/storefront/headers/women/Shorts/410women-shorts10.jpg' ,'http://c.americanapparel.net/storefront/headers/women/Shorts/410women-shorts11.jpg' ,'http://c.americanapparel.net/storefront/headers/women/Shorts/410women-shorts12.jpg' ,'http://c.americanapparel.net/storefront/headers/women/Shorts/410women-shorts2.jpg' ,'http://c.americanapparel.net/storefront/headers/women/Shorts/410women-shorts20.jpg' ,'http://c.americanapparel.net/storefront/headers/women/Shorts/410women-shorts3.jpg' ,'http://c.americanapparel.net/storefront/headers/women/Shorts/410women-shorts4.jpg' ,'http://c.americanapparel.net/storefront/headers/women/Shorts/410women-shorts5.jpg' ,'http://c.americanapparel.net/storefront/headers/women/Shorts/410women-shorts6.jpg' ,'http://c.americanapparel.net/storefront/headers/women/Shorts/410women-shorts7.jpg' ,'http://c.americanapparel.net/storefront/headers/women/Shorts/410women-shorts8.jpg' ,'http://c.americanapparel.net/storefront/headers/women/Shorts/410women-shorts9.jpg' ,'http://c.americanapparel.net/storefront/headers/women/Shorts/copy (2) of lace3.jpg' ,'http://c.americanapparel.net/storefront/headers/women/Shorts/copy (2) of lace4.jpg' ,'http://c.americanapparel.net/storefront/headers/women/Shorts/copy (5) of lace2.jpg' ,'http://c.americanapparel.net/storefront/headers/women/Shorts/copy of basict.jpg' ,'http://c.americanapparel.net/storefront/headers/women/Shorts/copy of lace1.jpg' ,'http://c.americanapparel.net/storefront/headers/women/Shorts/flannel_410x206.jpg' ,'http://c.americanapparel.net/storefront/headers/women/Shorts/img_0727.jpg' ,'http://c.americanapparel.net/storefront/headers/women/Shorts/rsacs301g.jpg' ,'http://c.americanapparel.net/storefront/headers/women/Shorts/rsalr300.jpg' ,'http://c.americanapparel.net/storefront/headers/women/Shorts/rsalr300_white.jpg' ,'http://c.americanapparel.net/storefront/headers/women/Shorts/rsase303.jpg' ,'http://c.americanapparel.net/storefront/headers/women/Shorts/shorts1_410.jpg' ,'http://c.americanapparel.net/storefront/headers/women/Shorts/shorts2.jpg' ,'http://c.americanapparel.net/storefront/headers/women/Shorts/shorts4.jpg' ,'http://c.americanapparel.net/storefront/headers/women/Shorts/shorts6.jpg' ,'http://c.americanapparel.net/storefront/headers/women/Shorts/shorts7.jpg' ,'http://c.americanapparel.net/storefront/headers/women/Shorts/shorts99.jpg' ,'http://c.americanapparel.net/storefront/headers/women/Shorts/tiana_pjs_410x206.jpg' ,'http://c.americanapparel.net/storefront/headers/women/Shorts/tiana_tap_410x206.jpg' ,'http://c.americanapparel.net/storefront/headers/women/Shorts/women-shorts1.jpg' ,'http://c.americanapparel.net/storefront/headers/women/Shorts/women-shorts2.jpg' ,'http://c.americanapparel.net/storefront/headers/women/Shorts/women-shorts3.jpg' ,'http://c.americanapparel.net/storefront/headers/women/Shorts/women-shorts4.jpg' ,'http://c.americanapparel.net/storefront/headers/women/Shorts/women-shorts5.jpg' ,'http://c.americanapparel.net/storefront/headers/women/Shorts/women-shorts8.jpg' ,'http://c.americanapparel.net/storefront/headers/women/Shorts/_f9r2974b.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;