
var timingArray = [3000, 9000, 10000, 12000, 9000];

(()=>{

    const messages = [
        `You are at "Shop.com" Web site doing your shopping.`,
        `Then you click a link that states to be taking you to "discount.com"`,
        `Behind the scenes without your perception and as part of the original click a hidden location "tracking.com" is visited.`,
        `This situation is violating your privacy since you never asked to visit "tracking.com" which now can even take you to a fake Website "ShadyShop.com"`,
        `"ShadyShop.com" can visually look the same than the original "Shop.com" and trick you in giving away your data.`          
    ];
   
    var subs_placeholder = document.getElementById("subtitles-placeholder");
               
    var alertLoop = function(i) {
        if (messages[i]) {
            subs_placeholder.innerHTML = messages[i];       
            setTimeout(function(){alertLoop(i+1);}, timingArray[i]);
        }
        else {
            alertLoop(0);
        }    
    }

    alertLoop(0);
  
})();