(function(){
    var height = document.documentElement.scrollHeight;
    var clientHeight = document.documentElement.clientHeight;
    if (clientHeight == 0) {
        try {
            WizChromeBrowser.Execute("scrollDone", null, null, null, null);
        } catch (err) {
        }
        return;
    }
    //
    var top = 0;
    function doScroll() {
        top += clientHeight;
        document.body.scrollTop = top;
        //
        top = document.body.scrollTop;
        if (top + clientHeight + 5 >= height) {
            //
            try {
                WizChromeBrowser.Execute("scrollDone", null, null, null, null);
            } catch (err) {
            }
            //
            return;
        }
        //
        setTimeout(doScroll, 300);
    }
    //
    doScroll();
})();

