// get window width  
var maxX = 0; var winWidth = 0;
if( typeof( window.innerWidth ) == 'number' ) {
    //Non-IE
    winWidth = window.innerWidth;
} else if( document.documentElement && document.documentElement.clientWidth ) {
    //IE 6+ in 'standards compliant mode'
    winWidth = document.documentElement.clientWidth;
} else if( document.body && document.body.clientWidth ) {
    //IE 4 compatible
    winWidth = document.body.clientWidth;
} else {
    //?
    winWidth = window.screen.width;
}
// Max X
maxX = winWidth / 2 - 200;
currX = -400;
    
  
function moveBerep() {
    var theDiv = document.getElementById('berepulo');
    currX = parseInt(theDiv.style.left); 
    currX += 20;
    if(currX > maxX) currX = maxX;
    theDiv.style.left = currX + "px";
    if(currX < maxX) {
        setTimeout("moveBerep()", 24);
    } else {
        theDiv.style.position = 'fixed';
    }
}

function hideBerep() {
    var theDiv = document.getElementById('berepulo');
    theDiv.style.display = 'none';
}

setTimeout("moveBerep()", 20000);
