var rbW = 440;
var rbH = 440;
var slp = 188;
var ssr = 192;
var ser = 212;
var sgr = 201;
var plaAr = 120;
var plaPr = 105;
var cpL1s = 35;
var cpL1e = 110;
var cpL2s = 130;
var cpL2e = 180;
var hnr = 40;
var Pcnt = 23;
var Hcx = 0;
var Hcy = 0;
var HSS = 0;
var aspNam = new Array();
aspNam[1] = new Array();
aspNam[2] = new Array();
aspNam[3] = new Array();
var aspAng = new Array();
aspAng[1] = new Array();
aspAng[2] = new Array();
aspAng[3] = new Array();
var orbAng = new Array();
orbAng[1] = new Array();
orbAng[2] = new Array();
orbAng[3] = new Array();
var aspPic = new Array();
aspPic[1] = new Array();
aspPic[2] = new Array();
aspPic[3] = new Array();
var PlanetName = new Array("太陽","月","水星","金星","火星","木星","土星","天王星","海王星","冥王星","ASC","IC","DSC","MC","龍頭","龍尾","リリス","Ep","Wp","Vt","Av","Pof","Pos");
var ZodiacName = new Array("牡羊座","牡牛座","双子座","蟹座","獅子座","乙女座","天秤座","蠍座","射手座","山羊座","水瓶座","魚座");
var CP = new Array(13);
var plapal = new Array();
plapal[0] = new Array();
plapal[1] = new Array();
plapal[2] = new Array();
plapal[3] = new Array();
plapal[4] = new Array();
plapal[5] = new Array();
plapal[6] = new Array();
plapal[7] = new Array();
var asptV = new Array(Pcnt);
var asptL = new Array(Pcnt);
var asptF = new Array(Pcnt);
for(i = 0;i < Pcnt;i++){asptV[i] = new Array(Pcnt);asptL[i] = new Array(Pcnt);asptF[i] = new Array(Pcnt);for(j = 0;j < Pcnt;j++){asptV[i][j] = "　";asptL[i][j] = "";asptF[i][j] = 0;}}
var PI = Math.PI
var RAD = 180.0 / PI;
var DEG = PI / 180.0;
var LONGITUDE = 0;
var LATITIDE = 0;
var JD  = 0;
var JDT = 0;
var MJD = 0;
var LON = 0;
var LAT = 0;
var LRV = 0;
var LEP = 0;
var ACT = 0;
var DCT = 0;
var AZI = 0;
var ELV = 0;
var LST = 0;
var GST = 0;
var Tk  = 0;
var LON_tbl = new Array(Pcnt);
var LAT_tbl = new Array(Pcnt);
var LRV_tbl = new Array(Pcnt);
var ACT_tbl = new Array(Pcnt);
var DCT_tbl = new Array(Pcnt);
var AZI_tbl = new Array(Pcnt);
var ELV_tbl = new Array(Pcnt);
var yy = 0;
var mm = 0;
var dt = 0;
var hr = 0;
var mn = 0;

var azm = 180;
var winw = 0;
var winh = 0;
var pos_x_c = 0;
var pos_y_c = 0;
var sp_cros_w = 600;
var sp_cros_h = 400;
var ostx = 0;
var osty = 0;
var ht_offset = 0;
var rep_back_path = "../back_w.jpg";
var rep_height = 400;
var rep_width = 600;
var rep_txt_color = "#333333";
var rep_txt_face = "ＭＳ ゴシック";
var rep_txt_size = "3";
var pict_path = "../pict/";
var p_msg_tbl = new Array(Pcnt);
var s_msg_tbl = new Array(13);
var n_msg_tbl = new Array(13);
var tm_pop=0;
var pop_timer=300;
var pop_txt_face="ＭＳ Ｐゴシック";
var pop_txt_col="ghostwhite";
var pop_txt_size=2;
var pop_alp=80;
var pop_bgcol="#333333";
var pop_bgpict="";
var pop_disp_txt=0;
var pop_en=1;
var pop_disp_w=300;
var pop_disp_h=300;








