﻿
function startCycle() {
    setTimeout('cycleImages();', 4000);
}
function stopCycle() {
    fadeActive = 0;
    fadeLoop = 0;
}
function cycleImages() {
    if (fadeActive == 1) {
        activeImage = activeImage + 1;
        crossfade(document.getElementById('FeatureImage'), '/Images/Home/Feature-' + activeImage + '.jpg', '1', '');
        if (activeImage == 3) {
            activeImage = 0;
        }
    }
    if (fadeLoop == 1) {
        if (document.getElementById('FeatureImage')) {
            setTimeout('cycleImages();', 7000);
        }
    }
}


var prevAction = '';
function loadAction(sAction) {

    if ($('ActionPnl_'+prevAction)) {
        $('ActionPnl_'+prevAction).hide();
    }
    prevAction = sAction;
    if ($('ActionPnl_' + sAction)) {
        $('ActionPnl_' + sAction).show();
    }
    $('ScreenGrayout').show();
    new Effect.Appear('ActionPanels', { duration: .5, afterFinish: function(effect) { initAction(); } });
}
function initAction() {
   //
}
function fadeAction() {
    if ($('ActionPnl_'+prevAction)) {
        $('ActionPnl_'+prevAction).hide();
    }
    new Effect.Fade('ScreenGrayout', { duration: .5 });
    $('ActionPanels').hide();
}



