/*Назначает класс элемента*/
function setElemClass (elemId, elemClass) {
    var elem;
    if (document.getElementById) // this is the way the standards work
        elem = document.getElementById(elemId);
    else if (document.all) // this is the way old msie versions work
        elem = document.all[elemId];
    else if (document.layers) // this is the way nn4 works
        elem = document.layers[elemId];
    elem.className = elemClass;
}

/*Назначает класс массива элементов*/
function setElemsClass (elemIds, elemClass) {
var i;
    for (i=0; i < elemIds.length; i++) {
      setElemClass(elemIds[i], elemClass);
    }
}

/*Назначает атрибут "display" элемента*/
function setElemDisplay (elemId, elemDisplay) {
    var elem;
    if (document.getElementById) // this is the way the standards work
        elem = document.getElementById(elemId);
    else if (document.all) // this is the way old msie versions work
        elem = document.all[elemId];
    else if (document.layers) // this is the way nn4 works
        elem = document.layers[elemId];
    elem.style.display = elemDisplay;
}

/*Назначает атрибут "display" массива элементов*/
function setElemsDisplay (elemIds, elemDisplay) {
var i;
    for (i=0; i < elemIds.length; i++) {
      setElemDisplay(elemIds[i], elemDisplay);
    }
}


/* Запрещает выделение текста в элементе*/
function disableSelection(element) {
    element.onselectstart = function() {
        return false;
    };
    element.unselectable = "on";
    element.style.MozUserSelect = "none";
    element.style.cursor = "default";
}