//code
var C_COMMENT_PAGE = "/_layouts/aq/forms/ACMS/Comments/DocumentCommentsFrame.aspx";


function OpenComments(lid, did)
{
    window.open(AQ_WEB_URL + C_COMMENT_PAGE + "?lid=" + lid + "&did=" + did,
             "documentComments", 
             "height=500,width=600,menubar=0,status=0,scrollbars=1,resizable=1,toolbar=0");
    return false;
}

function ProcessEco(item, name)
{
    if(item.title != "")
        return;
                
    if(name.substring(0,1) != "[")
        return;

    var ce = 3;
    if(name.substring(3,4) != "]")
        ce = 4;

    var cc = name.substring(1,ce);
    var cn = GetFullCountryName(cc);
   
   
    if(cn != cc)
    {
        item.title = cn + " - " + name.substring(5);
    }
    
    return false;
}


function GetFullCountryName(code)
{

switch(code)
{
case "AUS": return "Australia";
case "BD": return "Brunei Darussalam";
case "CDA": return "Canada";
case "CHL": return "Chile";
case "PRC": return "People’s Republic of China";
case "HKC": return "Hong Kong, China";
case "INA": return "Indonesia";
case "JPN": return "Japan";
case "ROK": return "Republic of Korea";
case "MAS": return "Malaysia";
case "MEX": return "Mexico";
case "NZ": return "New Zealand";
case "PNG": return "Papua New Guinea";
case "PE": return "Peru";
case "RP": return "The Republic of the Philippines";
case "RUS": return "The Russian Federation";
case "SIN": return "Singapore";
case "CT": return "Chinese Taipei";
case "THA": return "Thailand";
case "USA": return "United States";
case "VN": return "Viet Nam";
case "SEC": return "APEC Secretariat";
case "GST": return "Guest";
case "OBS": return "Observer";
default: return code;
}

}
