var headimage;
var bgstate;
var bg_pos = 0;

function moveBackground(x,id) {
    headimage = document.getElementById(id);
    moveBackgroundDo(x);
}

function moveBackgroundDo(x){
    //if(headimage.bp==undefined) headimage.bp = 0;
    var op = bg_pos;//Number(headimage.bp);
    if(op<=-558) op = 0;

    var np = op-x;

    headimage.style.backgroundPosition = (np)+"px";
    //headimage.bp = np;
    bg_pos = np;

    bgstate = window.setTimeout(function(){ moveBackgroundDo(x); },50);
}

