﻿Path= "GIF/"; //画像ファイルの有るパス
 //Path= "GIF/";
 ToneFile= "on"; //銀河の音程ファイル名
 ToneExt = ".gif"; //ファイル拡張子
 TonePage= ".htm"; //銀河の音程info Page
 SealFile= "mon"; //太陽の紋章ファイル名
 SealExt = ".gif"; //ファイル拡張子
 SealPage= ".htm"; //太陽の紋章info Page
 
 var Year=0; //Ｄ年月日
 var Moon=0;
 var Day =0;
 var Gyear; //Ｇ年月日
 var Gmonth;
 var Gdate;
 var FR; //フレームネーム保持
 var gGuide; //導くもの:ガイド

//色の表示（中文）
COLOR_J = new Array("","紅色","白色","藍色","黃色");
function ColorJ(color){
 FR.document.write(COLOR_J[color]);
}

//色の表示（英語）
COLOR_E = new Array("","Red","White","Blue","Yellow");
function ColorE(color){
 FR.document.write(COLOR_E[color]);
}

//音程（中文）
TONE_J = new Array("",
 "磁性的","月亮的","電力的","自我存在的","泛音的",
 "韻律的","共鳴的","星系的","太陽的","行星的",
 "光譜的","水晶的","宇宙的");
function ToneJ(tone){
 FR.document.write(TONE_J[tone]);
}

//音程（英語）
TONE_E = new Array("",
 "Magnetic","Lunar","Electric","Self-Existing","Overtone",
 "Rhythmic","Resonant","Galactic","Solar","Planetary",
 "Spectral","Crystal","Cosmic");
function ToneE(tone){
 FR.document.write(TONE_E[tone]);
}

//音程の力（中文）
TONE_POWER_J = new Array("",
 "目的","挑戦","服務","形體","放射",
 "平等","調和","完整","意圖","顯化",
 "解放","合作","存在");

//音程の力（英語）
TONE_POWER_E = new Array("",
 "purpose","challenge","service","form","radiance",
 "equality","attunement","integrity","intention","manifestation",
 "liberation","cooperation","presence");

//音程の機能（中文）
TONE_FUNCTION_J = new Array("",
 "統一","二元化","活性化","定義","授權",
 "組織","引導","調和","脈動","完美",
 "溶解","奉獻","包容");

//音程の機能（英語）
TONE_FUNCTION_E = new Array("",
 "unify","polarize","activate","define","empower",
 "organize","channel","harmonize","pulse","perfect",
 "dissolve","dedicate","endure");

//音程の行為（日本語）
TONE_ACTION_J = new Array("",
 "吸引","穩定","結合","測量","命令",
 "平衡","啟發","塑造","實現","產生",
 "釋放","普遍化","超越");

//音程の行為（英語）
TONE_ACTION_E_ING = new Array("",
 "Attracting","Stabilizing","Bonding","Measuring","Commanding",
 "Balancing","Inspiring","Modeling","Realizing","Producing",
 "Releasing","Universalizing","Transcending");

//紋章（日本語）
SEAL_J = new Array("",
 "龍","風","夜","種籽","蛇",
 "世界橋樑","手","星","月","狗",
 "猴","人","天行者","魔術師","鷹",
 "戦士","地球","鏡","風暴","太陽");
function SealJ(seal){
 FR.document.write(SEAL_J[seal]);
}

//紋章（英語）
SEAL_E = new Array("",
 "Dragon","Wind","Night","Seed","Serpent",
 "World-Bridger","Hand","Star","Moon","Dog",
 "Monkey","Human","Skywalker","Wizard","Eagle",
 "Warrior","Earth","Mirror","Storm","Sun");
function SealE(seal){
 FR.document.write(SEAL_E[seal]);
}

//紋章の行為（日本語）
SEAL_ACTION_J = new Array("",
 "滋養","傳達","夢想","設定目標","生存",
 "使平等","知曉","美化","淨化","愛",
 "遊戲","影響","探索","魅惑","創造",
 "質問","進化","反映","催化","啟示");  //啓示す

//紋章の行為（英語）
SEAL_ACTION_E = new Array("",
 "nurture","communicate","dream","target","survive",
 "equalize","know","beautify","purify","love",
 "play","influence","explore","enchant","create",
 "question","evolve","reflect","catalyze","enlighten");

