
var char = 0;
var caption = '';

function type() {
  $('#ticker').html(caption.substr(0, char++));
  //window.console.log('type:' + caption.substr(0, char));
  if(char < caption.length+1) {
    setTimeout("type()", 70);
  } else {
    char = 0;
    caption = "";
    setTimeout("activate_ticker()", 10000);
  }
}

function activate_ticker() {
  //window.console.log('Start...');
  if($('#ticker').length) {
    caption = $('#ticker').text()
    if(caption) type();
  }
}
