﻿function asComment(id) {this.id = id; this.value = '';this.defaultComment = '';  return this; };
asComment.prototype.ascmtoff = function(itemid, opt) {
    var txt = document.getElementById("txtComment_" + itemid);
    var btn = document.getElementById("btnCmt_" + itemid);
    var area = document.getElementById("ascmtarea_" + itemid);
    if (txt.value != '') { return false; };
    switch (opt) {
        case 1:
            txt.value = this.defaultComment;
            txt.rows = 1;
            txt.className = 'ascommentboxoff';
            btn.style.display = 'none';
            break;
        case 0:
            area.style.display = 'none';
            txt.value = '';


    };
};
asComment.prototype.ascmton = function(itemid) {
    var txt = document.getElementById("txtComment_" + itemid);
    var btn = document.getElementById("btnCmt_" + itemid);
    var area = document.getElementById("ascmtarea_" + itemid);
    if (area.style.display == 'none') { area.style.display = ''; };
    if (txt.value == this.defaultComment) { txt.value = ''; };
    txt.rows = 2;
    txt.className = 'ascommentbox';
    btn.style.display = '';

};
asComment.prototype.Add = function(itemid, itemtype) {
    window[this.commentSave].apply(this,arguments);
};
asComment.prototype.Delete = function(itemid, commentid) {
    window[this.commentDelete].apply(this, arguments);
};
    