function SetHandlers()
{
    var all = g('name_lib').getElementsByTagName('*');
    for (i = 0; i < all.length; i++)
    {
        switch (all[i].className)
        {
            case 'onom_block':
                all[i].onmouseover = function() { this.id = 'sel_block'; }
                all[i].onmouseout = function() { this.id = ''; }
            break;

            case 'part_w':
                all[i].onmouseover = function() { this.id = 'sel_part'; }
                all[i].onmouseout = function() { this.id = ''; }
            break;

            case 'a_part':
                all[i].onmouseover = function() { this.parentNode.id = 'a_span'; }
                all[i].onmouseout = function() { this.parentNode.id = ''; }
            break;

            case 'd_part':
                all[i].onmouseover = function() { this.parentNode.id = 'd_span'; }
                all[i].onmouseout = function() { this.parentNode.id = ''; }
            break;

            case 'a_block':
                all[i].onmouseover = function() { this.parentNode.parentNode.id = 'a_span'; }
                all[i].onmouseout = function() { this.parentNode.parentNode.id = ''; }
            break;

            case 'd_block':
                all[i].onmouseover = function() { this.parentNode.parentNode.id = 'd_span'; }
                all[i].onmouseout = function() { this.parentNode.parentNode.id = ''; }
            break;
        }
    }
}

function Mark(field_id, agree)
{	JsHttpRequest.query("/ajax.php?action=onom_names&id=" + field_id + "&agree=" + agree,
		{},
        function( res, err ) {
            if( res.success ) {            	field_id = new String(field_id);
            	var ids = field_id.split(',');
            	colors = Array(); colors[-1] = 'maroon'; colors[1] = 'green';
            	for (var i = 0; i < ids.length; i++)
            	{            		g('on' + ids[i]).style.borderBottom = '1px solid ' + colors[agree];
            	}
            }
		},
		true
	);
}