arr3 = new Array( ["http://www.petsandfriendsjv.com/images/homepage_ads/rotator3/canidae_alllifestages.jpg","http://www.petsandfriendsjv.com/dog_food_canidae_all_life_stages_dog_dry.asp","Canidae All Life Stages Dry"], ["http://www.petsandfriendsjv.com/images/homepage_ads/rotator3/chickensoup_adultdry.jpg","http://www.petsandfriendsjv.com/dog_food_chickensoup_adult_dry.asp","Chicken Soup for the Cat Lovers SoulAdult Dog Formula "], ["http://www.petsandfriendsjv.com/images/homepage_ads/rotator3/exclusive_reducedfat_chickenrice.jpg","http://www.petsandfriendsjv.com/dog_food_exclusive_adult_reducedfat_chickenrice.asp","Exclusive™ Reduced Fat Chicken & Rice Adult Formula"], ["http://www.petsandfriendsjv.com/images/homepage_ads/rotator3/fromm_surfturf.jpg","http://www.petsandfriendsjv.com/cat_food_fromm_surfturf.asp","Fromm Surf & Turf"] // no comma at the end of last index ); var lastImg="0"; function changeimg3() { var randNum = getRand(); document.getElementById("img3").src = arr3[randNum][0]; document.getElementById("link3").href = arr3[randNum][1]; document.getElementById("img3").title = arr3[randNum][2]; setTimeout('changeimg3()',10000); } function getRand () { var rnum; var id=Math.round(Math.random()*(arr3.length-1)); rnum = id; if (rnum==lastImg) { rnum = getRand(); } lastImg=rnum; return rnum; }