var pageslidefadeLoaded, busy = 0;
var activePage, activeScroll, scrollTimer = null;

function initPageSlideFade(){
        scroller1 = new scrollerobj('divContent');
        activeScroll = scroller1;

        pages = new Array();
        pages[0] = null;
        for (i=1; i<=numScrollPages; i++){
                pages[i] = new scrollerobj('dynPage'+i, 'divContent');
                pages[i].moveTo(0,0);
        }

        bw.opacity = ( bw.ie && !bw.ie4 && navigator.userAgent.indexOf('Windows')>-1 ) || bw.ns6
//        if (bw.ie5||bw.ie6 && !bw.mac) pages[1].css.filter= 'blendTrans(duration=0.6)'; // Loads the windows 9.x filters module.
        for (i=1; i<=numScrollPages; i++){
                activateContinue(i);
        }

        if (bw.ie) for(var i=0;i<document.links.length;i++) document.links[i].onfocus=document.links[i].blur;

        pageslidefadeLoaded = 1;
}

function scroll(step,page){
        activePage = pages[page];
        clearTimeout(scrollTimer);
        if ( !busy && (step<0&&activePage.y+activePage.h>activeScroll.h || step>0&&activePage.y<0) ){
                activePage.moveBy(0,step);
                scrollTimer = setTimeout('scroll('+step+','+page+')',40);
        }
}
function stopScroll(){
        clearTimeout(scrollTimer);
}

function activate(num){
        if (activePage!=pages[num] && !busy){
                busy = 1;
                if (transitionOut==0 || !bw.opacity){ activePage.hideIt(); activateContinue(num); }
                else if (transitionOut==1) activePage.blend('hidden', 'activateContinue('+num+')');
        }
}
function activateContinue(num){
        busy = 1;
        activePage = pages[num];
        activePage.moveTo(0,0);
        if (transitionIn==0 || !bw.opacity){ activePage.showIt(); busy=0; }
        else if (transitionIn==1) activePage.blend('visible', 'busy=0');
        else if (transitionIn==2) activePage.slide(0, slideAcceleration, 40, 'busy=0');
}