function KickerPages() { this.value = 0; }
var mySlide = new Array(
'http://c.americanapparel.net/storefront/headers/women/pants/05.jpg'
,'http://c.americanapparel.net/storefront/headers/women/pants/29.jpg'
,'http://c.americanapparel.net/storefront/headers/women/pants/30.jpg'
,'http://c.americanapparel.net/storefront/headers/women/pants/34.jpg'
,'http://c.americanapparel.net/storefront/headers/women/pants/410new-women1.jpg'
,'http://c.americanapparel.net/storefront/headers/women/pants/410new-women2.jpg'
,'http://c.americanapparel.net/storefront/headers/women/pants/410new-women3.jpg'
,'http://c.americanapparel.net/storefront/headers/women/pants/410new-women4.jpg'
,'http://c.americanapparel.net/storefront/headers/women/pants/410new-women5.jpg'
,'http://c.americanapparel.net/storefront/headers/women/pants/410women-pants2.jpg'
,'http://c.americanapparel.net/storefront/headers/women/pants/410women-pants20.jpg'
,'http://c.americanapparel.net/storefront/headers/women/pants/ah-410x206.jpg'
,'http://c.americanapparel.net/storefront/headers/women/pants/alyssa_horse_410x206.jpg'
,'http://c.americanapparel.net/storefront/headers/women/pants/ayesha-2_410x206.jpg'
,'http://c.americanapparel.net/storefront/headers/women/pants/blond_410x206.jpg'
,'http://c.americanapparel.net/storefront/headers/women/pants/button-up_410.jpg'
,'http://c.americanapparel.net/storefront/headers/women/pants/bwpants410.jpg.jpg'
,'http://c.americanapparel.net/storefront/headers/women/pants/cardishawl_410x206.jpg'
,'http://c.americanapparel.net/storefront/headers/women/pants/copy (2) of _f9r4301.jpg'
,'http://c.americanapparel.net/storefront/headers/women/pants/copy (3) of new9.jpg'
,'http://c.americanapparel.net/storefront/headers/women/pants/jasmin_410x206.jpg'
,'http://c.americanapparel.net/storefront/headers/women/pants/lawntee_410.jpg'
,'http://c.americanapparel.net/storefront/headers/women/pants/pants1.jpg'
,'http://c.americanapparel.net/storefront/headers/women/pants/pants10.jpg'
,'http://c.americanapparel.net/storefront/headers/women/pants/pants12.jpg'
,'http://c.americanapparel.net/storefront/headers/women/pants/pants13.jpg'
,'http://c.americanapparel.net/storefront/headers/women/pants/pants14_410.jpg'
,'http://c.americanapparel.net/storefront/headers/women/pants/pants15_410.jpg'
,'http://c.americanapparel.net/storefront/headers/women/pants/pants2.jpg'
,'http://c.americanapparel.net/storefront/headers/women/pants/pants20.jpg'
,'http://c.americanapparel.net/storefront/headers/women/pants/pants410.jpg'
,'http://c.americanapparel.net/storefront/headers/women/pants/pants50.jpg'
,'http://c.americanapparel.net/storefront/headers/women/pants/pants8.jpg'
,'http://c.americanapparel.net/storefront/headers/women/pants/pants98.jpg'
,'http://c.americanapparel.net/storefront/headers/women/pants/pants99.jpg'
,'http://c.americanapparel.net/storefront/headers/women/pants/pants_01.jpg'
,'http://c.americanapparel.net/storefront/headers/women/pants/pants_2.jpg'
,'http://c.americanapparel.net/storefront/headers/women/pants/pants_3.jpg'
,'http://c.americanapparel.net/storefront/headers/women/pants/pleats410.jpg'
,'http://c.americanapparel.net/storefront/headers/women/pants/rachel_410x206.jpg'
,'http://c.americanapparel.net/storefront/headers/women/pants/rsa0319.jpg'
,'http://c.americanapparel.net/storefront/headers/women/pants/rsart400.jpg'
,'http://c.americanapparel.net/storefront/headers/women/pants/rsatd300.jpg'
,'http://c.americanapparel.net/storefront/headers/women/pants/tiana015.jpg'
,'http://c.americanapparel.net/storefront/headers/women/pants/trp-410x206.jpg'
,'http://c.americanapparel.net/storefront/headers/women/pants/tyelar_410x206.jpg'
,'http://c.americanapparel.net/storefront/headers/women/pants/untitled2.jpg'
,'http://c.americanapparel.net/storefront/headers/women/pants/women-pants1.jpg'
,'http://c.americanapparel.net/storefront/headers/women/pants/women-pants2.jpg'
,'http://c.americanapparel.net/storefront/headers/women/pants/women-pants3.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;