Maybe changing the function to something like this:
Code:
var currentImgNumber = 1;
var numberOfImages = 3;
function switchImage(){
currentImgNumber++;
document.body.style.background = 'url(images/AdvertImage' + currentImgNumber + '.jpg)';
if(currentImgNumber == numberOfImages){
currentImgNumber = 0;
}
}
Set your additional attributes for the image just like you would do in the css like no repeats x+y etc. You can just add to that statement your other declarations.
Regards,
LC.