window.onload = function() {
    if (navigator.userAgent.indexOf("Opera 8.5") > 1) {
        document.getElementById('r_form').style.marginRight = '30px';
    }
    if ((navigator.userAgent.indexOf("MSIE 6") > 1) && !(navigator.userAgent.indexOf("Opera 8.5") > 1)) {
        //var obj = document.getElementById('hat').style;
        //obj.left = '-3px';
        //obj.marginRight = '-3px';
        var obj = document.getElementById('content').style;
        obj.left = '-3px';
        obj.marginRight = '-3px';
    }

    if ((navigator.userAgent.indexOf("MSIE 6") > 1)) {
        var obj = document.getElementById('news').style;
        //obj.marginLeft = '-12px';
    }
}

function changeTxtValue(id, val) {
    var i;
    i = document.getElementById(id).value;
    i -= 0; i += val - 0; // Конвертация в int

    // пришло A => Set = B
    // пришло -A => Set to 1
    // пришло 201+ => set to 1

    if (i <= 0 || i >= 201) {
        document.getElementById(id).value = 1;
    }
    else {
        document.getElementById(id).value = i;
    }
}

function OnTextChangeTxtValidate(id) {

    var i;
    i = document.getElementById(id).value;
    i -= 0; // Конвертация в int

    if (i >= 201) {
        document.getElementById(id).value = 1;
    }

}