﻿//Change the Sitefinity default logo with one more nice in the Sitefinity community edition
//id = id (string) of the paragraph that contains the Sitefinity logo to change. Usually is this: ctl00_sitefinityLogo
//isBackgroundBlack = if set to true it means that the background color in the page is dark else that is light
//url = the application url of your application
function ChangeSitefinityLogo(id, isBackgroundBlack, url) {

    var pathLight = url + "Images/PB_sitefinity97x20pix_DB.png"; 
    var pathDark = url + 'Images/PB_sitefinity97x20pix_WB.png';
    
    var htmlLight = "<br/><a href='http://www.sitefinity.com' target='_blank' title='Telerik Sitefinity CMS'><img src='" + pathLight + "' style='border: 0px none!important' /></a>";
    var htmlDark = "<br/><a href='http://www.sitefinity.com' target='_blank' title='Telerik Sitefinity CMS'><img src='" + pathDark + "' style='border: 0px none!important' /></a>";
    if (id != null && isBackgroundBlack != null) {
        var sl = document.getElementById(id);
        sl.removeChild(sl.childNodes[0]);
        if (isBackgroundBlack)
            sl.innerHTML = htmlLight;
        else
            sl.innerHTML = htmlDark;
    }
}
