var collection= new Array(0); //number of items in the array //manually added this item to the start of the collection /*collection[0] = new Array(2); collection[0][0]="spotlightShow_ecomply3"; collection[0][1]=5000; */ collection[0] = new Array(2); collection[0][0]="spotlightShow_1"; collection[0][1]=5000; collection[1] = new Array(2); collection[1][0]="spotlightShow_ecomply"; collection[1][1]=5000; collection[2] = new Array(2); collection[2][0]="spotlightShow_2"; collection[2][1]=5000; collection[3] = new Array(2); collection[3][0]="spotlightShow_ecomply2"; collection[3][1]=5000; collection[4] = new Array(2); collection[4][0]="spotlightShow_3"; collection[4][1]=5000; collection[5] = new Array(2); collection[5][0]="spotlightShow_ecomply"; collection[5][1]=5000; collection[6] = new Array(2); collection[6][0]="spotlightShow_4"; collection[6][1]=5000; collection[7] = new Array(2); collection[7][0]="spotlightShow_ecomply2"; collection[7][1]=5000; //make sure any items here are also manually added to the SEO visible version below /*collection[9] = new Array(2); collection[9][0]="spotlightShow_ecomply4"; //refers to a div located at the bottom of the page collection[9][1]=5000;*/ var index = 0; var tempTimer; var mouseIsOver = 0; function fademe(i){ clearTimeout(tempTimer); if (mouseIsOver){ tempTimer = setTimeout('fademe(index+1);',collection[index][1]); return 0; } if (i != null) index = i; if (index >= collection.length){ //restart index = 0; } else if (index < 0){ index = collection.length - 1; } $("#pic").animate({ opacity: 'hide'}, 500,function(){ //fade out interval time $("#flash").remove(); $("#pic").html( $("#"+collection[index][0]).html() ); $("#pic").animate({ opacity: 'show'}, 1000, function(){ //fade in interval time tempTimer = setTimeout('fademe(index+1);',collection[index][1]); //the time the item is displayed for, set in the collection }); }); } function fademeNext(){ clearTimeout(tempTimer); fademe(index + 1); } function fademePrev(){ clearTimeout(tempTimer); fademe(index - 1); } function whenMouseOver() { mouseIsOver = 1; } function whenMouseOut() { mouseIsOver = 0; }