﻿function borderedPanel_SetWidth(controlId, width)
{
    var control = document.getElementById(controlId);
    var fixedWidth = control.attributes["borderFixedWidth"].value;
    var innerSize = (width - (fixedWidth * 2)) + "px";
    
    control.style.width = width + "px";
    
    var top = document.getElementById(controlId + "_top");
    var bottom = document.getElementById(controlId + "_bottom");
    var content = document.getElementById(controlId + "_content");
    
    top.style.width = innerSize;
    bottom.style.width = innerSize;
    content.style.width = innerSize;
}

function borderedPanel_SetHeight(controlId, height)
{
    var control = document.getElementById(controlId);
    var fixedHeight = control.attributes["borderFixedHeight"].value;
    var innerSize = (height - (fixedHeight * 2)) + "px";
    
    control.style.height = height + "px";
    
    var left = document.getElementById(controlId + "_left");
    var right = document.getElementById(controlId + "_right");
    var content = document.getElementById(controlId + "_content");
    
    left.style.height = innerSize;
    right.style.height = innerSize;
    content.style.height = innerSize;
}
