﻿function myDrawFunction(x_1,x_2,x_3,x_4,x_5,x_6)
{
 
  //i = Math.floor(Math.random()*7); //乱数　0-6
  my_sec++;
  if (my_sec > 5) {
	my_sec = 1;
	my_i++;
	if (my_i > 6) {
		my_i = 0;
	}
  }

  if (my_i == 0) 	{
	//jg.clear();
	p_1="木";p_2="火";p_3="土";p_4="金";p_5="水";p_6="五行";
  }
  else if (my_i == 1) {p_1="東";p_2="南";p_3="央";p_4="西";p_5="北";p_6="五方";}
  else if (my_i == 2) {p_1="春";p_2="夏";p_3="土";p_4="秋";p_5="冬";p_6="五季";}
  else if (my_i == 3) {p_1="青";p_2="赤";p_3="黄";p_4="白";p_5="黒";p_6="五色";}
  else if (my_i == 4) {p_1="財";p_2="色";p_3="食";p_4="名";p_5="睡";p_6="五欲";}
  else if (my_i == 5) {p_1="目";p_2="舌";p_3="口";p_4="鼻";p_5="耳";p_6="五官";}
  else if (my_i == 6) {p_1="爪";p_2="毛";p_3="乳";p_4="息";p_5="髪";p_6="五支";}

  if (my_sec == 1) {
	 jg.setColor("#F0E7FF");
  	 jg.fillRect(0, 0, 90, 90);//四角(左上x,左上y,横,縦)

	 jg.setColor("maroon"); //円
	 jg.drawEllipse(15, 15, 60, 60); //円塗co-ordinates related to the document(左上x,左上y,横直径,縦直径)

	 jg.setColor("blue"); // 青
	 jg.fillEllipse(45-15, 0, 30, 30); //円塗り co-ordinates related to the document(左上x,左上y,横直径,縦直径)

	 jg.setColor("red"); // 赤
	 jg.fillEllipse(90-30, 45-20, 30, 30); //円塗り co-ordinates related to the document(左上x,左上y,横直径,縦直径)

	 jg.setColor("yellow"); // 黄
	 jg.fillEllipse(90-40, 90-30, 30, 30); //円塗り co-ordinates related to the document(左上x,左上y,横直径,縦直径)

	 jg.setColor("white"); // 白
	 jg.fillEllipse(0+10, 90-30, 30, 30); //円塗り co-ordinates related to the document(左上x,左上y,横直径,縦直径)

	 jg.setColor("black"); // 黒
	 jg.fillEllipse(0, 45-20, 30, 30); //円塗り co-ordinates related to the document(左上x,左上y,横直径,縦直径)


  }
  if (my_sec == 1) {
	 jg.setFont("arial","15px",Font.BOLD); 

	 jg.setColor("white"); //木
	 jg.drawString(p_1,45-15+7, 0+7); 

	 jg.setColor("white"); //火
	 jg.drawString(p_2,90-30+7, 45-20+7); 

	 jg.setColor("black"); //土
	 jg.drawString(p_3,90-40+7, 90-30+7); 

	 jg.setColor("black"); //金
	 jg.drawString(p_4,0+10+7, 90-30+7); 

	 jg.setColor("white"); //水
	 jg.drawString(p_5,0+7, 45-20+7); 

	 jg.setColor("black"); //五行
	 jg.drawString(p_6,45-15, 45-5); 

	 new Effect.Appear('myCanvas');
	 jg.paint(); // draws, in this case, directly into the document
  }

  //if (my_i == 0) {new Effect.Appear('myCanvas');}
  //if (my_sec == 5) {new Effect.Fade('myCanvas');}	

}

var jg = new jsGraphics("myCanvas");
my_i=0;
my_sec=0;
myDrawFunction('木','火','土','金','水','五行');


setInterval("myDrawFunction('木','火','土','金','水','五行')",1000);


