#*
 * Aipo is a groupware program developed by Aimluck,Inc.
 * Copyright (C) 2004-2011 Aimluck,Inc.
 * http://www.aipo.com
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Affero General Public License as
 * published by the Free Software Foundation, either version 3 of the
 * License, or (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Affero General Public License for more details.
 *
 * You should have received a copy of the GNU Affero General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 *#

## ---------------------------------------------------------------------------
<script language="JavaScript" type="text/javascript">
//<![CDATA[

dojo.require("aimluck.widget.Menu");

dojo.addOnLoad(function () {
    
    var subMenu =
		[
			{
                caption: "自分の記事",
                iconClass: "menuBarIconList",
				url: "$!jslink.getPortletById($!portlet.ID).addQueryData('eventSubmit_doBlog_entry_list','1')",
                submenu:
                [
				    {   caption: "自分の記事を見る", iconClass: "menuBarIconList", url: "$!jslink.getPortletById($!portlet.ID).addQueryData('eventSubmit_doBlog_entry_list','1')"    },
                    {   caption: "記事を書く", iconClass: "menuBarIconAdd", url: "javascript:aipo.common.showDialog('$!jslink.getPortletById($!portlet.ID).addQueryData("template","BlogEntryFormScreen").addQueryData("entityid","new")');"    }
                ]
            },
            {
                caption: "テーマ",
                iconClass: "menuBarIconList",
				url: "$!jslink.getPortletById($!portlet.ID).addQueryData('eventSubmit_doBlog_thema_list','1')" ,
                submenu:
                [
                    {   caption: "テーマ一覧を見る", iconClass: "menuBarIconList", url: "$!jslink.getPortletById($!portlet.ID).addQueryData('eventSubmit_doBlog_thema_list','1')"    },
                    {   caption: "テーマを追加する", iconClass: "menuBarIconAdd" , url: "javascript:aipo.common.showDialog('$!jslink.getPortletById($!portlet.ID).addQueryData("template","BlogThemaFormScreen").addQueryData("entityid","new")');"},
					{},
					{   caption: "共通テーマ一覧を見る", iconClass: "menuBarIconList", iconSrc:"images/blog/blog_common.gif", url: "$!jslink.getPortletById($!portlet.ID).addQueryData('eventSubmit_doBlog_common_thema_list','1')"    }
                ]
            },
            {   caption: "みんなの記事を見る", iconClass: "menuBarIconList", iconSrc2:"images/blog/blog_all.gif", url: "$!jslink.getPortletById($!portlet.ID).addQueryData('eventSubmit_doBlog_group_list','1')"    },
            {   caption: "最新の記事を見る", iconClass: "menuBarIconList", iconSrc2:"images/blog/blog_latest.gif", url: "$!jslink.getPortletById($!portlet.ID).addQueryData('eventSubmit_doBlog_entry_list_latest','1')" },
            {   caption: "記事を検索する", iconClass: "menuBarIconList", url: "$!jslink.getPortletById($!portlet.ID).addQueryData('eventSubmit_doBlog_search_list','1')"    },
			{   caption: "共通テーマ一覧を見る", iconClass: "menuBarIconList", iconSrc:"images/blog/blog_common.gif", url: "$!jslink.getPortletById($!portlet.ID).addQueryData('eventSubmit_doBlog_common_thema_list','1')"    }
		];
		
		if(aipo.blog.menuSelected == "undefined"){
		  aipo.blog.menuSelected = -1;  
		}
        var menubar = new aimluck.widget.Menubar({id: "mbar", items: subMenu, selectedIndex:aipo.blog.menuSelected}, "portletMenu");
});

//]]>
</script> 
