var csInterface = new CSInterface();

//var flyoutMenueXmlStr = '<Menu><MenuItem Id="menuItemPrefs" Label="Preferences" Enabled="true" Checked="false"/><MenuItem Id="menuItemHelp" Label="Help" Enabled="true" Checked="false"/><MenuItem Id="menuItemAbout" Label="About" Enabled="true" Checked="false"/></Menu>'
var flyoutMenueXmlStr = '<MenuItem Id="menuItemProjects" Label="Projects" Enabled="true" Checked="false"/>'
var flyoutMenueCallback = function(event){
    /*if(event.data.menuId == "menuItemPrefs"){
        openPrefsExtension();
    }*/
    if(event.data.menuId == "menuItemProjects"){
        dlg_projects();
    }
}
//csInterface.setPanelFlyoutMenu(flyoutMenueXmlStr);
//csInterface.addEventListener("com.adobe.csxs.events.flyoutMenuClicked", flyoutMenueCallback);

var contextMenueXmlStr = '<Menu><MenuItem Id="menuItemProjects" Label="Projects" Enabled="true" Checked="false"/><MenuItem Id="menuItemPrefs" Label="Preferences" Enabled="true" Checked="false"/><MenuItem Id="menuItemHelp" Label="Help" Enabled="true" Checked="false"/></Menu>'
            
csInterface.setContextMenu(contextMenueXmlStr, function(menuId){
    if(menuId == "menuItemProjects"){
        dlg_projects();
    }
    if(menuId == "menuItemPrefs"){
        openPrefsExtension();
    }
    if(menuId == "menuItemHelp"){
        openHelpExtension();
    }
});

