
 function writeTopNavi(mode) {
	 loginmd = myGetCookie("JMCSeq");
	 loginsid = myGetCookie("PHPSESSID");
	 if (loginmd == null || loginsid == null) {
	 	loginmd = null;
	 }
	 if (loginmd != null) {
		document.write("<font color=#ff0000>Login中!&nbsp;→</font>");
		switch (mode) {
			case "Top":
				TPath = ".";
				break;
			case "pub":
				TPath = "..";
				break;
			case "memberTop" :
				TPath = "..";
				break;
			default:
				TPath = "../..";
		}
		document.write("<a href=\"" + TPath + "/logout.php\">ログアウト</a>&nbsp;&nbsp;&nbsp;<br>");
	 }
	 if (mode == "Top") {
		 if (loginmd == null) {
		document.write("<form action=\"./MemView.php/\" method=post>");
		document.write("<input type=hidden name=Login value=\"login\">");
		document.write("<table border=0 cellpadding=0 cellspacing=0>");
//		document.write("<tr><td colspan=2 align=right>");
//		document.write("<a href=\"./SiteMap_P.html\"><img src=\"../images/toSiteMap.gif\" width=80 height=23 border=0></a>");
//		document.write("</td></tr>");
//		document.write("<tr><td colspan=2 class=LoginTitle>");
//		document.write("会員専用ページ");
//		document.write("</td></tr>");
		document.write("<tr><td align=right class=Login>会員ID&nbsp;</td><td><input type=text size=10 name=memid></td></tr>");
		document.write("<tr><td align=right class=Login>パスワード&nbsp;</td><td><input type=password size=10 name=passwd>");
		document.write("<input type=submit value=\"Login\">&nbsp;&nbsp;</td></tr>");
		document.write("<tr><td colspan=2><font size=-1 color=#ff0000>※半角・大文字でご入力下さい</font></td></tr>");
		document.write("</table></form>");
		document.write("</form>");
		 }
	 } else if (mode == "pub") {
		document.write("<a href=\"../\"><img src=\"../images/toHome.gif\" width=80 height=23 border=0></a>");
		document.write("<a href=\"../SiteMap_P.html\"><img src=\"../images/toSiteMap.gif\" width=80 height=23 border=0></a>");
	 } else if (mode == "memberTop") {
		document.write("<a href=\"../\"><img src=\"../images/toHome.gif\" width=80 height=23 border=0></a>");
	 } else {
		document.write("<a href=\"../../\"><img src=\"../../images/toHome.gif\" width=80 height=23 border=0></a>");
	 }
 }

 function weiteMainNavi(mode) {
	 loginmd = myGetCookie("JMCSeq");
	 loginsid = myGetCookie("PHPSESSID");
	 if (loginmd == null || loginsid == null) {
	 	loginmd = null;
	 }
	 switch (mode) {
	 	case "Members":
	 		CPath = "../..";
	 		break;
	 	case "ConsultantA":
	 		CPath = "../..";
	 		mode = "Consultant";
	 		break;
	 	case "CourseA":
	 		CPath = "../..";
	 		mode = "Course";
	 		break;
	 	case "MMRCA":
	 		CPath = "../..";
	 		mode = "MMRC";
	 		break;
	 	default:
	 		CPath = "..";
	 }
	 
	 if (mode == "Top") {
		 document.write("<div class=\"Navi21\"><a href=\"./Consultant/index.html\">医業経営とは</a></div>");
		 document.write("<div class=\"Navi21\"><a href=\"./Association/index.html\">協会概要</a></div>");
		 document.write("<div class=\"Navi21\"><a href=\"./Association/shibu.html\">支　部</a></div>");
		 document.write("<div class=\"Navi21\"><a href=\"./Several/wits/SemiList.php\">継続研修</a></div>");
		 document.write("<div class=\"Navi21\"><a href=\"./Convention/index.html\">コンサルタント学会</a></div>");
		 document.write("<div class=\"Navi21\"><a href=\"./Seminar/index.html\">セミナー等</a></div>");
		 document.write("<div class=\"Navi21\"><a href=\"./Several/MMRC/MonthList.php\">月刊ジャーマック</a></div>");
		 document.write("<div class=\"Navi21\"><a href=\"./Books/index.html\">書籍紹介</a></div>");
		 document.write("<div class=\"Navi21\"><a href=\"./Links/index.html\">リンク集</a></div>");
		 if (loginmd != null) {
			 document.write("<div class=\"Navi21\"><a href=\"./MemView.php/index.html\">会員ページ</a></div>");
		 }
		 return;
	 }
	 
	 if (mode == "Consultant") {
		 document.write("<div class=\"Navi22\"><a href=\"" + CPath + "/Consultant/index.html\">医業経営とは</a></div>");
	 } else {
		 document.write("<div class=\"Navi21\"><a href=\"" + CPath + "/Consultant/index.html\">医業経営とは</a></div>");
	 }
	 if (mode == "Association") {
		 document.write("<div class=\"Navi22\"><a href=\"" + CPath + "/Association/index.html\">協会概要</a></div>");
	 } else {
		 document.write("<div class=\"Navi21\"><a href=\"" + CPath + "/Association/index.html\">協会概要</a></div>");
	 }
	 if (mode == "Shibu") {
		 document.write("<div class=\"Navi22\"><a href=\"" + CPath + "/Association/shibu.html\">支部</a></div>");
	 } else {
		 document.write("<div class=\"Navi21\"><a href=\"" + CPath + "/Association/shibu.html\">支部</a></div>");
	 }
	 if (mode == "Course") {
		 document.write("<div class=\"Navi22\"><a href=\"" + CPath + "/SemiList.php\">継続研修</a></div>");
	 } else {
		 document.write("<div class=\"Navi21\"><a href=\"" + CPath + "/Several/wits/SemiList.php\">継続研修</a></div>");
	 }
	 if (mode == "Convention") {
		 document.write("<div class=\"Navi22\"><a href=\"" + CPath + "/Convention/index.html\">コンサルタント学会</a></div>");
	 } else {
		 document.write("<div class=\"Navi21\"><a href=\"" + CPath + "/Convention/index.html\">コンサルタント学会</a></div>");
	 }
	 if (mode == "Seminar") {
		 document.write("<div class=\"Navi22\"><a href=\"" + CPath + "/Seminar/index.html\">セミナー等</a></div>");
	 } else {
		 document.write("<div class=\"Navi21\"><a href=\"" + CPath + "/Seminar/index.html\">セミナー等</a></div>");
	 }
	 if (mode == "MMRC") {
		 document.write("<div class=\"Navi22\"><a href=\"" + CPath + "/Several/MMRC/MonthList.php\">月刊ジャーマック</a></div>");
	 } else {
		 document.write("<div class=\"Navi21\"><a href=\"" + CPath + "/Several/MMRC/MonthList.php\">月刊ジャーマック</a></div>");
	 }
	 if (mode == "Books") {
		 document.write("<div class=\"Navi22\"><a href=\"" + CPath + "/Books/index.html\">書籍紹介</a></div>");
	 } else {
		 document.write("<div class=\"Navi21\"><a href=\"" + CPath + "/Books/index.html\">書籍紹介</a></div>");
	 }
	 if (mode == "Links") {
		 document.write("<div class=\"Navi22\"><a href=\"" + CPath + "/Links/index.html\">リンク集</a></div>");
	 } else {
		 document.write("<div class=\"Navi21\"><a href=\"" + CPath + "/Links/index.html\">リンク集</a></div>");
	 }
	 if (loginmd != null) {
	 if (mode == "Members") {
		 document.write("<div class=\"Navi22\"><a href=\"../index.html\">会員ページ</a></div>");
	 } else {
		 document.write("<div class=\"Navi21\"><a href=\"../MemView.php/index.html\">会員ページ</a></div>");
	 }
	 }
 }

 function writeFooter(mode) {
	document.write("<div class=Footer>");
	document.write("Copyright &copy; Japan Association of Health Service Managemrnt Consultants");
	document.write("</div>");
 }
 
 function myGetCookie(myCookie){
//   myCookie = "@" + myCookie + "=";
   myCookie = myCookie + "=";
   myValue = null;
   myStr = document.cookie + ";" ;
   myOfst = myStr.indexOf(myCookie);
   if (myOfst != -1){
      myStart = myOfst + myCookie.length;
      myEnd   = myStr.indexOf(";" , myStart);
      myValue = unescape(myStr.substring(myStart,myEnd));
   }
   return myValue;
}