function PopGene(){var tmp="";tmp+="<div id=\"pop\" onclick=\"pop_clear()\" style=\"position:absolute;visibility:hidden;background-Color:"+pop_bgcol;if(pop_bgpict!=""){tmp+="; background:url("+pop_bgpict+")";}tmp+="; width:" + pop_disp_w + "px";tmp+="; height:" + pop_disp_h + "px";tmp+="\"></div>";document.write(tmp);pictAlpha("pop",pop_alp);}
function onMouseMovePoP(eve){if(pop_disp_txt==0){return;}pictVisible("pop",false);var ofsx=document.all?document.body.scrollLeft:window.pageXOffset;var ofsy=document.all?document.body.scrollTop:window.pageYOffset;var posw=document.all?document.body.clientWidth:window.innerWidth;var posh=document.all?document.body.clientHeight:window.innerHeight;var mpx=document.all?event.clientX:eve.pageX;var mpy=document.all?event.clientY:eve.pageY;var posX=mpx;var posY=mpy;if(document.all){posX=mpx+ofsx;posY=mpy+ofsy;}else if(document.getElementById){}var x_set=(ofsx+posw)-(pop_disp_w+15);if(x_set<posX){posX-=(pop_disp_w+15);}var y_set=(ofsy+posh)-(pop_disp_h+15);if(y_set<posY){posY-=(pop_disp_h+15);}pictMove("pop",posX+15,posY+15,null);pictVisible("pop",true);}
function pop_disp(i_tx){if(pop_en == 0){return;}clearTimeout(tm_pop);if(pop_disp_txt==0){document.getElementById("pop").innerHTML="<font face=\""+pop_txt_face+"\" Color=\""+pop_txt_col+"\" size="+pop_txt_size+">"+i_tx+"</font>";pop_disp_txt=1;}pictZindex("pop",156,0);tm_pop=setTimeout("pop_clear()",1000*pop_timer);}
function pop_clear(){clearTimeout(tm_pop);pictVisible("pop",false);pop_disp_txt=0;}
function pictAlpha(id,alp){if(document.all){document.all[id].style.filter="Alpha(Opacity="+alp+",FinishOpacity="+alp+")";}else if(document.getElementById){document.getElementById(id).style.filter="alpha(opacity=" + 90 + ")";document.getElementById(id).style.MozOpacity=(alp/100);document.getElementById(id).style.opacity=(alp/100);}}
function make_item(){var i = 0;pictGene("bk",0,0,rbW,rbH,pict_path + "3bk.gif",0);for(i = 0;i < 12;i++){pictGene("sn" + i,0,0,13,13,pict_path + "s" + i + ".gif",0);}for(i = 1;i < 13;i++){pictGene("mn" + i,0,0,13,13,pict_path + "m" + i + ".gif",0);}for(i = 0;i < Pcnt;i++){if(9 < i && i < 14){pictGene("np" + i,0,0,13,13,pict_path + "p" + i + ".gif",0);}else{pictGene("np" + i,0,0,13,13,pict_path + "p" + i + ".gif",0);}}PopGene();}
function zindex_set(){var i = 0;for(i = 0;i < 12;i++){pictZindex("sn" + i,1,0);}for(i = 1;i < 13;i++){pictZindex("mn" + i,1,0);}for(i = 0;i < Pcnt;i++){pictZindex("np" + i,1,0);}}
function lrs(cx,cy){var i = 0,j = 0,r = 0;for(i = 0;i < 12;i++){j = (i * 30) - ASC;r = drawLineCR("lr" + i,cx,cy,ssr,ser,j,1,1,"white");plapal[5][i] = j;}for(i = 0;i <= 71;i++){j = (i * 5) - ASC;r = drawLineCR("lp" + i,cx,cy,slp,slp,j,1,1,"red");}for(i = 0;i < 12;i++){setCR("sn" + i,cx,cy,sgr,plapal[5][i] + 15,13,13);s_msg_tbl[i] = "　" + ZodiacName[i];cursor_sw("sn" + i,1);pictVisible("sn" + i,true);}}
function PHno(){var i,j,k;for(i = 0;i < Pcnt;i++){k = nm(plapal[0][i] - ASC);for(j = 1;j < 13;j++){if(CP[j] <= k && k < CP[j+1]){plapal[6][i] = j;}}}}
function pset(cx,cy){var i = 0,j = 0,k = 0,l = 0;var ar = new Array(23);var temp = "";PHno();for(i = 0;i < Pcnt;i++){k = 0;l = 0;for(j = 0;j < i;j++){if(9 < j && j < 14){}else{if(CompAzB(plapal[2][i],plapal[2][j],9)){k += 1;}}}if(9 < i && i < 14){setCR("np" + i,cx,cy,plaAr,plapal[2][i],13,13);}else{setCR("np" + i,cx,cy,plaPr - (12 * k),plapal[2][i],13,13);}cursor_sw("np" + i,1);temp = "　" + PlanetName[i] + "　" + plapal[3][i];temp += "　[ " + ZodiacName[Math.floor(plapal[0][i] / 30)] + "　" + deg2rm(plapal[0][i] % 30)+ " ]";plapal[7][i] = nm(plapal[0][i] - ASC) - nm(CP[plapal[6][i]]);temp += "　[ " + plapal[6][i]+ "室  " + deg2rm(plapal[7][i])+ " ]<br>";for(j = 0;j < Pcnt;j++){if(asptL[i][j] != ""){temp += "　" + asptL[i][j] + "<br>";}else if(asptL[j][i] != ""){temp += "　" + asptL[j][i] + "<br>";}}p_msg_tbl[i] = temp;pictVisible("np" + i,true);}}
function cpls(cx,cy){var i=0;for(i = 1;i < 13;i++){drawLineCR("cp1" + i,cx,cy,cpL1s,cpL1e,CP[i],1,1,"gray");drawLineCR("cp2" + i,cx,cy,cpL2s,cpL2e,CP[i],1,1,"gray");}}
function CompAzB(r1,r2,a){var ret = 0;var l = nm(r1 - r2);var m = nm(r2 - r1);if(l < a || m < a){ret = 1;}return ret;}
function CompAzR(r1,r2){var ret = 0;var l = r1 * DEG;var m = r2 * DEG;if(l > m){ret = l - m;}if(m > l){ret = m - l;}ret = nm(ret * RAD);if(ret > 180){ret = 360 - ret;}return ret;}
function asporb(nm,pic,a,or,cl){var no = aspNam[cl].length;aspNam[cl][no] = nm;aspAng[cl][no] = a;orbAng[cl][no] = or;aspPic[cl][no] = pic;}
function aspt(cl){var al = aspNam[cl].length;var i = 0,j = 0,k = 0,l = 0,m = 0;for(i = 0;i < Pcnt;i++){for(j = 0;j < Pcnt;j++){for(k = 0;k < al;k++){l = CompAzB(plapal[2][i],plapal[2][j],aspAng[cl][k] + orbAng[cl][k]);m = CompAzB(plapal[2][i],plapal[2][j],aspAng[cl][k] - orbAng[cl][k]);if(i < j){if(l == 1 && m == 0){asptV[i][j] = "<img src=\"" + aspPic[cl][k] + "\" alt=\"" + aspNam[cl][k] + "\n" + PlanetName[j] + "　―　" + PlanetName[i] + "\">";asptL[i][j] = "\n" + PlanetName[j] + "\t" + aspNam[cl][k];asptL[j][i] = "\n" + PlanetName[i] + "\t" + aspNam[cl][k];asptF[i][j] = cl;}}else{asptV[i][j] = deg2rm(CompAzR(plapal[2][i],plapal[2][j]));}}}}}
function aspt_line(cl){var i = 0,j = 0,k = 0,l = 0,m = 0;for(i = 0;i < 10;i++){for(j = 0;j < 10;j++){if(i < j){if(asptF[i][j] ==1){drawLineICR("a1"+i+"l"+j,Hcx,Hcy,80,plapal[2][i],plapal[2][j],1,true,"red");}else if(asptF[i][j] ==2){drawLineICR("a2"+i+"l"+j,Hcx,Hcy,80,plapal[2][i],plapal[2][j],1,true,"blue");}else if(asptF[i][j] ==3){drawLineICR("a3"+i+"l"+j,Hcx,Hcy,80,plapal[2][i],plapal[2][j],1,true,"green");}}}}}
function revc(jd){var PRC1 = new Array(Pcnt);Planet(jd - 0.5);for(i = 0;i < Pcnt;i++){PRC1[i] = LON_tbl[i];}Planet(jd + 0.5);for(i = 0;i < Pcnt;i++){if(LON_tbl[i] * DEG < PRC1[i] * DEG){plapal[3][i] = "R";}else{plapal[3][i] = "";}}plapal[3][0] = "";plapal[3][1] = "";Planet(jd);}
function hps(cx,cy,r){var npos = 0;var cps = new Array(12);var temp = "";for(i = 1;i < 13;i++){npos = CP[i] + nm((CP[i+1] - CP[i]) / 2);setCR("mn" + i,cx,cy,r,npos,13,13);cursor_sw("mn" + i,1);pictVisible("mn" + i,true);}for(i=1;i < 13;i++){cps[i] = nm(CP[i] + ASC);temp = "　";temp += i + "室　　" + ZodiacName[Math.floor(cps[i] / 30)]+ "　　" + deg2rm(cps[i] % 30);n_msg_tbl[i] = temp;}}
function rep(intxt,sel){var i = 0,temp = "";hwin=window.open("","Horowindow" + sel,"resizable=yes,scrollbars=yes,height=" + rep_height + ",width=" + rep_width + "");hwin.document.open();temp += "<HTML><HEAD><META HTTP-EQUIV=\"Content-Type\" CONTENT=\"text/html;charset=Shift_JIS\"><TITLE>表" + sel + "</TITLE>";temp += "<script>";temp += "function hton(a,b){document.getElementById(a+\"p\"+b).style.backgroundColor=\"#aaaacc\";";temp += "document.getElementById(b+\"p\"+a).style.backgroundColor=\"#aaaacc\";}";temp += "function htoff(a,b){document.getElementById(a+\"p\"+b).style.backgroundColor=\"\";";temp += "document.getElementById(b+\"p\"+a).style.backgroundColor=\"\";}";temp += "</script>";temp += "</HEAD>";temp += "<BODY text=" + rep_txt_color + " vLink=#800080 aLink=#ff0000 link=#0000ff bgColor=#ffffff background=" + rep_back_path + " BGPROPERTIES=\"fixed\"><br>";temp += "<FONT face=\"" + rep_txt_face + "\" size=" + rep_txt_size + ">";temp += intxt;temp += "<hr align=left width=\"100%\" SIZE=3><CENTER><FORM><INPUT TYPE=\"button\" VALUE=\"閉じる\" onClick=\"window.close()\"></FORM></CENTER>";temp += "</BODY></HTML>";hwin.document.write(temp);hwin.document.close();if(document.all){hwin.document.focus();}}
function disp_1(){var temp = "";temp += "<font size=\"2\" Color=\"#333333\">西暦"+yy+"年"+mm+"月"+dt+"日"+hr+"時"+mn+"分"+get_MP()+"<br></font><TABLE border=\"1\"><TBODY><TR><TD>　</TD>";for(i = 0;i < Pcnt;i++){temp += "<TD align=middle><img src=\"" + pict_path + "p" + i + ".gif" + "\" alt=\"" + PlanetName[i] + "\"></TD>";}temp += "</TR>";for(i = 0;i < Pcnt;i++){temp += "<TR><TD align=\"middle\"><img src=\"" + pict_path + "p" + i + ".gif" + "\" alt=\"" + PlanetName[i] + "\"></TD>";for(j = 0;j < Pcnt;j++){temp += "<TD align=\"middle\" id=" + i+"p"+j + " onmouseOver=\"hton("+i+","+j+")\" onmouseOut=\"htoff("+i+","+j+")\"><font size=\"2\" Color=\"#333333\">";if(i != j){temp += asptV[i][j];}else{temp += "　　";}temp += "</font></TD>";}temp += "</TR>";}temp += "</TBODY></TABLE><font size=\"2\" Color=\"#333333\">";for(i = 0;i < aspAng[1].length;i++){temp += aspNam[1][i]+" = " + aspAng[1][i] + "°　　オーブ　" + orbAng[1][i] + "°<br>";}for(i = 0;i < aspAng[2].length;i++){temp += aspNam[2][i]+" = " + aspAng[2][i] + "°　　オーブ　" + orbAng[2][i] + "°<br>";}for(i = 0;i < aspAng[3].length;i++){temp += aspNam[3][i]+" = " + aspAng[3][i] + "°　　オーブ　" + orbAng[3][i] + "°<br>";}temp += "</font>";return temp;}
function disp_2(){var tempN = new Array(20);var tempS = new Array(20);var tempA = new Array(20);var temp = "";for(i = 0;i < Pcnt;i++){tempN[i] = PlanetName[i];tempS[i] = ZodiacName[Math.floor(plapal[0][i] / 30)];tempA[i] = deg2rm(plapal[0][i] % 30) + plapal[3][i];}temp += "<font size=2 Color=\"#333333\">西暦" + yy + "年" + mm + "月" + dt + "日" + hr + "時" + mn + "分"+get_MP()+"<br></font><TABLE border=1 width=\"100%\"><TBODY><TR>";temp += "<TD align=middle><font size=2 Color=\"#333333\">感受点</font></TD><TD align=middle><font size=2 Color=\"white\">サイン</font></TD><TD align=middle><font size=2 Color=\"#333333\">角度</font></TD></TR>";for(i = 0;i < Pcnt;i++){temp += "<TR>";temp += "<TD align=middle>" + "<font size=2 Color=\"#333333\">" + tempN[i] + "</TD>";temp += "<TD align=middle>" + "<font size=2 Color=\"#333333\">" + tempS[i] + "</TD>";temp += "<TD align=middle>" + "<font size=2 Color=\"#333333\">" + tempA[i] + "</TD>";temp += "</TR>";}temp += "</TBODY></TABLE>";return temp;}
function disp_3(){var i = 0,cpr = 0,temp = "";temp += "<font size=2 Color=\"#333333\">" + "西暦" + yy + "年" + mm + "月" + dt + "日" + hr + "時" + mn + "分"+get_MP()+"<br></font><TABLE border=1 width=\"100%\"><TBODY>";for(i = 1;i < 13;i++){temp += "<TR>";cpr = nm(CP[i]+ASC);temp += "<TD align=middle>" + "<font size=2 Color=\"#333333\">"+ i + "室" + "</TD>";temp += "<TD align=middle>" + "<font size=2 Color=\"#333333\">"+ ZodiacName[Math.floor(cpr / 30)] + "</TD>";temp += "<TD align=middle>" + "<font size=2 Color=\"#333333\">"+ deg2rm(cpr % 30);temp += "</TR>";}temp += "</TBODY></TABLE>";return temp;}
function calc(){var r,i;window.status="ホロスコープが表示されるまで暫くお待ちください。";r = dateIn();if(r == 1){return;}disp();JDT = conv_date_jd(yy,mm,dt,hr,mn,0,Tk,0);Planet(JDT);ASC = plapal[0][10];IC  = plapal[0][11];DSC = plapal[0][12];MC  = plapal[0][13];CalcHouse(HSS);cpls(Hcx,Hcy);aspt(3);aspt(2);aspt(1);pictMove("bk",Hcx - 220,Hcy - 220,null);pictVisible("bk",true);lrs(Hcx,Hcy);revc(JDT);hps(Hcx,Hcy,hnr);pset(Hcx,Hcy);zindex_set();aspt_line(1);window.status="ホロスコープ作成完了。";}
function Planet(jd){var SY = 0,SR = 0;LEP = CalcEPS(jd);LST = ConvLST(jd,0,LONGITUDE);for(i = 0;i < 10;i++){planet_dt(jd,i);if(i == 0){SY = LON; SR = LRV;}else if(1 < i && i < 10){ConvSE(SY,SR,LON,LAT,LRV);}LON_tbl[i] = LON;LAT_tbl[i] = LAT;LRV_tbl[i] = LRV;ConvCT(LON,LAT,LEP);ACT_tbl[i] = ACT;DCT_tbl[i] = DCT;}LON_tbl[10] = CalcASC(LEP,LST,LATITIDE);LON_tbl[11] = nm(CalcMC(LEP,LST) + 180);LON_tbl[12] = nm(CalcASC(LEP,LST,LATITIDE) + 180);LON_tbl[13] = CalcMC(LEP,LST);LON_tbl[14] = CalcDH(jd);LON_tbl[15] = nm(CalcDH(jd) + 180);LON_tbl[16] = CalcBM(jd);LON_tbl[17] = nm(CalcEP(LEP,LST,LATITIDE));LON_tbl[18] = nm(CalcEP(LEP,LST,LATITIDE) + 180);LON_tbl[19] = nm(CalcVTX(LEP,LST,LATITIDE));LON_tbl[20] = nm(CalcVTX(LEP,LST,LATITIDE) + 180);LON_tbl[21] = nm(LON_tbl[10] + LON_tbl[1] - LON_tbl[0]);LON_tbl[22] = nm(LON_tbl[10] + LON_tbl[0] - LON_tbl[1]);for(i = 0;i < Pcnt;i++){plapal[0][i] = LON_tbl[i];plapal[2][i] = nm(LON_tbl[i] - LON_tbl[10]);}}
function planet_dt(jd,pno){var plon = 0,plat = 0,prad = 0,i = 0;T = ((jd - 2400000.5) - 51544.5 + 0.00074074) / 36525.0;if(pno == 0){plon += 280.4659 + 36000.7695 * T;var lo = new Array(0.0004,161,31557,0.0004,48,29930,0.0005,221,2281,0.0005,118,155,0.0006,316,33718,0.0007,64,9038,0.0007,110,3035,0.0007,45,65929,0.0013,352,22519,0.0015,254,45038,0.0018,208,445267,0.0018,159,19,0.0020,158,32964,0.0200,265.1,71998.1,-0.0048 * T,267.520,35999.050,1.9147,267.520,35999.050);var la = new Array();var ra = new Array(0.000005,226,33718,0.000005,233,22519,0.000016,164,45038,0.000016,68,32964,0.000031,298,445267,0.000139,175,71998,-0.000042 * T,177.53,35999.05,0.016706,177.53,35999.05,1.000140,0.0,0.0);}else if(pno == 1){plon += 218.3162 + 481267.8809 * T;var lo = new Array(0.0003,191,2322131,0.0003,70,4067,0.0003,220,549197,0.0003,58,1808933,0.0003,337,349472,0.0003,354,381404,0.0003,340,958465,0.0004,187,12006,0.0004,223,39871,0.0005,242,509131,0.0005,24,1745069,0.0005,90,1908795,0.0006,156,2258267,0.0006,38,111869,0.0007,127,27864,0.0007,186,485333,0.0007,50,405201,0.0007,114,790672,0.0008,98,1403732,0.0009,129,858602,0.0011,186,1920802,0.0012,249,1267871,0.0016,152,1856938,0.0018,274,401329,0.0021,16,341337,0.0021,85,71998,0.0021,357,990397,0.0022,151,818536,0.0023,163,922466,0.0024,122,99863,0.0026,17,1379739,0.0027,182,918399,0.0028,145,1934,0.0037,259,541062,0.0038,21,1781068,0.0040,29,133,0.0040,56,1844932,0.0040,283,1331734,0.0050,205,481266,0.0052,107,31932,0.0068,323,926533,0.0079,188,449334,0.0085,111,826671,0.0100,315,1431597,0.0107,246,1303870,0.0110,142,489205,0.0125,52,1443603,0.0154,41,75870,0.0304,222.5,513197.9,0.0347,27.9,445267.1,0.0409,47.4,441199.8,0.0458,148.2,854535.2,0.0533,280.7,1367733.1,0.0571,13.2,377336.3,0.0588,124.2,63863.5,0.1144,276.5,966404.0,0.1851,87.53,35999.05,0.2136,179.93,954397.74,0.6583,145.70,890534.22,1.2740,10.74,413335.35,6.2888,44.963,477198.868);var la = new Array(0.0003,57,335334,0.0003,16,1814936,0.0003,115,2264270,0.0003,57,1409735,0.0003,282,932536,0.0004,352,1024264,0.0004,149,2328134,0.0005,222,948395,0.0005,149,419339,0.0005,190,848532,0.0006,322,1361730,0.0006,134,559072,0.0007,205,1309873,0.0008,235,972407,0.0009,340,1787072,0.0010,288,1297866,0.0011,48,1914799,0.0013,65,37935,0.0013,6,447203,0.0014,129,29996,0.0015,316,996400,0.0015,121,928469,0.0015,46,42002,0.0018,10,1449606,0.0018,181,519201,0.0018,153,820668,0.0019,141,924402,0.0021,80,105866,0.0022,241,1337737,0.0022,308,481268,0.0025,106,860538,0.0034,230,443331,0.0042,14,1850935,0.0043,217,547066,0.0082,55,371333,0.0088,87,471196,0.0093,187,884531,0.0172,273.2,1437599.8,0.0326,239.0,1373736.2,0.0463,82.5,69866.7,0.0554,104.0,896537.4,0.1733,52.43,407332.20,0.2777,48.31,6003.15,0.2806,138.24,960400.89,5.1281,3.273,483202.019);prad += 0.950725;var ra = new Array(0.000005,140,405201,0.000006,212,99863,0.000006,276,485333,0.000007,148,1808933,0.000007,281,2322131,0.000009,204,790672,0.000010,114,1745069,0.000011,219,858602,0.000011,180,1908795,0.000012,246,2258267,0.000013,4,401329,0.000013,106,341337,0.000013,188,1403732,0.000019,339,1267871,0.000023,266,553069,0.000026,241,818536,0.000029,87,990397,0.000030,131,75870,0.000031,253,922466,0.000033,349,541062,0.000034,272,918399,0.000041,295,481266,0.000063,278,449334,0.000064,13,1331734,0.000073,111,1781068,0.000078,146,1844932,0.000083,53,926533,0.000084,214,63864,0.000103,201,826671,0.000111,178,35999,0.000167,336,1303870,0.000173,45,1431597,0.000197,232,489205,0.000263,312,513198,0.000271,118,445267,0.000319,137.4,441199.8,0.000400,103.2,377336.3,0.000531,238.2,854535.2,0.000858,10.7,1367733.1,0.002824,269.93,954397.74,0.007842,235.70,890534.22,0.009530,100.74,413335.35,0.051820,134.963,477198.868);}else if(pno == 2){plon += 252.2502 + 149474.0714 * T;var lo = new Array(0.0003,11,448419,0.0003,288,123392,0.0003,63,181909,0.0004,84,143117,0.0005,292,1046308,0.0006,268,155828,0.0009,171,143403,0.0010,234,32437,0.0011,54,1046308,0.0019,85,6356,0.0023,117,896836,0.0052,239,896835,0.0069,148,1,0.0081,302,747363,0.0230,64.0,747362.6,0.0256,127.4,597890.8,0.0760,312.6,448418.3,0.0850,143.0,149473.3,0.1016,249.2,597890.1,0.1796,137.84,298945.77,0.5258,74.38,448417.55,2.9818 + 0.0006 * T,259.589,298945.031,23.4405 + 0.0023 * T,84.7947,149472.5153);var la = new Array(0.0003,146,896836,0.0005,352,149474,0.0009,45,448417,0.0009,331,747364,0.0012,83,1046308,0.0020,157,597891,0.0023,347,298946,0.0028,342,448419,0.0047,268,896835,0.0050,230,298945,0.0187,93.1,747362.9,0.0367,55.7,149472.1,0.0753,278.3,597890.4,0.3123,103.51,448417.92,1.3643 + 0.0005 * T,288.71,298945.40,1.4396 + 0.0005 * T,119.12,0.37,6.7057 + 0.0017 * T,113.919,149472.886);prad += 0.395283 + 0.000002 * T;var ra = new Array(0.000006,149,896835,0.000042,334,747363,0.000218,159.2,597890.1,0.001214,344.38,448417.55,0.007955 + 0.000002 * T,169.59,298945.03,0.078341 + 0.000008 * T,354.795,149472.515);}else if(pno == 3){plon += 181.9793 + 58519.2125 * T;var lo = new Array(0.0004,34,54076,0.0005,110,3035,0.0007,351,175554,0.0007,70,58519,0.0008,303,155,0.0008,239,55483,0.0010,244,9038,0.0014,172,22519,0.0020,159,67556,0.0032,254,45038,0.0033,11,117036,0.0503,300.6,117036.6,-0.0054 * T,320.41,58517.81,0.7761,320.41,58517.81);var la = new Array(0.0005,46,175555,0.0230,65.7,117036.1,0.0230,144.9,0.5,0.0010 * T,15.299,58518.312,3.3939,15.299,58518.312);prad += 0.723348;var ra = new Array(0.000004,121,55483,0.000014,69,67556,0.000016,164,45038,0.000017,281,117036,-0.000034 * T,230.41,58517.81,0.004899,230.41,58517.81);}else if(pno == 4){plon += 355.4472 + 19141.6999 * T;var lo = new Array(0.0003,214,6842,0.0003,179,48316,0.0003,21,76562,0.0003,256,10017,0.0004,28,17918,0.0004,220,6069,0.0004,229,895,0.0005,53,21421,0.0005,137,16696,0.0006,205,51350,0.0007,166,12298,0.0007,208,29176,0.0009,167,10036,0.0009,67,35245,0.0010,39,3035,0.0013,290,4561,0.0018,50,1098,0.0019,95,14579,0.0023,13,16859,0.0028,1,57422,0.0028,142,19142,0.0038,21,2281,0.0045,191,32211,0.0047,348,76559,0.0060,168,13071,0.0070,48,16105,0.0037 * T,180,0,0.0140,180,0,0.0144,342,38282,0.0147,336,19,0.0504,328.2,57419.6,0.0012 * T,308.78,38279.71,0.6227,308.78,38279.71,0.0105 * T,289.388,19139.859,10.6919,289.388,19139.859);var la = new Array(0.0020,274,76561,0.0021,3,19139,0.0179,254.7,57420.6,0.1709,235.28,38280.79,0.1727,16.50,1.07,-0.0007 * T,215.876,19140.925,1.8334,215.876,19140.925);prad += 1.530339 + 0.000013 * T;var ra = new Array(0.000008,311,2281,0.000009,89,48316,0.000010,338,35245,0.000013,118,29176,0.000023,3,14579,0.000024,284,16859,0.000035,258,76559,0.000055,77,13071,0.000072,103,32211,0.000080,317,16105,0.000455,238.2,57419.6,0.000013 * T,218.78,38279.72,0.006606,218.78,38279.72,0.000139 * T,199.388,19139.859,0.141850,199.388,19139.859);}else if(pno == 5){plon += 34.39356 + 3036.08406 * T;var lo = new Array(0.00003,195,12691,0.00009,251,10324,0.00010,174.0,10902.8,0.00012,258.5,7779.9,0.00028 * T,197.2,9087.8,0.00029,270.6,9704.4,0.00035,241.5,8473.4,0.00039,345.5,12131.7,0.00094,221.3,7251.8,0.00224,54.64,1466.26,0.00335,244.10,1284.47,0.00343,259.11,6666.05,0.00397,294.77,4206.81,0.00482,273.36,4730.71,0.00501,206.94,5449.93,0.00607,88.37,4759.11,0.00699,198.68,2920.69,0.00757,327.94,9107.13,0.02120,73.665,1822.117,0.02274,135.412,2405.806,0.03557,191.685,596.267,0.04370 * T,218.916,6071.843,0.05532,237.453,3624.312,0.17575,309.5012,6083.2578,5.54603,289.68429,3034.53346);plat += 0.06299;var la = new Array(0.00006,181,799,0.00006,132,8494,0.00007,191,9699,0.00011,267.9,4231.5,0.00020,262.6,12136.2,0.00028,75.7,5432.9,0.00031,266.8,562.9,0.00033,0.8,4850.1,0.00038,214.6,1225.1,0.00045,122.2,3627.8,0.00051 * T,180.0,0.0,0.00063,171.6,6654.4,0.00072,113.1,2424.7,0.00106 * T,339.44,6049.97,0.00185 * T,152.84,9115.63,0.00347,243.22,9134.65,0.02141 * T,309.356,3034.269,0.06295,223.544,6068.687,1.30086,203.91874,3034.12633);prad += 5.209105;var ra = new Array(0.000005,138,9560,0.000005,164,10256,0.000009,84,10896,0.000009,249,12122,0.000012,175,7830,0.000016,167,8482,0.000017,288,1517,0.000030 * T,180,0.0,0.000057 * T,276,9479,0.000061,334,4840,0.000061,169,1190,0.000069,125,7258,0.000129,171,6671,0.000212,233,9113,0.000224,205,4215,0.000299,124,5444,0.000306,97,601,0.000309 * T,312,6090,0.000612 * T,19,2968,0.000635,344,1818,0.000880,46,2406,0.002802,147.7,3624.5,0.006134,219.0,6066.1,0.251681,199.614,3034.534);}else if(pno == 6){plon += 49.97937 + 1224.04687 * T;var lo = new Array(0.00004,79,8461,0.00005,68,9616,0.00007,354,10868,0.00009,69,6619,0.00010,92,6055,0.00011,74.1,7825.9,0.00018,13.7,9058.0,0.00029,94.9,6009.6,0.00040,147.7,4516.9,0.00054,29.7,7243.0,0.00056,316.6,4729.7,0.00094,97.3,4198.7,0.00184,44.09,5435.18,0.00215,22.82,3151.76,0.00857,334.19,1884.95,0.01138,105.909,3816.622,0.03220 * T,8.114,3731.729,0.11441,9.0137,597.5060,0.19720,187.9907,2310.5997,0.44141 * T,279.0711,2380.3750,4.81254 * T,317.43950,1200.76570,6.19608,227.52458,1178.39096);plat += 0.04858;var la = new Array(0.00017,79.5,4953.0,0.00039,64.0,4861.3,0.00055,321.0,3035.3,0.00064 * T,28.8,3629.0,0.00230 * T,251.99,2450.45,0.00277,303.12,1812.03,0.00305,296.69,437.68,0.00812,121.34,3673.28,0.00978 * T,27.67,514.08,0.05938 * T,113.635,1223.005,0.13425,163.7721,2445.2128,2.47972,206.33867,1224.56984);prad += 9.554001;var ra = new Array(0.000004,244,12669,0.000007,15,8336,0.000009,343,9610,0.000012,263,10878,0.000014,20,6628,0.000027,1,7826,0.000032,281,9051,0.000055,15,6017,0.000096,298,7245,0.000119,22,4379,0.000136,358,4900,0.000166,160,3228,0.000215,32,3941,0.000314,313,5440,0.000555 * T,180.0,0.0,0.001238 * T,225.3,2600.0,0.001556,347.2,3612.4,0.005400,277.3,586.3,0.008245,341.2,1814.6,0.014780,92.09,2442.07,0.314172 * T,227.317,1205.098,0.515185,137.576,1188.045);}else if(pno == 7){plon += 313.33676 + 428.72880 * T;var lo = new Array(0.00014,308.1,3157.9,0.00015 * T,313.4,3798.6,0.00017,321.9,2873.2,0.00017,183.6,2356.6,0.00036,10.4,5647.4,0.00090,247.7,1968.3,0.01475,351.028,2608.702,0.12397,354.5935,1065.1192,0.58964,188.3245,919.0429,2.69325 * T,317.76510,597.77389,3.20671 * T,114.02740,705.15539,5.35857,48.85031,460.61987);var la = new Array(0.00025,194.2,3030.9,0.00036 * T,263.0,1526.5,0.02997,180.0,0.0,0.13490,83.3517,998.0302,0.56518 * T,354.9571,892.2869,0.67756,273.6644,652.9504,1.15483,128.15303,419.91739,1.78488 * T,188.32394,507.52281);prad += 19.203034;var ra = new Array(0.000120,100,5652,0.000205,37,3104,0.000223,321,2120,0.000656,202,1527,0.004897,80.4,2613.7,0.042617 * T,0.0,0.0,0.062710,67.99,799.95,0.166685 * T,307.419,702.024,0.361949 * T,19.879,440.702,0.905790,320.313,408.729);}else if(pno == 8){plon += -55.13323 + 219.93503 * T;var lo = new Array(0.00023,19.2,5851.6,0.00225,127.61,2279.43,0.00235,309.35,2266.50,0.00945,0.09,2815.89,0.01344,50.826,986.281,0.02928 * T,342.114,904.371,0.04403 * T,332.797,684.128,0.97450,167.7269,221.3904);plat += 0.01725;var la = new Array(0.00012,243.9,3035.0,0.00015,187.5,2596.7,0.00015,224.7,1107.1,0.01366,338.864,447.128,1.76958,83.11018,218.87906);prad += 30.073033;var ra = new Array(0.000120,111,5845,0.002579,104.0,1025.1,0.003364,308.1,524.0,0.004944,90.1,2815.4,0.009784 * T,195.7,515.2,0.260457,79.994,222.371);}else if(pno == 9){plon += 241.82574 + 179.09519 * T;var lo = new Array(0.00013,293.0,3288.8,0.00022,77.9,5861.8,0.00145,19.01,2488.14,0.00590,112.91,1306.75,0.00861,60.35,2836.46,0.07886,41.989,941.622,1.18379,351.67676,551.34710,15.8108,298.348019,246.556453);plat += -2.30285;var la = new Array(0.00042,254.2,2342.3,0.00090,213.7,1532.6,0.00098,18.8,3055.6,0.00119,293.06,2658.22,0.01855,146.660,1089.202,0.26775,105.0840,713.1227,2.45310,66.15350,415.60630,17.04550,42.574982,172.554318);prad += 38.662489;var ra = new Array(0.000116,169,5860,0.000390,15,3188,0.001188,114.1,1748.0,0.002543 * T,199.5,2196.1,0.004902,149.4,2831.6,0.007619 * T,31.0,1425.9,0.008426,252.9,909.8,0.333884,228.717,475.963,8.670489,198.4973,181.3383);}for(i = 0;i < lo.length;i += 3){plon += lo[i] * Math.cos((lo[i+1] + lo[i+2] * T) * DEG);}for(i = 0;i < la.length;i += 3){plat += la[i] * Math.cos((la[i+1] + la[i+2] * T) * DEG);}for(i = 0;i < ra.length;i += 3){prad += ra[i] * Math.cos((ra[i+1] + ra[i+2] * T) * DEG);}plon = nm(plon);plat = nm(plat);prad = nm(prad);LON = plon;LAT = plat;LRV = prad;}
function ConvSE(ys,rs,ym,bm,rm){var Ac = rm * Math.cos(bm * DEG) * Math.cos(ym * DEG) + rs * Math.cos(ys * DEG);var Bc = rm * Math.cos(bm * DEG) * Math.sin(ym * DEG) + rs * Math.sin(ys * DEG);var Cc = rm * Math.sin(bm * DEG);var Rc = Math.sqrt(Ac * Ac + Bc * Bc + Cc * Cc);var b = Math.asin(Cc / Rc);LAT = b * RAD;var ye = Math.atan(Bc / Ac);if(Ac < 0){ye = ye + Math.PI;}if(ye < 0){ye = ye + Math.PI * 2;}LON = ye * RAD;}
function ConvCT(y,b,e){var ry = y / RAD,rb = b / RAD,re = e / RAD;var xs = Math.cos(rb) * Math.sin(ry) * Math.sin(re) + Math.sin(rb) * Math.cos(re);var d  = Math.asin(xs);var c = Math.cos(rb) * Math.cos(ry);var s = Math.cos(rb) * Math.sin(ry) * Math.cos(re) - Math.sin(rb) * Math.sin(re);var a = Math.atan(s / c);if(c < 0){a = a + Math.PI;}if(a < 0){a = a + Math.PI * 2;}ACT = a * RAD;DCT = d * RAD;}
function conv_date_jd(year,month,day,hour,minute,sec,oft,sel){if(month < 3){year -= 1;month += 12;}var t = Math.floor(year / 100);var jd = Math.floor(year * 365.25) - t + Math.floor(t / 4);jd += Math.floor(30.6001 * (month + 1)) + day + 1720996.5;jd += (hour / 24) + (minute / 1440) + (sec / 86400);if(sel == 1){jd -= 2400000.5;}jd += oft / 24;return jd;}
function ConvLST(jd,tdef,longitude){var d = (0.671262 + 1.0027379094 * (jd - 2400000.5 - 40000) + longitude / 360);var ret = Math.PI * 2 * (d - Math.floor(d));ret = (d - Math.floor(d));ret += tdef / 24;return ret;}
function CalcMC(LEP,LST){var RAMC = nm(LST * 360);var ret = Math.atan(Math.tan(RAMC * DEG) / Math.cos(LEP * DEG));ret *= RAD;ret = nm(ret);if(RAMC > 0 && RAMC < 90){}else if(RAMC > 90 && RAMC < 270){ret += 180;}else if(RAMC > 270 && RAMC < 360){ret += 360;}ret = nm(ret);return ret;}
function CalcASC(LEP,LST,latitude){var RAMC = nm(LST * 360);var x = Math.tan(latitude * DEG)*Math.sin(LEP * DEG)+Math.sin(RAMC * DEG)*Math.cos(LEP * DEG);var y = Math.cos(RAMC * DEG);var ret = Math.atan2(y,-x);ret *= RAD;ret = nm(ret);return ret;}
function CalcEP(LEP,LST){var RAMC = nm((LST - 0.25) * 360);var ret = Math.atan(Math.tan(RAMC * DEG) / Math.cos(LEP * DEG));ret *= RAD;ret = nm(ret);if(RAMC > 0 && RAMC < 90){ret += 180;}else if(RAMC > 90 && RAMC < 270){ret += 360;}else if(RAMC > 270 && RAMC < 360){ret += 180;}ret = nm(ret);return ret;}
function CalcVTX(LEP,LST,latitude){var RAMC = nm(LST * 360);var x = ((1/(Math.tan(latitude * DEG))*Math.sin(LEP * DEG)) - (Math.sin(RAMC * DEG)*Math.cos(LEP * DEG)));var y = Math.cos(RAMC * DEG);var ret = -Math.atan2(y,-x);ret *= RAD;ret = nm(ret);return ret;}
function CalcDH(jd){var J = (jd - 2378496) / 36525;var omg = 33.272936 - 1934.144694 * J + 2.08028 * Math.pow(10,-3) * Math.pow(J,2) + 2.08333 * Math.pow(10,-6) * Math.pow(J,3);return nm(omg);}
function CalcBM(jd){var J = (jd - 2378496) / 36525;var pnl = 225.397325 + 4069.053805 * J - 1.02869 * Math.pow(10,-2) * Math.pow(J,2) - 1.22222 * Math.pow(10,-5) * Math.pow(J,3);return nm(pnl + 180);}
function CalcEPS(jd){var T = (jd -2400000.5 - 51544.5 + 0.00074074) / 36525.0;var ep = 23.43923 - 0.01301 * T + 0.00256 * Math.cos((1934.0 * T + 235.0) * DEG) + 0.00016 * Math.cos((72002.0 * T + 201.0) * DEG);return ep;}
function nm(agl){return (agl - 360.0 * Math.floor(agl / 360.0));}
function deg2rm(deg){var tmp = "";var a = Math.abs(deg);var r = Math.floor(a);var b = a - r;var m = Math.floor(b * 60);if(deg < 0){tmp = "-";}else{tmp = "";}if(r < 10){tmp += "0" + r;}else{tmp += r;}tmp += "°";if(m < 10){tmp += "0" + m;}else{tmp += m;}tmp += "' ";return tmp;}
function get_MP(){var MP = 0;cyc = 29.530589;k = Math.floor((JDT-2451550.09765) / cyc); t = k / 1236.85; sg = 2451550.09765 + cyc * k + 0.0001337 * t * t - 0.40720 * Math.sin((201.5643 + 385.8169 * k)* Math.PI/180) + 0.17241 * Math.sin(( 2.5534 + 29.1054 * k)* Math.PI/180); moon = JDT - sg;MP = Math.floor(moon * 100) / 100;MP = "  月齢 " + MP;return MP;}
function pos_center(){winw=document.all ? document.body.clientWidth : window.innerWidth;winh=document.all ? document.body.clientHeight : window.innerHeight;var pos_x = document.all ? document.body.scrollLeft : window.pageXOffset;var pos_y = document.all ? document.body.scrollTop : window.pageYOffset;pos_x_c = winw / 2 + pos_x;pos_y_c = winh / 2 + pos_y + ht_offset;ostx = (winw - sp_cros_w) / 2;osty = (winh - sp_cros_h) / 2 + ht_offset;if(ostx < 0){ostx = 0;}if(osty < 0){osty = 0;}}
function pictAlt(idno,src){if(document.all){document.all[idno].title = src;}else if(document.getElementById){document.getElementById(idno).title = src;}}
function pictZindex(idno,z,pn){if(document.all){if(pn == 0){document.all[idno].style.zIndex += z;}else if(pn == 1){document.all[idno].style.zIndex -= z;}}else if(document.getElementById){if(pn == 0){document.getElementById(idno).style.zIndex += z;}else if(pn == 1){document.getElementById(idno).style.zIndex -= z;}}}
function cursor_sw(idno,sw){var tmp = "";switch(sw){case 0 : tmp = "auto";break;case 1 : tmp = "pointer";break;case 2 : tmp = "crosshair";break;case 3 : tmp = "move";break;case 4 : tmp = "text";break;case 5 : tmp = "wait";break;case 6 : tmp = "help";break;default: break;}if(document.all){document.all[idno].style.cursor = tmp;}else if(document.getElementById){document.getElementById(idno).style.cursor = tmp;}}
function pictVisible(idno,vis){if(document.all){document.all[idno].style.visibility = vis ? "visible" : "hidden";}else if(document.getElementById){document.getElementById(idno).style.visibility = vis ? "visible" : "hidden";}}
function pictMove(idno,x,y,z){if(document.all){if(x != null){document.all[idno].style.left = x;}if(y != null){document.all[idno].style.top = y;}if(z != null){document.all[idno].style.zIndex = z;}}else if(document.getElementById){if(x != null){document.getElementById(idno).style.left = x;}if(y != null){document.getElementById(idno).style.top = y;}if(z != null){document.getElementById(idno).style.zIndex = z;}}}
function ev1(){var idno = this.id;var ss = idno.substr(0,2);var no = parseInt(idno.substr(2,2));var col = "deepskyblue";var ang = 0;var amsg = "";var pname = "";var dpf=0;if(ss == "bk"){}else if(ss == "np"){amsg = p_msg_tbl[no];dpf=1;}else if(ss == "mn"){amsg = n_msg_tbl[no];dpf=1;}else if(ss == "sn"){amsg = s_msg_tbl[no];dpf=1;}if(dpf==1){pop_disp(amsg);}}
function ev2(){var idno = this.id;}
function ev3(){var idno = this.id;}
function ev4(){var idno = this.id;pop_clear();}
function pictGene(idno,x,y,w,h,src_p,vis){var tcW = w,tcH = h;var pict_obj = document.createElement("img");with(pict_obj){src = src_p;id = idno;onmouseover = ev1;onmousedown = ev2;onmouseup = ev3;onmouseout = ev4;}with(pict_obj.style){position = "absolute";overflow = "hidden";width = tcW;height = tcH;top = y + "px";left = x + "px";visibility = vis ? "visible" : "hidden";}return document.body.appendChild(pict_obj);}
function devGene(idno,src,x,y,vis){var devObj = document.createElement("<div>");with(devObj.style){position = "absolute";overflow = "hidden";top = y + "px";left = x + "px";}devObj.id = idno;devObj.style.visibility = vis ? "visible" : "hidden";devObj.innerHTML = src;return document.body.appendChild(devObj);}
function objClear(obj_n){document.body.removeChild(obj_n);}
function dot(x,y,w,h,cor){var dot_obj = document.createElement("div");with(dot_obj.style){backgroundColor = cor;position = "absolute";overflow = "hidden";width = w;height = h;top = y + "px";left = x + "px";}return dot_obj;}
function drawLineCR(idno,cx,cy,crs,cre,sr,wh,vis,cor){var tcObj = document.createElement("div");var tcW = wh,tcH = wh,tcColor = cor;var lpX = 0,lpY = 0,fx1 = cx,fy1 = cy;var rCOS = Math.cos((sr + 90 + azm) * DEG);var rSIN = Math.sin((sr + 90 + azm) * DEG);var fx2 = Math.round(rSIN * crs) + fx1;var fy2 = Math.round(rCOS * crs) + fy1;fx1 = Math.round(rSIN * cre) + fx1;fy1 = Math.round(rCOS * cre) + fy1;fx1 = Math.round(fx1 - (tcW / 2));fy1 = Math.round(fy1 - (tcH / 2));fx2 = Math.round(fx2 - (tcW / 2));fy2 = Math.round(fy2 - (tcH / 2));lpX = Math.abs(fx2 - fx1);lpY = Math.abs(fy2 - fy1);tcObj.id = idno;tcObj.style.visibility = vis ? "visible" : "hidden";if((fx1 == fx2) || (fy1 == fy2)){tcW = Math.abs(fx2 - fx1) + tcW;tcH = Math.abs(fy2 - fy1) + tcH;lpY = Math.min(fy1,fy2);lpX = Math.min(fx1,fx2);tcObj.appendChild(dot(lpX,lpY,tcW,tcH,tcColor));}else if(lpX > lpY){if(fx1 > fx2){stp = (fy1 > fy2) ? 1 : -1;s = fx1;fx1 = fx2;fx2 = s;fy1 = fy2;}else{stp = (fy1 < fy2) ? 1: -1;}tcObj.appendChild(dot(fx1,fy1,tcW,tcH,tcColor));s = lpX >> 1;while(++fx1 <= fx2){if((s -= lpY) < 0){s += lpX;fy1 += stp;}tcObj.appendChild(dot(fx1,fy1,tcW,tcH,tcColor));}}else{if(fy1 > fy2){stp = (fx1 > fx2) ? 1 : -1;s = fy1;fy1 = fy2;fy2 = s;fx1 = fx2;}else{stp = (fx1 < fx2) ? 1: -1;}tcObj.appendChild(dot(fx1,fy1,tcW,tcH,tcColor));s = lpY >> 1;while(++fy1 <= fy2){if((s -= lpX) < 0){s += lpY;fx1 += stp;}tcObj.appendChild(dot(fx1,fy1,tcW,tcH,tcColor));}}return document.body.appendChild(tcObj);}
function setCR(idno,cx,cy,cr,sr,w,h){var rCOS = Math.cos((sr + 90 + azm) * DEG);var rSIN = Math.sin((sr + 90 + azm) * DEG);var fx = Math.round(rSIN * cr) + cx;var fy = Math.round(rCOS * cr) + cy;fx = Math.round(fx - (w / 2));fy = Math.round(fy - (h / 2));pictMove(idno,fx,fy,null);}
function drawLineICR(idno,cx,cy,cr,sr1,sr2,wh,vis,cor){var tcObj = document.createElement("div");var tcColor = cor;var tcW = wh;var tcH = wh;var lpX = 0;var lpY = 0;var PI_r = Math.PI / 180;var rCOS1 = Math.cos((sr1 + 90 + azm) * PI_r);var rSIN1 = Math.sin((sr1 + 90 + azm) * PI_r);var fx1 = Math.round(rSIN1 * cr) + cx;var fy1 = Math.round(rCOS1 * cr) + cy;var rCOS2 = Math.cos((sr2 + 90 + azm) * PI_r);var rSIN2 = Math.sin((sr2 + 90 + azm) * PI_r);var fx2 = Math.round(rSIN2 * cr) + cx;var fy2 = Math.round(rCOS2 * cr) + cy;fx1 = Math.round(fx1 - (tcW / 2));fy1 = Math.round(fy1 - (tcH / 2));fx2 = Math.round(fx2 - (tcW / 2));fy2 = Math.round(fy2 - (tcH / 2));lpX = Math.abs(fx2 - fx1);lpY = Math.abs(fy2 - fy1);tcObj.id = idno;tcObj.style.visibility = vis ? "visible" : "hidden";if((fx1 == fx2) || (fy1 == fy2)){tcW = Math.abs(fx2 - fx1) + tcW;tcH = Math.abs(fy2 - fy1) + tcH;lpY = Math.min(fy1,fy2);lpX = Math.min(fx1,fx2);tcObj.appendChild(dot(lpX,lpY,tcW,tcH,tcColor));}else if(lpX > lpY){if(fx1 > fx2){stp = (fy1 > fy2) ? 1 : -1;s = fx1;fx1 = fx2;fx2 = s;fy1 = fy2;}else{stp = (fy1 < fy2) ? 1: -1;}tcObj.appendChild(dot(fx1,fy1,tcW,tcH,tcColor));s = lpX >> 1;while(++fx1 <= fx2){if((s -= lpY) < 0){s += lpX;fy1 += stp;}tcObj.appendChild(dot(fx1,fy1,tcW,tcH,tcColor));}}else{if(fy1 > fy2){stp = (fx1 > fx2) ? 1 : -1;s = fy1;fy1 = fy2;fy2 = s;fx1 = fx2;}else{stp = (fx1 < fx2) ? 1: -1;}tcObj.appendChild(dot(fx1,fy1,tcW,tcH,tcColor));s = lpY >> 1;while(++fy1 <= fy2){if((s -= lpX) < 0){s += lpY;fx1 += stp;}tcObj.appendChild(dot(fx1,fy1,tcW,tcH,tcColor));}}return document.body.appendChild(tcObj);}
function setCookie(kName,kValue,lim){life = new Date();life.setTime(life.getTime() + 24 * 60 * 60 * 1000 * lim);document.cookie = kName + "=" + escape(kValue) + "; expires=" + life.toGMTString();}
function getCookie(kName){var cookieArray = document.cookie.split("; ");for(var i = 0 ; i < cookieArray.length ; i++){var kCrumb = cookieArray[i].split("=");if(kName == kCrumb[0]){return unescape(kCrumb[1]);}}return null;}
function delCookie(kName){document.cookie = kName + "=" + escape('') + "; expires=Fri, 31 Dec 1970 10:10:10 GMT;";}


