function KickerPages() { this.value = 0; }
var mySlide = new Array(
'http://c.americanapparel.net/storefront/headers/women/bras/16.jpg'
,'http://c.americanapparel.net/storefront/headers/women/bras/17.jpg'
,'http://c.americanapparel.net/storefront/headers/women/bras/19.jpg'
,'http://c.americanapparel.net/storefront/headers/women/bras/1bra410.jpg'
,'http://c.americanapparel.net/storefront/headers/women/bras/2bra410.jpg'
,'http://c.americanapparel.net/storefront/headers/women/bras/4.jpg'
,'http://c.americanapparel.net/storefront/headers/women/bras/410women-bras20.jpg'
,'http://c.americanapparel.net/storefront/headers/women/bras/410women-bras21.jpg'
,'http://c.americanapparel.net/storefront/headers/women/bras/410_new.jpg'
,'http://c.americanapparel.net/storefront/headers/women/bras/7.jpg'
,'http://c.americanapparel.net/storefront/headers/women/bras/alyssa-thong-410x206.jpg'
,'http://c.americanapparel.net/storefront/headers/women/bras/bras10.jpg'
,'http://c.americanapparel.net/storefront/headers/women/bras/bras2.jpg'
,'http://c.americanapparel.net/storefront/headers/women/bras/bras3.jpg'
,'http://c.americanapparel.net/storefront/headers/women/bras/bras4.jpg'
,'http://c.americanapparel.net/storefront/headers/women/bras/bras6.jpg'
,'http://c.americanapparel.net/storefront/headers/women/bras/bras7.jpg'
,'http://c.americanapparel.net/storefront/headers/women/bras/bras8.jpg'
,'http://c.americanapparel.net/storefront/headers/women/bras/copy (2) of 410.jpg'
,'http://c.americanapparel.net/storefront/headers/women/bras/copy (2) of pantys8.jpg'
,'http://c.americanapparel.net/storefront/headers/women/bras/copy (3) of lace.jpg'
,'http://c.americanapparel.net/storefront/headers/women/bras/copy of copy of skirts6.jpg'
,'http://c.americanapparel.net/storefront/headers/women/bras/copy of lace.jpg'
,'http://c.americanapparel.net/storefront/headers/women/bras/copy of lace6.jpg'
,'http://c.americanapparel.net/storefront/headers/women/bras/copy of lace7.jpg'
,'http://c.americanapparel.net/storefront/headers/women/bras/intimates_01.jpg'
,'http://c.americanapparel.net/storefront/headers/women/bras/moresheets410.jpg'
,'http://c.americanapparel.net/storefront/headers/women/bras/table.jpg'
,'http://c.americanapparel.net/storefront/headers/women/bras/table3.jpg'
,'http://c.americanapparel.net/storefront/headers/women/bras/tiana-410x206.jpg'
,'http://c.americanapparel.net/storefront/headers/women/bras/tiana015.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;