//var width = 440;
var position = -440;
var bpeu;
var _in;
var _out;
var showing;
var hiding;
var steprate=40;

function showbpeu(show) {
    bpeu = document.getElementById('bpeu');
    if (show && !showing && !hiding) {
        _in = window.setTimeout("bpeuSlideIn()", steprate);
        showing = true;
    } else if (!show && !showing && !hiding) {
        _out = window.setTimeout("bpeuSlideOut()", steprate);
        hiding = true;
    }
}

function bpeuSlideIn() {
    if (position < 0) {
        position += steprate;
        bpeu.style.left = position.toString() + "px";
        _in = window.setTimeout("bpeuSlideIn()", steprate);
    } else {
        showing = false;
        window.clearTimeout(_in);
    }
}

function bpeuSlideOut() {
    if (position > -440) {
        position -= steprate;
        bpeu.style.left = position.toString() + "px";
        _out = window.setTimeout("bpeuSlideOut()", steprate);
    } else {
        hiding = false;
        window.clearTimeout(_out);
    }
}
