﻿function onclicks(imgurl) {
    document.getElementById("picture").style.backgroundImage = "url(" + imgurl + ")";
}

function Qie() {
    var imgScr = new Array();

    imgScr[0] = "url(images/one.gif)";
    imgScr[1] = "url(images/two.gif)";
    imgScr[2] = "url(images/san.gif)";

    if (document.getElementById("picture").style.backgroundImage == imgScr[0]) {
        document.getElementById("picture").style.backgroundImage = imgScr[1];
    } else if (document.getElementById("picture").style.backgroundImage == imgScr[1]) {
        document.getElementById("picture").style.backgroundImage = imgScr[2];
    } else if (document.getElementById("picture").style.backgroundImage == imgScr[2]) {
        document.getElementById("picture").style.backgroundImage = imgScr[0];
    } else {
        document.getElementById("picture").style.backgroundImage = imgScr[1];
    }
}

setInterval(Qie, 3000);
