Frame 1
function phD(ph_p) {
var _local2;
if ((ph_p >= 0) && (ph_p <= 2.49)) {
_local2 = lang.ph1;
} else if ((ph_p >= 2.5) && (ph_p <= 22.49)) {
_local2 = lang.ph2;
} else if ((ph_p >= 22.5) && (ph_p <= 27.49)) {
_local2 = lang.ph3;
} else if ((ph_p >= 27.5) && (ph_p <= 47.49)) {
_local2 = lang.ph4;
} else if ((ph_p >= 47.5) && (ph_p <= 52.49)) {
_local2 = lang.ph5;
} else if ((ph_p >= 52.5) && (ph_p <= 73.49)) {
_local2 = lang.ph6;
} else if ((ph_p >= 73.5) && (ph_p <= 77.49)) {
_local2 = lang.ph7;
} else if ((ph_p >= 77.5) && (ph_p <= 97.49)) {
_local2 = lang.ph8;
} else {
_local2 = lang.ph1;
}
return(_local2);
}
function rnd(val, prec) {
if (rnd.arguments.length == 1) {
prec = 0;
}
val = val * Math.pow(10, prec);
val = Math.round(val);
val = val / Math.pow(10, prec);
return(val);
}
function cmm_dAdj(x) {
if (x > 360) {
while (x > 360) {
x = x - 360;
}
} else if (x < 0) {
while (x < 0) {
x = x + 360;
}
}
return(x);
}
function cmm_dToR(d) {
return(((d * 2) * Math.PI) / 360);
}
function cmm_gPh(msdate) {
var _local22 = new Date(Date.UTC(1990, 0, 1, 0, 0, 0, 0));
var _local4 = ((msdate - _local22.getTime()) / MSPD) + 1;
var _local10 = 279.403303;
var _local21 = 282.768422;
var _local24 = 0.985647356386601 * _local4;
_local24 = cmm_dAdj(_local24);
var _local16 = (_local24 + _local10) - _local21;
S_M = cmm_dAdj(_local16);
_local22 = 1.91516872600429 * Math.sin(cmm_dToR(S_M));
var _local1 = (_local24 + _local22) + _local10;
_local1 = cmm_dAdj(_local1);
var _local3;
var _local15 = 318.351648;
var _local13 = 36.34041;
var _local17 = 318.510107;
var _local5 = cmm_dAdj((13.1763966 * _local4) + _local15);
var _local11 = cmm_dAdj((_local5 - (0.1114041 * _local4)) - _local13);
_local24 = cmm_dAdj(_local17 - (0.0529539 * _local4));
_local3 = (2 * (_local5 - _local1)) - _local11;
var _local9 = 1.2739 * Math.sin(cmm_dToR(_local3));
_local3 = cmm_dToR(S_M);
var _local12 = 0.1858 * Math.sin(_local3);
var _local19 = 0.37 * Math.sin(_local3);
var _local7 = ((_local11 + _local9) - _local12) - _local19;
var _local20 = 6.2886 * Math.sin(cmm_dToR(_local7));
var _local18 = 0.214 * Math.sin(2 * cmm_dToR(_local7));
var _local8 = (((_local5 + _local9) + _local20) - _local12) + _local18;
var _local23 = 0.6583 * Math.sin(cmm_dToR(2 * (_local8 - _local1)));
var _local14 = _local8 + _local23;
var _local2 = _local14 - _local1;
_local2 = cmm_dAdj(_local2);
var _local6 = 0.5 * (1 - Math.cos(cmm_dToR(_local2)));
_local6 = _local6 * 100;
_local3 = new Object();
_local3.ph = _local6;
_local3.D = _local2;
_local3.a = (_local2 / 360) * 100;
return(_local3);
}
function getTZO() {
var _local1 = new Date();
return((-_local1.getTimezoneOffset()) / 60);
}
function TZinfo(n) {
var _local1 = 0;
while (_local1 < aTZh.length) {
if (aTZh[_local1] == n) {
return(aTZd[_local1]);
}
_local1++;
}
return("TZinfo error");
}
function hmsStr(h, m, s, clock, secs, delim, pad_hr) {
h = h - 0;
m = m - 0;
s = s - 0;
if (!delim) {
delim = ":";
}
var _local2 = "";
if (clock == "24hr") {
if (m < 10) {
m = "0" + m;
}
if (h < 10) {
h = "0" + h;
}
_local2 = (h + ":") + m;
if (secs) {
if (s < 10) {
s = "0" + s;
}
_local2 = _local2 + (":" + s);
}
} else if (clock == "12hr") {
var _local1 = tI(h, m, s);
if (pad_hr && (_local1.h < 10)) {
_local1.h = "0" + _local1.h;
}
_local2 = (_local1.h + ":") + _local1.m;
if (secs) {
_local2 = _local2 + (":" + _local1.s);
}
_local2 = _local2 + (" " + _local1.ext);
}
return(_local2);
}
function tI(h, m, s, r) {
var _local3 = new Array();
var _local6 = false;
if (s || (s == 0)) {
if (r) {
s = rndN(s, r);
_local6 = true;
}
if (s < 10) {
s = "0" + s;
} else if (s == 60) {
s = "00";
if (m) {
m = (m - 0) + 1;
}
}
_local3.s = s;
}
if (m || (m == 0)) {
if (r && (!_local6)) {
m = rndN(m, r);
}
if (m < 10) {
m = "0" + m;
} else if (m == 60) {
m = "00";
if (h) {
h = (h - 0) + 1;
}
}
_local3.m = m;
}
if (h || (h == 0)) {
_local6 = f24h(h);
_local3.h = _local6.h;
_local3.ext = _local6.ext;
}
return(_local3);
}
function rndN(val, r) {
if (!r) {
return(val);
}
var _local1 = val;
while (_local1 > r) {
_local1 = _local1 - r;
}
val = val - _local1;
if ((_local1 / r) >= 0.5) {
val = val + r;
}
return(val);
}
function f24h(h) {
var _local2 = new Array();
if (h || (h == 0)) {
if (h >= 24) {
while (h >= 24) {
h = h - 24;
}
}
if (h >= 12) {
h = ((h == 12) ? 12 : (h - 12));
_local2.ext = "PM";
} else {
h = ((h == 0) ? 12 : (h));
_local2.ext = "AM";
}
_local2.h = h;
} else {
return(-1);
}
return(_local2);
}
function HexToR(h) {
return(parseInt(cutHex(h).substring(0, 2), 16));
}
function HexToG(h) {
return(parseInt(cutHex(h).substring(2, 4), 16));
}
function HexToB(h) {
return(parseInt(cutHex(h).substring(4, 6), 16));
}
function cutHex(h) {
return(((h.charAt(0) == "#") ? (h.substring(1, 7)) : (h)));
}
function setColors() {
var _local1 = new flash.geom.ColorTransform();
var _local12 = new Number("0x" + bg_color);
_local1.rgb = _local12;
var _local8 = new flash.geom.Transform(background_mc);
_local8.colorTransform = _local1;
var _local9 = new flash.geom.Transform(moon_all_mc.crop_mc);
_local9.colorTransform = _local1;
var _local7 = new flash.geom.Transform(moon_all_mc.gibbous_shadow_mc);
_local7.colorTransform = _local1;
var _local6 = new flash.geom.Transform(moon_all_mc.crescent_shadow_mc);
_local6.colorTransform = _local1;
var _local4 = new flash.geom.Transform(moon_all_mc.half_mc);
_local4.colorTransform = _local1;
var _local2 = new flash.geom.ColorTransform(1, 1, 1, 1, HexToR(moon_color), HexToG(moon_color), HexToB(moon_color), 0);
if (moon_all_mc.moon_img_mc1) {
_local7 = new flash.geom.Transform(moon_all_mc.moon_img_mc1);
_local7.colorTransform = _local2;
}
if (moon_all_mc.moon_img_mc2) {
var _local11 = new flash.geom.Transform(moon_all_mc.moon_img_mc2);
_local11.colorTransform = _local2;
}
_local6 = new flash.geom.Transform(moon_overlay_img_mc);
_local6.colorTransform = _local2;
var _local3 = new flash.geom.ColorTransform();
var _local10 = new Number("0x" + text_color);
_local3.rgb = _local10;
var _local5 = new flash.geom.Transform(h_icon_mc);
_local5.colorTransform = _local3;
}
function setMoonImage(ph_i) {
var _local4 = ph_i.a;
var _local3 = rnd(_local4, 0) / 100;
var _local2 = rnd(_local3 * 40, 0);
var _local1;
if (hemisphere == 2) {
n = 40 - _local2;
} else {
n = _local2;
}
if ((n == 0) || (n == 40)) {
_local1 = 30;
} else if (n == 30) {
_local1 = 40;
} else if (n > 30) {
_local1 = ((35 - n) * 2) + n;
} else {
_local1 = n;
}
moon_all_mc.gotoAndStop(_local1);
}
function hemisphereRotation() {
if (hemisphere == 2) {
hemisphere_str = lang.sh2;
moon_all_mc.moon_img_mc1._rotation = 180;
moon_all_mc.moon_img_mc2._rotation = 180;
moon_all_mc.moon_overlay_img_mc._rotation = 180;
h_icon_mc._rotation = 180;
} else if (hemisphere == 1) {
hemisphere_str = lang.nh2;
moon_all_mc.moon_img_mc1._rotation = 0;
moon_all_mc.moon_img_mc2._rotation = 0;
moon_all_mc.moon_overlay_img_mc._rotation = 0;
h_icon_mc._rotation = 0;
}
}
function showHemisphereOptions() {
hemisphere_mc._visible = true;
return(undefined);
}
function makeDataStr(tdy, ph_i) {
var _local7 = ph_i.ph;
var _local9 = ph_i.a;
data_txt1.autoSize = ((mod_layout == "v") ? "center" : "left");
data_txt1.textColor = "0x" + text_color;
data_txt1.text = phD(_local9) + "";
data_txt2.autoSize = ((mod_layout == "v") ? "center" : "left");
data_txt2.textColor = "0x" + text_color;
data_txt2.text = (rnd(_local7, 0) + "% ") + lang.pof;
data_txt3.autoSize = ((mod_layout == "v") ? "center" : "left");
data_txt3.textColor = "0x" + text_color;
var _local4 = tdy.getDate();
var _local1 = tdy.getMonth() + 1;
var _local5 = tdy.getFullYear();
if (_local1 < 10) {
_local1 = "0" + _local1;
}
var _local2 = (dfd_option ? "/" : ".");
if (date_format == "mdy") {
data_txt3.text = (((_local1 + _local2) + _local4) + _local2) + _local5;
} else if (date_format == "dmy") {
data_txt3.text = (((_local4 + _local2) + _local1) + _local2) + _local5;
} else if (date_format == "ymd") {
data_txt3.text = (((_local5 + _local2) + _local1) + _local2) + _local4;
} else {
data_txt3.text = (((((aDW[tdy.getDay()] + " ") + _local4) + " ") + aM2[_local1 - 1]) + ", ") + _local5;
}
data_txt4.autoSize = ((mod_layout == "v") ? "center" : "left");
data_txt4.textColor = "0x" + text_color;
if (time_format == "tz") {
var _local6 = TZinfo(getTZO());
data_txt4.text = lang.gmt + ((_local6 == "GMT") ? "" : (" " + _local6));
} else {
var _local8 = ((time_format == "12hr") ? false : true);
data_txt4.text = hmsStr(tdy.getHours(), tdy.getMinutes(), tdy.getSeconds(), time_format, show_secs, "", _local8);
}
}
function createModule() {
var _local2 = new Date();
var _local1 = cmm_gPh(_local2);
setMoonImage(_local1);
hemisphereRotation();
makeDataStr(_local2, _local1);
setColors();
}
function isTrue(x) {
if ((((((x == undefined) || (x == "undefined")) || (x == "")) || (x == false)) || (x == null)) || (x == 0)) {
return(false);
}
return(true);
}
function hasValue(x) {
if (((((x == undefined) || (x == "undefined")) || (x === "")) || (x === false)) || (x === null)) {
return(false);
}
return(true);
}
var mod_layout = "h";
hemisphere_mc._visible = false;
hemisphere_mc.nh_mc.nh_bg_mc._visible = false;
hemisphere_mc.sh_mc.sh_bg_mc._visible = false;
var so = SharedObject.getLocal("moon_module_settings");
var usage = _level0.u;
var tracking_code = _level0.tk;
var text_color = ((_level0.tc == undefined) ? "FFFFFF" : (_level0.tc));
var bg_color = ((_level0.bgc == undefined) ? "000000" : (_level0.bgc));
var moon_color = ((_level0.mc == undefined) ? "000000" : (_level0.mc));
if (so.data.hs != undefined) {
hemisphere = so.data.hs;
} else if (_level0.hs != undefined) {
hemisphere = _level0.hs;
} else {
hemisphere = 1;
}
var cfg_js = _level0.js;
var cfg_msp = _level0.msp;
var host = _level0.hst;
var url = _level0.url;
var date_format = _level0.df;
var dfd_option = (_level0.dfd * 1);
var time_format = _level0.tf;
if (time_format != "tz") {
time_format = ((time_format == "24hr") ? "24hr" : "12hr");
}
var show_secs = ((_level0.scs === undefined) ? true : (_level0.scs * 1));
if (time_format != "tz") {
if (mod_layout == "v") {
if (!show_secs) {
data_txt4._x = data_txt4._x + 1;
h_icon_mc._x = h_icon_mc._x - 6;
h_icon_inv_btn._x = h_icon_inv_btn._x - 6;
}
if (time_format == "24hr") {
data_txt4._x = data_txt4._x + 1;
h_icon_mc._x = h_icon_mc._x - 6;
h_icon_inv_btn._x = h_icon_inv_btn._x - 6;
}
} else if (mod_layout == "h") {
if (!show_secs) {
h_icon_mc._x = h_icon_mc._x - 12;
h_icon_inv_btn._x = h_icon_inv_btn._x - 12;
}
if (time_format == "24hr") {
h_icon_mc._x = h_icon_mc._x - 12;
h_icon_inv_btn._x = h_icon_inv_btn._x - 12;
}
}
}
var lang_id = ((_level0.lg == undefined) ? "en" : (_level0.lg));
var lgA = new Array();
lgA.en = {ph1:"New Moon", ph2:"Waxing Crescent", ph3:"First Quarter", ph4:"Waxing Gibbous", ph5:"Full Moon", ph6:"Waning Gibbous", ph7:"Third Quarter", ph8:"Waning Crescent", ph9:"New Moon", pof:"of Full", wd1:"Sun", wd2:"Mon", wd3:"Tue", wd4:"Wed", wd5:"Thu", wd6:"Fri", wd7:"Sat", mo1:"Jan", mo2:"Feb", mo3:"Mar", mo4:"Apr", mo5:"May", mo6:"Jun", mo7:"Jul", mo8:"Aug", mo9:"Sep", mo10:"Oct", mo11:"Nov", mo12:"Dec", gmt:"GMT", nh1:"N", nh2:"NH", sh1:"S", sh2:"SH", ht:"Choose your hemisphere:"};
var lang = lgA[lang_id];
if (!lang) {
lang = lgA.en;
}
hemisphere_mc.h_txt.text = lang.ht;
hemisphere_mc.nh_mc.nh_txt.text = lang.nh1;
hemisphere_mc.sh_mc.sh_txt.text = lang.sh1;
var MSPD = 86400000;
var aDW = new Array(lang.wd1, lang.wd2, lang.wd3, lang.wd4, lang.wd5, lang.wd6, lang.wd7);
var aM2 = new Array(lang.mo1, lang.mo2, lang.mo3, lang.mo4, lang.mo5, lang.mo6, lang.mo7, lang.mo8, lang.mo9, lang.mo10, lang.mo11, lang.mo12);
var aTZh = new Array(-12, -11, -10, -9.5, -9, -8.5, -8, -7, -6, -5, -4, -3.5, -3, -2, -1, 0, 1, 2, 3, 3.5, 4, 4.5, 5, 5.5, 6, 6.5, 7, 8, 9, 9.5, 10, 10.5, 11, 11.5, 12, 13);
var aTZd = new Array("-12:00", "-11:00", "-10:00", "-09:30", "-09:00", "-08:30", "-08:00", "-07:00", "-06:00", "-05:00", "-04:00", "-03:30", "-03:00", "-02:00", "-01:00", "GMT", "+01:00", "+02:00", "+03:00", "+03:30", "+04:00", "+04:30", "+05:00", "+05:30", "+06:00", "+06:30", "+07:00", "+08:00", "+09:00", "+09:30", "+10:00", "+10:30", "+11:00", "+11:30", "+12:00", "+13:00");
var hemisphere_str = "";
h_icon_inv_btn.onRelease = function () {
showHemisphereOptions();
return(undefined);
};
hemisphere_mc.nh_mc.onRollOver = function () {
hemisphere_mc.nh_mc.nh_bg_mc._visible = true;
return(undefined);
};
hemisphere_mc.nh_mc.onRollOut = function () {
hemisphere_mc.nh_mc.nh_bg_mc._visible = false;
return(undefined);
};
hemisphere_mc.nh_mc.onRelease = function () {
hemisphere_mc._visible = false;
hemisphere = 1;
so.data.hs = 1;
flush_res = so.flush();
createModule();
};
hemisphere_mc.sh_mc.onRollOver = function () {
hemisphere_mc.sh_mc.sh_bg_mc._visible = true;
return(undefined);
};
hemisphere_mc.sh_mc.onRollOut = function () {
hemisphere_mc.sh_mc.sh_bg_mc._visible = false;
return(undefined);
};
hemisphere_mc.sh_mc.onRelease = function () {
hemisphere_mc._visible = false;
hemisphere = 2;
so.data.hs = 2;
flush_res = so.flush();
createModule();
createModule();
};
createModule();
createModule();
if (show_secs) {
var intervalID = setInterval(createModule, 100);
} else {
var intervalID = setInterval(createModule, 15000);
}
var url = "";
if (usage == "mc") {
url = "http://www.moonconnection.com/go/mcmf/";
} else if (usage == "cc") {
url = "http://www.calculatorcat.com/go/ccmf/";
} else if (usage == "gm") {
if (isTrue(tracking_code)) {
url = ("http://www.moonconnection.com/go/" + tracking_code) + "/";
} else {
url = "http://www.moonconnection.com/quickphase/";
}
} else if (usage == "mcpn") {
if (isTrue(tracking_code)) {
url = ("http://www.moonconnection.com/go/" + tracking_code) + "/";
}
} else if ((usage == "ccpn") || (usage == "pn")) {
if (isTrue(tracking_code)) {
url = ("http://www.calculatorcat.com/go/" + tracking_code) + "/";
}
} else if (isTrue(tracking_code)) {
url = ("http://www.moonconnection.com/go/" + tracking_code) + "/";
} else {
url = "http://www.moonconnection.com/go/dmf/";
}
if (isTrue(url)) {
invisible_btn.onRelease = function () {
getURL (url, "_blank");
};
} else {
invisible_btn._visible = false;
}
Symbol 20 MovieClip Frame 1
this._parent.setColors();
Symbol 20 MovieClip Frame 11
this._parent.setColors();
Symbol 20 MovieClip Frame 20
this._parent.setColors();
Symbol 20 MovieClip Frame 21
this._parent.setColors();
Symbol 20 MovieClip Frame 30
this._parent.setColors();
this._parent.setColors();
Symbol 20 MovieClip Frame 31
this._parent.setColors();
Symbol 20 MovieClip Frame 40
this._parent.setColors();