var pictures = 7; var dt = new Date(); var hr = dt.getSeconds(); var ra = hr % pictures; var re = ++ra; var msg= ""; document.write(msg);