Advertisement
Guest User

radu

a guest
Jan 29th, 2010
1,726
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. var swfobject = function () {
  2.     var D = "undefined",
  3.         r = "object",
  4.         S = "Shockwave Flash",
  5.         W = "ShockwaveFlash.ShockwaveFlash",
  6.         q = "application/x-shockwave-flash",
  7.         R = "SWFObjectExprInst",
  8.         x = "onreadystatechange",
  9.         O = window,
  10.         j = document,
  11.         t = navigator,
  12.         T = false,
  13.         U = [h],
  14.         o = [],
  15.         N = [],
  16.         I = [],
  17.         l, Q, E, B, J = false,
  18.         a = false,
  19.         n, G, m = true,
  20.         M = function () {
  21.         var aa = typeof j.getElementById != D && typeof j.getElementsByTagName != D && typeof j.createElement != D,
  22.             ah = t.userAgent.toLowerCase(),
  23.             Y = t.platform.toLowerCase(),
  24.             ae = Y ? /win/.test(Y) : /win/.test(ah),
  25.         ac = Y ? /mac/.test(Y) : /mac/.test(ah),
  26.         af = /webkit/.test(ah) ? parseFloat(ah.replace(/^.*webkit\/(\d+(\.\d+)?).*$/, "$1")) : false,
  27.         X = !+"\v1",
  28.         ag = [0, 0, 0],
  29.         ab = null;
  30.         if (typeof t.plugins != D && typeof t.plugins[S] == r) {
  31.             ab = t.plugins[S].description;
  32.             if (ab && !(typeof t.mimeTypes != D && t.mimeTypes[q] && !t.mimeTypes[q].enabledPlugin)) {
  33.                 T = true;
  34.                 X = false;
  35.                 ab = ab.replace(/^.*\s+(\S+\s+\S+$)/, "$1");
  36.                 ag[0] = parseInt(ab.replace(/^(.*)\..*$/, "$1"), 10);
  37.                 ag[1] = parseInt(ab.replace(/^.*\.(.*)\s.*$/, "$1"), 10);
  38.                 ag[2] = /[a-zA-Z]/.test(ab) ? parseInt(ab.replace(/^.*[a-zA-Z]+(.*)$/, "$1"), 10) : 0
  39.             }
  40.         } else {
  41.             if (typeof O.ActiveXObject != D) {
  42.                 try {
  43.                     var ad = new ActiveXObject(W);
  44.                     if (ad) {
  45.                         ab = ad.GetVariable("$version");
  46.                         if (ab) {
  47.                             X = true;
  48.                             ab = ab.split(" ")[1].split(",");
  49.                             ag = [parseInt(ab[0], 10), parseInt(ab[1], 10), parseInt(ab[2], 10)]
  50.                         }
  51.                     }
  52.                 } catch(Z) {}
  53.             }
  54.         }
  55.         return {
  56.             w3: aa,
  57.             pv: ag,
  58.             wk: af,
  59.             ie: X,
  60.             win: ae,
  61.             mac: ac
  62.         }
  63.     }(),
  64.         k = function () {
  65.         if (!M.w3) {
  66.             return
  67.         }
  68.         if ((typeof j.readyState != D && j.readyState == "complete") || (typeof j.readyState == D && (j.getElementsByTagName("body")[0] || j.body))) {
  69.             f()
  70.         }
  71.         if (!J) {
  72.             if (typeof j.addEventListener != D) {
  73.                 j.addEventListener("DOMContentLoaded", f, false)
  74.             }
  75.             if (M.ie && M.win) {
  76.                 j.attachEvent(x, function () {
  77.                     if (j.readyState == "complete") {
  78.                         j.detachEvent(x, arguments.callee);
  79.                         f()
  80.                     }
  81.                 });
  82.                 if (O == top) {
  83.                     (function () {
  84.                         if (J) {
  85.                             return
  86.                         }
  87.                         try {
  88.                             j.documentElement.doScroll("left")
  89.                         } catch(X) {
  90.                             setTimeout(arguments.callee, 0);
  91.                             return
  92.                         }
  93.                         f()
  94.                     })()
  95.                 }
  96.             }
  97.             if (M.wk) {
  98.                 (function () {
  99.                     if (J) {
  100.                         return
  101.                     }
  102.                     if (!/loaded|complete/.test(j.readyState)) {
  103.                         setTimeout(arguments.callee, 0);
  104.                         return
  105.                     }
  106.                     f()
  107.                 })()
  108.             }
  109.             s(f)
  110.         }
  111.     }();
  112.  
  113.     function f() {
  114.         if (J) {
  115.             return
  116.         }
  117.         try {
  118.             var Z = j.getElementsByTagName("body")[0].appendChild(C("span"));
  119.             Z.parentNode.removeChild(Z)
  120.         } catch(aa) {
  121.             return
  122.         }
  123.         J = true;
  124.         var X = U.length;
  125.         for (var Y = 0; Y < X; Y++) {
  126.             U[Y]()
  127.         }
  128.     }
  129.     function K(X) {
  130.         if (J) {
  131.             X()
  132.         } else {
  133.             U[U.length] = X
  134.         }
  135.     }
  136.     function s(Y) {
  137.         if (typeof O.addEventListener != D) {
  138.             O.addEventListener("load", Y, false)
  139.         } else {
  140.             if (typeof j.addEventListener != D) {
  141.                 j.addEventListener("load", Y, false)
  142.             } else {
  143.                 if (typeof O.attachEvent != D) {
  144.                     i(O, "onload", Y)
  145.                 } else {
  146.                     if (typeof O.onload == "function") {
  147.                         var X = O.onload;
  148.                         O.onload = function () {
  149.                             X();
  150.                             Y()
  151.                         }
  152.                     } else {
  153.                         O.onload = Y
  154.                     }
  155.                 }
  156.             }
  157.         }
  158.     }
  159.     function h() {
  160.         if (T) {
  161.             V()
  162.         } else {
  163.             H()
  164.         }
  165.     }
  166.     function V() {
  167.         var X = j.getElementsByTagName("body")[0];
  168.         var aa = C(r);
  169.         aa.setAttribute("type", q);
  170.         var Z = X.appendChild(aa);
  171.         if (Z) {
  172.             var Y = 0;
  173.             (function () {
  174.                 if (typeof Z.GetVariable != D) {
  175.                     var ab = Z.GetVariable("$version");
  176.                     if (ab) {
  177.                         ab = ab.split(" ")[1].split(",");
  178.                         M.pv = [parseInt(ab[0], 10), parseInt(ab[1], 10), parseInt(ab[2], 10)]
  179.                     }
  180.                 } else {
  181.                     if (Y < 10) {
  182.                         Y++;
  183.                         setTimeout(arguments.callee, 10);
  184.                         return
  185.                     }
  186.                 }
  187.                 X.removeChild(aa);
  188.                 Z = null;
  189.                 H()
  190.             })()
  191.         } else {
  192.             H()
  193.         }
  194.     }
  195.     function H() {
  196.         var ag = o.length;
  197.         if (ag > 0) {
  198.             for (var af = 0; af < ag; af++) {
  199.                 var Y = o[af].id;
  200.                 var ab = o[af].callbackFn;
  201.                 var aa = {
  202.                     success: false,
  203.                     id: Y
  204.                 };
  205.                 if (M.pv[0] > 0) {
  206.                     var ae = c(Y);
  207.                     if (ae) {
  208.                         if (F(o[af].swfVersion) && !(M.wk && M.wk < 312)) {
  209.                             w(Y, true);
  210.                             if (ab) {
  211.                                 aa.success = true;
  212.                                 aa.ref = z(Y);
  213.                                 ab(aa)
  214.                             }
  215.                         } else {
  216.                             if (o[af].expressInstall && A()) {
  217.                                 var ai = {};
  218.                                 ai.data = o[af].expressInstall;
  219.                                 ai.width = ae.getAttribute("width") || "0";
  220.                                 ai.height = ae.getAttribute("height") || "0";
  221.                                 if (ae.getAttribute("class")) {
  222.                                     ai.styleclass = ae.getAttribute("class")
  223.                                 }
  224.                                 if (ae.getAttribute("align")) {
  225.                                     ai.align = ae.getAttribute("align")
  226.                                 }
  227.                                 var ah = {};
  228.                                 var X = ae.getElementsByTagName("param");
  229.                                 var ac = X.length;
  230.                                 for (var ad = 0; ad < ac; ad++) {
  231.                                     if (X[ad].getAttribute("name").toLowerCase() != "movie") {
  232.                                         ah[X[ad].getAttribute("name")] = X[ad].getAttribute("value")
  233.                                     }
  234.                                 }
  235.                                 P(ai, ah, Y, ab)
  236.                             } else {
  237.                                 p(ae);
  238.                                 if (ab) {
  239.                                     ab(aa)
  240.                                 }
  241.                             }
  242.                         }
  243.                     }
  244.                 } else {
  245.                     w(Y, true);
  246.                     if (ab) {
  247.                         var Z = z(Y);
  248.                         if (Z && typeof Z.SetVariable != D) {
  249.                             aa.success = true;
  250.                             aa.ref = Z
  251.                         }
  252.                         ab(aa)
  253.                     }
  254.                 }
  255.             }
  256.         }
  257.     }
  258.     function z(aa) {
  259.         var X = null;
  260.         var Y = c(aa);
  261.         if (Y && Y.nodeName == "OBJECT") {
  262.             if (typeof Y.SetVariable != D) {
  263.                 X = Y
  264.             } else {
  265.                 var Z = Y.getElementsByTagName(r)[0];
  266.                 if (Z) {
  267.                     X = Z
  268.                 }
  269.             }
  270.         }
  271.         return X
  272.     }
  273.     function A() {
  274.         return !a && F("6.0.65") && (M.win || M.mac) && !(M.wk && M.wk < 312)
  275.     }
  276.     function P(aa, ab, X, Z) {
  277.         a = true;
  278.         E = Z || null;
  279.         B = {
  280.             success: false,
  281.             id: X
  282.         };
  283.         var ae = c(X);
  284.         if (ae) {
  285.             if (ae.nodeName == "OBJECT") {
  286.                 l = g(ae);
  287.                 Q = null
  288.             } else {
  289.                 l = ae;
  290.                 Q = X
  291.             }
  292.             aa.id = R;
  293.             if (typeof aa.width == D || (!/%$/.test(aa.width) && parseInt(aa.width, 10) < 310)) {
  294.                 aa.width = "310"
  295.             }
  296.             if (typeof aa.height == D || (!/%$/.test(aa.height) && parseInt(aa.height, 10) < 137)) {
  297.                 aa.height = "137"
  298.             }
  299.             j.title = j.title.slice(0, 47) + " - Flash Player Installation";
  300.             var ad = M.ie && M.win ? "ActiveX" : "PlugIn",
  301.             ac = "MMredirectURL=" + O.location.toString().replace(/&/g, "%26") + "&MMplayerType=" + ad + "&MMdoctitle=" + j.title;
  302.             if (typeof ab.flashvars != D) {
  303.                 ab.flashvars += "&" + ac
  304.             } else {
  305.                 ab.flashvars = ac
  306.             }
  307.             if (M.ie && M.win && ae.readyState != 4) {
  308.                 var Y = C("div");
  309.                 X += "SWFObjectNew";
  310.                 Y.setAttribute("id", X);
  311.                 ae.parentNode.insertBefore(Y, ae);
  312.                 ae.style.display = "none";
  313.                 (function () {
  314.                     if (ae.readyState == 4) {
  315.                         ae.parentNode.removeChild(ae)
  316.                     } else {
  317.                         setTimeout(arguments.callee, 10)
  318.                     }
  319.                 })()
  320.             }
  321.             u(aa, ab, X)
  322.         }
  323.     }
  324.     function p(Y) {
  325.         if (M.ie && M.win && Y.readyState != 4) {
  326.             var X = C("div");
  327.             Y.parentNode.insertBefore(X, Y);
  328.             X.parentNode.replaceChild(g(Y), X);
  329.             Y.style.display = "none";
  330.             (function () {
  331.                 if (Y.readyState == 4) {
  332.                     Y.parentNode.removeChild(Y)
  333.                 } else {
  334.                     setTimeout(arguments.callee, 10)
  335.                 }
  336.             })()
  337.         } else {
  338.             Y.parentNode.replaceChild(g(Y), Y)
  339.         }
  340.     }
  341.     function g(ab) {
  342.         var aa = C("div");
  343.         if (M.win && M.ie) {
  344.             aa.innerHTML = ab.innerHTML
  345.         } else {
  346.             var Y = ab.getElementsByTagName(r)[0];
  347.             if (Y) {
  348.                 var ad = Y.childNodes;
  349.                 if (ad) {
  350.                     var X = ad.length;
  351.                     for (var Z = 0; Z < X; Z++) {
  352.                         if (! (ad[Z].nodeType == 1 && ad[Z].nodeName == "PARAM") && !(ad[Z].nodeType == 8)) {
  353.                             aa.appendChild(ad[Z].cloneNode(true))
  354.                         }
  355.                     }
  356.                 }
  357.             }
  358.         }
  359.         return aa
  360.     }
  361.     function u(ai, ag, Y) {
  362.         var X, aa = c(Y);
  363.         if (M.wk && M.wk < 312) {
  364.             return X
  365.         }
  366.         if (aa) {
  367.             if (typeof ai.id == D) {
  368.                 ai.id = Y
  369.             }
  370.             if (M.ie && M.win) {
  371.                 var ah = "";
  372.                 for (var ae in ai) {
  373.                     if (ai[ae] != Object.prototype[ae]) {
  374.                         if (ae.toLowerCase() == "data") {
  375.                             ag.movie = ai[ae]
  376.                         } else {
  377.                             if (ae.toLowerCase() == "styleclass") {
  378.                                 ah += ' class="' + ai[ae] + '"'
  379.                             } else {
  380.                                 if (ae.toLowerCase() != "classid") {
  381.                                     ah += " " + ae + '="' + ai[ae] + '"'
  382.                                 }
  383.                             }
  384.                         }
  385.                     }
  386.                 }
  387.                 var af = "";
  388.                 for (var ad in ag) {
  389.                     if (ag[ad] != Object.prototype[ad]) {
  390.                         af += '<param name="' + ad + '" value="' + ag[ad] + '" />'
  391.                     }
  392.                 }
  393.                 aa.outerHTML = '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"' + ah + ">" + af + "</object>";
  394.                 N[N.length] = ai.id;
  395.                 X = c(ai.id)
  396.             } else {
  397.                 var Z = C(r);
  398.                 Z.setAttribute("type", q);
  399.                 for (var ac in ai) {
  400.                     if (ai[ac] != Object.prototype[ac]) {
  401.                         if (ac.toLowerCase() == "styleclass") {
  402.                             Z.setAttribute("class", ai[ac])
  403.                         } else {
  404.                             if (ac.toLowerCase() != "classid") {
  405.                                 Z.setAttribute(ac, ai[ac])
  406.                             }
  407.                         }
  408.                     }
  409.                 }
  410.                 for (var ab in ag) {
  411.                     if (ag[ab] != Object.prototype[ab] && ab.toLowerCase() != "movie") {
  412.                         e(Z, ab, ag[ab])
  413.                     }
  414.                 }
  415.                 aa.parentNode.replaceChild(Z, aa);
  416.                 X = Z
  417.             }
  418.         }
  419.         return X
  420.     }
  421.     function e(Z, X, Y) {
  422.         var aa = C("param");
  423.         aa.setAttribute("name", X);
  424.         aa.setAttribute("value", Y);
  425.         Z.appendChild(aa)
  426.     }
  427.     function y(Y) {
  428.         var X = c(Y);
  429.         if (X && X.nodeName == "OBJECT") {
  430.             if (M.ie && M.win) {
  431.                 X.style.display = "none";
  432.                 (function () {
  433.                     if (X.readyState == 4) {
  434.                         b(Y)
  435.                     } else {
  436.                         setTimeout(arguments.callee, 10)
  437.                     }
  438.                 })()
  439.             } else {
  440.                 X.parentNode.removeChild(X)
  441.             }
  442.         }
  443.     }
  444.     function b(Z) {
  445.         var Y = c(Z);
  446.         if (Y) {
  447.             for (var X in Y) {
  448.                 if (typeof Y[X] == "function") {
  449.                     Y[X] = null
  450.                 }
  451.             }
  452.             Y.parentNode.removeChild(Y)
  453.         }
  454.     }
  455.     function c(Z) {
  456.         var X = null;
  457.         try {
  458.             X = j.getElementById(Z)
  459.         } catch(Y) {}
  460.         return X
  461.     }
  462.     function C(X) {
  463.         return j.createElement(X)
  464.     }
  465.     function i(Z, X, Y) {
  466.         Z.attachEvent(X, Y);
  467.         I[I.length] = [Z, X, Y]
  468.     }
  469.     function F(Z) {
  470.         var Y = M.pv,
  471.             X = Z.split(".");
  472.         X[0] = parseInt(X[0], 10);
  473.         X[1] = parseInt(X[1], 10) || 0;
  474.         X[2] = parseInt(X[2], 10) || 0;
  475.         return (Y[0] > X[0] || (Y[0] == X[0] && Y[1] > X[1]) || (Y[0] == X[0] && Y[1] == X[1] && Y[2] >= X[2])) ? true : false
  476.     }
  477.     function v(ac, Y, ad, ab) {
  478.         if (M.ie && M.mac) {
  479.             return
  480.         }
  481.         var aa = j.getElementsByTagName("head")[0];
  482.         if (!aa) {
  483.             return
  484.         }
  485.         var X = (ad && typeof ad == "string") ? ad : "screen";
  486.         if (ab) {
  487.             n = null;
  488.             G = null
  489.         }
  490.         if (!n || G != X) {
  491.             var Z = C("style");
  492.             Z.setAttribute("type", "text/css");
  493.             Z.setAttribute("media", X);
  494.             n = aa.appendChild(Z);
  495.             if (M.ie && M.win && typeof j.styleSheets != D && j.styleSheets.length > 0) {
  496.                 n = j.styleSheets[j.styleSheets.length - 1]
  497.             }
  498.             G = X
  499.         }
  500.         if (M.ie && M.win) {
  501.             if (n && typeof n.addRule == r) {
  502.                 n.addRule(ac, Y)
  503.             }
  504.         } else {
  505.             if (n && typeof j.createTextNode != D) {
  506.                 n.appendChild(j.createTextNode(ac + " {" + Y + "}"))
  507.             }
  508.         }
  509.     }
  510.     function w(Z, X) {
  511.         if (!m) {
  512.             return
  513.         }
  514.         var Y = X ? "visible" : "hidden";
  515.         if (J && c(Z)) {
  516.             c(Z).style.visibility = Y
  517.         } else {
  518.             v("#" + Z, "visibility:" + Y)
  519.         }
  520.     }
  521.     function L(Y) {
  522.         var Z = /[\\\"<>\.;]/;
  523.         var X = Z.exec(Y) != null;
  524.         return X && typeof encodeURIComponent != D ? encodeURIComponent(Y) : Y
  525.     }
  526.     var d = function () {
  527.         if (M.ie && M.win) {
  528.             window.attachEvent("onunload", function () {
  529.                 var ac = I.length;
  530.                 for (var ab = 0; ab < ac; ab++) {
  531.                     I[ab][0].detachEvent(I[ab][1], I[ab][2])
  532.                 }
  533.                 var Z = N.length;
  534.                 for (var aa = 0; aa < Z; aa++) {
  535.                     y(N[aa])
  536.                 }
  537.                 for (var Y in M) {
  538.                     M[Y] = null
  539.                 }
  540.                 M = null;
  541.                 for (var X in swfobject) {
  542.                     swfobject[X] = null
  543.                 }
  544.                 swfobject = null
  545.             })
  546.         }
  547.     }();
  548.     return {
  549.         registerObject: function (ab, X, aa, Z) {
  550.             if (M.w3 && ab && X) {
  551.                 var Y = {};
  552.                 Y.id = ab;
  553.                 Y.swfVersion = X;
  554.                 Y.expressInstall = aa;
  555.                 Y.callbackFn = Z;
  556.                 o[o.length] = Y;
  557.                 w(ab, false)
  558.             } else {
  559.                 if (Z) {
  560.                     Z({
  561.                         success: false,
  562.                         id: ab
  563.                     })
  564.                 }
  565.             }
  566.         },
  567.         getObjectById: function (X) {
  568.             if (M.w3) {
  569.                 return z(X)
  570.             }
  571.         },
  572.         embedSWF: function (ab, ah, ae, ag, Y, aa, Z, ad, af, ac) {
  573.             var X = {
  574.                 success: false,
  575.                 id: ah
  576.             };
  577.             if (M.w3 && !(M.wk && M.wk < 312) && ab && ah && ae && ag && Y) {
  578.                 w(ah, false);
  579.                 K(function () {
  580.                     ae += "";
  581.                     ag += "";
  582.                     var aj = {};
  583.                     if (af && typeof af === r) {
  584.                         for (var al in af) {
  585.                             aj[al] = af[al]
  586.                         }
  587.                     }
  588.                     aj.data = ab;
  589.                     aj.width = ae;
  590.                     aj.height = ag;
  591.                     var am = {};
  592.                     if (ad && typeof ad === r) {
  593.                         for (var ak in ad) {
  594.                             am[ak] = ad[ak]
  595.                         }
  596.                     }
  597.                     if (Z && typeof Z === r) {
  598.                         for (var ai in Z) {
  599.                             if (typeof am.flashvars != D) {
  600.                                 am.flashvars += "&" + ai + "=" + Z[ai]
  601.                             } else {
  602.                                 am.flashvars = ai + "=" + Z[ai]
  603.                             }
  604.                         }
  605.                     }
  606.                     if (F(Y)) {
  607.                         var an = u(aj, am, ah);
  608.                         if (aj.id == ah) {
  609.                             w(ah, true)
  610.                         }
  611.                         X.success = true;
  612.                         X.ref = an
  613.                     } else {
  614.                         if (aa && A()) {
  615.                             aj.data = aa;
  616.                             P(aj, am, ah, ac);
  617.                             return
  618.                         } else {
  619.                             w(ah, true)
  620.                         }
  621.                     }
  622.                     if (ac) {
  623.                         ac(X)
  624.                     }
  625.                 })
  626.             } else {
  627.                 if (ac) {
  628.                     ac(X)
  629.                 }
  630.             }
  631.         },
  632.         switchOffAutoHideShow: function () {
  633.             m = false
  634.         },
  635.         ua: M,
  636.         getFlashPlayerVersion: function () {
  637.             return {
  638.                 major: M.pv[0],
  639.                 minor: M.pv[1],
  640.                 release: M.pv[2]
  641.             }
  642.         },
  643.         hasFlashPlayerVersion: F,
  644.         createSWF: function (Z, Y, X) {
  645.             if (M.w3) {
  646.                 return u(Z, Y, X)
  647.             } else {
  648.                 return undefined
  649.             }
  650.         },
  651.         showExpressInstall: function (Z, aa, X, Y) {
  652.             if (M.w3 && A()) {
  653.                 P(Z, aa, X, Y)
  654.             }
  655.         },
  656.         removeSWF: function (X) {
  657.             if (M.w3) {
  658.                 y(X)
  659.             }
  660.         },
  661.         createCSS: function (aa, Z, Y, X) {
  662.             if (M.w3) {
  663.                 v(aa, Z, Y, X)
  664.             }
  665.         },
  666.         addDomLoadEvent: K,
  667.         addLoadEvent: s,
  668.         getQueryParamValue: function (aa) {
  669.             var Z = j.location.search || j.location.hash;
  670.             if (Z) {
  671.                 if (/\?/.test(Z)) {
  672.                     Z = Z.split("?")[1]
  673.                 }
  674.                 if (aa == null) {
  675.                     return L(Z)
  676.                 }
  677.                 var Y = Z.split("&");
  678.                 for (var X = 0; X < Y.length; X++) {
  679.                     if (Y[X].substring(0, Y[X].indexOf("=")) == aa) {
  680.                         return L(Y[X].substring((Y[X].indexOf("=") + 1)))
  681.                     }
  682.                 }
  683.             }
  684.             return ""
  685.         },
  686.         expressInstallCallback: function () {
  687.             if (a) {
  688.                 var X = c(R);
  689.                 if (X && l) {
  690.                     X.parentNode.replaceChild(l, X);
  691.                     if (Q) {
  692.                         w(Q, true);
  693.                         if (M.ie && M.win) {
  694.                             l.style.display = "block"
  695.                         }
  696.                     }
  697.                     if (E) {
  698.                         E(B)
  699.                     }
  700.                 }
  701.                 a = false
  702.             }
  703.         }
  704.     }
  705. }();
  706. Calendar = (function () {
  707.     function y(at) {
  708.         at = at || {};
  709.         this.args = at = al(at, {
  710.             animation: !c,
  711.             cont: null,
  712.             bottomBar: true,
  713.             date: true,
  714.             fdow: aq("fdow"),
  715.             min: null,
  716.             max: null,
  717.             reverseWheel: false,
  718.             selection: [],
  719.             selectionType: y.SEL_SINGLE,
  720.             weekNumbers: false,
  721.             align: "Bl/ / /T/r",
  722.             inputField: null,
  723.             trigger: null,
  724.             dateFormat: "%Y-%m-%d",
  725.             opacity: j ? 1 : 3,
  726.             titleFormat: "%b %Y",
  727.             showTime: false,
  728.             timePos: "right",
  729.             time: true,
  730.             minuteStep: 5,
  731.             disabled: ad,
  732.             dateInfo: ad,
  733.             onChange: ad,
  734.             onSelect: ad,
  735.             onTimeChange: ad,
  736.             onFocus: ad,
  737.             onBlur: ad
  738.         });
  739.         this.handlers = {};
  740.         var P = this,
  741.             D = new Date();
  742.         at.min = Y(at.min);
  743.         at.max = Y(at.max);
  744.         if (at.date === true) {
  745.             at.date = D
  746.         }
  747.         if (at.time === true) {
  748.             at.time = D.getHours() * 100 + Math.floor(D.getMinutes() / at.minuteStep) * at.minuteStep
  749.         }
  750.         this.date = Y(at.date);
  751.         this.time = at.time;
  752.         this.fdow = at.fdow;
  753.         m("onChange onSelect onTimeChange onFocus onBlur".split(/\s+/), function (av) {
  754.             var au = at[av];
  755.             if (! (au instanceof Array)) {
  756.                 au = [au]
  757.             }
  758.             P.handlers[av] = au
  759.         });
  760.         this.selection = new y.Selection(at.selection, at.selectionType, R, this);
  761.         var ar = K.call(this);
  762.         if (at.cont) {
  763.             W(at.cont).appendChild(ar)
  764.         }
  765.         if (at.trigger) {
  766.             this.manageFields(at.trigger, at.inputField, at.dateFormat)
  767.         }
  768.     }
  769.     var S = navigator.userAgent,
  770.         s = /opera/i.test(S),
  771.         ai = /Konqueror|Safari|KHTML/i.test(S),
  772.         j = /msie/i.test(S) && !s && !(/mac_powerpc/i.test(S)),
  773.         c = j && /msie 6/i.test(S),
  774.         x = /gecko/i.test(S) && !ai && !s && !j,
  775.         l = y.prototype,
  776.         q = y.I18N = {};
  777.     y.SEL_NONE = 0;
  778.     y.SEL_SINGLE = 1;
  779.     y.SEL_MULTIPLE = 2;
  780.     y.SEL_WEEK = 3;
  781.     y.dateToInt = V;
  782.     y.intToDate = B;
  783.     y.printDate = ab;
  784.     y.formatString = k;
  785.     y.i18n = aq;
  786.     y.LANG = function (P, D, ar) {
  787.         q.__ = q[P] = {
  788.             name: D,
  789.             data: ar
  790.         }
  791.     };
  792.     y.setup = function (D) {
  793.         return new y(D)
  794.     };
  795.     l.moveTo = function (aG, aD) {
  796.         aG = Y(aG);
  797.         var aC = af(aG, this.date, true),
  798.             au, az = this.args,
  799.             aH = az.min && af(aG, az.min),
  800.             aI = az.max && af(aG, az.max);
  801.         if (!az.animation) {
  802.             aD = false
  803.         }
  804.         ae(aH != null && aH <= 1, [this.els.navPrevMonth, this.els.navPrevYear], "DynarchCalendar-navDisabled");
  805.         ae(aI != null && aI >= -1, [this.els.navNextMonth, this.els.navNextYear], "DynarchCalendar-navDisabled");
  806.         if (aH < -1) {
  807.             aG = az.min;
  808.             au = 1;
  809.             aC = 0
  810.         }
  811.         if (aI > 1) {
  812.             aG = az.max;
  813.             au = 2;
  814.             aC = 0
  815.         }
  816.         this.date = aG;
  817.         this.refresh( !! aD);
  818.         this.callHooks("onChange", this, aG, aD);
  819.         if (aD && !(aC == 0 && aD == 2)) {
  820.             if (this._bodyAnim) {
  821.                 this._bodyAnim.stop()
  822.             }
  823.             var aw = this.els.body,
  824.                 ax = G("div", "DynarchCalendar-animBody-" + U[aC], aw),
  825.                 aF = aw.firstChild,
  826.                 av = am(aF) || 0.7,
  827.                 ay = au ? Z.brakes : aC == 0 ? Z.shake : Z.accel_ab2,
  828.             aE = aC * aC > 4,
  829.             ar = aE ? aF.offsetTop : aF.offsetLeft,
  830.             aB = ax.style,
  831.             aA = aE ? aw.offsetHeight : aw.offsetWidth;
  832.             if (aC < 0) {
  833.                 aA += ar
  834.             } else {
  835.                 if (aC > 0) {
  836.                     aA = ar - aA
  837.                 } else {
  838.                     aA = Math.round(aA / 7);
  839.                     if (au == 2) {
  840.                         aA = -aA
  841.                     }
  842.                 }
  843.             }
  844.             if (!au && aC != 0) {
  845.                 var P = ax.cloneNode(true),
  846.                     D = P.style,
  847.                     at = 2 * aA;
  848.                 P.appendChild(aF.cloneNode(true));
  849.                 D[aE ? "marginTop" : "marginLeft"] = aA + "px";
  850.                 aw.appendChild(P)
  851.             }
  852.             aF.style.visibility = "hidden";
  853.             ax.innerHTML = ac(this);
  854.             this._bodyAnim = ap({
  855.                 onUpdate: v(function (aK, aM) {
  856.                     var aL = ay(aK);
  857.                     if (P) {
  858.                         var aJ = aM(aL, aA, at) + "px"
  859.                     }
  860.                     if (au) {
  861.                         aB[aE ? "marginTop" : "marginLeft"] = aM(aL, aA, 0) + "px"
  862.                     } else {
  863.                         if (aE || aC == 0) {
  864.                             aB.marginTop = aM(aC == 0 ? ay(aK * aK) : aL, 0, aA) + "px";
  865.                             if (aC != 0) {
  866.                                 D.marginTop = aJ
  867.                             }
  868.                         }
  869.                         if (!aE || aC == 0) {
  870.                             aB.marginLeft = aM(aL, 0, aA) + "px";
  871.                             if (aC != 0) {
  872.                                 D.marginLeft = aJ
  873.                             }
  874.                         }
  875.                     }
  876.                     if (this.args.opacity > 2 && P) {
  877.                         am(P, 1 - aL);
  878.                         am(ax, aL)
  879.                     }
  880.                 },
  881.                 this),
  882.                 onStop: v(function (aJ) {
  883.                     aw.innerHTML = ac(this, aG);
  884.                     this._bodyAnim = null
  885.                 },
  886.                 this)
  887.             })
  888.         }
  889.         this._lastHoverDate = null;
  890.         return aH >= -1 && aI <= 1
  891.     };
  892.     l.isDisabled = function (D) {
  893.         var P = this.args;
  894.         return (P.min && af(D, P.min) < 0) || (P.max && af(D, P.max) > 0) || P.disabled(D)
  895.     };
  896.     l.toggleMenu = function () {
  897.         u(this, !this._menuVisible)
  898.     };
  899.     l.refresh = function (D) {
  900.         var P = this.els;
  901.         if (!D) {
  902.             P.body.innerHTML = ac(this)
  903.         }
  904.         P.title.innerHTML = F(this);
  905.         P.yearInput.value = this.date.getFullYear()
  906.     };
  907.     l.redraw = function () {
  908.         var D = this.els;
  909.         this.refresh();
  910.         D.dayNames.innerHTML = h(this);
  911.         D.menu.innerHTML = ak(this);
  912.         if (D.bottomBar) {
  913.             D.bottomBar.innerHTML = H(this)
  914.         }
  915.         t(D.topCont, v(function (ar) {
  916.             var P = r[ar.className];
  917.             if (P) {
  918.                 D[P] = ar
  919.             }
  920.             if (ar.className == "DynarchCalendar-menu-year") {
  921.                 p(ar, this._focusEvents);
  922.                 D.yearInput = ar
  923.             } else {
  924.                 if (j) {
  925.                     ar.setAttribute("unselectable", "on")
  926.                 }
  927.             }
  928.         },
  929.         this));
  930.         this.setTime(null, true)
  931.     };
  932.     l.setLanguage = function (D) {
  933.         var P = y.setLanguage(D);
  934.         if (P) {
  935.             this.fdow = P.data.fdow;
  936.             this.redraw()
  937.         }
  938.     };
  939.     y.setLanguage = function (D) {
  940.         var P = q[D];
  941.         if (P) {
  942.             q.__ = P
  943.         }
  944.         return P
  945.     };
  946.     l.focus = function () {
  947.         try {
  948.             this.els[this._menuVisible ? "yearInput" : "focusLink"].focus()
  949.         } catch(D) {}
  950.         i.call(this)
  951.     };
  952.     l.blur = function () {
  953.         this.els.focusLink.blur();
  954.         this.els.yearInput.blur();
  955.         z.call(this)
  956.     };
  957.     l.showAt = function (P, ax, av) {
  958.         if (this._showAnim) {
  959.             this._showAnim.stop()
  960.         }
  961.         av = av && this.args.animation;
  962.         var aw = this.els.topCont,
  963.             ar = this,
  964.             D = this.els.body.firstChild,
  965.             au = D.offsetHeight,
  966.             at = aw.style;
  967.         at.position = "absolute";
  968.         at.left = P + "px";
  969.         at.top = ax + "px";
  970.         at.zIndex = 10000;
  971.         at.display = "";
  972.         if (av) {
  973.             D.style.marginTop = -au + "px";
  974.             this.args.opacity > 1 && am(aw, 0);
  975.             this._showAnim = ap({
  976.                 onUpdate: function (ay, az) {
  977.                     D.style.marginTop = -az(Z.accel_b(ay), au, 0) + "px";
  978.                     ar.args.opacity > 1 && am(aw, ay)
  979.                 },
  980.                 onStop: function () {
  981.                     ar.args.opacity > 1 && am(aw, "");
  982.                     ar._showAnim = null
  983.                 }
  984.             })
  985.         }
  986.     };
  987.     l.hide = function () {
  988.         var at = this.els.topCont,
  989.             P = this,
  990.             D = this.els.body.firstChild,
  991.             ar = D.offsetHeight,
  992.             au = J(at).y;
  993.         if (this.args.animation) {
  994.             if (this._showAnim) {
  995.                 this._showAnim.stop()
  996.             }
  997.             this._showAnim = ap({
  998.                 onUpdate: function (av, aw) {
  999.                     P.args.opacity > 1 && am(at, 1 - av);
  1000.                     D.style.marginTop = -aw(Z.accel_b(av), 0, ar) + "px";
  1001.                     at.style.top = aw(Z.accel_ab(av), au, au - 10) + "px"
  1002.                 },
  1003.                 onStop: function () {
  1004.                     at.style.display = "none";
  1005.                     D.style.marginTop = "";
  1006.                     P.args.opacity > 1 && am(at, "");
  1007.                     P._showAnim = null
  1008.                 }
  1009.             })
  1010.         } else {
  1011.             at.style.display = "none"
  1012.         }
  1013.         this.inputField = null
  1014.     };
  1015.     l.popup = function (D, at) {
  1016.         D = W(D);
  1017.         if (!at) {
  1018.             at = this.args.align
  1019.         }
  1020.         at = at.split(/\x2f/);
  1021.         var ar = J(D),
  1022.             aw = this.els.topCont,
  1023.             ay = aw.style,
  1024.             au, ax = X();
  1025.         ay.visibility = "hidden";
  1026.         ay.display = "";
  1027.         this.showAt(0, 0);
  1028.         document.body.appendChild(aw);
  1029.         au = {
  1030.             x: aw.offsetWidth,
  1031.             y: aw.offsetHeight
  1032.         };
  1033.  
  1034.         function P(az) {
  1035.             var aA = {
  1036.                 x: av.x,
  1037.                 y: av.y
  1038.             };
  1039.             if (!az) {
  1040.                 return aA
  1041.             }
  1042.             if (/B/.test(az)) {
  1043.                 aA.y += D.offsetHeight
  1044.             }
  1045.             if (/b/.test(az)) {
  1046.                 aA.y += D.offsetHeight - au.y
  1047.             }
  1048.             if (/T/.test(az)) {
  1049.                 aA.y -= au.y
  1050.             }
  1051.             if (/l/.test(az)) {
  1052.                 aA.x -= au.x - D.offsetWidth
  1053.             }
  1054.             if (/L/.test(az)) {
  1055.                 aA.x -= au.x
  1056.             }
  1057.             if (/R/.test(az)) {
  1058.                 aA.x += D.offsetWidth
  1059.             }
  1060.             if (/c/i.test(az)) {
  1061.                 aA.x += (D.offsetWidth - au.x) / 2
  1062.             }
  1063.             if (/m/i.test(az)) {
  1064.                 aA.y += (D.offsetHeight - au.y) / 2
  1065.             }
  1066.             return aA
  1067.         }
  1068.         var av = ar;
  1069.         av = P(at[0]);
  1070.         if (av.y < ax.y) {
  1071.             av.y = ar.y;
  1072.             av = P(at[1])
  1073.         }
  1074.         if (av.x + au.x > ax.x + ax.w) {
  1075.             av.x = ar.x;
  1076.             av = P(at[2])
  1077.         }
  1078.         if (av.y + au.y > ax.y + ax.h) {
  1079.             av.y = ar.y;
  1080.             av = P(at[3])
  1081.         }
  1082.         if (av.x < ax.x) {
  1083.             av.x = ar.x;
  1084.             av = P(at[4])
  1085.         }
  1086.         this.showAt(av.x, av.y, true);
  1087.         ay.visibility = "";
  1088.         this.focus()
  1089.     };
  1090.     l.manageFields = function (ar, P, D) {
  1091.         P = W(P);
  1092.         p(W(ar), "click", v(function () {
  1093.             this.inputField = P;
  1094.             this.dateFormat = D;
  1095.             if (this.selection.type == y.SEL_SINGLE) {
  1096.                 var aw, av, au, at;
  1097.                 aw = /input|textarea/i.test(P.tagName) ? P.value : (P.innerText || P.textContent);
  1098.                 if (aw) {
  1099.                     av = /(^|[^%])%[bBmo]/.exec(D);
  1100.                     au = /(^|[^%])%[de]/.exec(D);
  1101.                     if (av && au) {
  1102.                         at = av.index < au.index
  1103.                     }
  1104.                     aw = Calendar.parseDate(aw, at);
  1105.                     if (aw) {
  1106.                         this.moveTo(aw);
  1107.                         this.selection.set(aw, false, true)
  1108.                     }
  1109.                 }
  1110.             }
  1111.             this.popup(ar)
  1112.         },
  1113.         this))
  1114.     };
  1115.     l.callHooks = function (ar) {
  1116.         var at = b(arguments, 1),
  1117.             D = this.handlers[ar],
  1118.             P = 0;
  1119.         for (; P < D.length; ++P) {
  1120.             D[P].apply(this, at)
  1121.         }
  1122.     };
  1123.     l.addEventListener = function (P, D) {
  1124.         this.handlers[P].push(D)
  1125.     };
  1126.     l.removeEventListener = function (at, ar) {
  1127.         var D = this.handlers[at],
  1128.             P = D.length;
  1129.         while (--P >= 0) {
  1130.             if (D[P] === ar) {
  1131.                 D.splice(P, 1)
  1132.             }
  1133.         }
  1134.     };
  1135.     l.getTime = function () {
  1136.         return this.time
  1137.     };
  1138.     l.setTime = function (au, P) {
  1139.         if (this.args.showTime) {
  1140.             au = this.time = au != null ? au : this.time;
  1141.             var ar = this.getHours(),
  1142.                 D = this.getMinutes(),
  1143.                 at = ar < 12;
  1144.             if (this.args.showTime == 12) {
  1145.                 if (ar == 0) {
  1146.                     ar = 12
  1147.                 }
  1148.                 if (ar > 12) {
  1149.                     ar -= 12
  1150.                 }
  1151.                 this.els.timeAM.innerHTML = aq(at ? "AM" : "PM")
  1152.             }
  1153.             if (ar < 10) {
  1154.                 ar = "0" + ar
  1155.             }
  1156.             if (D < 10) {
  1157.                 D = "0" + D
  1158.             }
  1159.             this.els.timeHour.innerHTML = ar;
  1160.             this.els.timeMinute.innerHTML = D;
  1161.             if (!P) {
  1162.                 this.callHooks("onTimeChange", this, au)
  1163.             }
  1164.         }
  1165.     };
  1166.     l.getHours = function () {
  1167.         return Math.floor(this.time / 100)
  1168.     };
  1169.     l.getMinutes = function () {
  1170.         return this.time % 100
  1171.     };
  1172.     l.setHours = function (D) {
  1173.         if (D < 0) {
  1174.             D += 24
  1175.         }
  1176.         this.setTime(100 * (D % 24) + this.time % 100)
  1177.     };
  1178.     l.setMinutes = function (D) {
  1179.         if (D < 0) {
  1180.             D += 60
  1181.         }
  1182.         this.setTime(100 * this.getHours() + (D % 60))
  1183.     };
  1184.     l._getInputYear = function () {
  1185.         var D = parseInt(this.els.yearInput.value, 10);
  1186.         if (isNaN(D)) {
  1187.             D = this.date.getFullYear()
  1188.         }
  1189.         return D
  1190.     };
  1191.     l._showTooltip = function (D) {
  1192.         var P = "",
  1193.             at, ar = this.els.tooltip;
  1194.         if (D) {
  1195.             D = B(D);
  1196.             at = this.args.dateInfo(D);
  1197.             if (at && at.tooltip) {
  1198.                 P = "<div class='DynarchCalendar-tooltipCont'>" + ab(D, at.tooltip) + "</div>"
  1199.             }
  1200.         }
  1201.         ar.innerHTML = P
  1202.     };
  1203.     var ah = " align='center' cellspacing='0' cellpadding='0'";
  1204.  
  1205.     function h(D) {
  1206.         var ar = ["<table", ah, "><tr>"],
  1207.             P = 0;
  1208.         if (D.args.weekNumbers) {
  1209.             ar.push("<td><div class='DynarchCalendar-weekNumber'>", aq("wk"), "</div></td>")
  1210.         }
  1211.         while (P < 7) {
  1212.             var at = (P+++D.fdow) % 7;
  1213.             ar.push("<td><div", aq("weekend").indexOf(at) >= 0 ? " class='DynarchCalendar-weekend'>" : ">", aq("sdn")[at], "</div></td>")
  1214.         }
  1215.         ar.push("</tr></table>");
  1216.         return ar.join("")
  1217.     }
  1218.     function ac(aw, aG, aD) {
  1219.         aG = aG || aw.date;
  1220.         aD = aD || aw.fdow;
  1221.         aG = new Date(aG);
  1222.         var aI = aG.getMonth(),
  1223.             av = [],
  1224.             aA = 0,
  1225.             D = aw.args.weekNumbers;
  1226.         aG.setDate(1);
  1227.         var az = (aG.getDay() - aD) % 7;
  1228.         if (az < 0) {
  1229.             az += 7
  1230.         }
  1231.         aG.setDate(-az);
  1232.         aG.setDate(aG.getDate() + 1);
  1233.         var aE = new Date(),
  1234.             at = aE.getDate(),
  1235.             P = aE.getMonth(),
  1236.             aJ = aE.getFullYear();
  1237.         av[aA++] = "<table class='DynarchCalendar-bodyTable'" + ah + ">";
  1238.         for (var aC = 0; aC < 6; ++aC) {
  1239.             av[aA++] = "<tr class='DynarchCalendar-week";
  1240.             if (aC == 0) {
  1241.                 av[aA++] = " DynarchCalendar-first-row"
  1242.             }
  1243.             if (aC == 5) {
  1244.                 av[aA++] = " DynarchCalendar-last-row"
  1245.             }
  1246.             av[aA++] = "'>";
  1247.             if (D) {
  1248.                 av[aA++] = "<td class='DynarchCalendar-first-col'><div class='DynarchCalendar-weekNumber'>" + a(aG) + "</div></td>"
  1249.             }
  1250.             for (var aB = 0; aB < 7; ++aB) {
  1251.                 var aF = aG.getDate(),
  1252.                     ay = aG.getMonth(),
  1253.                     au = aG.getFullYear(),
  1254.                     ar = 10000 * au + 100 * (ay + 1) + aF,
  1255.                     aH = aw.selection.isSelected(ar),
  1256.                     ax = aw.isDisabled(aG);
  1257.                 av[aA++] = "<td class='";
  1258.                 if (aB == 0 && !D) {
  1259.                     av[aA++] = " DynarchCalendar-first-col"
  1260.                 }
  1261.                 if (aB == 0 && aC == 0) {
  1262.                     aw._firstDateVisible = ar
  1263.                 }
  1264.                 if (aB == 6) {
  1265.                     av[aA++] = " DynarchCalendar-last-col";
  1266.                     if (aC == 5) {
  1267.                         aw._lastDateVisible = ar
  1268.                     }
  1269.                 }
  1270.                 if (aH) {
  1271.                     av[aA++] = " DynarchCalendar-td-selected"
  1272.                 }
  1273.                 av[aA++] = "'><div dyc-type='date' unselectable='on' dyc-date='" + ar + "' ";
  1274.                 if (ax) {
  1275.                     av[aA++] = "disabled='1' "
  1276.                 }
  1277.                 av[aA++] = "class='DynarchCalendar-day";
  1278.                 if (aq("weekend").indexOf(aG.getDay()) >= 0) {
  1279.                     av[aA++] = " DynarchCalendar-weekend"
  1280.                 }
  1281.                 if (ay != aI) {
  1282.                     av[aA++] = " DynarchCalendar-day-othermonth"
  1283.                 }
  1284.                 if (aF == at && ay == P && au == aJ) {
  1285.                     av[aA++] = " DynarchCalendar-day-today"
  1286.                 }
  1287.                 if (ax) {
  1288.                     av[aA++] = " DynarchCalendar-day-disabled"
  1289.                 }
  1290.                 if (aH) {
  1291.                     av[aA++] = " DynarchCalendar-day-selected"
  1292.                 }
  1293.                 ax = aw.args.dateInfo(aG);
  1294.                 if (ax && ax.klass) {
  1295.                     av[aA++] = " " + ax.klass
  1296.                 }
  1297.                 av[aA++] = "'>" + aF + "</div></td>";
  1298.                 aG.setDate(aF + 1)
  1299.             }
  1300.             av[aA++] = "</tr>"
  1301.         }
  1302.         av[aA++] = "</table>";
  1303.         return av.join("")
  1304.     }
  1305.     function n(D) {
  1306.         var P = ["<table width='100%' class='DynarchCalendar-topCont'", ah, "><tr><td><div class='DynarchCalendar'>", !j ? "<button class='DynarchCalendar-focusLink'></button>" : "<a class='DynarchCalendar-focusLink' href='#'></a>", "<div class='DynarchCalendar-topBar'><div dyc-type='nav' dyc-btn='-Y' dyc-cls='hover-navBtn,pressed-navBtn' class='DynarchCalendar-navBtn DynarchCalendar-prevYear'><div></div></div><div dyc-type='nav' dyc-btn='+Y' dyc-cls='hover-navBtn,pressed-navBtn' class='DynarchCalendar-navBtn DynarchCalendar-nextYear'><div></div></div><div dyc-type='nav' dyc-btn='-M' dyc-cls='hover-navBtn,pressed-navBtn' class='DynarchCalendar-navBtn DynarchCalendar-prevMonth'><div></div></div><div dyc-type='nav' dyc-btn='+M' dyc-cls='hover-navBtn,pressed-navBtn' class='DynarchCalendar-navBtn DynarchCalendar-nextMonth'><div></div></div><table class='DynarchCalendar-titleCont'", ah, "><tr><td><div dyc-type='title' dyc-btn='menu' dyc-cls='hover-title,pressed-title' class='DynarchCalendar-title'>", F(D), "</div></td></tr></table><div class='DynarchCalendar-dayNames'>", h(D), "</div></div><div class='DynarchCalendar-body'></div>"];
  1307.         if (D.args.bottomBar || D.args.showTime) {
  1308.             P.push("<div class='DynarchCalendar-bottomBar'>", H(D), "</div>")
  1309.         }
  1310.         P.push("<div class='DynarchCalendar-menu' style='display: none'>", ak(D), "</div><div class='DynarchCalendar-tooltip'></div></div></td></tr></table>");
  1311.         return P.join("")
  1312.     }
  1313.     function F(D) {
  1314.         return "<div unselectable='on'>" + ab(D.date, D.args.titleFormat) + "</div>"
  1315.     }
  1316.     function ak(P) {
  1317.         var au = ["<table height='100%'", ah, "><tr><td><table style='margin-top: 1.5em'", ah, "><tr><td colspan='3'><input dyc-btn='year' class='DynarchCalendar-menu-year' size='6' value='", P.date.getFullYear(), "' /></td></tr><tr><td><div dyc-type='menubtn' dyc-cls='hover-navBtn,pressed-navBtn' dyc-btn='today'>", aq("goToday"), "</div></td></tr></table><p class='DynarchCalendar-menu-sep'>&nbsp;</p><table class='DynarchCalendar-menu-mtable'", ah, ">"],
  1318.             av = aq("smn"),
  1319.             at = 0,
  1320.             D = au.length,
  1321.             ar;
  1322.         while (at < 12) {
  1323.             au[D++] = "<tr>";
  1324.             for (ar = 4; --ar > 0;) {
  1325.                 au[D++] = "<td><div dyc-type='menubtn' dyc-cls='hover-navBtn,pressed-navBtn' dyc-btn='m" + at + "' class='DynarchCalendar-menu-month'>" + av[at++] + "</div></td>"
  1326.             }
  1327.             au[D++] = "</tr>"
  1328.         }
  1329.         au[D++] = "</table></td></tr></table>";
  1330.         return au.join("")
  1331.     }
  1332.     function w(D, P) {
  1333.         P.push("<table class='DynarchCalendar-time'" + ah + "><tr><td rowspan='2'><div dyc-type='time-hour' dyc-cls='hover-time,pressed-time' class='DynarchCalendar-time-hour'></div></td><td dyc-type='time-hour+' dyc-cls='hover-time,pressed-time' class='DynarchCalendar-time-up'></td><td rowspan='2' class='DynarchCalendar-time-sep'></td><td rowspan='2'><div dyc-type='time-min' dyc-cls='hover-time,pressed-time' class='DynarchCalendar-time-minute'></div></td><td dyc-type='time-min+' dyc-cls='hover-time,pressed-time' class='DynarchCalendar-time-up'></td>");
  1334.         if (D.args.showTime == 12) {
  1335.             P.push("<td rowspan='2' class='DynarchCalendar-time-sep'></td><td rowspan='2'><div class='DynarchCalendar-time-am' dyc-type='time-am' dyc-cls='hover-time,pressed-time'></div></td>")
  1336.         }
  1337.         P.push("</tr><tr><td dyc-type='time-hour-' dyc-cls='hover-time,pressed-time' class='DynarchCalendar-time-down'></td><td dyc-type='time-min-' dyc-cls='hover-time,pressed-time' class='DynarchCalendar-time-down'></td></tr></table>")
  1338.     }
  1339.     function H(D) {
  1340.         var ar = [],
  1341.             P = D.args;
  1342.         ar.push("<table", ah, " style='width:100%'><tr>");
  1343.  
  1344.         function at() {
  1345.             if (P.showTime) {
  1346.                 ar.push("<td>");
  1347.                 w(D, ar);
  1348.                 ar.push("</td>")
  1349.             }
  1350.         }
  1351.         if (P.timePos == "left") {
  1352.             at()
  1353.         }
  1354.         if (P.bottomBar) {
  1355.             ar.push("<td>");
  1356.             ar.push("<table", ah, "><tr><td><div dyc-btn='today' dyc-cls='hover-bottomBar-today,pressed-bottomBar-today' dyc-type='bottomBar-today' class='DynarchCalendar-bottomBar-today'>", aq("today"), "</div></td></tr></table>");
  1357.             ar.push("</td>")
  1358.         }
  1359.         if (P.timePos == "right") {
  1360.             at()
  1361.         }
  1362.         ar.push("</tr></table>");
  1363.         return ar.join("")
  1364.     }
  1365.     var r = {
  1366.         "DynarchCalendar-topCont": "topCont",
  1367.         "DynarchCalendar-focusLink": "focusLink",
  1368.         DynarchCalendar: "main",
  1369.         "DynarchCalendar-topBar": "topBar",
  1370.         "DynarchCalendar-title": "title",
  1371.         "DynarchCalendar-dayNames": "dayNames",
  1372.         "DynarchCalendar-body": "body",
  1373.         "DynarchCalendar-menu": "menu",
  1374.         "DynarchCalendar-menu-year": "yearInput",
  1375.         "DynarchCalendar-bottomBar": "bottomBar",
  1376.         "DynarchCalendar-tooltip": "tooltip",
  1377.         "DynarchCalendar-time-hour": "timeHour",
  1378.         "DynarchCalendar-time-minute": "timeMinute",
  1379.         "DynarchCalendar-time-am": "timeAM",
  1380.         "DynarchCalendar-navBtn DynarchCalendar-prevYear": "navPrevYear",
  1381.         "DynarchCalendar-navBtn DynarchCalendar-nextYear": "navNextYear",
  1382.         "DynarchCalendar-navBtn DynarchCalendar-prevMonth": "navPrevMonth",
  1383.         "DynarchCalendar-navBtn DynarchCalendar-nextMonth": "navNextMonth"
  1384.     };
  1385.  
  1386.     function K() {
  1387.         var ar = G("div"),
  1388.             P = this.els = {},
  1389.             D = {
  1390.             mousedown: v(I, this, true),
  1391.             mouseup: v(I, this, false),
  1392.             mouseover: v(T, this, true),
  1393.             mouseout: v(T, this, false),
  1394.             keypress: v(L, this)
  1395.         };
  1396.         D[x ? "DOMMouseScroll" : "mousewheel"] = v(E, this);
  1397.         if (j) {
  1398.             D.dblclick = D.mousedown;
  1399.             D.keydown = D.keypress
  1400.         }
  1401.         ar.innerHTML = n(this);
  1402.         t(ar.firstChild, function (au) {
  1403.             var at = r[au.className];
  1404.             if (at) {
  1405.                 P[at] = au
  1406.             }
  1407.             if (j) {
  1408.                 au.setAttribute("unselectable", "on")
  1409.             }
  1410.         });
  1411.         p(P.main, D);
  1412.         p([P.focusLink, P.yearInput], this._focusEvents = {
  1413.             focus: v(i, this),
  1414.             blur: v(e, this)
  1415.         });
  1416.         this.moveTo(this.date, false);
  1417.         this.setTime(null, true);
  1418.         return P.topCont
  1419.     }
  1420.     function i() {
  1421.         if (this._bluringTimeout) {
  1422.             clearTimeout(this._bluringTimeout)
  1423.         }
  1424.         this.focused = true;
  1425.         M(this.els.main, "DynarchCalendar-focused");
  1426.         this.callHooks("onFocus", this)
  1427.     }
  1428.     function z() {
  1429.         this.focused = false;
  1430.         aj(this.els.main, "DynarchCalendar-focused");
  1431.         if (this._menuVisible) {
  1432.             u(this, false)
  1433.         }
  1434.         if (!this.args.cont) {
  1435.             this.hide()
  1436.         }
  1437.         this.callHooks("onBlur", this)
  1438.     }
  1439.     function e() {
  1440.         this._bluringTimeout = setTimeout(v(z, this), 50)
  1441.     }
  1442.     function N(D) {
  1443.         switch (D) {
  1444.         case "time-hour+":
  1445.             this.setHours(this.getHours() + 1);
  1446.             break;
  1447.         case "time-hour-":
  1448.             this.setHours(this.getHours() - 1);
  1449.             break;
  1450.         case "time-min+":
  1451.             this.setMinutes(this.getMinutes() + this.args.minuteStep);
  1452.             break;
  1453.         case "time-min-":
  1454.             this.setMinutes(this.getMinutes() - this.args.minuteStep);
  1455.             break;
  1456.         default:
  1457.             return
  1458.         }
  1459.     }
  1460.     var U = {
  1461.         "-3": "backYear",
  1462.         "-2": "back",
  1463.         "0": "now",
  1464.         "2": "fwd",
  1465.         "3": "fwdYear"
  1466.     };
  1467.  
  1468.     function aa(P, at, D) {
  1469.         if (this._bodyAnim) {
  1470.             this._bodyAnim.stop()
  1471.         }
  1472.         var ar;
  1473.         if (at != 0) {
  1474.             ar = new Date(P.date);
  1475.             ar.setDate(1);
  1476.             switch (at) {
  1477.             case "-Y":
  1478.             case -2:
  1479.                 ar.setFullYear(ar.getFullYear() - 1);
  1480.                 break;
  1481.             case "+Y":
  1482.             case 2:
  1483.                 ar.setFullYear(ar.getFullYear() + 1);
  1484.                 break;
  1485.             case "-M":
  1486.             case -1:
  1487.                 ar.setMonth(ar.getMonth() - 1);
  1488.                 break;
  1489.             case "+M":
  1490.             case 1:
  1491.                 ar.setMonth(ar.getMonth() + 1);
  1492.                 break
  1493.             }
  1494.         } else {
  1495.             ar = new Date()
  1496.         }
  1497.         return P.moveTo(ar, !D)
  1498.     }
  1499.     function u(ar, P) {
  1500.         ar._menuVisible = P;
  1501.         ae(P, ar.els.title, "DynarchCalendar-pressed-title");
  1502.         var at = ar.els.menu;
  1503.         if (c) {
  1504.             at.style.height = ar.els.main.offsetHeight + "px"
  1505.         }
  1506.         if (!ar.args.animation) {
  1507.             O(at, P);
  1508.             if (ar.focused) {
  1509.                 ar.focus()
  1510.             }
  1511.         } else {
  1512.             if (ar._menuAnim) {
  1513.                 ar._menuAnim.stop()
  1514.             }
  1515.             var D = ar.els.main.offsetHeight;
  1516.             if (c) {
  1517.                 at.style.width = ar.els.topBar.offsetWidth + "px"
  1518.             }
  1519.             if (P) {
  1520.                 at.firstChild.style.marginTop = -D + "px";
  1521.                 ar.args.opacity > 0 && am(at, 0);
  1522.                 O(at, true)
  1523.             }
  1524.             ar._menuAnim = ap({
  1525.                 onUpdate: function (au, av) {
  1526.                     at.firstChild.style.marginTop = av(Z.accel_b(au), -D, 0, !P) + "px";
  1527.                     ar.args.opacity > 0 && am(at, av(Z.accel_b(au), 0, 0.85, !P))
  1528.                 },
  1529.                 onStop: function () {
  1530.                     ar.args.opacity > 0 && am(at, 0.85);
  1531.                     at.firstChild.style.marginTop = "";
  1532.                     ar._menuAnim = null;
  1533.                     if (!P) {
  1534.                         O(at, false);
  1535.                         if (ar.focused) {
  1536.                             ar.focus()
  1537.                         }
  1538.                     }
  1539.                 }
  1540.             })
  1541.         }
  1542.     }
  1543.     function I(az, ay) {
  1544.         ay = ay || window.event;
  1545.         var au = o(ay);
  1546.         if (au && !au.getAttribute("disabled")) {
  1547.             var D = au.getAttribute("dyc-btn"),
  1548.                 ax = au.getAttribute("dyc-type"),
  1549.                 av = au.getAttribute("dyc-date"),
  1550.                 at = this.selection,
  1551.                 ar, P = {
  1552.                 mouseover: an,
  1553.                 mousemove: an,
  1554.                 mouseup: function (aC) {
  1555.                     var aB = au.getAttribute("dyc-cls");
  1556.                     if (aB) {
  1557.                         aj(au, ao(aB, 1))
  1558.                     }
  1559.                     clearTimeout(ar);
  1560.                     d(document, P, true);
  1561.                     P = null
  1562.                 }
  1563.             };
  1564.             if (az) {
  1565.                 setTimeout(v(this.focus, this), 1);
  1566.                 var aA = au.getAttribute("dyc-cls");
  1567.                 if (aA) {
  1568.                     M(au, ao(aA, 1))
  1569.                 }
  1570.                 if ("menu" == D) {
  1571.                     this.toggleMenu()
  1572.                 } else {
  1573.                     if (au && /^[+-][MY]$/.test(D)) {
  1574.                         if (aa(this, D)) {
  1575.                             var aw = v(function () {
  1576.                                 if (aa(this, D, true)) {
  1577.                                     ar = setTimeout(aw, 40)
  1578.                                 } else {
  1579.                                     P.mouseup();
  1580.                                     aa(this, D)
  1581.                                 }
  1582.                             },
  1583.                             this);
  1584.                             ar = setTimeout(aw, 350);
  1585.                             p(document, P, true)
  1586.                         } else {
  1587.                             P.mouseup()
  1588.                         }
  1589.                     } else {
  1590.                         if ("year" == D) {
  1591.                             this.els.yearInput.focus();
  1592.                             this.els.yearInput.select()
  1593.                         } else {
  1594.                             if (ax == "time-am") {
  1595.                                 p(document, P, true)
  1596.                             } else {
  1597.                                 if (/^time/.test(ax)) {
  1598.                                     var aw = v(function (aB) {
  1599.                                         N.call(this, aB);
  1600.                                         ar = setTimeout(aw, 100)
  1601.                                     },
  1602.                                     this, ax);
  1603.                                     N.call(this, ax);
  1604.                                     ar = setTimeout(aw, 350);
  1605.                                     p(document, P, true)
  1606.                                 } else {
  1607.                                     if (av && at.type) {
  1608.                                         if (at.type == y.SEL_MULTIPLE) {
  1609.                                             if (ay.shiftKey && this._selRangeStart) {
  1610.                                                 at.selectRange(this._selRangeStart, av)
  1611.                                             } else {
  1612.                                                 if (!ay.ctrlKey && !at.isSelected(av)) {
  1613.                                                     at.clear(true)
  1614.                                                 }
  1615.                                                 at.set(av, true);
  1616.                                                 this._selRangeStart = av
  1617.                                             }
  1618.                                         } else {
  1619.                                             at.set(av);
  1620.                                             this.moveTo(B(av), 2)
  1621.                                         }
  1622.                                         au = this._getDateDiv(av);
  1623.                                         T.call(this, true, {
  1624.                                             target: au
  1625.                                         })
  1626.                                     }
  1627.                                     p(document, P, true)
  1628.                                 }
  1629.                             }
  1630.                         }
  1631.                     }
  1632.                 }
  1633.                 if (j && P && /dbl/i.test(ay.type)) {
  1634.                     P.mouseup()
  1635.                 }
  1636.                 if (/^(DynarchCalendar-(topBar|bottomBar|weekend|weekNumber|menu(-sep)?))?$/.test(au.className) && !this.args.cont) {
  1637.                     P.mousemove = v(g, this);
  1638.                     this._mouseDiff = f(ay, J(this.els.topCont));
  1639.                     p(document, P, true)
  1640.                 }
  1641.             } else {
  1642.                 if ("today" == D) {
  1643.                     if (!this._menuVisible && at.type == y.SEL_SINGLE) {
  1644.                         at.set(new Date())
  1645.                     }
  1646.                     this.moveTo(new Date(), true);
  1647.                     u(this, false)
  1648.                 } else {
  1649.                     if (/^m([0-9]+)/.test(D)) {
  1650.                         var av = new Date(this.date);
  1651.                         av.setDate(1);
  1652.                         av.setMonth(RegExp.$1);
  1653.                         av.setFullYear(this._getInputYear());
  1654.                         this.moveTo(av, true);
  1655.                         u(this, false)
  1656.                     } else {
  1657.                         if (ax == "time-am") {
  1658.                             this.setHours(this.getHours() + 12)
  1659.                         }
  1660.                     }
  1661.                 }
  1662.             }
  1663.             if (!j) {
  1664.                 an(ay)
  1665.             }
  1666.         }
  1667.     }
  1668.     function g(P) {
  1669.         P = P || window.event;
  1670.         var D = this.els.topCont.style,
  1671.             ar = f(P, this._mouseDiff);
  1672.         D.left = ar.x + "px";
  1673.         D.top = ar.y + "px"
  1674.     }
  1675.     function o(P) {
  1676.         var D = P.target || P.srcElement,
  1677.             ar = D;
  1678.         while (D && D.getAttribute && !D.getAttribute("dyc-type")) {
  1679.             D = D.parentNode
  1680.         }
  1681.         return D.getAttribute && D || ar
  1682.     }
  1683.     function ao(D, P) {
  1684.         return "DynarchCalendar-" + D.split(/,/)[P]
  1685.     }
  1686.     function T(au, at) {
  1687.         at = at || window.event;
  1688.         var ar = o(at);
  1689.         if (ar) {
  1690.             var P = ar.getAttribute("dyc-type");
  1691.             if (P && !ar.getAttribute("disabled")) {
  1692.                 if (!au || !this._bodyAnim || P != "date") {
  1693.                     var D = ar.getAttribute("dyc-cls");
  1694.                     D = D ? ao(D, 0) : "DynarchCalendar-hover-" + P;
  1695.                     if (P != "date" || this.selection.type) {
  1696.                         ae(au, ar, D)
  1697.                     }
  1698.                     if (P == "date") {
  1699.                         ae(au, ar.parentNode.parentNode, "DynarchCalendar-hover-week");
  1700.                         this._showTooltip(ar.getAttribute("dyc-date"))
  1701.                     }
  1702.                     if (/^time-hour/.test(P)) {
  1703.                         ae(au, this.els.timeHour, "DynarchCalendar-hover-time")
  1704.                     }
  1705.                     if (/^time-min/.test(P)) {
  1706.                         ae(au, this.els.timeMinute, "DynarchCalendar-hover-time")
  1707.                     }
  1708.                     aj(this._getDateDiv(this._lastHoverDate), "DynarchCalendar-hover-date");
  1709.                     this._lastHoverDate = null
  1710.                 }
  1711.             }
  1712.         }
  1713.         if (!au) {
  1714.             this._showTooltip()
  1715.         }
  1716.     }
  1717.     function E(ar) {
  1718.         ar = ar || window.event;
  1719.         var P = o(ar);
  1720.         if (P) {
  1721.             var at = P.getAttribute("dyc-btn"),
  1722.                 D = P.getAttribute("dyc-type"),
  1723.                 au = ar.wheelDelta ? ar.wheelDelta / 120 : -ar.detail / 3;
  1724.             au = au < 0 ? -1 : au > 0 ? 1 : 0;
  1725.             if (this.args.reverseWheel) {
  1726.                 au = -au
  1727.             }
  1728.             if (/^(time-(hour|min))/.test(D)) {
  1729.                 switch (RegExp.$1) {
  1730.                 case "time-hour":
  1731.                     this.setHours(this.getHours() + au);
  1732.                     break;
  1733.                 case "time-min":
  1734.                     this.setMinutes(this.getMinutes() + this.args.minuteStep * au);
  1735.                     break
  1736.                 }
  1737.                 an(ar)
  1738.             } else {
  1739.                 if (/Y/i.test(at)) {
  1740.                     au *= 2
  1741.                 }
  1742.                 aa(this, -au);
  1743.                 an(ar)
  1744.             }
  1745.         }
  1746.     }
  1747.     function R() {
  1748.         this.refresh();
  1749.         var D = this.inputField,
  1750.             P = this.selection;
  1751.         if (D) {
  1752.             var ar = P.print(this.dateFormat);
  1753.             (/input|textarea/i.test(D.tagName)) ? D.value = ar : D.innerHTML = ar
  1754.         }
  1755.         this.callHooks("onSelect", this, P)
  1756.     }
  1757.     var ag = {
  1758.         37: -1,
  1759.         38: -2,
  1760.         39: 1,
  1761.         40: 2
  1762.     },
  1763.         Q = {
  1764.         33: -1,
  1765.         34: 1
  1766.     };
  1767.  
  1768.     function L(aB) {
  1769.         if (this._menuAnim) {
  1770.             return
  1771.         }
  1772.         aB = aB || window.event;
  1773.         var ar = aB.target || aB.srcElement,
  1774.             aC = ar.getAttribute("dyc-btn"),
  1775.             aD = aB.keyCode,
  1776.             ay = aB.charCode || aD,
  1777.             D = ag[aD];
  1778.         if ("year" == aC && aD == 13) {
  1779.             var au = new Date(this.date);
  1780.             au.setDate(1);
  1781.             au.setFullYear(this._getInputYear());
  1782.             this.moveTo(au, true);
  1783.             u(this, false);
  1784.             return an(aB)
  1785.         }
  1786.         if (this._menuVisible) {
  1787.             if (aD == 27) {
  1788.                 u(this, false);
  1789.                 return an(aB)
  1790.             }
  1791.         } else {
  1792.             if (!aB.ctrlKey) {
  1793.                 D = null
  1794.             }
  1795.             if (D == null && !aB.ctrlKey) {
  1796.                 D = Q[aD]
  1797.             }
  1798.             if (aD == 36) {
  1799.                 D = 0
  1800.             }
  1801.             if (D != null) {
  1802.                 aa(this, D);
  1803.                 return an(aB)
  1804.             }
  1805.             ay = String.fromCharCode(ay).toLowerCase();
  1806.             var ax = this.els.yearInput,
  1807.                 P = this.selection;
  1808.             if (ay == " ") {
  1809.                 u(this, true);
  1810.                 this.focus();
  1811.                 ax.focus();
  1812.                 ax.select();
  1813.                 return an(aB)
  1814.             }
  1815.             if (ay >= "0" && ay <= "9") {
  1816.                 u(this, true);
  1817.                 this.focus();
  1818.                 ax.value = ay;
  1819.                 ax.focus();
  1820.                 return an(aB)
  1821.             }
  1822.             var av = aq("mn"),
  1823.                 az = aB.shiftKey ? -1 : this.date.getMonth(),
  1824.             aw = 0,
  1825.             at;
  1826.             while (++aw < 12) {
  1827.                 at = av[(az + aw) % 12].toLowerCase();
  1828.                 if (at.indexOf(ay) == 0) {
  1829.                     var au = new Date(this.date);
  1830.                     au.setDate(1);
  1831.                     au.setMonth((az + aw) % 12);
  1832.                     this.moveTo(au, true);
  1833.                     return an(aB)
  1834.                 }
  1835.             }
  1836.             if (aD >= 37 && aD <= 40) {
  1837.                 var au = this._lastHoverDate;
  1838.                 if (!au && !P.isEmpty()) {
  1839.                     au = aD < 39 ? P.getFirstDate() : P.getLastDate();
  1840.                     if (au < this._firstDateVisible || au > this._lastDateVisible) {
  1841.                         au = null
  1842.                     }
  1843.                 }
  1844.                 if (!au) {
  1845.                     au = aD < 39 ? this._lastDateVisible : this._firstDateVisible
  1846.                 } else {
  1847.                     var aA = au;
  1848.                     au = B(au);
  1849.                     var az = 100;
  1850.                     while (az -->
  1851.                     0) {
  1852.                         switch (aD) {
  1853.                         case 37:
  1854.                             au.setDate(au.getDate() - 1);
  1855.                             break;
  1856.                         case 38:
  1857.                             au.setDate(au.getDate() - 7);
  1858.                             break;
  1859.                         case 39:
  1860.                             au.setDate(au.getDate() + 1);
  1861.                             break;
  1862.                         case 40:
  1863.                             au.setDate(au.getDate() + 7);
  1864.                             break
  1865.                         }
  1866.                         if (!this.isDisabled(au)) {
  1867.                             break
  1868.                         }
  1869.                     }
  1870.                     au = V(au);
  1871.                     if (au < this._firstDateVisible || au > this._lastDateVisible) {
  1872.                         this.moveTo(au)
  1873.                     }
  1874.                 }
  1875.                 aj(this._getDateDiv(aA), M(this._getDateDiv(au), "DynarchCalendar-hover-date"));
  1876.                 this._lastHoverDate = au;
  1877.                 return an(aB)
  1878.             }
  1879.             if (aD == 13) {
  1880.                 if (this._lastHoverDate) {
  1881.                     if (P.type == y.SEL_MULTIPLE && (aB.shiftKey || aB.ctrlKey)) {
  1882.                         if (aB.shiftKey && this._selRangeStart) {
  1883.                             P.clear(true);
  1884.                             P.selectRange(this._selRangeStart, this._lastHoverDate)
  1885.                         }
  1886.                         if (aB.ctrlKey) {
  1887.                             P.set(this._selRangeStart = this._lastHoverDate, true)
  1888.                         }
  1889.                     } else {
  1890.                         P.reset(this._selRangeStart = this._lastHoverDate)
  1891.                     }
  1892.                     return an(aB)
  1893.                 }
  1894.             }
  1895.             if (aD == 27 && !this.args.cont) {
  1896.                 this.hide()
  1897.             }
  1898.         }
  1899.     }
  1900.     l._getDateDiv = function (D) {
  1901.         var ar = null;
  1902.         if (D) {
  1903.             try {
  1904.                 t(this.els.body, function (at) {
  1905.                     if (at.getAttribute("dyc-date") == D) {
  1906.                         throw ar = at
  1907.                     }
  1908.                 })
  1909.             } catch(P) {}
  1910.         }
  1911.         return ar
  1912.     };
  1913.  
  1914.     function k(D, P) {
  1915.         return D.replace(/\$\{([^:\}]+)(:[^\}]+)?\}/g, function (av, au, at) {
  1916.             var aw = P[au],
  1917.                 ar;
  1918.             if (at) {
  1919.                 ar = at.substr(1).split(/\s*\|\s*/);
  1920.                 aw = (aw >= ar.length ? ar[ar.length - 1] : ar[aw]).replace(/##?/g, function (ax) {
  1921.                     return ax.length == 2 ? "#" : aw
  1922.                 })
  1923.             }
  1924.             return aw
  1925.         })
  1926.     }
  1927.     function aq(ar, P) {
  1928.         var D = q.__.data[ar];
  1929.         if (P && typeof D == "string") {
  1930.             D = k(D, P)
  1931.         }
  1932.         return D
  1933.     }(y.Selection = function (ar, P, D, at) {
  1934.         this.type = P;
  1935.         this.sel = ar instanceof Array ? ar : [ar];
  1936.         this.onChange = v(D, at);
  1937.         this.cal = at
  1938.     }).prototype = {
  1939.         get: function () {
  1940.             return this.type == y.SEL_SINGLE ? this.sel[0] : this.sel
  1941.         },
  1942.         isEmpty: function () {
  1943.             return this.sel.length == 0
  1944.         },
  1945.         set: function (P, D, ar) {
  1946.             var at = this.type == y.SEL_SINGLE;
  1947.             if (P instanceof Array) {
  1948.                 this.sel = P;
  1949.                 this.normalize();
  1950.                 if (!ar) {
  1951.                     this.onChange(this)
  1952.                 }
  1953.             } else {
  1954.                 P = V(P);
  1955.                 if (at || !this.isSelected(P)) {
  1956.                     at ? this.sel = [P] : this.sel.splice(this.findInsertPos(P), 0, P);
  1957.                     this.normalize();
  1958.                     if (!ar) {
  1959.                         this.onChange(this)
  1960.                     }
  1961.                 } else {
  1962.                     if (D) {
  1963.                         this.unselect(P, ar)
  1964.                     }
  1965.                 }
  1966.             }
  1967.         },
  1968.         reset: function () {
  1969.             this.sel = [];
  1970.             this.set.apply(this, arguments)
  1971.         },
  1972.         countDays: function () {
  1973.             var av = 0,
  1974.                 D = this.sel,
  1975.                 P = D.length,
  1976.                 at, au, ar;
  1977.             while (--P >= 0) {
  1978.                 at = D[P];
  1979.                 if (at instanceof Array) {
  1980.                     au = B(at[0]);
  1981.                     ar = B(at[1]);
  1982.                     av += Math.round(Math.abs(ar.getTime() - au.getTime()) / 86400000)
  1983.                 }++av
  1984.             }
  1985.             return av
  1986.         },
  1987.         unselect: function (P, ar) {
  1988.             P = V(P);
  1989.             var at = false;
  1990.             for (var ay = this.sel, au = ay.length, D; --au >= 0;) {
  1991.                 D = ay[au];
  1992.                 if (D instanceof Array) {
  1993.                     if (P >= D[0] && P <= D[1]) {
  1994.                         var av = B(P),
  1995.                             ax = av.getDate();
  1996.                         if (P == D[0]) {
  1997.                             av.setDate(ax + 1);
  1998.                             D[0] = V(av);
  1999.                             at = true
  2000.                         } else {
  2001.                             if (P == D[1]) {
  2002.                                 av.setDate(ax - 1);
  2003.                                 D[1] = V(av);
  2004.                                 at = true
  2005.                             } else {
  2006.                                 var aw = new Date(av);
  2007.                                 aw.setDate(ax + 1);
  2008.                                 av.setDate(ax - 1);
  2009.                                 ay.splice(au + 1, 0, [V(aw), D[1]]);
  2010.                                 D[1] = V(av);
  2011.                                 at = true
  2012.                             }
  2013.                         }
  2014.                     }
  2015.                 } else {
  2016.                     if (P == D) {
  2017.                         ay.splice(au, 1);
  2018.                         at = true
  2019.                     }
  2020.                 }
  2021.             }
  2022.             if (at) {
  2023.                 this.normalize();
  2024.                 if (!ar) {
  2025.                     this.onChange(this)
  2026.                 }
  2027.             }
  2028.         },
  2029.         normalize: function () {
  2030.             this.sel = this.sel.sort(function (ay, ax) {
  2031.                 if (ay instanceof Array) {
  2032.                     ay = ay[0]
  2033.                 }
  2034.                 if (ax instanceof Array) {
  2035.                     ax = ax[0]
  2036.                 }
  2037.                 return ay - ax
  2038.             });
  2039.             for (var P = this.sel, ar = P.length, av, au; --ar >= 0;) {
  2040.                 av = P[ar];
  2041.                 if (av instanceof Array) {
  2042.                     if (av[0] > av[1]) {
  2043.                         P.splice(ar, 1);
  2044.                         continue
  2045.                     }
  2046.                     if (av[0] == av[1]) {
  2047.                         av = P[ar] = av[0]
  2048.                     }
  2049.                 }
  2050.                 if (au) {
  2051.                     var at = au,
  2052.                         aw = av instanceof Array ? av[1] : av;
  2053.                     aw = B(aw);
  2054.                     aw.setDate(aw.getDate() + 1);
  2055.                     aw = V(aw);
  2056.                     if (aw >= at) {
  2057.                         var D = P[ar + 1];
  2058.                         if (av instanceof Array && D instanceof Array) {
  2059.                             av[1] = D[1];
  2060.                             P.splice(ar + 1, 1)
  2061.                         } else {
  2062.                             if (av instanceof Array) {
  2063.                                 av[1] = au;
  2064.                                 P.splice(ar + 1, 1)
  2065.                             } else {
  2066.                                 if (D instanceof Array) {
  2067.                                     D[0] = av;
  2068.                                     P.splice(ar, 1)
  2069.                                 } else {
  2070.                                     P[ar] = [av, D];
  2071.                                     P.splice(ar + 1, 1)
  2072.                                 }
  2073.                             }
  2074.                         }
  2075.                     }
  2076.                 }
  2077.                 au = av instanceof Array ? av[0] : av
  2078.             }
  2079.         },
  2080.         findInsertPos: function (P) {
  2081.             for (var D = this.sel, ar = D.length, at; --ar >= 0;) {
  2082.                 at = D[ar];
  2083.                 if (at instanceof Array) {
  2084.                     at = at[0]
  2085.                 }
  2086.                 if (at <= P) {
  2087.                     break
  2088.                 }
  2089.             }
  2090.             return ar + 1
  2091.         },
  2092.         clear: function (D) {
  2093.             this.sel = [];
  2094.             if (!D) {
  2095.                 this.onChange(this)
  2096.             }
  2097.         },
  2098.         selectRange: function (ar, P) {
  2099.             ar = V(ar);
  2100.             P = V(P);
  2101.             if (ar > P) {
  2102.                 var D = ar;
  2103.                 ar = P;
  2104.                 P = D
  2105.             }
  2106.             this.sel.push([ar, P]);
  2107.             this.normalize();
  2108.             this.onChange(this)
  2109.         },
  2110.         isSelected: function (D) {
  2111.             for (var P = this.sel.length, ar; --P >= 0;) {
  2112.                 ar = this.sel[P];
  2113.                 if (ar instanceof Array && D >= ar[0] && D <= ar[1] || D == ar) {
  2114.                     return true
  2115.                 }
  2116.             }
  2117.             return false
  2118.         },
  2119.         getFirstDate: function () {
  2120.             var D = this.sel[0];
  2121.             if (D && D instanceof Array) {
  2122.                 D = D[0]
  2123.             }
  2124.             return D
  2125.         },
  2126.         getLastDate: function () {
  2127.             if (this.sel.length > 0) {
  2128.                 var D = this.sel[this.sel.length - 1];
  2129.                 if (D && D instanceof Array) {
  2130.                     D = D[1]
  2131.                 }
  2132.                 return D
  2133.             }
  2134.         },
  2135.         print: function (ar, at) {
  2136.             var P = [],
  2137.                 au = 0,
  2138.                 aw, av = this.cal.getHours(),
  2139.                 D = this.cal.getMinutes();
  2140.             if (!at) {
  2141.                 at = " -> "
  2142.             }
  2143.             while (au < this.sel.length) {
  2144.                 aw = this.sel[au++];
  2145.                 if (aw instanceof Array) {
  2146.                     P.push(ab(B(aw[0], av, D), ar) + at + ab(B(aw[1], av, D), ar))
  2147.                 } else {
  2148.                     P.push(ab(B(aw, av, D), ar))
  2149.                 }
  2150.             }
  2151.             return P
  2152.         },
  2153.         getDates: function (P) {
  2154.             var D = [],
  2155.                 ar = 0,
  2156.                 au, at;
  2157.             while (ar < this.sel.length) {
  2158.                 at = this.sel[ar++];
  2159.                 if (at instanceof Array) {
  2160.                     au = B(at[0]);
  2161.                     at = at[1];
  2162.                     while (V(au) < at) {
  2163.                         D.push(P ? ab(au, P) : new Date(au));
  2164.                         au.setDate(au.getDate() + 1)
  2165.                     }
  2166.                 } else {
  2167.                     au = B(at)
  2168.                 }
  2169.                 D.push(P ? ab(au, P) : au)
  2170.             }
  2171.             return D
  2172.         }
  2173.     };
  2174.  
  2175.     function a(P) {
  2176.         P = new Date(P.getFullYear(), P.getMonth(), P.getDate(), 12, 0, 0);
  2177.         var ar = P.getDay();
  2178.         P.setDate(P.getDate() - (ar + 6) % 7 + 3);
  2179.         var D = P.valueOf();
  2180.         P.setMonth(0);
  2181.         P.setDate(4);
  2182.         return Math.round((D - P.valueOf()) / (7 * 86400000)) + 1
  2183.     }
  2184.     function C(D) {
  2185.         D = new Date(D.getFullYear(), D.getMonth(), D.getDate(), 0, 0, 0);
  2186.         var ar = new Date(D.getFullYear(), 0, 1, 12, 0, 0);
  2187.         var P = D - ar;
  2188.         return Math.floor(P / 86400000)
  2189.     }
  2190.     function V(D) {
  2191.         if (D instanceof Date) {
  2192.             return 10000 * D.getFullYear() + 100 * (D.getMonth() + 1) + D.getDate()
  2193.         }
  2194.         if (typeof D == "string") {
  2195.             return parseInt(D, 10)
  2196.         }
  2197.         return D
  2198.     }
  2199.     function B(ar, au, av, at, P) {
  2200.         if (! (ar instanceof Date)) {
  2201.             ar = parseInt(ar, 10);
  2202.             var aw = Math.floor(ar / 10000);
  2203.             ar = ar % 10000;
  2204.             var D = Math.floor(ar / 100);
  2205.             ar = ar % 100;
  2206.             ar = new Date(aw, D - 1, ar, au || 12, av || 0, at || 0, P || 0)
  2207.         }
  2208.         return ar
  2209.     }
  2210.     function af(aw, au, ar) {
  2211.         var av = aw.getFullYear(),
  2212.             ay = aw.getMonth(),
  2213.             P = aw.getDate(),
  2214.             at = au.getFullYear(),
  2215.             ax = au.getMonth(),
  2216.             D = au.getDate();
  2217.         return av < at ? -3 : av > at ? 3 : ay < ax ? -2 : ay > ax ? 2 : ar ? 0 : P < D ? -1 : P > D ? 1 : 0
  2218.     }
  2219.     function ab(D, ax) {
  2220.         var P = D.getMonth(),
  2221.             aw = D.getDate(),
  2222.             ay = D.getFullYear(),
  2223.             az = a(D),
  2224.             aA = D.getDay(),
  2225.             aB = D.getHours(),
  2226.             ar = (aB >= 12),
  2227.             au = (ar) ? (aB - 12) : aB,
  2228.         aD = C(D),
  2229.         at = D.getMinutes(),
  2230.         av = D.getSeconds(),
  2231.         aC = /%./g,
  2232.         aE;
  2233.         if (au === 0) {
  2234.             au = 12
  2235.         }
  2236.         aE = {
  2237.             "%a": aq("sdn")[aA],
  2238.             "%A": aq("dn")[aA],
  2239.             "%b": aq("smn")[P],
  2240.             "%B": aq("mn")[P],
  2241.             "%C": 1 + Math.floor(ay / 100),
  2242.             "%d": aw < 10 ? "0" + aw : aw,
  2243.             "%e": aw,
  2244.             "%H": aB < 10 ? "0" + aB : aB,
  2245.             "%I": au < 10 ? "0" + au : au,
  2246.             "%j": aD < 10 ? "00" + aD : aD < 100 ? "0" + aD : aD,
  2247.             "%k": aB,
  2248.             "%l": au,
  2249.             "%m": P < 9 ? "0" + (1 + P) : 1 + P,
  2250.             "%o": 1 + P,
  2251.             "%M": at < 10 ? "0" + at : at,
  2252.             "%n": "\n",
  2253.             "%p": ar ? "PM" : "AM",
  2254.             "%P": ar ? "pm" : "am",
  2255.             "%s": Math.floor(D.getTime() / 1000),
  2256.             "%S": av < 10 ? "0" + av : av,
  2257.             "%t": "\t",
  2258.             "%U": az < 10 ? "0" + az : az,
  2259.             "%W": az < 10 ? "0" + az : az,
  2260.             "%V": az < 10 ? "0" + az : az,
  2261.             "%u": aA + 1,
  2262.             "%w": aA,
  2263.             "%y": ("" + ay).substr(2, 2),
  2264.             "%Y": ay,
  2265.             "%%": "%"
  2266.         };
  2267.         return ax.replace(aC, function (aF) {
  2268.             return aE.hasOwnProperty(aF) ? aE[aF] : aF
  2269.         })
  2270.     }
  2271.     function Y(P) {
  2272.         if (P) {
  2273.             if (typeof P == "number") {
  2274.                 return B(P)
  2275.             }
  2276.             if (! (P instanceof Date)) {
  2277.                 var D = P.split(/-/);
  2278.                 return new Date(parseInt(D[0], 10), parseInt(D[1], 10) - 1, parseInt(D[2], 10), 12, 0, 0, 0)
  2279.             }
  2280.         }
  2281.         return P
  2282.     }
  2283.     function A(ar) {
  2284.         ar = ar.toLowerCase();
  2285.  
  2286.         function P(at) {
  2287.             for (var au = at.length; --au >= 0;) {
  2288.                 if (at[au].toLowerCase().indexOf(ar) == 0) {
  2289.                     return au
  2290.                 }
  2291.             }
  2292.         }
  2293.         var D = P(aq("smn")) || P(aq("mn"));
  2294.         if (D != null) {
  2295.             D++
  2296.         }
  2297.         return D
  2298.     }
  2299.     y.parseDate = function (au, D, aw) {
  2300.         if (!/\S/.test(au)) {
  2301.             return ""
  2302.         }
  2303.         au = au.replace(/^\s+/, "").replace(/\s+$/, "");
  2304.         aw = aw || new Date();
  2305.         var aB = null,
  2306.             P = null,
  2307.             aD = null,
  2308.             av = null,
  2309.             ar = null,
  2310.             aC = null;
  2311.         var ay = au.match(/([0-9]{1,2}):([0-9]{1,2})(:[0-9]{1,2})?\s*(am|pm)?/i);
  2312.         if (ay) {
  2313.             av = parseInt(ay[1], 10);
  2314.             ar = parseInt(ay[2], 10);
  2315.             aC = ay[3] ? parseInt(ay[3].substr(1), 10) : 0;
  2316.             au = au.substring(0, ay.index) + au.substr(ay.index + ay[0].length);
  2317.             if (ay[4]) {
  2318.                 if (ay[4].toLowerCase() == "pm" && av < 12) {
  2319.                     av += 12
  2320.                 } else {
  2321.                     if (ay[4].toLowerCase() == "am" && av >= 12) {
  2322.                         av -= 12
  2323.                     }
  2324.                 }
  2325.             }
  2326.         }
  2327.         var az = au.split(/\W+/);
  2328.         var ax = [];
  2329.         for (var at = 0; at < az.length; ++at) {
  2330.             var aA = az[at];
  2331.             if (/^[0-9]{4}$/.test(aA)) {
  2332.                 aB = parseInt(aA, 10);
  2333.                 if (!P && !aD && D == null) {
  2334.                     D = true
  2335.                 }
  2336.             } else {
  2337.                 if (/^[0-9]{1,2}$/.test(aA)) {
  2338.                     aA = parseInt(aA, 10);
  2339.                     if (aA >= 60) {
  2340.                         aB = aA
  2341.                     } else {
  2342.                         if (aA >= 0 && aA <= 12) {
  2343.                             ax.push(aA)
  2344.                         } else {
  2345.                             if (aA >= 1 && aA <= 31) {
  2346.                                 aD = aA
  2347.                             }
  2348.                         }
  2349.                     }
  2350.                 } else {
  2351.                     P = A(aA)
  2352.                 }
  2353.             }
  2354.         }
  2355.         if (ax.length >= 2) {
  2356.             if (D) {
  2357.                 if (!P) {
  2358.                     P = ax.shift()
  2359.                 }
  2360.                 if (!aD) {
  2361.                     aD = ax.shift()
  2362.                 }
  2363.             } else {
  2364.                 if (!aD) {
  2365.                     aD = ax.shift()
  2366.                 }
  2367.                 if (!P) {
  2368.                     P = ax.shift()
  2369.                 }
  2370.             }
  2371.         } else {
  2372.             if (ax.length == 1) {
  2373.                 if (!aD) {
  2374.                     aD = ax.shift()
  2375.                 } else {
  2376.                     if (!P) {
  2377.                         P = ax.shift()
  2378.                     }
  2379.                 }
  2380.             }
  2381.         }
  2382.         if (!aB) {
  2383.             aB = ax.length > 0 ? ax.shift() : aw.getFullYear()
  2384.         }
  2385.         if (aB < 30) {
  2386.             aB += 2000
  2387.         } else {
  2388.             if (aB < 99) {
  2389.                 aB += 1900
  2390.             }
  2391.         }
  2392.         if (!P) {
  2393.             P = aw.getMonth() + 1
  2394.         }
  2395.         return aB && P && aD ? new Date(aB, P - 1, aD, av, ar, aC) : null
  2396.     };
  2397.  
  2398.     function al(D, at, P, ar) {
  2399.         ar = {};
  2400.         for (P in at) {
  2401.             if (at.hasOwnProperty(P)) {
  2402.                 ar[P] = at[P]
  2403.             }
  2404.         }
  2405.         for (P in D) {
  2406.             if (D.hasOwnProperty(P)) {
  2407.                 ar[P] = D[P]
  2408.             }
  2409.         }
  2410.         return ar
  2411.     }
  2412.     function p(ar, au, at, D) {
  2413.         if (ar instanceof Array) {
  2414.             for (var P = ar.length; --P >= 0;) {
  2415.                 p(ar[P], au, at, D)
  2416.             }
  2417.         } else {
  2418.             if (typeof au == "object") {
  2419.                 for (var P in au) {
  2420.                     if (au.hasOwnProperty(P)) {
  2421.                         p(ar, P, au[P], at)
  2422.                     }
  2423.                 }
  2424.             } else {
  2425.                 if (ar.addEventListener) {
  2426.                     ar.addEventListener(au, at, j ? true : !!D)
  2427.                 } else {
  2428.                     if (ar.attachEvent) {
  2429.                         ar.attachEvent("on" + au, at)
  2430.                     } else {
  2431.                         ar["on" + au] = at
  2432.                     }
  2433.                 }
  2434.             }
  2435.         }
  2436.     }
  2437.     function d(ar, au, at, D) {
  2438.         if (ar instanceof Array) {
  2439.             for (var P = ar.length; --P >= 0;) {
  2440.                 d(ar[P], au, at)
  2441.             }
  2442.         } else {
  2443.             if (typeof au == "object") {
  2444.                 for (var P in au) {
  2445.                     if (au.hasOwnProperty(P)) {
  2446.                         d(ar, P, au[P], at)
  2447.                     }
  2448.                 }
  2449.             } else {
  2450.                 if (ar.removeEventListener) {
  2451.                     ar.removeEventListener(au, at, j ? true : !!D)
  2452.                 } else {
  2453.                     if (ar.detachEvent) {
  2454.                         ar.detachEvent("on" + au, at)
  2455.                     } else {
  2456.                         ar["on" + au] = null
  2457.                     }
  2458.                 }
  2459.             }
  2460.         }
  2461.     }
  2462.     function an(D) {
  2463.         D = D || window.event;
  2464.         if (j) {
  2465.             D.cancelBubble = true;
  2466.             D.returnValue = false
  2467.         } else {
  2468.             D.preventDefault();
  2469.             D.stopPropagation()
  2470.         }
  2471.         return false
  2472.     }
  2473.     function aj(au, at, av) {
  2474.         if (au) {
  2475.             var D = au.className.replace(/^\s+|\s+$/, "").split(/\x20/),
  2476.                 P = [],
  2477.                 ar;
  2478.             for (ar = D.length; ar > 0;) {
  2479.                 if (D[--ar] != at) {
  2480.                     P.push(D[ar])
  2481.                 }
  2482.             }
  2483.             if (av) {
  2484.                 P.push(av)
  2485.             }
  2486.             au.className = P.join(" ")
  2487.         }
  2488.         return av
  2489.     }
  2490.     function M(P, D) {
  2491.         return aj(P, D, D)
  2492.     }
  2493.     function ae(at, ar, P) {
  2494.         if (ar instanceof Array) {
  2495.             for (var D = ar.length; --D >= 0;) {
  2496.                 ae(at, ar[D], P)
  2497.             }
  2498.         } else {
  2499.             aj(ar, P, at ? P : null)
  2500.         }
  2501.         return at
  2502.     }
  2503.     function G(at, D, ar) {
  2504.         var P = null;
  2505.         if (document.createElementNS) {
  2506.             P = document.createElementNS("http://www.w3.org/1999/xhtml", at)
  2507.         } else {
  2508.             P = document.createElement(at)
  2509.         }
  2510.         if (D) {
  2511.             P.className = D
  2512.         }
  2513.         if (ar) {
  2514.             ar.appendChild(P)
  2515.         }
  2516.         return P
  2517.     }
  2518.     function b(au, av) {
  2519.         if (av == null) {
  2520.             av = 0
  2521.         }
  2522.         var D, at, P;
  2523.         try {
  2524.             D = Array.prototype.slice.call(au, av)
  2525.         } catch(ar) {
  2526.             D = new Array(au.length - av);
  2527.             for (at = av, P = 0; at < au.length; ++at, ++P) {
  2528.                 D[P] = au[at]
  2529.             }
  2530.         }
  2531.         return D
  2532.     }
  2533.     function v(P, ar) {
  2534.         var D = b(arguments, 2);
  2535.         return (ar == undefined ?
  2536.         function () {
  2537.             return P.apply(this, D.concat(b(arguments)))
  2538.         } : function () {
  2539.             return P.apply(ar, D.concat(b(arguments)))
  2540.         })
  2541.     }
  2542.     function t(P, ar) {
  2543.         if (!ar(P)) {
  2544.             for (var D = P.firstChild; D; D = D.nextSibling) {
  2545.                 if (D.nodeType == 1) {
  2546.                     t(D, ar)
  2547.                 }
  2548.             }
  2549.         }
  2550.     }
  2551.     function ap(D, aw, ar) {
  2552.         D = al(D, {
  2553.             fps: 50,
  2554.             len: 15,
  2555.             onUpdate: ad,
  2556.             onStop: ad
  2557.         });
  2558.         if (j) {
  2559.             D.len = Math.round(D.len / 2)
  2560.         }
  2561.         function at(aA, az, ax, ay) {
  2562.             return ay ? ax + aA * (az - ax) : az + aA * (ax - az)
  2563.         }
  2564.         function av() {
  2565.             if (aw) {
  2566.                 P()
  2567.             }
  2568.             ar = 0;
  2569.             aw = setInterval(au, 1000 / D.fps)
  2570.         }
  2571.         function P() {
  2572.             if (aw) {
  2573.                 clearInterval(aw);
  2574.                 aw = null
  2575.             }
  2576.             D.onStop(ar / D.len, at)
  2577.         }
  2578.         function au() {
  2579.             var ax = D.len;
  2580.             D.onUpdate(ar / ax, at);
  2581.             if (ar == ax) {
  2582.                 P()
  2583.             }++ar
  2584.         }
  2585.         av();
  2586.         return {
  2587.             start: av,
  2588.             stop: P,
  2589.             update: au,
  2590.             args: D,
  2591.             map: at
  2592.         }
  2593.     }
  2594.     var Z = {
  2595.         elastic_b: function (D) {
  2596.             return 1 - Math.cos(-D * 5.5 * Math.PI) / Math.pow(2, 7 * D)
  2597.         },
  2598.         magnetic: function (D) {
  2599.             return 1 - Math.cos(D * D * D * 10.5 * Math.PI) / Math.exp(4 * D)
  2600.         },
  2601.         accel_b: function (D) {
  2602.             D = 1 - D;
  2603.             return 1 - D * D * D * D
  2604.         },
  2605.         accel_a: function (D) {
  2606.             return D * D * D
  2607.         },
  2608.         accel_ab: function (D) {
  2609.             D = 1 - D;
  2610.             return 1 - Math.sin(D * D * Math.PI / 2)
  2611.         },
  2612.         accel_ab2: function (D) {
  2613.             return (D /= 0.5) < 1 ? 1 / 2 * D * D : -1 / 2 * ((--D) * (D - 2) - 1)
  2614.         },
  2615.         brakes: function (D) {
  2616.             D = 1 - D;
  2617.             return 1 - Math.sin(D * D * Math.PI)
  2618.         },
  2619.         shake: function (D) {
  2620.             return D < 0.5 ? -Math.cos(D * 11 * Math.PI) * D * D : (D = 1 - D, Math.cos(D * 11 * Math.PI) * D * D)
  2621.         }
  2622.     };
  2623.  
  2624.     function am(D, P) {
  2625.         if (P === "") {
  2626.             j ? D.style.filter = "" : D.style.opacity = ""
  2627.         } else {
  2628.             if (P != null) {
  2629.                 j ? D.style.filter = "alpha(opacity=" + P * 100 + ")" : D.style.opacity = P
  2630.             } else {
  2631.                 if (!j) {
  2632.                     P = parseFloat(D.style.opacity)
  2633.                 } else {
  2634.                     if (/alpha\(opacity=([0-9.])+\)/.test(D.style.opacity)) {
  2635.                         P = parseFloat(RegExp.$1) / 100
  2636.                     }
  2637.                 }
  2638.             }
  2639.         }
  2640.         return P
  2641.     }
  2642.     function O(ar, D) {
  2643.         var P = ar.style;
  2644.         if (D != null) {
  2645.             P.display = D ? "" : "none"
  2646.         }
  2647.         return P.display != "none"
  2648.     }
  2649.     function f(P, ar) {
  2650.         var D = j ? P.clientX + document.body.scrollLeft : P.pageX;
  2651.         var at = j ? P.clientY + document.body.scrollTop : P.pageY;
  2652.         if (ar) {
  2653.             D -= ar.x;
  2654.             at -= ar.y
  2655.         }
  2656.         return {
  2657.             x: D,
  2658.             y: at
  2659.         }
  2660.     }
  2661.     function J(au) {
  2662.         var D = 0,
  2663.             at = 0,
  2664.             ar = /^div$/i.test(au.tagName),
  2665.             av, P;
  2666.         if (ar && au.scrollLeft) {
  2667.             D = au.scrollLeft
  2668.         }
  2669.         if (ar && au.scrollTop) {
  2670.             at = au.scrollTop
  2671.         }
  2672.         av = {
  2673.             x: au.offsetLeft - D,
  2674.             y: au.offsetTop - at
  2675.         };
  2676.         if (au.offsetParent) {
  2677.             P = J(au.offsetParent);
  2678.             av.x += P.x;
  2679.             av.y += P.y
  2680.         }
  2681.         return av
  2682.     }
  2683.     function X() {
  2684.         var P = document.documentElement,
  2685.             D = document.body;
  2686.         return {
  2687.             x: P.scrollLeft || D.scrollLeft,
  2688.             y: P.scrollTop || D.scrollTop,
  2689.             w: P.clientWidth || window.innerWidth || D.clientWidth,
  2690.             h: P.clientHeight || window.innerHeight || D.clientHeight
  2691.         }
  2692.     }
  2693.     function m(D, ar, P) {
  2694.         for (P = 0; P < D.length; ++P) {
  2695.             ar(D[P])
  2696.         }
  2697.     }
  2698.     var ad = new Function();
  2699.  
  2700.     function W(D) {
  2701.         if (typeof D == "string") {
  2702.             D = document.getElementById(D)
  2703.         }
  2704.         return D
  2705.     }
  2706.     return y
  2707. })();
  2708. Calendar.LANG("ro", "Română", {
  2709.     fdow: 1,
  2710.     goToday: "Astăzi",
  2711.     today: "Astăzi",
  2712.     wk: "săp.",
  2713.     weekend: "0,6",
  2714.     AM: "am",
  2715.     PM: "pm",
  2716.     mn: ["Ianuarie", "Februarie", "Martie", "Aprilie", "Mai", "Iunie", "Iulie", "August", "Septembrie", "Octombrie", "Noiembrie", "Decembrie"],
  2717.     smn: ["Ian", "Feb", "Mar", "Apr", "Mai", "Iun", "Iul", "Aug", "Sep", "Oct", "Noi", "Dec"],
  2718.     dn: ["Duminică", "Luni", "MarÅ£i", "Miercuri", "Joi", "Vineri", "Sâmbătă", "Duminică"],
  2719.     sdn: ["Du", "Lu", "Ma", "Mi", "Jo", "Vi", "Sâ", "Du"]
  2720. });
  2721. var streamer_const = "rtmp://media.3netmedia.ro/live/";
  2722. var streamer_video = "rtmp://media.3netmedia.ro/fastplay/";
  2723. var feeds = new Array();
  2724. feeds[0] = new Object();
  2725. feeds[0].nume = "Sala de Repetiţii";
  2726. feeds[0].detalii = "În fiecare Sâmbătă de la 13:00";
  2727. feeds[0].mount = "camera3";
  2728. feeds[0].poza = '/images/sigla.png';
  2729. var t;
  2730. var tt;
  2731. var plstcat = null;
  2732. var playlist_json = null;
  2733. var currentPlaylist = null;
  2734. var currentLength = 0;
  2735. var player = null;
  2736. var pozitie_playlist = null;
  2737. var current_album = null;
  2738. var current_sugest = new Object(null);
  2739. var searchReq = getXmlHttpRequestObject();
  2740. var sugest_contor = 0;
  2741. var temp_class = null;
  2742. var song_id = new Array();
  2743. var ox = 0;
  2744. //codare
  2745. var base64EncodeChars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
  2746. var base64DecodeChars = new Array(-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 62, -1, -1, -1, 63, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, -1, -1, -1, -1, -1, -1, -1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, -1, -1, -1, -1, -1, -1, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, -1, -1, -1, -1, -1);
  2747.  
  2748. function base64encode(str) {
  2749.     var out, i, len;
  2750.     var c1, c2, c3;
  2751.     len = str.length;
  2752.     i = 0;
  2753.     out = "";
  2754.     while (i < len) {
  2755.         c1 = str.charCodeAt(i++) & 0xff;
  2756.         if (i == len) {
  2757.             out += base64EncodeChars.charAt(c1 >> 2);
  2758.             out += base64EncodeChars.charAt((c1 & 0x3) << 4);
  2759.             out += "==";
  2760.             break;
  2761.         }
  2762.         c2 = str.charCodeAt(i++);
  2763.         if (i == len) {
  2764.             out += base64EncodeChars.charAt(c1 >> 2);
  2765.             out += base64EncodeChars.charAt(((c1 & 0x3) << 4) | ((c2 & 0xF0) >> 4));
  2766.             out += base64EncodeChars.charAt((c2 & 0xF) << 2);
  2767.             out += "=";
  2768.             break;
  2769.         }
  2770.         c3 = str.charCodeAt(i++);
  2771.         out += base64EncodeChars.charAt(c1 >> 2);
  2772.         out += base64EncodeChars.charAt(((c1 & 0x3) << 4) | ((c2 & 0xF0) >> 4));
  2773.         out += base64EncodeChars.charAt(((c2 & 0xF) << 2) | ((c3 & 0xC0) >> 6));
  2774.         out += base64EncodeChars.charAt(c3 & 0x3F);
  2775.     }
  2776.     return out;
  2777. }
  2778.  
  2779. function base64decode(str) {
  2780.     var c1, c2, c3, c4;
  2781.     var i, len, out;
  2782.     len = str.length;
  2783.     i = 0;
  2784.     out = "";
  2785.     while (i < len) {
  2786.         /* c1 */
  2787.         do {
  2788.             c1 = base64DecodeChars[str.charCodeAt(i++) & 0xff];
  2789.         } while (i < len && c1 == -1);
  2790.         if (c1 == -1) break;
  2791.         /* c2 */
  2792.         do {
  2793.             c2 = base64DecodeChars[str.charCodeAt(i++) & 0xff];
  2794.         } while (i < len && c2 == -1);
  2795.         if (c2 == -1) break;
  2796.         out += String.fromCharCode((c1 << 2) | ((c2 & 0x30) >> 4));
  2797.         /* c3 */
  2798.         do {
  2799.             c3 = str.charCodeAt(i++) & 0xff;
  2800.             if (c3 == 61) return out;
  2801.             c3 = base64DecodeChars[c3];
  2802.         } while (i < len && c3 == -1);
  2803.         if (c3 == -1) break;
  2804.         out += String.fromCharCode(((c2 & 0XF) << 4) | ((c3 & 0x3C) >> 2));
  2805.         /* c4 */
  2806.         do {
  2807.             c4 = str.charCodeAt(i++) & 0xff;
  2808.             if (c4 == 61) return out;
  2809.             c4 = base64DecodeChars[c4];
  2810.         } while (i < len && c4 == -1);
  2811.         if (c4 == -1) break;
  2812.         out += String.fromCharCode(((c3 & 0x03) << 6) | c4);
  2813.     }
  2814.     return out;
  2815. }
  2816. //utilitare
  2817.  
  2818.  
  2819. function numar(s) {
  2820.     return parseInt(s.match(/\d+$/));
  2821. }
  2822.  
  2823. function getHTTPPage(url) {
  2824.     var xmlhttp
  2825.     /*@cc_on @*/
  2826.     /*@if (@_jscript_version >= 5)
  2827.           try {
  2828.           xmlhttp=new ActiveXObject("Msxml2.XMLHTTP")
  2829.          } catch (e) {
  2830.           try {
  2831.             xmlhttp=new ActiveXObject("Microsoft.XMLHTTP")
  2832.           } catch (E) {
  2833.            xmlhttp=false
  2834.           }
  2835.          }
  2836.         @else
  2837.          xmlhttp=false
  2838.         @end @*/
  2839.     if (!xmlhttp) {
  2840.         try {
  2841.             xmlhttp = new XMLHttpRequest();
  2842.         } catch(e) {
  2843.             xmlhttp = false;
  2844.         }
  2845.     }
  2846.     xmlhttp.open("GET", url, false);
  2847.     xmlhttp.send(null);
  2848.     var ret = xmlhttp.responseText;
  2849.     xmlhttp = null;
  2850.     return ret;
  2851. }
  2852.  
  2853. function readXML(fisier) {
  2854.     var xmlDoc;
  2855.     if (window.XMLHttpRequest) {
  2856.         xmlDoc = new window.XMLHttpRequest();
  2857.         xmlDoc.open("GET", fisier, false);
  2858.         xmlDoc.send("");
  2859.         xmlDoc = xmlDoc.responseXML;
  2860.     }
  2861.     // IE 5 and IE 6
  2862.     else if (ActiveXObject("Microsoft.XMLDOM")) {
  2863.         xmlDoc = new ActiveXObject("Microsoft.XMLDOM");
  2864.         xmlDoc.async = false;
  2865.         xmlDoc.load(fisier);
  2866.     }
  2867. }
  2868.  
  2869. function clear_search(obiect) {
  2870.     switch (obiect.value) {
  2871.     case "oraÅŸul tău":
  2872.         ;
  2873.     case "Search and Play":
  2874.     case "Nick":
  2875.     case "Alege piesa":
  2876.         obiect.value = "";
  2877.     }
  2878. }
  2879.  
  2880. function reset_search(obiect) {
  2881.     if (obiect.value == "") {
  2882.         switch (obiect.id) {
  2883.         case "localitate":
  2884.             obiect.value = "oraÅŸul tău";
  2885.             break;
  2886.         case "txtSearch":
  2887.             obiect.value = "Alege piesa";
  2888.             break;
  2889.         case "R3pageNick":
  2890.             obiect.value = "Nick";
  2891.             break;
  2892.         default:
  2893.             obiect.value = "Search and Play";
  2894.         }
  2895.     }
  2896. }
  2897.  
  2898. function random_header(x) {
  2899.     document.getElementById("Header").style.backgroundImage = "url(" + x + "images/header/h" + (Math.floor(Math.random() * 4 + 1)) + ".png)";
  2900. }
  2901.  
  2902. function read_chat() {
  2903.     var s = getHTTPPage("chatlog.php?r=" + Math.round(Math.random() * 10000));
  2904.     s = s.replace('<?xml version="1.0" encoding="utf-8"?>', "");
  2905.     s = s.replace(/<chat>/, "");
  2906.     s = s.replace(/<\/chat>/, "");
  2907.     s = s.replace(/<replica>/g, "");
  2908.     s = s.replace(/<\/replica>/g, "<br />");
  2909.     s = s.replace(/<nume>/g, "<b>&lt;");
  2910.     s = s.replace(/<\/nume>/g, "&gt; : </b>");
  2911.     s = s.replace(/<mesaj>/g, "");
  2912.     s = s.replace(/<\/mesaj>/g, "");
  2913.     s = s.replace(/3/g, "");
  2914.     s = s.replace(/6/g, "");
  2915.     s = s.replace(/01/g, "");
  2916.     s = s.replace(/01/g, "");
  2917.     s = s.replace(/02/g, "");
  2918.     s = s.replace(/02/g, "");
  2919.     s = s.replace(/03/g, "");
  2920.     s = s.replace(/03/g, "");
  2921.     s = s.replace(/04/g, "");
  2922.     s = s.replace(/04/g, "");
  2923.     s = s.replace(/05/g, "");
  2924.     s = s.replace(/05/g, "");
  2925.     s = s.replace(/06/g, "");
  2926.     s = s.replace(/06/g, "");
  2927.     s = s.replace(/07/g, "");
  2928.     s = s.replace(/07/g, "");
  2929.     s = s.replace(/08/g, "");
  2930.     s = s.replace(/08/g, "");
  2931.     s = s.replace(/09/g, "");
  2932.     s = s.replace(/09/g, "");
  2933.     s = s.replace(/10/g, "");
  2934.     s = s.replace(/10/g, "");
  2935.     s = s.replace(/11/g, "");
  2936.     s = s.replace(/11/g, "");
  2937.     s = s.replace(/12/g, "");
  2938.     s = s.replace(/12/g, "");
  2939.     s = s.replace(/13/g, "");
  2940.     s = s.replace(/13/g, "");
  2941.     s = s.replace(//g, "");
  2942.     s = s.replace(//g, "");
  2943.     document.getElementById("chat").innerHTML = s;
  2944.     tt = setTimeout("read_chat()", 10000);
  2945. }
  2946.  
  2947. function change_menu_head(x) {
  2948.     if (x == 1) {
  2949.         str = "bottom left"
  2950.     } else {
  2951.         str = "top left"
  2952.     }
  2953.     document.getElementById("meniu").style.backgroundPosition = str;
  2954. }
  2955.  
  2956. function vremea(cale, local) {
  2957.     if (local == "") {
  2958.         local = "Bucuresti"
  2959.     }
  2960.     var s = getHTTPPage(cale + "vremea.php?local=" + local);
  2961.     document.getElementById("vremea").innerHTML = s;
  2962. }
  2963.  
  2964. function showPlaylist(obj) {
  2965.     if (plstcat) {
  2966.         clearTimeout(t);
  2967.         plstcat.style.display = "none";
  2968.         document.getElementById("p" + numar(plstcat.id)).className = "playlisturi";
  2969.     }
  2970.     plstcat = document.getElementById("playlist" + numar(obj.id))
  2971.     if (plstcat.innerHTML == '') {
  2972.         var randvideos = null
  2973.         if (numar(obj.id) == 2) {
  2974.             randvideos = vgr_vector
  2975.         } else {
  2976.             randvideos = feeds
  2977.         }
  2978.         for (i = 0; randvideos[i]; i++) {
  2979.             var p = document.createElement("div");
  2980.             var img = document.createElement("img");
  2981.             var h1txt = document.createElement("h1");
  2982.             var h2txt = document.createElement("h2");
  2983.             var alink = document.createElement("a");
  2984.             attr = document.createAttribute("class");
  2985.             attr = document.createAttribute("id");
  2986.             attr = document.createAttribute("alt");
  2987.             attr = document.createAttribute("title");
  2988.             attr = document.createAttribute("src");
  2989.             attr = document.createAttribute("width");
  2990.             attr = document.createAttribute("onclick");
  2991.             attr = document.createAttribute("href");
  2992.             if (pozitie_playlist) {
  2993.                 if (numar(pozitie_playlist.id) == i) {
  2994.                     p.setAttribute('className', 'element select');
  2995.                     p.setAttribute('class', 'element select');
  2996.                 } else {
  2997.                     p.setAttribute('className', 'element');
  2998.                     p.setAttribute('class', 'element');
  2999.                 }
  3000.             } else {
  3001.                 p.setAttribute('className', 'element');
  3002.                 p.setAttribute('class', 'element');
  3003.             }
  3004.             p.setAttribute('id', 'pozitie' + i);
  3005.             img.setAttribute('className', 'element');
  3006.             img.setAttribute('class', 'element');
  3007.             img.setAttribute('width', 65);
  3008.             h1txt.setAttribute('className', 'item');
  3009.             h1txt.setAttribute('class', 'item');
  3010.             h2txt.setAttribute('className', 'item');
  3011.             h2txt.setAttribute('class', 'item');
  3012.             if (numar(obj.id) == 2) {
  3013.                 //p.setAttribute('onclick','playvideo("'+randvideos[i].Dbvideo.nume+'","'+randvideos[i].Dbvideo.id_newmedia+'",this)');
  3014.                 alink.setAttribute('href', 'javascript:playvideo("' + randvideos[i].Dbvideo.nume + '","' + randvideos[i].Dbvideo.id_newmedia + '",this)');
  3015.                 img.setAttribute('alt', randvideos[i].Dbvideo.nume);
  3016.                 img.setAttribute('title', randvideos[i].Dbvideo.nume);
  3017.                 img.setAttribute('src', 'http://media.3netmedia.ro/media/Radio3Net/video/thumbs/' + randvideos[i].Dbvideo.id_newmedia + '.png');
  3018.                 h1txt.innerHTML = randvideos[i].Dbvideo.nume;
  3019.                 h2txt.innerHTML = randvideos[i].Dbartist.name;
  3020.             } else {
  3021.                 //p.setAttribute('onclick','playstream("'+randvideos[i].mount+'","'+randvideos[i].nume+'",this)');
  3022.                 alink.setAttribute('href', 'javascript:playstream("' + randvideos[i].mount + '","' + randvideos[i].nume + '",this)');
  3023.                 img.setAttribute('alt', '');
  3024.                 img.setAttribute('title', '');
  3025.                 img.setAttribute('src', randvideos[i].poza);
  3026.                 h1txt.innerHTML = randvideos[i].nume;
  3027.                 h2txt.innerHTML = randvideos[i].detalii;
  3028.             }
  3029.             alink.appendChild(img);
  3030.             alink.appendChild(h1txt);
  3031.             alink.appendChild(h2txt);
  3032.             p.appendChild(alink);
  3033.             plstcat.appendChild(p);
  3034.         }
  3035.     }
  3036.  
  3037.     plstcat.style.display = "block";
  3038.     obj.className = "playlisturi selected";
  3039. }
  3040.  
  3041. function hidePlaylist() {
  3042.     if (plstcat != null) {
  3043.         plstcat.style.display = "none";
  3044.         document.getElementById("p" + numar(plstcat.id)).className = "playlisturi";
  3045.     }
  3046. }
  3047.  
  3048. function hidePlaylistTimmer() {
  3049.     clearTimeout(t);
  3050.     t = setTimeout('hidePlaylist()', 1250)
  3051. }
  3052. //search
  3053.  
  3054.  
  3055. function getXmlHttpRequestObject() {
  3056.     if (window.XMLHttpRequest) {
  3057.         return new XMLHttpRequest();
  3058.     } else if (window.ActiveXObject) {
  3059.         return new ActiveXObject("Microsoft.XMLHTTP");
  3060.     } else {
  3061.         alert("Your Browser Sucks!\nIt's about time to upgrade don't you think?");
  3062.     }
  3063. }
  3064.  
  3065. function searchSuggest(cale) {
  3066.     if (searchReq.readyState == 4 || searchReq.readyState == 0) {
  3067.         var str = escape(document.getElementById('txtSearch').value);
  3068.         searchReq.open("GET", cale + 'songrequest.php?str=' + base64encode(str), true);
  3069.         searchReq.onreadystatechange = handleSearchSuggest;
  3070.         searchReq.send(null);
  3071.     }
  3072. }
  3073.  
  3074. function handleSearchSuggest() {
  3075.     if (searchReq.readyState == 4) {
  3076.         current_sugest = null;
  3077.         var ss = document.getElementById('search_suggest')
  3078.         ss.innerHTML = '';
  3079.         var str = searchReq.responseText.split("\n");
  3080.         for (i = 0; i < str.length - 1; i++) {
  3081.             //Build our element string.  This is cleaner using the DOM, but
  3082.             //IE doesn't support dynamically added attributes.
  3083.             var suggest = '<div sid="' + numar(str[i].slice(str[i].indexOf("|||"), str[i].length)) + '" onmouseover="javascript:suggestOver(this,' + numar(str[i].slice(str[i].indexOf("|||"), str[i].length)) + ');" ';
  3084.             suggest += 'onclick="javascript:setSearch(this.innerHTML);" ';
  3085.             suggest += 'class="suggest_link" id="sugest' + i + '">' + str[i].slice(0, str[i].indexOf("|||")) + '</div>';
  3086.             ss.innerHTML += suggest;
  3087.             sugest_contor++;
  3088.         }
  3089.     }
  3090. }
  3091.  
  3092. function suggestOver(div_value, sid) {
  3093.     div_value.className = 'suggest_link over';
  3094.     document.getElementById('songid').value = sid;
  3095.     if (current_sugest) {
  3096.         current_sugest.className = 'suggest_link'
  3097.     }
  3098.     current_sugest = div_value;
  3099. }
  3100.  
  3101. function setSearch(value) {
  3102.     document.getElementById('txtSearch').value = value;
  3103.     document.getElementById('search_suggest').innerHTML = '';
  3104. }
  3105.  
  3106. function keyHandler(e, cale) {
  3107.     switch (e.keyCode) {
  3108.     case 38:
  3109.         if (current_sugest) {
  3110.             if (numar(current_sugest.id) > 1) {
  3111.                 var obiect = new Object();
  3112.                 obiect = document.getElementById("sugest" + (numar(current_sugest.id) - 1));
  3113.                 current_sugest.className = 'suggest_link';
  3114.                 obiect.className = 'suggest_link over';
  3115.                 current_sugest = obiect;
  3116.             }
  3117.         } else {
  3118.             if (document.getElementById("sugest1")) {
  3119.                 current_sugest = document.getElementById("sugest1");
  3120.                 current_sugest.className = 'suggest_link over';
  3121.             }
  3122.         }
  3123.         document.getElementById('txtSearch').value = current_sugest.innerHTML;
  3124.         document.getElementById('songid').value = current_sugest.sid;
  3125.         break;
  3126.     case 40:
  3127.         if (current_sugest) {
  3128.             if (numar(current_sugest.id) < sugest_contor - 1) {
  3129.                 var obiect = new Object();
  3130.                 obiect = document.getElementById("sugest" + (numar(current_sugest.id) + 1));
  3131.                 current_sugest.className = 'suggest_link';
  3132.                 obiect.className = 'suggest_link over';
  3133.                 current_sugest = obiect;
  3134.             }
  3135.         } else {
  3136.             if (document.getElementById("sugest1")) {
  3137.                 current_sugest = document.getElementById("sugest1");
  3138.                 current_sugest.className = 'suggest_link over';
  3139.             }
  3140.         }
  3141.         document.getElementById('txtSearch').value = current_sugest.innerHTML;
  3142.         document.getElementById('songid').value = current_sugest.sid;
  3143.         break;
  3144.     case 27:
  3145.         setSearch("");
  3146.     case 13:
  3147.         document.getElementById("search_suggest").style.display = "none";
  3148.         current_sugest = null;
  3149.         break;
  3150.     default:
  3151.         document.getElementById("search_suggest").style.display = "block";
  3152.         searchSuggest(cale);
  3153.     }
  3154. }
  3155.  
  3156. function dedicatie() {
  3157.     if (document.getElementById("songid").value == '') {
  3158.         document.getElementById("dedicatia").innerHTML = "<font color='#ff0000'>Nu ati introdus dedicatia</font>"
  3159.     } else {
  3160.         document.getElementById("dedicatia").innerHTML = getHTTPPage("/requests.php?songid=" + document.getElementById("songid").value);
  3161.     }
  3162. }
  3163. //cookie control
  3164.  
  3165.  
  3166. function setCookie(c_name, value, expiredays) {
  3167.     var exdate = new Date();
  3168.     exdate.setDate(exdate.getDate() + expiredays);
  3169.     document.cookie = c_name + "=" + escape(value) + ((expiredays == null) ? ";path=/" : ";expires=" + exdate.toGMTString()) + ";path=/";
  3170. }
  3171.  
  3172. function getCookie(c_name) {
  3173.     if (document.cookie.length > 0) {
  3174.         c_start = document.cookie.indexOf(c_name + "=");
  3175.         if (c_start != -1) {
  3176.             c_start = c_start + c_name.length + 1;
  3177.             c_end = document.cookie.indexOf(";", c_start);
  3178.             if (c_end == -1) c_end = document.cookie.length;
  3179.             return unescape(document.cookie.substring(c_start, c_end));
  3180.         }
  3181.     }
  3182.     return "";
  3183. }
  3184. //flash content
  3185.  
  3186.  
  3187. function createPlayer(theFile, w, h, mut, logo_, vol, playlist_, plgs) {
  3188.     var flashvars = new Object();
  3189.     flashvars.stretching = "uniform";
  3190.     flashvars.repeat = "list";
  3191.     flashvars.controlbar = "over";
  3192.     flashvars.skin = "/player/radio3net_skin/radio3net.swf";
  3193.  
  3194.     if (playlist_) {} else {
  3195.         playlist_ = "none"
  3196.     }
  3197.     if (plgs) {} else {
  3198.         playlist_ = "none"
  3199.     }
  3200.  
  3201.     switch (getCookie("playerCurrentContentType")) {
  3202.     case "webcam":
  3203.         flashvars.file = "Camera" + getCookie("playerCurrentContentLoad");
  3204.         flashvars.streamer = streamer_const;
  3205.         flashvars.type = "rtmp";
  3206.         flashvars.playlist = "none";
  3207.         document.getElementById("cam1").className = "camere";
  3208.         document.getElementById("cam" + getCookie("playerCurrentContentLoad")).className = "camere selected";
  3209.         break;
  3210.     case "stream":
  3211.         flashvars.streamer = streamer_const;
  3212.         flashvars.type = "rtmp";
  3213.         flashvars.playlist = 'none';
  3214.         flashvars.plugins = 'livestream-1&livestream.file=' + getCookie("playerCurrentContentLoad") + '&livestream.streamer=' + streamer_const + '&livestream.message=în câteva momente: ' + getCookie("playerCurrentContentTitle") + '&livestream.interval=3';
  3215.         document.getElementById("cam1").className = "camere";
  3216.         break;
  3217.     case "video":
  3218.         flashvars.file = "Radio3Net/video/" + getCookie("playerCurrentContentLoad") + ".flv";
  3219.         flashvars.type = "rtmp";
  3220.         flashvars.streamer = streamer_video;
  3221.         flashvars.playlist = "none";
  3222.         document.getElementById("cam1").className = "camere";
  3223.         break;
  3224.     case "audio":
  3225.         flashvars.file = "Radio3Net/audio/" + getCookie("playerCurrentContentLoad") + ".mp3";
  3226.         flashvars.type = "rtmp";
  3227.         flashvars.streamer = streamer_video;
  3228.         flashvars.playlist = "none";
  3229.         flashvars.image = base64decode(getCookie("playerCurrentContentPicture"));
  3230.         document.getElementById("cam1").className = "camere";
  3231.         break;
  3232.     case "playlist":
  3233.         flashvars.file = "";
  3234.         flashvars.streamer = streamer_const;
  3235.         flashvars.type = "rtmp";
  3236.         flashvars.playlist = "bottom";
  3237.         flashvars.playlistsize = 181;
  3238.         document.getElementById("cam1").className = "camere";
  3239.         break;
  3240.     default:
  3241.         flashvars.file = theFile;
  3242.         flashvars.streamer = streamer_const;
  3243.         flashvars.type = "rtmp";
  3244.         flashvars.playlist = "none";
  3245.     }
  3246.     flashvars.mute = mut;
  3247.     flashvars.stretching = "uniform";
  3248.     flashvars.bufferlength = "3";
  3249.     flashvars.logo = logo_;
  3250.     if (getCookie("playerCurrentVolume") != "") {
  3251.         flashvars.volume = numar(getCookie("playerCurrentVolume"));
  3252.     } else {
  3253.         flashvars.volume = vol;
  3254.     }
  3255.     if (getCookie("playerCurrentState") == "PLAYING" || getCookie("playerCurrentState") == "") {
  3256.         flashvars.autostart = "true";
  3257.     } else {
  3258.         flashvars.autostart = "false";
  3259.     }
  3260.     var params = {
  3261.         allowfullscreen: "true",
  3262.         allowscriptaccess: "always",
  3263.         wmode: "transparent",
  3264.         expressinstall: "/flash/expressInstall.swf",
  3265.         bgcolor: "#000000"
  3266.     }
  3267.     var attributes = {
  3268.         id: "player1",
  3269.         name: "player1"
  3270.     }
  3271.     swfobject.embedSWF("/player/player.swf", "player_container", w, h, "9.0.0.0", false, flashvars, params, attributes);
  3272. }
  3273.  
  3274. function createFlashContent(content, theFile, wm, fs, w, h, cb, ct, bg) {
  3275.     var flashvars = {
  3276.         xmlfile: theFile,
  3277.         dimx: w,
  3278.         dimy: h,
  3279.         culoare: cb,
  3280.         culoaretxt: ct,
  3281.         backgnd: bg
  3282.     }
  3283.     var params = {
  3284.         allowfullscreen: fs,
  3285.         allowscriptaccess: "always",
  3286.         scale: "noscale",
  3287.         wmode: wm,
  3288.         menu: "false",
  3289.         expressinstall: "/flash/expressInstall.swf"
  3290.     }
  3291.     var attributes = {
  3292.         id: content,
  3293.         name: content
  3294.     }
  3295.     swfobject.embedSWF("/flash/" + content + ".swf", "container_" + content, w, h, "9.0.0.0", false, flashvars, params, attributes);
  3296. }
  3297. //jw playe listeners
  3298.  
  3299.  
  3300. function playerReady(thePlayer) {
  3301.     player = window.document[thePlayer.id];
  3302.     addListeners();
  3303. }
  3304.  
  3305. function addListeners() {
  3306.     if (player) {
  3307.         switch (getCookie("playerCurrentContentType")) {
  3308.         case "video":
  3309.             break;
  3310.         case "playlist":
  3311.             if (playlist_json == null) {
  3312.                 playlist_json = eval(base64decode('' + getHTTPPage("/playlistjson.php?p=" + getCookie("playerCurrentContentLoad"))));
  3313.                 var playlist_count = 0;
  3314.                 while (playlist_json[playlist_count]) {
  3315.                     playlist_json[playlist_count].description = base64decode(getCookie("playerCurrentContentAuthor"));
  3316.                     playlist_json[playlist_count].image = base64decode(getCookie("playerCurrentContentPicture"));
  3317.                     playlist_count++;
  3318.                 }
  3319.             }
  3320.             player.sendEvent('LOAD', playlist_json);
  3321.             player.sendEvent('ITEM', numar(getCookie("playerCurrentItem")))
  3322.             break;
  3323.         case "audio":
  3324.         case "webcam":
  3325.         case "stream":
  3326.             player.sendEvent("PLAY", "true");
  3327.             break;
  3328.         }
  3329.         player.addModelListener("STATE", "stateListener");
  3330.         player.addControllerListener("ITEM", "itemListener");
  3331.         player.addViewListener("VOLUME", "volumeListener");
  3332.     } else {
  3333.         setTimeout("addListeners()", 100);
  3334.     }
  3335. }
  3336.  
  3337. function stateListener(obj) {
  3338.     currentState = obj.newstate;
  3339.     setCookie("playerCurrentState", currentState);
  3340. }
  3341.  
  3342. function volumeListener(obj) {
  3343.     currentVolume = obj.percentage;
  3344.     setCookie("playerCurrentVolume", currentVolume);
  3345. }
  3346.  
  3347. function itemListener(obj) {
  3348.     currentItem = obj.index;
  3349.     setCookie("playerCurrentItem", currentItem);
  3350. }
  3351. //jw player control
  3352.  
  3353.  
  3354. function webcam(x, y) {
  3355.     playlist_json = null;
  3356.     setCookie("playerCurrentContentLoad", x);
  3357.     if (getCookie("playerCurrentContentType") != "webcam") {
  3358.         setCookie("playerCurrentContentType", "webcam");
  3359.         if (current_album) {
  3360.             current_album.className = current_album.className.slice(0, current_album.className.indexOf(" selected"));
  3361.             current_album = null;
  3362.         }
  3363.         var f = document.getElementById("player_container1");
  3364.         if (f == null) {
  3365.             f = document.getElementById("player_container2");
  3366.         }
  3367.         f.innerHTML = "<div id='player_container'></div>";
  3368.         if (f.id == "player_container1") {
  3369.             createPlayer("Camera" + x, 300, 188, 'false', 'none', 15);
  3370.         } else {
  3371.             createPlayer("Camera" + x, 516, 320, 'false', 'none', 15);
  3372.         }
  3373.     } else {
  3374.         player.sendEvent('LOAD', {
  3375.             file: "Camera" + x,
  3376.             type: "rtmp"
  3377.         })
  3378.     }
  3379.     s = "cam" + x;
  3380.     document.getElementById(s).className = "camere selected";
  3381.     s = "cam" + y;
  3382.     document.getElementById(s).className = "camere";
  3383. }
  3384.  
  3385. function playstream(mount, titlu, obiect) {
  3386.     setCookie("playerCurrentContentLoad", mount);
  3387.     setCookie("playerCurrentContentHTMLObj", obiect);
  3388.     setCookie("playerCurrentContentTitle", titlu);
  3389.     setCookie("playerCurrentContentType", "stream");
  3390.     var f = document.getElementById("player_container2");
  3391.     if (f == null) {
  3392.         f = document.getElementById("player_container1")
  3393.     }
  3394.     document.getElementById("cam1").className = "camere";
  3395.     document.getElementById("cam2").className = "camere";
  3396.     player = null;
  3397.     playlist_json = null;
  3398.     f.innerHTML = "<div id='player_container'></div>";
  3399.     if (f.id == "player_container2") {
  3400.         createPlayer('', 516, 320, 'false', '/player/sigla.png', 15)
  3401.     } else {
  3402.         createPlayer('', 300, 188, 'false', '/player/sigla.png', 15)
  3403.     }
  3404.     if (current_album) {
  3405.         current_album.className = current_album.className.slice(0, current_album.className.indexOf(" selected"));
  3406.     }
  3407.     obiect.className = obiect.className + " selected";
  3408.     current_album = obiect;
  3409. }
  3410.  
  3411. function playaudio(titlu, id, obiect, poza) {
  3412.     if (obiect.className.indexOf(" selected") == -1) {
  3413.         playlist_json = null;
  3414.         setCookie("playerCurrentContentLoad", id);
  3415.         setCookie("playerCurrentContentHTMLObj", obiect);
  3416.         setCookie("playerCurrentContentTitle", titlu);
  3417.         setCookie("playerCurrentContentPicture", poza);
  3418.         document.getElementById("cam1").className = "camere";
  3419.         document.getElementById("cam2").className = "camere";
  3420.         if (getCookie("playerCurrentContentType") != "audio") {
  3421.             var f = document.getElementById("player_container2");
  3422.             if (f == null) {
  3423.                 f = document.getElementById("player_container1")
  3424.             }
  3425.             player = null;
  3426.             f.innerHTML = "<div id='player_container'></div>";
  3427.             if (f.id == "player_container2") {
  3428.                 createPlayer('', 516, 320, 'false', 'none', 60)
  3429.             } else {
  3430.                 createPlayer('', 300, 188, 'false', 'none', 60)
  3431.             }
  3432.         } else {
  3433.             var temp_ = {
  3434.                 file: "Radio3Net/audio/" + id + ".mp3",
  3435.                 title: base64decode(titlu),
  3436.                 author: "Radio3Net",
  3437.                 description: "Radio3Net",
  3438.                 streamer: streamer_video,
  3439.                 image: base64decode(poza)
  3440.             };
  3441.             player.sendEvent('LOAD', temp_);
  3442.             player.sendEvent('PLAY', 'true');
  3443.         }
  3444.         obiect.className = obiect.className + " selected";
  3445.         if (current_album) {
  3446.             current_album.className = current_album.className.slice(0, current_album.className.indexOf(" selected"));
  3447.         }
  3448.         current_album = obiect;
  3449.         setCookie("playerCurrentContentType", "audio");
  3450.     }
  3451. }
  3452.  
  3453. function playvideo(titlu, id, obiect) {
  3454.     var ok = false;
  3455.     if (obiect.className) {
  3456.         if (obiect.className.indexOf(" selected") == -1) ok = true
  3457.     }
  3458.     if (ok || obiect.className == null) {
  3459.         playlist_json = null;
  3460.         setCookie("playerCurrentContentLoad", id);
  3461.         setCookie("playerCurrentContentHTMLObj", obiect);
  3462.         setCookie("playerCurrentContentTitle", titlu);
  3463.         if (getCookie("playerCurrentContentType") != "video") {
  3464.             setCookie("playerCurrentContentType", "video");
  3465.             document.getElementById("cam1").className = "camere";
  3466.             document.getElementById("cam2").className = "camere";
  3467.             var f = document.getElementById("player_container2");
  3468.             if (f == null) {
  3469.                 f = document.getElementById("player_container1")
  3470.             }
  3471.             player = null;
  3472.             f.innerHTML = "<div id='player_container'></div>";
  3473.             if (f.id == "player_container2") {
  3474.                 createPlayer('', 516, 320, 'false', 'none', 15)
  3475.             } else {
  3476.                 createPlayer('', 300, 188, 'false', 'none', 15)
  3477.             }
  3478.         } else {
  3479.             var temp_ = {
  3480.                 file: "Radio3Net/video/" + id + ".flv",
  3481.                 title: titlu,
  3482.                 author: "Radio3Net",
  3483.                 description: "Radio3Net",
  3484.                 streamer: streamer_video
  3485.             };
  3486.             player.sendEvent('LOAD', temp_);
  3487.             player.sendEvent('PLAY', 'true');
  3488.         }
  3489.         if (ok) {
  3490.             obiect.className = obiect.className + " selected";
  3491.             if (current_album) {
  3492.                 current_album.className = current_album.className.slice(0, current_album.className.indexOf(" selected"));
  3493.             }
  3494.             current_album = obiect;
  3495.         }
  3496.     }
  3497. }
  3498.  
  3499. function get_playlist(id, cale, obj, poza, autor) {
  3500.     playlist_json = null;
  3501.     setCookie("playerCurrentContentLoad", id);
  3502.     setCookie("playerCurrentContentHTMLObj", obj);
  3503.     setCookie("playerCurrentContentAuthor", autor);
  3504.     setCookie("playerCurrentContentPicture", poza);
  3505.     setCookie("playerCurrentContentType", "playlist");
  3506.     setCookie("playerCurrentItem", 0);
  3507.     document.getElementById("cam1").className = "camere";
  3508.     document.getElementById("cam2").className = "camere";
  3509.     playlist_json = eval(base64decode('' + getHTTPPage(cale + "playlistjson.php?p=" + id)));
  3510.     var playlist_count = 0;
  3511.     while (playlist_json[playlist_count]) {
  3512.         playlist_json[playlist_count].description = base64decode(autor);
  3513.         playlist_json[playlist_count].image = base64decode(poza);
  3514.         playlist_count++;
  3515.     }
  3516.     var f = document.getElementById("player_container2");
  3517.     if (f == null) {
  3518.         f = document.getElementById("player_container1")
  3519.     }
  3520.     player = null;
  3521.     f.innerHTML = "<div id='player_container'></div>";
  3522.     if (f.id == "player_container2") {
  3523.         createPlayer('', 516, 520, 'false', 'none', 15, "bottom");
  3524.     } else {
  3525.         createPlayer('', 300, 400, 'false', 'none', 15, "bottom");
  3526.     }
  3527.     if (obj) {
  3528.         obj.className = obj.className + " selected";
  3529.     }
  3530.     if (current_album) {
  3531.         current_album.className = current_album.className.slice(current_album.className, current_album.className.indexOf(" "));
  3532.     }
  3533.     current_album = obj;
  3534.     live_stream = false;
  3535. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement