
//Displays news based on the year
function displayNews(news_year, parentId) {
   
    document.getElementById(parentId).style.backgroundColor = '#99CCFF';
    //Gets all divs
    var array_news = document.getElementsByTagName('div');
    for (i=0; i<array_news.length;i++) {
       // Gets all divs the ids of which contain the string 'news_20'
        if (array_news[i].id.indexOf('news_20')>-1) {
           if (array_news[i].id == news_year) {
                visible_news = document.getElementById(array_news[i].id);
                visible_news.style.display = "inline";
           } else {
                not_visible_news = document.getElementById(array_news[i].id);
                not_visible_news.style.display = "none";
                parentCell = document.getElementById("cell_" + array_news[i].id);
                parentCell.style.backgroundColor = 'white';
            }
        }
    }

    
    
    
}

//Displays products -detergents-cosmetics and professional.
function displayProducts(productType, parentId) {
   
    document.getElementById(parentId + "_1").style.backgroundColor = '#99CCFF';
    document.getElementById(parentId + "_2").style.backgroundColor = '#99CCFF';
   
    //Gets all divs
    var array_products = document.getElementsByTagName('div');
    
    for (i = 0; i < array_products.length; i++) {
        
        // Gets all divs the ids of which contain the string 'type_products'
        if (array_products[i].id.indexOf('type_products') > -1) {
           
            if (array_products[i].id == productType) {
                visible_products = document.getElementById(array_products[i].id);
                visible_products.style.display = "inline";
               
            } else {
           
                not_visible_products = document.getElementById(array_products[i].id);
                not_visible_products.style.display = "none";
                parentCell1 = document.getElementById("cell_" + array_products[i].id+"_1");
                parentCell1.style.backgroundColor = 'white';
                parentCell2 = document.getElementById("cell_" + array_products[i].id + "_2");
                parentCell2.style.backgroundColor = 'white';
            }
           
        }
       
    }
   
}
