/**
 * Klasa czakająca na rozwinięcie
 */

function WebElement(element) {

    if (!element) {
        this.elem = document.createElement('div');
    } else {
        this.elem = $el(element);
        if (!this.elem) this.elem = document.createElement(element);
    }
    if (!this.elem) alert('Problem z utworzeniem elementu');
}

WebElement.prototype.elem = null;

WebElement.prototype.readCurrentStyle = function() {

}

WebElement.prototype.setLocation = function(x, y, jm) {
    jm = jm ? jm : this.jm;
    if (x) this.elem.style.top = y + jm;
    if (y) this.elem.style.left = x + jm;
}

WebElement.prototype.setSize = function(width, height, jm) {
    jm = jm ? jm : this.jm;
    if (width) this.elem.style.width = width + jm;
    if (height) this.elem.style.height = height + jm;
}

WebElement.prototype.setBounds = function(x, y, width, height, jm) {
    jm = jm ? jm : this.jm;
    this.setLocation(x, y, jm);
    this.setSize(width, height, jm);
}

WebElement.prototype.getElement = function() {
    return this.elem;
}

WebElement.prototype.setBorder = function(width, style, color, jm) {
    jm = jm ? jm : this.jm;
    this.elem.style.borderWidth = 1 + jm;
    this.elem.style.borderColor = color;
    this.elem.style.borderStyle = style;
}


WebElement.prototype.collapse = function(on, off) {
    dtUtils.colapse(this.elem, on, off);
}


function Border(width, style, color, jm) {
    jm = jm ? jm : "px";
    this.width = width + jm;
    this.style = style;
    this.color = color;
}
