arr4 = new Array( ["http://www.petsandfriendsjv.com/images/homepage_ads/rotator4/exclusive_senior_chickenrice.jpg","http://www.petsandfriendsjv.com/dog_food_exclusive_senior_chickenrice.asp","Exclusive™ Chicken & Rice Senior Formula"], ["http://www.petsandfriendsjv.com/images/homepage_ads/rotator4/naturalbalance_duckpotato.jpg","http://www.petsandfriendsjv.com/dog_food_naturalbalance_duck_sweet_potato_dry.asp","Natural Balance Potato & Duck Formula"], ["http://www.petsandfriendsjv.com/images/homepage_ads/rotator4/naturesvariety_beefmedallions.jpg","http://www.petsandfriendsjv.com/dog_food_naturesvariety_rawbeefpatties.asp","Beef Formula Nature's Variety Raw Frozen Diet for Dogs and Cats"], ["http://www.petsandfriendsjv.com/images/homepage_ads/rotator4/sciencediet_caninelight.jpg","http://www.petsandfriendsjv.com/dog_food_sciencediet_canine_light.asp","Science Diet Light Adult"] // no comma at the end of last index ); var lastImg="0"; function changeimg4() { var randNum = getRand(); document.getElementById("img4").src = arr4[randNum][0]; document.getElementById("link4").href = arr4[randNum][1]; document.getElementById("img4").title = arr4[randNum][2]; setTimeout('changeimg4()',15000); } function getRand () { var rnum; var id=Math.round(Math.random()*(arr4.length-1)); rnum = id; if (rnum==lastImg) { rnum = getRand(); } lastImg=rnum; return rnum; }