    function example_animate(sdiv, px) {
        $(sdiv).animate({
            'marginLeft': px
        });
    }

    var LeftStatus='close'
    var timer1
    var timer2

    function CloseBox() {

        if (document.getElementById('LeftBox').offsetLeft == -172) {

            timer1 = setTimeout(function () {
                example_animate('#LeftBox', '+=172px');
            }, 1000)



            timer2 = setTimeout(function () {
                example_animate('#RightBox', '-=538px');
            }, 1000)

            LeftStatus='close'
        }
    }

    function OpenBox() {

        if (document.getElementById('LeftBox').offsetLeft == -172 || document.getElementById('RightBox').offsetLeft == 530) {
            LeaveOpen();
        } else {
            if (document.getElementById('LeftBox').offsetLeft == 0 && LeftStatus=='close') {
            
                example_animate('#LeftBox', '-=172px');
                example_animate('#RightBox', '+=538px');

                LeftStatus = 'open'
            }
        }




    }


    function LeaveOpen() {

        clearTimeout(timer2)
        clearTimeout(timer1)
        
        
     }

