﻿function getStyle(el, styleProp) {
    var x = document.getElementById(el);
    if (x.currentStyle)
        var y = x.currentStyle[styleProp];
    else if (window.getComputedStyle)
        var y = document.defaultView.getComputedStyle(x, null).getPropertyValue(styleProp);

    y = y.replace("px", "");
    return y * 1;
}

function ExpandLeft() {
    var contentLeft = document.getElementById("content_left");
    contentLeft.style.display = 'block';
    var width = (getStyle("content_left", "width") + 30);
    if (width > 590) { width = 590; }
    contentLeft.style.width = width + "px";

    if (contentLeft.clientHeight < contentLeft.scrollHeight) {
        var height = (getStyle("content_left", "height") + 20);
        contentLeft.style.height = height + "px";
    }
    if (width != 590 || (contentLeft.clientHeight < contentLeft.scrollHeight)) {
        // setTimeout("ExpandLeft()", 50);
    }
    else {
        clearInterval(expLeft);
    }
}
function ExpandRight() {
    var contentRight = document.getElementById("content_right");
    contentRight.style.display = 'block';
    var width = (getStyle("content_right", "width") + 30);
    if (width > 590) { width = 590; }
    contentRight.style.width = width + "px";

    if (contentRight.clientHeight < contentRight.scrollHeight) {
        var height = (getStyle("content_right", "height") + 20);
        contentRight.style.height = height + "px";
    }
    if (width != 590 || (contentRight.clientHeight < contentRight.scrollHeight)) {
        //setTimeout("ExpandRight()", 50);
    }
    else {
        clearInterval(expRight);
    }
}
function CollapseLeft() {
    var contentLeft = document.getElementById("content_left");
    var width = (getStyle("content_left", "width") - 30);
    if (width < 0) { width = 0; }
    contentLeft.style.width = width + "px";

    var height = (getStyle("content_left", "height") - 20);
    if (height < 0) { height = 0; }
    contentLeft.style.height = height + "px";

    //  alert(height);

    if (width != 0) {
        //setTimeout("Collapse1()", 10);
    }
    else {
        clearInterval(colLeft);
        contentLeft.style.display = 'none';
    }
}
function CollapseRight() {
    var contentRight = document.getElementById("content_right");
    var width = (getStyle("content_right", "width") - 30);
    if (width < 0) { width = 0; }

    var height = (getStyle("content_right", "height") - 20);
    if (height < 0) { height = 0; }
    contentRight.style.height = height + "px";

    contentRight.style.width = width + "px";
    if (width != 0) {
        //setTimeout("Collapse2()", 10);
    }
    else {
        clearInterval(colRight);
        contentRight.style.display = 'none';
    }
}

var colLeft = "";
var colRight = "";
var expLeft = "";
var expRight = "";