//紋章の力（日本語）
SEAL_POWER_J = new Array("",
 "誕生","靈","豊盛","開花","生命力",
 "死","實現","優雅","宇宙的水","心",
 "魔法","自由意志","空間","永恆","視野",
 "智能","導航","無限","自生","宇宙的火");
function SealPowerJ(seal){
 FR.document.write(SEAL_POWER_J[seal]);
}

//紋章の力（英語）
SEAL_POWER_E = new Array("",
 "birth","spirit","abundance","flowering","life force",
 "death","accomplishment","elegance","universal water","heart",
 "magic","free will","space","timelessness","vision",
 "intelligence","navigation","endlessness","self-generation",
 "universal fire");

//紋章を司どる（日本語）
SEAL_CONDUCT_J = new Array("",
 "存在","呼吸","直覺","覺知","本能",
 "機會","治癒","藝術","流動","忠誠",
 "幻相","智慧","警覺","接納","心識",
 "無畏","同步性","秩序","能量","生命");

//紋章を司どる（英語）
SEAL_CONDUCT_E = new Array("",
 "being","breath","intuition","awareness","instinct",
 "opportunity","healing","art","flow","loyalty",
 "illusion","wisdom","wakefullness","receptivity","mind",
 "fearlessness","synchronicity","order","energy","life");

POLAR_J = new Array(14); //極性キン（日本語）
 POLAR_J[03]="確立";
 POLAR_J[04]="變換";
 POLAR_J[10]="擴張";
 POLAR_J[11]="輸送";

POLAR_E = new Array(14); //極性キン（英語）
 POLAR_E[ 3]="establish";
 POLAR_E[ 4]="convert";
 POLAR_E[10]="extend";
 POLAR_E[11]="transport";

//タイム・セル（日本語）
TIME_CELL_J = new Array("","輸入","保存","處理","輸出","母體");
function TimeCellJ(seal){
 var cell;
 cell= Dint(seal,4);
 FR.document.write(TIME_CELL_J[cell]);
}

//タイム・セル（英語）
TIME_CELL_E = new Array("",
 "input","store","process","output","matrix");
function TimeCellE(seal){
 var cell;
 cell= Dint(seal,4);
 FR.document.write(TIME_CELL_E[cell]);
}

//曜日の表示
YOUBI = new Array("","星期日","星期一","星期二","星期三","星期四","星期五","星期六");
function DispYoubi(Youbi){
 FR.document.write("("+YOUBI[Youbi]+")");
}

//数値の頭に０を追加して２桁化する
function ZeroHead(x){
 if(x<10){return("0"+x)}
 return(x)
}

//剰余の計算 x,y 共に正の整数
function Dmod(x,y){
 return( ((x-1)%y)+1 );
}

//intの計算
function Dint(x,y){
 return( Math.floor((x-1)/y)+1 );
}

//Ｄ暦を取得
DaddG = new Array(0,158,189,217,248,278,309,0,5,36,66,97,127);
function DfromG(y,m,d){
 var sum;
 Year=y;
 sum=DaddG[m]+d;
 if(m<=6){ Year--; }

 if(m==7){
   if(d<26){
     sum=339+d;
     Year--;
   }else{
     sum=d-26;
   }
 }
 sum++;
 Moon= Dint(sum,28);
 Day = Dmod(sum,28);
}

//KINを取得
function KINfromD(y,m,d){
 sum= ((y-1900)*365)+((m-1)*28)+d+258;
 kin= Dmod(sum,260);
 return(kin);
}

//ＫＩＮより情報取得
function GetCTSfromKIN(Kin){
 color=Dmod(Kin,4);  //色
 tone =Dmod(Kin,13); //音程
 seal =Dmod(Kin,20); //紋章

 gGuide=((tone-1)*12)+seal; //導くもの
 gGuide=Dmod(gGuide,20);
}

//銀河の署名（日本語）
function GalacticSignatureJ(){
 GetCTSfromKIN(kin);
 ColorJ(color);
 ToneJ(tone);
 SealJ(seal);
}

