function swres(select,imgid)
{
    var num = select;
    var table = document.getElementById('table_'+imgid);
    for (i=0; i < table.rows.length; i++)
    {
        if (table.rows[i].id.substr(3,1) != num && table.rows[i].id.substr(0,3) == 'res')
        {
            table.rows[i].style.display='none';
        } else {
            table.rows[i].style.display='';
        }
        if (num == 0) table.rows[i].style.display='';
    }
    $('#'+imgid).val(num);
}
function f2(x) {
    x.focus();
    x.select();
    if(window.clipboardData){ var r=clipboardData.setData('Text',x.value); return 1; }
    else return false;
};

function _alert (title,mess)
{
    if (mess) 
    {
	$('#dialog').html(mess);
    }
    $("#dialog").dialog({
        bgiframe: true,
	modal: true,
	resizable: false,
	closeOnEscape: true,
	title: title,
    	buttons: {
            Ok: function() {
                $(this).dialog('close');
		$(this).dialog('destroy');
            }
        }
    });
}