// This creates an important message tile on the index page if a tile's title contains the text
// "Important Message".

var page = window.location.pathname;
page = page.substring(page.lastIndexOf('/'));
// alert(page);
if(page == '/index.html' || page == '/') {
    // Add id to main tiles container
    $('a:contains("Important Message")').closest('.wh_tiles').attr('id','main_tiles');
    // Add a class and an id to the top faqs div
    $('a:contains("Important Message")').closest('.wh_tile').addClass('topfaqs_tile').attr('id','topfaqs_tile');

    // Add a class and an id to the wh_tile_shortdesc
    $('a:contains("Important Message")').closest('.wh_tile_text').children('div.wh_tile_shortdesc').attr('id','topfaqs_shortdesc');
    
    // Create a new div for the Top FAQs tiles
    $('<div class=" wh_tiles_topfaqs " id=" wh_tiles_topfaqs "></div>').insertAfter('#main_tiles');
    // Move the Top FAQs tile to the new div
    $('#topfaqs_tile').appendTo('.wh_tiles_topfaqs');
    // Remove wh_content_flex_container class from parent div
    $('a:contains("Important Message")').closest('.container').attr('id','main_container').css('display','flex');
    $('a:contains("Important Message")').closest('div#main_container').removeClass('wh_content_flex_container');
    // Format the Top FAQs tiles
    $('a:contains("Important Message")').closest('a').css({color: '#ffffff'});
    $('.wh_tile_text').children('wh_tile_shortdesc').css('color', '#ffffff !important'); 
}
