﻿function addRingToWishList(oSrcElement, iRingId, sRootUrl){
    add_AddToWishList(sRootUrl + '/AJAXCallListener.aspx', iRingId);
}

function getDesignerBioAndHeroImage(oSrcElement, iDesignerId, sRootUrl){    
    oSrcElement.className='designerItemActive';
    get_DesignerBioAndHeroImage(sRootUrl + '/AJAXCallListener.aspx', iDesignerId);
}

function makeDesignerNameInActive(oSrcElement){
    oSrcElement.className='designerItem';
}

function layoutRingHomeFixup(navAreaId, mainAreaId) {
    // elements used to comp
    var elmNavArea = document.getElementById(navAreaId);                
    var elmMainArea = document.getElementById(mainAreaId);
    
    var iContentAreaHeight = elmMainArea.offsetHeight;
    
    if(elmNavArea.offsetHeight < iContentAreaHeight)
    {
        // need to increase the nav area height
        elmNavArea.style.height = 'auto';
        elmNavArea.style.height = iContentAreaHeight + "px";
    }
    if(elmNavArea.offsetHeight > iContentAreaHeight)
    {
        // need to increase the main area height
        var iMainAreaHeightRequirements = elmNavArea.offsetHeight;
        elmMainArea.style.height = 'auto';
        elmMainArea.style.height = iMainAreaHeightRequirements + "px";
    }
}

function layoutNoFeatureAreaFixup(navAreaId, mainAreaId) {
    
    // elements used to comp
    var elmNavArea = document.getElementById(navAreaId);                
    var elmMainArea = document.getElementById(mainAreaId);
    
    var iContentAreaHeight = elmMainArea.offsetHeight;
    
    if(elmNavArea.offsetHeight < iContentAreaHeight)
    {
        // need to increase the nav area height
        elmNavArea.style.height = 'auto';
        elmNavArea.style.height = iContentAreaHeight + "px";
    }
    if(elmNavArea.offsetHeight > iContentAreaHeight)
    {
        // need to increase the main area height
        var iMainAreaHeightRequirements = elmNavArea.offsetHeight;
        elmMainArea.style.height = 'auto';
        elmMainArea.style.height = iMainAreaHeightRequirements + "px";
    }
}

function layoutFixup(navAreaId, mainAreaId, delimAreaId, featureAreaId) {
    // elements used to comp
    var elmNavArea = document.getElementById(navAreaId);                
    var elmMainArea = document.getElementById(mainAreaId);
    var elmDelimArea = document.getElementById(delimAreaId);
    var elmFeatureArea = document.getElementById(featureAreaId);
    
    var iContentAreaHeight = elmMainArea.offsetHeight + elmFeatureArea.offsetHeight + elmDelimArea.offsetHeight;
    
    if(elmNavArea.offsetHeight < iContentAreaHeight)
    {
        // need to increase the nav area height
        elmNavArea.style.height = 'auto';
        elmNavArea.style.height = iContentAreaHeight + "px";
    }
    if(elmNavArea.offsetHeight > iContentAreaHeight)
    {
        // need to increase the feature area height
        var iFeatureAreaHeightRequirements = elmNavArea.offsetHeight - (elmMainArea.offsetHeight + elmDelimArea.offsetHeight);
        elmFeatureArea.style.height = 'auto';
        elmFeatureArea.style.height = iFeatureAreaHeightRequirements + "px";
    }
}