//銀河の署名（英語）
function GalacticSignatureE(){
 GetCTSfromKIN(kin);
 ColorE(color); FR.document.write(" ");
 ToneE(tone); FR.document.write(" ");
 SealE(seal);
}

//絵文字の署名
function Griph(){
 GetCTSfromKIN(kin);

 FR.document.write("<br><TABLE cellpadding=10 bgcolor=#FFFFFF><TD ALIGN=CENTER>");
// FR.document.write("<IMG SRC='"+Path+SealFile+ZeroHead(seal)+SealExt+"'>");
 FR.document.write("<a href='"+SealFile+ZeroHead(seal)+SealPage+"'><IMG SRC='"+Path+SealFile+ZeroHead(seal)+SealExt+"' border=0></a>");
 FR.document.write("<BR>");
// FR.document.write("<IMG SRC='"+Path+ToneFile+ZeroHead(tone)+ToneExt+"'>");
 FR.document.write("<a href='"+ToneFile+ZeroHead(tone)+TonePage+"'><IMG SRC='"+Path+ToneFile+ZeroHead(tone)+ToneExt+"' border=0></a>");
 FR.document.write("</TD><TD>");
}

//銀河の署名
function GaracticSignetureUnit(){
 Griph();   //絵文字での署名
 FR.document.write("星系印記<br>");
 FR.document.write("<FONT SIZE=5><b><font color=#000000>◎KIN"+kin+"<BR>");
 GalacticSignatureJ();  //日本語での署名

 FR.document.write("<BR>(");
 GalacticSignatureE();  // 英語 での署名
 FR.document.write(")</b></FONT></font>");
 FR.document.write("</TD></TABLE><br>");
}

//１３の月の暦
function ThirteenMoon(){
 KINfromD(Year,1,1);
 FR.document.write("◆ ");
 GalacticSignatureJ(kin);
 FR.document.write("年　");

 if(Moon==14){
  FR.document.write("綠色日：銀河自由日<BR>");
 }else{
  ToneJ(Moon);
  FR.document.write("月"+"　"+Day+"日");
  Youbi= Dmod(Day,7);
  DispYoubi(Youbi);
  FR.document.write(" ◆<BR>");
 }
}

//キンの書（日本語）
function BookOfKinJ(){
 FR.document.write("我為了"+SEAL_ACTION_J[seal]); //１行目
 FR.document.write("而"+TONE_FUNCTION_J[tone]+"<BR>");

 FR.document.write("將"+SEAL_CONDUCT_J[seal]); //２行目
 FR.document.write(TONE_ACTION_J[tone]+"的同時<BR>");

 FR.document.write("我封印起"+SEAL_POWER_J[seal]+"的"); //３行目
 TimeCellJ(seal);
 FR.document.write("<BR>");

 FR.document.write("藉由"+TONE_POWER_J[tone]+"的"); //４行目
 FR.document.write(TONE_J[tone]+"音調<BR>");

 FR.document.write("我被"); //５行目
 if(seal==gGuide){
  FR.document.write("自身雙重");
 }else{
  SealPowerJ(gGuide);
 }
 FR.document.write("的力量所引導<BR>");

 if(PolarCheck(tone,seal)){ //６行目
  FR.document.write("我是極性KIN　我將"+COLOR_J[color]);
  FR.document.write("銀河光譜");
  FR.document.write(POLAR_J[tone]+"<BR>");
 }

 if(GapCheck(kin)){ //７行目
  FR.document.write("進入我　我是銀河的活性化的正門<BR>");
 }
}

//キンの書（英語）
function BookOfKinE(){
 FR.document.write("Ｉ "+TONE_FUNCTION_E[tone]); //1Line
 FR.document.write(" in order to "+SEAL_ACTION_E[seal]+"<BR>");

 FR.document.write(TONE_ACTION_E_ING[tone]+" "); //2Line
 FR.document.write(SEAL_CONDUCT_E[seal]+"<BR>");

 FR.document.write("Ｉ seal the "); //3Line
 TimeCellE(seal);
 FR.document.write(" of "+SEAL_POWER_E[seal]+"<BR>");

 FR.document.write("With the "+TONE_E[tone]); //4Line
 FR.document.write(" tone of "+TONE_POWER_E[tone]+"<BR>");

 FR.document.write("I am guided by "); //5Line
 if(seal==gGuide){
  FR.document.write("my own power doubled<BR>");
 }else{
  FR.document.write("the power of "+SEAL_POWER_E[gGuide]+"<BR>");
 }

 if(PolarCheck(tone,seal)){ //6Line
  FR.document.write("I am a polar kin-I ");
  FR.document.write(POLAR_E[tone]+" the ");
  FR.document.write(COLOR_E[color]+" galactic spectrum<BR>");
 }

 if(GapCheck(kin)){ //7Line
  FR.document.write("I am a galactic activation portal-enter me<BR>");
 }
}

