var slotArray = new Array(9); function changeBanner(name,text,slot,imgs,urls,des,max) { count = slotArray[slot]; try { description = document.getElementsByName(text); description[0].innerHTML = des[count]; } catch(err) { d = document.getElementById(text); d.innerHTML = des[count]; } try { document.images[name].src = imgs[count].src; } catch(err) { d.innerHTML = count } try { document.links[name].href = urls[count]; } catch(err) { try { document.links.item(name).href = urls[count]; } catch(err) { alert("Link error"); } } count = count + 1 if(count>=max) count=0; slotArray[slot] = count; }