﻿function callback_Show_CompleteWord_vnh(res)
{
    if(res == null || res.value==null || res.value=="" || res =='undefined')
    {
        $get("divComplete_vnh").style.display="none";
        return;               
     }
     if(res.value!="")
     {
        if($get("divComplete_vnh")!=null)
        {
            $get("divComplete_vnh").innerHTML = res.value;     
            $get("divComplete_vnh").style.display="";        
        }
        setPosSelect();             
     }
     else
     {
        $get("divComplete_vnh").style.display="none";
     }               
}



function callback_showmean_dlg_all(res) {
    var s = "";
    var str = "";
    var str1 = "";
    mscrollbar = 0;
    var nCount = 0;    
    if(res.value!=null)
    {
        nCount = res.value.length;
    }
    for (var i = 0; i < nCount; i++) {
        if (i == 0) {
            s += "<div class=\"p5 ovf dlg_bgW\" id=\"contentdlg_" + i + "\">" + res.value[i][1] + "</div>";
        }
        else {
            s += "<div class=\"p5 ovf dlg_bgW\" id=\"contentdlg_" + i + "\" style=\"display:none;\" >" + res.value[i][1] + "</div>";
        }
        if (i == 0) {
            str1 += createNodeChoose(i, res.value[i][3], nCount);
        }
        else {
            str1 += createNodeNChoose(i, res.value[i][3], nCount);
        }
    }
    if (nCount != 0) {
        str += "<div id=\"id_dlg_dict_nut\" style=\"-moz-user-select:none;\">";
        str += "<div id=\"idscrollbar\" class=\"fl\" style=\"height:20px; padding:0px; width:305px; margin-top:3px; overflow:hidden;\">"; //scroll;hidden;
        str += "<div class=\"divinline_dlg dlgk1b \" id='td_dict' style=\"margin-left:0px;width:2000px;height:19px;\">";
        str += "<div id=\"idwtab\" class=\"fl\">" + str1 + "</div>";
        str += "</div></div>";
        str += "<div id=\"dlg_nut\" class=\"fl dlgk1b ovf\" style=\"height:19px; width:22px;margin-top:3px;\"><div id=\"dlg_nut_r\" style=\"display:none\" class=\"fr btn_scroll_right ovf\" onclick=\"dlg_right_click()\">&nbsp;</div><div id=\"dlg_nut_l\" style=\"display:none\" class=\"btn_scroll_left fr ovf\" onclick=\"dlg_left_click()\">&nbsp;</div>&nbsp;</div>";
        str += "</div>";
        document.getElementById("dlgdiv").innerHTML = (str + "<div id=\"div_dlg_nd\" class=\"dlgdiv ovf\" style=\"max-height:200px;width:325px\" onmouseup='ctrl_shift_RightClick_dlg(event);' ondblclick='DbClick_dlg(event);' oncontextmenu='return false;'>" + s + "</div>");
    }
    else {
        str = "<div class=\" m5t\"><div class=\"ft\">" + wordTemp + "</div>";
        str += "<div class=\"fc i\">Dữ liệu đang được cập nhật</div></div>";
        document.getElementById("dlgdiv").innerHTML = ("<div id=\"div_dlg_nd\" class=\"kc4f ovf\" style=\"margin-top:3px;max-height:200px;width:325px\" onmouseup='ctrl_shift_RightClick_dlg(event);' ondblclick='DbClick_dlg(event);' oncontextmenu='return false;'>" + str + "</div>");
    }
    
    if (nCount != 0) {
        if ($get("idwtab").offsetWidth > 300) {
            $get("dlg_nut_l").style.display = "";
            $get("dlg_nut_r").style.display = "";
        }
        disableSelection($get("id_dlg_dict_nut"));
    }
}
function disableSelection(target) {
    if (typeof target.onselectstart != "undefined") //IE route
        target.onselectstart = function() { return false }
    else if (typeof target.style.MozUserSelect != "undefined") //Firefox route
        target.style.MozUserSelect = "none"
    else //All other route (ie: Opera)
        target.onmousedown = function() { return false }
    target.style.cursor = "default"
}