//極性キンの判定
function PolarCheck(tone,seal){
 var r;
 r=Dmod(seal,5);
 if(r!=5){ return(false); }
 if((tone==3)||(tone==4)||(tone==10)||(tone==11)){
  return(true);
 }
 return(false);
}

//ＧＡＰキンの判定
GAP_KIN=new Array(1,22,43,50,64,69,85,88,106,107,108,109,110);
function GapCheck(Kin){
 var r=false,s,j;
 if(Kin>130){ Kin=261-Kin;}
 s=Dmod(Kin,20);
 if(s>10){ j=Dint(Kin,20)*20; Kin=j-s+1;}
 for(var n in GAP_KIN){
  if(Kin==GAP_KIN[n]){ r=true; break; }
 }
 return(r);
}

//キンの書
function BookOfKinSet(){
 FR.document.write('<FONT size="+1">【KIN文書】</FONT>');

 FR.document.write("<BR>");
 BookOfKinJ();
 FR.document.write("<BR>");
 FR.document.write('<FONT size="+1">【BOOK of KIN】</FONT>');
 FR.document.write("<BR>");
 BookOfKinE();

}

//一日の情報
function OneDay(){
 Gset();

 DfromG(Gyear,Gmonth,Gdate);
 ThirteenMoon(); //１３の月

 KINfromD(Year,Moon,Day);
 GaracticSignetureUnit(); //銀河の署名

 BookOfKinSet();
}

//<HR>タグ
function Hr(){
 FR.document.write('<HR width="90%" size=1>');
}

//タイトル
function Title(){
 FR=f1;
 FR.document.open();
 FR.document.write("<HTML>");
 FR.document.write("<HEAD>");
 FR.document.write("<TITLE>Dream Spell Ver.Chinese</TITLE>");
 FR.document.write('<BODY  bgcolor="#F5F5DC" text="#303d4b" link="#fdb0e6" vlink="#d0beae" alink="#0000ff" oncontextmenu="return false" ondragstart="return false">');
 FR.document.write("<CENTER><B>");
 FR.document.write('<FONT FACE="">');
// FR.document.write("<H1>～　Dream Spell　～</H1>");
}

//HTMLエンディング
function Ending(){
 FR.document.write("<TABLE><TD><font size=1>Dreamspell Information©1990 Jos&eacute; and Lloydine Arg&uuml;elles<BR>");
 FR.document.write("Chinese Translation©2008 MikeyPan：Red Self-Existing Serpent</font></TD></TABLE>");
 FR.document.write("</FONT></B></CENTER></BODY></HTML>");
 FR.document.close();
}

//最初の計算
function FirstCalc(){
 now= new Date();  // 今日のＧ日付取得
 Gyear = now.getFullYear();
 Gmonth= now.getMonth()+1;
 Gdate = now.getDate();
}

//再計算
function ReCalc(){
 Gyear = eval(document.Gday.GYear.value);
 Gmonth= eval(document.Gday.GMonth.value);
 Gdate = eval(document.Gday.GDate.value);
}

//今日に戻る
function RetToday(){
 First= true;
 Main();
}

//Ｇ暦を入力フォームにセットする
function Gset(){
 document.Gday.GYear.value =Gyear;
 document.Gday.GMonth.value=Gmonth;
 document.Gday.GDate.value =Gdate;
}

//メインルーチン
function Main(){
 Title();
// Hr();
 if(First==true){
  FirstCalc();
  First= false;
 }else{
  ReCalc();
 }
 OneDay();
 Hr();
 Ending();
}
 //scripted v6 By たろぴ：黄色い磁気の人(Yellow Magnetic Human)
