//console.log("top of file")
var currentHostname = location.hostname;
var resPrefix = ( ( (currentHostname.substring(0,3) == 'wcm') || (currentHostname.substring(2,5) == 'wcm') || (currentHostname.substring(0,5) == 'belsr') ) ? "/sites/sdc" : "" );

function SwitchSection(imgPath,sectionId){
    //console.log("entering SwitchSection(imgPath => %s,sectionId => %s)",imgPath,sectionId);
    if (document.getElementById){
        //switch image at top of div
        var myimg = document.getElementById("SC_SectionTitle");
        //console.info("myimg => %o",myimg);
        var newImgPath = resPrefix + "/support/secure_channel_files/" + imgPath;
        //console.info("newImgPath => %s",newImgPath);
        myimg.src = newImgPath;
        //toggle all divs off
        var scsection = document.getElementById("SC_section");
        //console.info("scsection => %o",scsection);
        var scsectiondoms = scsection.getElementsByTagName("div");
        //console.info("scsectiondoms => %o",scsectiondoms);
        for (i=0;i<scsectiondoms.length;i++){
            scsectiondoms[i].style.display = "none";
        }
        //toggle "active" div on
        var mysection = document.getElementById(sectionId);
        //console.info("mysection => %o",mysection);
        mysection.style.display = "block";
    }
}

