
var modProductPos = 0;
var modProductPosMax = -500;
var modProductCount = 5;
var modProductHeight = 80;
var modProductsShow = 15;
var modProductScroll = modProductHeight * modProductsShow;
var modListScrollMethod = 'easy';

function modProductCountProc(fx_count) {
    modProductCount = fx_count;
    modProductPosMax = (modProductCount * modProductHeight * -1) + modProductScroll;
}

function modProductUp() {
    if (modListScrollMethod == 'easy') {
        var animateto = modProductPos - modProductScroll
        if (animateto.valueOf() < modProductPosMax.valueOf() ) {
            animateto = modProductPosMax.valueOf();
        }
        modProductPos = animateto;
        xpsCkSets('modProductPos302124', animateto)
        animateto = animateto.toString() + 'px';
        $('#modProducts').animate({ marginTop: animateto }, 500);
        modListControls();
    }        
}

function modProductDown() {
    if (modListScrollMethod == 'easy') {
        var animateto = modProductPos + modProductScroll;
        if (animateto > 0) {
            animateto = 0; 
        }
        modProductPos = animateto;
        xpsCkSets('modProductPos302124', animateto)
        animateto = animateto.toString() + 'px';
        $('#modProducts').animate({ marginTop: animateto }, 500);
        modListControls();
    }        
}

function modProductAll() {
    if (document.getElementById('modProductControlAll').innerHTML=='Show All Products') { 
        document.getElementById('modProductControlAll').innerHTML='Show Easy Scroll';
        $('#modProducts').css('margin-top', '0px');
        $('#modProductsOut').removeClass('sc_ezscroll');
        modListScrollMethod = 'all';
    } else {
        document.getElementById('modProductControlAll').innerHTML='Show All Products';
        $('#modProducts').css('margin-top', '0px');
        $('#modProductsOut').addClass('sc_ezscroll');
        modListScrollMethod = 'easy';
    }
    modProductPos=0;
    xpsCkSets('modProductPos302124', 0)
    modListControls();
}

function modListControls() {
    if (document.getElementById('modProductControlAll').innerHTML=='Show All Products') {
        if (modProductPos==0) {
            $('#modProductControlPrev').fadeTo('slow', .33);    
            $('#modProductControlNext').css('visibility', 'visible');
            $('#modProductControlNext').fadeTo('slow', 1);
        } else if (modProductPos==modProductPosMax) {
            $('#modProductControlNext').fadeTo('slow', .33);
            $('#modProductControlPrev').css('visibility', 'visible');
            $('#modProductControlPrev').fadeTo('slow', 1);
        } else {
            $('#modProductControlPrev').css('visibility', 'visible');
            $('#modProductControlPrev').fadeTo('slow', 1);  
            $('#modProductControlNext').css('visibility', 'visible');     
            $('#modProductControlNext').fadeTo('slow', 1); 
        }
    } else {
        $('#modProductControlPrev').fadeTo('slow', .33);  
        $('#modProductControlNext').fadeTo('slow', .33);   
    }        
}



xpsJSPage = 'ran';



