var CMSGlobal = new elcNavigation();

// For syndication, not used on aveda
function wsmlMakeResourceUrl(src) { return src; }

// Set the current section in the left nav.
// Assumes images are named sidenavimg_something
function cms_set_section(name) {
    var imgname = 'sidenavimg_'+name;
    var img = CMSGlobal.getItem(imgname);
    if (!img) { return; }
    CMSGlobal.setOn(imgname);
    img.isDefault = 1;
    var link = img.image.obj.parentNode;
    link.onmouseover = null;
    link.onmouseout = null;
}


// CMS fixes
function cms_fix_module_height() {
    var module = el('ModuleWrapper');
    var module_children = module.childNodes;
    var module_maxheight = 0;
    $A(module_children).each(function(child) {
        var pos = Position.cumulativeOffset(child);
        var height = pos[1] + EL.getHeight(child);
        if (height > module_maxheight) { module_maxheight = height; }
    });
    module.style.height = module_maxheight + 'px';
}
