function KickerPages() { this.value = 0; }
var mySlide = new Array(
'http://c.americanapparel.net/storefront/headers/women/tanktops/12.jpg'
,'http://c.americanapparel.net/storefront/headers/women/tanktops/13.jpg'
,'http://c.americanapparel.net/storefront/headers/women/tanktops/14.jpg'
,'http://c.americanapparel.net/storefront/headers/women/tanktops/15.jpg'
,'http://c.americanapparel.net/storefront/headers/women/tanktops/16.jpg'
,'http://c.americanapparel.net/storefront/headers/women/tanktops/2.jpg'
,'http://c.americanapparel.net/storefront/headers/women/tanktops/20_410x206.jpg'
,'http://c.americanapparel.net/storefront/headers/women/tanktops/3.jpg'
,'http://c.americanapparel.net/storefront/headers/women/tanktops/4.jpg'
,'http://c.americanapparel.net/storefront/headers/women/tanktops/410women-tanktops1.jpg'
,'http://c.americanapparel.net/storefront/headers/women/tanktops/410women-tanktops2.jpg'
,'http://c.americanapparel.net/storefront/headers/women/tanktops/410women-tanktops3.jpg'
,'http://c.americanapparel.net/storefront/headers/women/tanktops/410women-tanktops4.jpg'
,'http://c.americanapparel.net/storefront/headers/women/tanktops/410women-tanktops5.jpg'
,'http://c.americanapparel.net/storefront/headers/women/tanktops/6.jpg'
,'http://c.americanapparel.net/storefront/headers/women/tanktops/copy (2) of 410.jpg'
,'http://c.americanapparel.net/storefront/headers/women/tanktops/copy of _f9r3123b.jpg'
,'http://c.americanapparel.net/storefront/headers/women/tanktops/lace-tank_410.jpg'
,'http://c.americanapparel.net/storefront/headers/women/tanktops/rsa0313ss.jpg'
,'http://c.americanapparel.net/storefront/headers/women/tanktops/rsa0319.jpg'
,'http://c.americanapparel.net/storefront/headers/women/tanktops/rsase303.jpg'
,'http://c.americanapparel.net/storefront/headers/women/tanktops/tank2_410.jpg'
,'http://c.americanapparel.net/storefront/headers/women/tanktops/tanks1.jpg'
,'http://c.americanapparel.net/storefront/headers/women/tanktops/tanks10.jpg'
,'http://c.americanapparel.net/storefront/headers/women/tanktops/tanks2.jpg'
,'http://c.americanapparel.net/storefront/headers/women/tanktops/tanks20.jpg'
,'http://c.americanapparel.net/storefront/headers/women/tanktops/tanks4.jpg'
,'http://c.americanapparel.net/storefront/headers/women/tanktops/tanks410.jpg'
,'http://c.americanapparel.net/storefront/headers/women/tanktops/tanks5.jpg'
,'http://c.americanapparel.net/storefront/headers/women/tanktops/tanks7.jpg'
,'http://c.americanapparel.net/storefront/headers/women/tanktops/tanks8.jpg'
,'http://c.americanapparel.net/storefront/headers/women/tanktops/tanks9.jpg'
,'http://c.americanapparel.net/storefront/headers/women/tanktops/tanks98.jpg'
,'http://c.americanapparel.net/storefront/headers/women/tanktops/tanks99.jpg'
,'http://c.americanapparel.net/storefront/headers/women/tanktops/tanks_410.jpg'
,'http://c.americanapparel.net/storefront/headers/women/tanktops/tanktops.jpg'
,'http://c.americanapparel.net/storefront/headers/women/tanktops/tank_410.jpg'
,'http://c.americanapparel.net/storefront/headers/women/tanktops/women-tanks33.jpg'
,'http://c.americanapparel.net/storefront/headers/women/tanktops/women-tanks8.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;