var bye;

function logout_action(lang) {

    var l=0;
    var t=0;

    cart_clean();

    l = Math.round(window.screen.width/2) - 125;
    t = Math.round(window.screen.height/2) - 75;

    switch (lang) {
      case 'ua' :  bye = window.open('/html/thanks_ua.html', 'dialog', 'fullscreen=0, resizable=1, status=0, scrollbars=0, height=120, width=250, left='+l+', top='+t+'');
                   break;
      case 'ru' :  bye = window.open('/html/thanks_ru.html', 'dialog', 'fullscreen=0, resizable=1, status=0, scrollbars=0, height=120, width=250, left='+l+', top='+t+'');
                   break;
      case 'en' :  bye = window.open('/html/thanks_en.html', 'dialog', 'fullscreen=0, resizable=1, status=0, scrollbars=0, height=120, width=250, left='+l+', top='+t+'');
                   break;
   }
}

var progressEnd = 9; // set to number of progress <span>'s.
var progressColor = '#914D0B'; // set to progress bar color
var progressInterval = 1000; // set to time between updates (milli-seconds)

var progressAt = progressEnd;
var progressTimer;

function progress_clear() {
    
    for (var i = 1; i <= progressEnd; i++) document.getElementById('progress'+i).style.backgroundColor = 'transparent';
    progressAt = 0;
}

function progress_update() {
    
    document.getElementById('showbar').style.visibility = 'visible';
    document.getElementById('showbartext').style.visibility = 'visible';
    progressAt++;
    if (progressAt > progressEnd) progress_clear();
    else document.getElementById('progress'+progressAt).style.backgroundColor = progressColor;
    progressTimer = setTimeout('progress_update()',progressInterval);
}

function progress_stop() {

    clearTimeout(progressTimer);
    progress_clear();
    document.getElementById('showbar').style.visibility = 'hidden';
    document.getElementById('showbartext').style.visibility = 'hidden';

}
