/* OSの判定 */

function Jump_Index2(){

	/* iPhoneの場合 */
	if (navigator.userAgent.indexOf("iPhone") != -1 ){		
	location.href="index2.html";

        } else if(navigator.userAgent.indexOf("Android") != -1 ){
	location.href="index2.html";

	} else {

	}

}

/* レイアウト枠（レイヤー）を表示/非表示にする  */
function toggleMenu(){

	divnam1 = "news"; 
	divnam2 = "nav"; 
	divnam3 = "upd"; 
	divnam4 = "calender"; 

	vflg = document.getElementById(divnam1).style.visibility;

	if (vflg == 'hidden'){ 

		document.getElementById(divnam1).style.visibility = 'visible';
		document.getElementById(divnam2).style.visibility = 'visible';
		document.getElementById(divnam3).style.visibility = 'visible';
		document.getElementById(divnam4).style.visibility = 'hidden';

	}else{

		document.getElementById(divnam1).style.visibility = 'hidden';
		document.getElementById(divnam2).style.visibility = 'hidden';
		document.getElementById(divnam3).style.visibility = 'hidden';
		document.getElementById(divnam4).style.visibility = 'visible';

	}

}

/* カレンダー  */
function calender2(){
	var date=new Date();
	var Monthdays=new Array(31,28,31,30,31,30,31,31,30,31,30,31);
	var Days=new Array("<FONT size=5 COLOR=red>日</FONT>",
		"<FONT size=5 COLOR=black>月</FONT>",
		"<FONT size=5 COLOR=black>火</FONT>",
		"<FONT size=5 COLOR=black>水</FONT>",
		"<FONT size=5 COLOR=black>木</FONT>",
		"<FONT size=5 COLOR=black>金</FONT>",
		"<FONT size=5 COLOR=blue>土</FONT>");
	year=date.getYear();
	today=date.getDate();
	// 年、うるう年の設定
	if(year<2000){year=year+1900;}
	if(((year%4==0)&&(year%100!=0))||(year%400==0)){
		Monthdays[1]=29;
	}
	thisMonthDays=Monthdays[date.getMonth()];
	date.setDate(1);
	Startday=date.getDay();
	// 年・月表示
	document.write("<Table Border=1>");
	document.write("<TR><TH Colspan=7><FONT size=5>");
	document.write(year,'年',date.getMonth()+1,'月');
	document.write("</FONT></TH></TR>");
	// 曜日の表示
	document.write("<TR>");
	for(i=0;i<7;i++){
		document.write("<TH>",Days[i],"</TH>");
	}
	document.write("</TR>")
	// 日にちの表示
	document.write("<TR>");
	col=0;
	for(i=0;i<Startday;i++){
		document.write("<TD></TD>");
		col++;
	}
	for(i=1;i<=thisMonthDays;i++){
		document.write("<TD ALIGN=Right>");
		document.write("<A href='http://ja.wikipedia.org/wiki/");

		document.write(date.getMonth()+1);
		document.write("%E6%9C%88");
		document.write(i);
		document.write("%E6%97%A5");
		document.write("' target='_blank'>");
		if(i==today){
			document.write("<Font size=5 Color=black><B>");
		}
		else if(col==0){
			document.write("<Font size=5 Color=red><B>");
		}
		else if(col==6){
			document.write("<Font size=5 Color=blue><B>");
		}
		else {
			document.write("<Font size=5<B>");
		}
		document.write(i);
		if(i==today){
			document.write("</B></Font>");
		}
		else if(col==0){
			document.write("</B></Font>");
		}
		else if(col==6){
			document.write("</B></Font>");
		}
		else {
			document.write("</Font>");
		}
		document.write("</TD>");
		col++;
		if(col==7){
			document.write("</TR>\n<TR>");
			col=0;
		}
	}
	document.write("</Table>");
}

