﻿function rotate() {
       eo_Callback("Callback1", 'run');
        if (controlIndex == controlIndexLimit) {
            controlIndex = 0;
            currotseqcount++;
        }
            if (currotseqcount > maxrotseqcount) {
                stopRotation();
            }
}

function startRotation() {
    if (intervalInstance == 0) {
        show = setInterval('rotate()', rotationtime);
        intervalInstance = 1;
    }
}

function stopRotation() {
    if (intervalInstance == 1) {
        clearInterval(show);
        intervalInstance = 0;
    }
}

function writeDiv(s) {
setDivStyle(curConsole);
curDivInConsole.innerHTML = s;
//window.status = 'control index: ' + controlIndex + ' rotation seq count: ' + currotseqcount;
controlIndex++;
}

function testimonialAfterExcecute(callback, output, extraData) {
writeDiv(extraData);
}

function setDivStyle(el) {
    var tdiv = el.style;
    tdiv.position = 'relative';
    tdiv.marginRight = 'auto';
    tdiv.marginLeft = 'auto';
    tdiv.width = '700px';
    tdiv.height = '110px';
    tdiv.border = '1px #7b4921 solid';
    if (curbgcount == bgcount) {curbgcount = 1;} else {curbgcount++;}
    tdiv.backgroundImage = 'url(testimonialBGImg/' + curbgcount + '.jpg)';
    tdiv.backgroundRepeat = 'no-repeat';
}

function openSubmitTestimonial() {
    eo_GetObject('Dialog1').show(true);
}






