Graham
Keyarn wrap it in a 'for' loop
<script> var x = document.getElementsByClassName("myads");
for (i=0;i < 2;i++){
........
}
although it could overwrite the same element
so think of the setting as a maximum
If you want it so there are always the same number of ads
If the ad has already been set it repeats the iteration by subtracting 1 from the loop count