Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var swfobject = function () {
- var D = "undefined",
- r = "object",
- S = "Shockwave Flash",
- W = "ShockwaveFlash.ShockwaveFlash",
- q = "application/x-shockwave-flash",
- R = "SWFObjectExprInst",
- x = "onreadystatechange",
- O = window,
- j = document,
- t = navigator,
- T = false,
- U = [h],
- o = [],
- N = [],
- I = [],
- l, Q, E, B, J = false,
- a = false,
- n, G, m = true,
- M = function () {
- var aa = typeof j.getElementById != D && typeof j.getElementsByTagName != D && typeof j.createElement != D,
- ah = t.userAgent.toLowerCase(),
- Y = t.platform.toLowerCase(),
- ae = Y ? /win/.test(Y) : /win/.test(ah),
- ac = Y ? /mac/.test(Y) : /mac/.test(ah),
- af = /webkit/.test(ah) ? parseFloat(ah.replace(/^.*webkit\/(\d+(\.\d+)?).*$/, "$1")) : false,
- X = !+"\v1",
- ag = [0, 0, 0],
- ab = null;
- if (typeof t.plugins != D && typeof t.plugins[S] == r) {
- ab = t.plugins[S].description;
- if (ab && !(typeof t.mimeTypes != D && t.mimeTypes[q] && !t.mimeTypes[q].enabledPlugin)) {
- T = true;
- X = false;
- ab = ab.replace(/^.*\s+(\S+\s+\S+$)/, "$1");
- ag[0] = parseInt(ab.replace(/^(.*)\..*$/, "$1"), 10);
- ag[1] = parseInt(ab.replace(/^.*\.(.*)\s.*$/, "$1"), 10);
- ag[2] = /[a-zA-Z]/.test(ab) ? parseInt(ab.replace(/^.*[a-zA-Z]+(.*)$/, "$1"), 10) : 0
- }
- } else {
- if (typeof O.ActiveXObject != D) {
- try {
- var ad = new ActiveXObject(W);
- if (ad) {
- ab = ad.GetVariable("$version");
- if (ab) {
- X = true;
- ab = ab.split(" ")[1].split(",");
- ag = [parseInt(ab[0], 10), parseInt(ab[1], 10), parseInt(ab[2], 10)]
- }
- }
- } catch(Z) {}
- }
- }
- return {
- w3: aa,
- pv: ag,
- wk: af,
- ie: X,
- win: ae,
- mac: ac
- }
- }(),
- k = function () {
- if (!M.w3) {
- return
- }
- if ((typeof j.readyState != D && j.readyState == "complete") || (typeof j.readyState == D && (j.getElementsByTagName("body")[0] || j.body))) {
- f()
- }
- if (!J) {
- if (typeof j.addEventListener != D) {
- j.addEventListener("DOMContentLoaded", f, false)
- }
- if (M.ie && M.win) {
- j.attachEvent(x, function () {
- if (j.readyState == "complete") {
- j.detachEvent(x, arguments.callee);
- f()
- }
- });
- if (O == top) {
- (function () {
- if (J) {
- return
- }
- try {
- j.documentElement.doScroll("left")
- } catch(X) {
- setTimeout(arguments.callee, 0);
- return
- }
- f()
- })()
- }
- }
- if (M.wk) {
- (function () {
- if (J) {
- return
- }
- if (!/loaded|complete/.test(j.readyState)) {
- setTimeout(arguments.callee, 0);
- return
- }
- f()
- })()
- }
- s(f)
- }
- }();
- function f() {
- if (J) {
- return
- }
- try {
- var Z = j.getElementsByTagName("body")[0].appendChild(C("span"));
- Z.parentNode.removeChild(Z)
- } catch(aa) {
- return
- }
- J = true;
- var X = U.length;
- for (var Y = 0; Y < X; Y++) {
- U[Y]()
- }
- }
- function K(X) {
- if (J) {
- X()
- } else {
- U[U.length] = X
- }
- }
- function s(Y) {
- if (typeof O.addEventListener != D) {
- O.addEventListener("load", Y, false)
- } else {
- if (typeof j.addEventListener != D) {
- j.addEventListener("load", Y, false)
- } else {
- if (typeof O.attachEvent != D) {
- i(O, "onload", Y)
- } else {
- if (typeof O.onload == "function") {
- var X = O.onload;
- O.onload = function () {
- X();
- Y()
- }
- } else {
- O.onload = Y
- }
- }
- }
- }
- }
- function h() {
- if (T) {
- V()
- } else {
- H()
- }
- }
- function V() {
- var X = j.getElementsByTagName("body")[0];
- var aa = C(r);
- aa.setAttribute("type", q);
- var Z = X.appendChild(aa);
- if (Z) {
- var Y = 0;
- (function () {
- if (typeof Z.GetVariable != D) {
- var ab = Z.GetVariable("$version");
- if (ab) {
- ab = ab.split(" ")[1].split(",");
- M.pv = [parseInt(ab[0], 10), parseInt(ab[1], 10), parseInt(ab[2], 10)]
- }
- } else {
- if (Y < 10) {
- Y++;
- setTimeout(arguments.callee, 10);
- return
- }
- }
- X.removeChild(aa);
- Z = null;
- H()
- })()
- } else {
- H()
- }
- }
- function H() {
- var ag = o.length;
- if (ag > 0) {
- for (var af = 0; af < ag; af++) {
- var Y = o[af].id;
- var ab = o[af].callbackFn;
- var aa = {
- success: false,
- id: Y
- };
- if (M.pv[0] > 0) {
- var ae = c(Y);
- if (ae) {
- if (F(o[af].swfVersion) && !(M.wk && M.wk < 312)) {
- w(Y, true);
- if (ab) {
- aa.success = true;
- aa.ref = z(Y);
- ab(aa)
- }
- } else {
- if (o[af].expressInstall && A()) {
- var ai = {};
- ai.data = o[af].expressInstall;
- ai.width = ae.getAttribute("width") || "0";
- ai.height = ae.getAttribute("height") || "0";
- if (ae.getAttribute("class")) {
- ai.styleclass = ae.getAttribute("class")
- }
- if (ae.getAttribute("align")) {
- ai.align = ae.getAttribute("align")
- }
- var ah = {};
- var X = ae.getElementsByTagName("param");
- var ac = X.length;
- for (var ad = 0; ad < ac; ad++) {
- if (X[ad].getAttribute("name").toLowerCase() != "movie") {
- ah[X[ad].getAttribute("name")] = X[ad].getAttribute("value")
- }
- }
- P(ai, ah, Y, ab)
- } else {
- p(ae);
- if (ab) {
- ab(aa)
- }
- }
- }
- }
- } else {
- w(Y, true);
- if (ab) {
- var Z = z(Y);
- if (Z && typeof Z.SetVariable != D) {
- aa.success = true;
- aa.ref = Z
- }
- ab(aa)
- }
- }
- }
- }
- }
- function z(aa) {
- var X = null;
- var Y = c(aa);
- if (Y && Y.nodeName == "OBJECT") {
- if (typeof Y.SetVariable != D) {
- X = Y
- } else {
- var Z = Y.getElementsByTagName(r)[0];
- if (Z) {
- X = Z
- }
- }
- }
- return X
- }
- function A() {
- return !a && F("6.0.65") && (M.win || M.mac) && !(M.wk && M.wk < 312)
- }
- function P(aa, ab, X, Z) {
- a = true;
- E = Z || null;
- B = {
- success: false,
- id: X
- };
- var ae = c(X);
- if (ae) {
- if (ae.nodeName == "OBJECT") {
- l = g(ae);
- Q = null
- } else {
- l = ae;
- Q = X
- }
- aa.id = R;
- if (typeof aa.width == D || (!/%$/.test(aa.width) && parseInt(aa.width, 10) < 310)) {
- aa.width = "310"
- }
- if (typeof aa.height == D || (!/%$/.test(aa.height) && parseInt(aa.height, 10) < 137)) {
- aa.height = "137"
- }
- j.title = j.title.slice(0, 47) + " - Flash Player Installation";
- var ad = M.ie && M.win ? "ActiveX" : "PlugIn",
- ac = "MMredirectURL=" + O.location.toString().replace(/&/g, "%26") + "&MMplayerType=" + ad + "&MMdoctitle=" + j.title;
- if (typeof ab.flashvars != D) {
- ab.flashvars += "&" + ac
- } else {
- ab.flashvars = ac
- }
- if (M.ie && M.win && ae.readyState != 4) {
- var Y = C("div");
- X += "SWFObjectNew";
- Y.setAttribute("id", X);
- ae.parentNode.insertBefore(Y, ae);
- ae.style.display = "none";
- (function () {
- if (ae.readyState == 4) {
- ae.parentNode.removeChild(ae)
- } else {
- setTimeout(arguments.callee, 10)
- }
- })()
- }
- u(aa, ab, X)
- }
- }
- function p(Y) {
- if (M.ie && M.win && Y.readyState != 4) {
- var X = C("div");
- Y.parentNode.insertBefore(X, Y);
- X.parentNode.replaceChild(g(Y), X);
- Y.style.display = "none";
- (function () {
- if (Y.readyState == 4) {
- Y.parentNode.removeChild(Y)
- } else {
- setTimeout(arguments.callee, 10)
- }
- })()
- } else {
- Y.parentNode.replaceChild(g(Y), Y)
- }
- }
- function g(ab) {
- var aa = C("div");
- if (M.win && M.ie) {
- aa.innerHTML = ab.innerHTML
- } else {
- var Y = ab.getElementsByTagName(r)[0];
- if (Y) {
- var ad = Y.childNodes;
- if (ad) {
- var X = ad.length;
- for (var Z = 0; Z < X; Z++) {
- if (! (ad[Z].nodeType == 1 && ad[Z].nodeName == "PARAM") && !(ad[Z].nodeType == 8)) {
- aa.appendChild(ad[Z].cloneNode(true))
- }
- }
- }
- }
- }
- return aa
- }
- function u(ai, ag, Y) {
- var X, aa = c(Y);
- if (M.wk && M.wk < 312) {
- return X
- }
- if (aa) {
- if (typeof ai.id == D) {
- ai.id = Y
- }
- if (M.ie && M.win) {
- var ah = "";
- for (var ae in ai) {
- if (ai[ae] != Object.prototype[ae]) {
- if (ae.toLowerCase() == "data") {
- ag.movie = ai[ae]
- } else {
- if (ae.toLowerCase() == "styleclass") {
- ah += ' class="' + ai[ae] + '"'
- } else {
- if (ae.toLowerCase() != "classid") {
- ah += " " + ae + '="' + ai[ae] + '"'
- }
- }
- }
- }
- }
- var af = "";
- for (var ad in ag) {
- if (ag[ad] != Object.prototype[ad]) {
- af += '<param name="' + ad + '" value="' + ag[ad] + '" />'
- }
- }
- aa.outerHTML = '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"' + ah + ">" + af + "</object>";
- N[N.length] = ai.id;
- X = c(ai.id)
- } else {
- var Z = C(r);
- Z.setAttribute("type", q);
- for (var ac in ai) {
- if (ai[ac] != Object.prototype[ac]) {
- if (ac.toLowerCase() == "styleclass") {
- Z.setAttribute("class", ai[ac])
- } else {
- if (ac.toLowerCase() != "classid") {
- Z.setAttribute(ac, ai[ac])
- }
- }
- }
- }
- for (var ab in ag) {
- if (ag[ab] != Object.prototype[ab] && ab.toLowerCase() != "movie") {
- e(Z, ab, ag[ab])
- }
- }
- aa.parentNode.replaceChild(Z, aa);
- X = Z
- }
- }
- return X
- }
- function e(Z, X, Y) {
- var aa = C("param");
- aa.setAttribute("name", X);
- aa.setAttribute("value", Y);
- Z.appendChild(aa)
- }
- function y(Y) {
- var X = c(Y);
- if (X && X.nodeName == "OBJECT") {
- if (M.ie && M.win) {
- X.style.display = "none";
- (function () {
- if (X.readyState == 4) {
- b(Y)
- } else {
- setTimeout(arguments.callee, 10)
- }
- })()
- } else {
- X.parentNode.removeChild(X)
- }
- }
- }
- function b(Z) {
- var Y = c(Z);
- if (Y) {
- for (var X in Y) {
- if (typeof Y[X] == "function") {
- Y[X] = null
- }
- }
- Y.parentNode.removeChild(Y)
- }
- }
- function c(Z) {
- var X = null;
- try {
- X = j.getElementById(Z)
- } catch(Y) {}
- return X
- }
- function C(X) {
- return j.createElement(X)
- }
- function i(Z, X, Y) {
- Z.attachEvent(X, Y);
- I[I.length] = [Z, X, Y]
- }
- function F(Z) {
- var Y = M.pv,
- X = Z.split(".");
- X[0] = parseInt(X[0], 10);
- X[1] = parseInt(X[1], 10) || 0;
- X[2] = parseInt(X[2], 10) || 0;
- 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
- }
- function v(ac, Y, ad, ab) {
- if (M.ie && M.mac) {
- return
- }
- var aa = j.getElementsByTagName("head")[0];
- if (!aa) {
- return
- }
- var X = (ad && typeof ad == "string") ? ad : "screen";
- if (ab) {
- n = null;
- G = null
- }
- if (!n || G != X) {
- var Z = C("style");
- Z.setAttribute("type", "text/css");
- Z.setAttribute("media", X);
- n = aa.appendChild(Z);
- if (M.ie && M.win && typeof j.styleSheets != D && j.styleSheets.length > 0) {
- n = j.styleSheets[j.styleSheets.length - 1]
- }
- G = X
- }
- if (M.ie && M.win) {
- if (n && typeof n.addRule == r) {
- n.addRule(ac, Y)
- }
- } else {
- if (n && typeof j.createTextNode != D) {
- n.appendChild(j.createTextNode(ac + " {" + Y + "}"))
- }
- }
- }
- function w(Z, X) {
- if (!m) {
- return
- }
- var Y = X ? "visible" : "hidden";
- if (J && c(Z)) {
- c(Z).style.visibility = Y
- } else {
- v("#" + Z, "visibility:" + Y)
- }
- }
- function L(Y) {
- var Z = /[\\\"<>\.;]/;
- var X = Z.exec(Y) != null;
- return X && typeof encodeURIComponent != D ? encodeURIComponent(Y) : Y
- }
- var d = function () {
- if (M.ie && M.win) {
- window.attachEvent("onunload", function () {
- var ac = I.length;
- for (var ab = 0; ab < ac; ab++) {
- I[ab][0].detachEvent(I[ab][1], I[ab][2])
- }
- var Z = N.length;
- for (var aa = 0; aa < Z; aa++) {
- y(N[aa])
- }
- for (var Y in M) {
- M[Y] = null
- }
- M = null;
- for (var X in swfobject) {
- swfobject[X] = null
- }
- swfobject = null
- })
- }
- }();
- return {
- registerObject: function (ab, X, aa, Z) {
- if (M.w3 && ab && X) {
- var Y = {};
- Y.id = ab;
- Y.swfVersion = X;
- Y.expressInstall = aa;
- Y.callbackFn = Z;
- o[o.length] = Y;
- w(ab, false)
- } else {
- if (Z) {
- Z({
- success: false,
- id: ab
- })
- }
- }
- },
- getObjectById: function (X) {
- if (M.w3) {
- return z(X)
- }
- },
- embedSWF: function (ab, ah, ae, ag, Y, aa, Z, ad, af, ac) {
- var X = {
- success: false,
- id: ah
- };
- if (M.w3 && !(M.wk && M.wk < 312) && ab && ah && ae && ag && Y) {
- w(ah, false);
- K(function () {
- ae += "";
- ag += "";
- var aj = {};
- if (af && typeof af === r) {
- for (var al in af) {
- aj[al] = af[al]
- }
- }
- aj.data = ab;
- aj.width = ae;
- aj.height = ag;
- var am = {};
- if (ad && typeof ad === r) {
- for (var ak in ad) {
- am[ak] = ad[ak]
- }
- }
- if (Z && typeof Z === r) {
- for (var ai in Z) {
- if (typeof am.flashvars != D) {
- am.flashvars += "&" + ai + "=" + Z[ai]
- } else {
- am.flashvars = ai + "=" + Z[ai]
- }
- }
- }
- if (F(Y)) {
- var an = u(aj, am, ah);
- if (aj.id == ah) {
- w(ah, true)
- }
- X.success = true;
- X.ref = an
- } else {
- if (aa && A()) {
- aj.data = aa;
- P(aj, am, ah, ac);
- return
- } else {
- w(ah, true)
- }
- }
- if (ac) {
- ac(X)
- }
- })
- } else {
- if (ac) {
- ac(X)
- }
- }
- },
- switchOffAutoHideShow: function () {
- m = false
- },
- ua: M,
- getFlashPlayerVersion: function () {
- return {
- major: M.pv[0],
- minor: M.pv[1],
- release: M.pv[2]
- }
- },
- hasFlashPlayerVersion: F,
- createSWF: function (Z, Y, X) {
- if (M.w3) {
- return u(Z, Y, X)
- } else {
- return undefined
- }
- },
- showExpressInstall: function (Z, aa, X, Y) {
- if (M.w3 && A()) {
- P(Z, aa, X, Y)
- }
- },
- removeSWF: function (X) {
- if (M.w3) {
- y(X)
- }
- },
- createCSS: function (aa, Z, Y, X) {
- if (M.w3) {
- v(aa, Z, Y, X)
- }
- },
- addDomLoadEvent: K,
- addLoadEvent: s,
- getQueryParamValue: function (aa) {
- var Z = j.location.search || j.location.hash;
- if (Z) {
- if (/\?/.test(Z)) {
- Z = Z.split("?")[1]
- }
- if (aa == null) {
- return L(Z)
- }
- var Y = Z.split("&");
- for (var X = 0; X < Y.length; X++) {
- if (Y[X].substring(0, Y[X].indexOf("=")) == aa) {
- return L(Y[X].substring((Y[X].indexOf("=") + 1)))
- }
- }
- }
- return ""
- },
- expressInstallCallback: function () {
- if (a) {
- var X = c(R);
- if (X && l) {
- X.parentNode.replaceChild(l, X);
- if (Q) {
- w(Q, true);
- if (M.ie && M.win) {
- l.style.display = "block"
- }
- }
- if (E) {
- E(B)
- }
- }
- a = false
- }
- }
- }
- }();
- Calendar = (function () {
- function y(at) {
- at = at || {};
- this.args = at = al(at, {
- animation: !c,
- cont: null,
- bottomBar: true,
- date: true,
- fdow: aq("fdow"),
- min: null,
- max: null,
- reverseWheel: false,
- selection: [],
- selectionType: y.SEL_SINGLE,
- weekNumbers: false,
- align: "Bl/ / /T/r",
- inputField: null,
- trigger: null,
- dateFormat: "%Y-%m-%d",
- opacity: j ? 1 : 3,
- titleFormat: "%b %Y",
- showTime: false,
- timePos: "right",
- time: true,
- minuteStep: 5,
- disabled: ad,
- dateInfo: ad,
- onChange: ad,
- onSelect: ad,
- onTimeChange: ad,
- onFocus: ad,
- onBlur: ad
- });
- this.handlers = {};
- var P = this,
- D = new Date();
- at.min = Y(at.min);
- at.max = Y(at.max);
- if (at.date === true) {
- at.date = D
- }
- if (at.time === true) {
- at.time = D.getHours() * 100 + Math.floor(D.getMinutes() / at.minuteStep) * at.minuteStep
- }
- this.date = Y(at.date);
- this.time = at.time;
- this.fdow = at.fdow;
- m("onChange onSelect onTimeChange onFocus onBlur".split(/\s+/), function (av) {
- var au = at[av];
- if (! (au instanceof Array)) {
- au = [au]
- }
- P.handlers[av] = au
- });
- this.selection = new y.Selection(at.selection, at.selectionType, R, this);
- var ar = K.call(this);
- if (at.cont) {
- W(at.cont).appendChild(ar)
- }
- if (at.trigger) {
- this.manageFields(at.trigger, at.inputField, at.dateFormat)
- }
- }
- var S = navigator.userAgent,
- s = /opera/i.test(S),
- ai = /Konqueror|Safari|KHTML/i.test(S),
- j = /msie/i.test(S) && !s && !(/mac_powerpc/i.test(S)),
- c = j && /msie 6/i.test(S),
- x = /gecko/i.test(S) && !ai && !s && !j,
- l = y.prototype,
- q = y.I18N = {};
- y.SEL_NONE = 0;
- y.SEL_SINGLE = 1;
- y.SEL_MULTIPLE = 2;
- y.SEL_WEEK = 3;
- y.dateToInt = V;
- y.intToDate = B;
- y.printDate = ab;
- y.formatString = k;
- y.i18n = aq;
- y.LANG = function (P, D, ar) {
- q.__ = q[P] = {
- name: D,
- data: ar
- }
- };
- y.setup = function (D) {
- return new y(D)
- };
- l.moveTo = function (aG, aD) {
- aG = Y(aG);
- var aC = af(aG, this.date, true),
- au, az = this.args,
- aH = az.min && af(aG, az.min),
- aI = az.max && af(aG, az.max);
- if (!az.animation) {
- aD = false
- }
- ae(aH != null && aH <= 1, [this.els.navPrevMonth, this.els.navPrevYear], "DynarchCalendar-navDisabled");
- ae(aI != null && aI >= -1, [this.els.navNextMonth, this.els.navNextYear], "DynarchCalendar-navDisabled");
- if (aH < -1) {
- aG = az.min;
- au = 1;
- aC = 0
- }
- if (aI > 1) {
- aG = az.max;
- au = 2;
- aC = 0
- }
- this.date = aG;
- this.refresh( !! aD);
- this.callHooks("onChange", this, aG, aD);
- if (aD && !(aC == 0 && aD == 2)) {
- if (this._bodyAnim) {
- this._bodyAnim.stop()
- }
- var aw = this.els.body,
- ax = G("div", "DynarchCalendar-animBody-" + U[aC], aw),
- aF = aw.firstChild,
- av = am(aF) || 0.7,
- ay = au ? Z.brakes : aC == 0 ? Z.shake : Z.accel_ab2,
- aE = aC * aC > 4,
- ar = aE ? aF.offsetTop : aF.offsetLeft,
- aB = ax.style,
- aA = aE ? aw.offsetHeight : aw.offsetWidth;
- if (aC < 0) {
- aA += ar
- } else {
- if (aC > 0) {
- aA = ar - aA
- } else {
- aA = Math.round(aA / 7);
- if (au == 2) {
- aA = -aA
- }
- }
- }
- if (!au && aC != 0) {
- var P = ax.cloneNode(true),
- D = P.style,
- at = 2 * aA;
- P.appendChild(aF.cloneNode(true));
- D[aE ? "marginTop" : "marginLeft"] = aA + "px";
- aw.appendChild(P)
- }
- aF.style.visibility = "hidden";
- ax.innerHTML = ac(this);
- this._bodyAnim = ap({
- onUpdate: v(function (aK, aM) {
- var aL = ay(aK);
- if (P) {
- var aJ = aM(aL, aA, at) + "px"
- }
- if (au) {
- aB[aE ? "marginTop" : "marginLeft"] = aM(aL, aA, 0) + "px"
- } else {
- if (aE || aC == 0) {
- aB.marginTop = aM(aC == 0 ? ay(aK * aK) : aL, 0, aA) + "px";
- if (aC != 0) {
- D.marginTop = aJ
- }
- }
- if (!aE || aC == 0) {
- aB.marginLeft = aM(aL, 0, aA) + "px";
- if (aC != 0) {
- D.marginLeft = aJ
- }
- }
- }
- if (this.args.opacity > 2 && P) {
- am(P, 1 - aL);
- am(ax, aL)
- }
- },
- this),
- onStop: v(function (aJ) {
- aw.innerHTML = ac(this, aG);
- this._bodyAnim = null
- },
- this)
- })
- }
- this._lastHoverDate = null;
- return aH >= -1 && aI <= 1
- };
- l.isDisabled = function (D) {
- var P = this.args;
- return (P.min && af(D, P.min) < 0) || (P.max && af(D, P.max) > 0) || P.disabled(D)
- };
- l.toggleMenu = function () {
- u(this, !this._menuVisible)
- };
- l.refresh = function (D) {
- var P = this.els;
- if (!D) {
- P.body.innerHTML = ac(this)
- }
- P.title.innerHTML = F(this);
- P.yearInput.value = this.date.getFullYear()
- };
- l.redraw = function () {
- var D = this.els;
- this.refresh();
- D.dayNames.innerHTML = h(this);
- D.menu.innerHTML = ak(this);
- if (D.bottomBar) {
- D.bottomBar.innerHTML = H(this)
- }
- t(D.topCont, v(function (ar) {
- var P = r[ar.className];
- if (P) {
- D[P] = ar
- }
- if (ar.className == "DynarchCalendar-menu-year") {
- p(ar, this._focusEvents);
- D.yearInput = ar
- } else {
- if (j) {
- ar.setAttribute("unselectable", "on")
- }
- }
- },
- this));
- this.setTime(null, true)
- };
- l.setLanguage = function (D) {
- var P = y.setLanguage(D);
- if (P) {
- this.fdow = P.data.fdow;
- this.redraw()
- }
- };
- y.setLanguage = function (D) {
- var P = q[D];
- if (P) {
- q.__ = P
- }
- return P
- };
- l.focus = function () {
- try {
- this.els[this._menuVisible ? "yearInput" : "focusLink"].focus()
- } catch(D) {}
- i.call(this)
- };
- l.blur = function () {
- this.els.focusLink.blur();
- this.els.yearInput.blur();
- z.call(this)
- };
- l.showAt = function (P, ax, av) {
- if (this._showAnim) {
- this._showAnim.stop()
- }
- av = av && this.args.animation;
- var aw = this.els.topCont,
- ar = this,
- D = this.els.body.firstChild,
- au = D.offsetHeight,
- at = aw.style;
- at.position = "absolute";
- at.left = P + "px";
- at.top = ax + "px";
- at.zIndex = 10000;
- at.display = "";
- if (av) {
- D.style.marginTop = -au + "px";
- this.args.opacity > 1 && am(aw, 0);
- this._showAnim = ap({
- onUpdate: function (ay, az) {
- D.style.marginTop = -az(Z.accel_b(ay), au, 0) + "px";
- ar.args.opacity > 1 && am(aw, ay)
- },
- onStop: function () {
- ar.args.opacity > 1 && am(aw, "");
- ar._showAnim = null
- }
- })
- }
- };
- l.hide = function () {
- var at = this.els.topCont,
- P = this,
- D = this.els.body.firstChild,
- ar = D.offsetHeight,
- au = J(at).y;
- if (this.args.animation) {
- if (this._showAnim) {
- this._showAnim.stop()
- }
- this._showAnim = ap({
- onUpdate: function (av, aw) {
- P.args.opacity > 1 && am(at, 1 - av);
- D.style.marginTop = -aw(Z.accel_b(av), 0, ar) + "px";
- at.style.top = aw(Z.accel_ab(av), au, au - 10) + "px"
- },
- onStop: function () {
- at.style.display = "none";
- D.style.marginTop = "";
- P.args.opacity > 1 && am(at, "");
- P._showAnim = null
- }
- })
- } else {
- at.style.display = "none"
- }
- this.inputField = null
- };
- l.popup = function (D, at) {
- D = W(D);
- if (!at) {
- at = this.args.align
- }
- at = at.split(/\x2f/);
- var ar = J(D),
- aw = this.els.topCont,
- ay = aw.style,
- au, ax = X();
- ay.visibility = "hidden";
- ay.display = "";
- this.showAt(0, 0);
- document.body.appendChild(aw);
- au = {
- x: aw.offsetWidth,
- y: aw.offsetHeight
- };
- function P(az) {
- var aA = {
- x: av.x,
- y: av.y
- };
- if (!az) {
- return aA
- }
- if (/B/.test(az)) {
- aA.y += D.offsetHeight
- }
- if (/b/.test(az)) {
- aA.y += D.offsetHeight - au.y
- }
- if (/T/.test(az)) {
- aA.y -= au.y
- }
- if (/l/.test(az)) {
- aA.x -= au.x - D.offsetWidth
- }
- if (/L/.test(az)) {
- aA.x -= au.x
- }
- if (/R/.test(az)) {
- aA.x += D.offsetWidth
- }
- if (/c/i.test(az)) {
- aA.x += (D.offsetWidth - au.x) / 2
- }
- if (/m/i.test(az)) {
- aA.y += (D.offsetHeight - au.y) / 2
- }
- return aA
- }
- var av = ar;
- av = P(at[0]);
- if (av.y < ax.y) {
- av.y = ar.y;
- av = P(at[1])
- }
- if (av.x + au.x > ax.x + ax.w) {
- av.x = ar.x;
- av = P(at[2])
- }
- if (av.y + au.y > ax.y + ax.h) {
- av.y = ar.y;
- av = P(at[3])
- }
- if (av.x < ax.x) {
- av.x = ar.x;
- av = P(at[4])
- }
- this.showAt(av.x, av.y, true);
- ay.visibility = "";
- this.focus()
- };
- l.manageFields = function (ar, P, D) {
- P = W(P);
- p(W(ar), "click", v(function () {
- this.inputField = P;
- this.dateFormat = D;
- if (this.selection.type == y.SEL_SINGLE) {
- var aw, av, au, at;
- aw = /input|textarea/i.test(P.tagName) ? P.value : (P.innerText || P.textContent);
- if (aw) {
- av = /(^|[^%])%[bBmo]/.exec(D);
- au = /(^|[^%])%[de]/.exec(D);
- if (av && au) {
- at = av.index < au.index
- }
- aw = Calendar.parseDate(aw, at);
- if (aw) {
- this.moveTo(aw);
- this.selection.set(aw, false, true)
- }
- }
- }
- this.popup(ar)
- },
- this))
- };
- l.callHooks = function (ar) {
- var at = b(arguments, 1),
- D = this.handlers[ar],
- P = 0;
- for (; P < D.length; ++P) {
- D[P].apply(this, at)
- }
- };
- l.addEventListener = function (P, D) {
- this.handlers[P].push(D)
- };
- l.removeEventListener = function (at, ar) {
- var D = this.handlers[at],
- P = D.length;
- while (--P >= 0) {
- if (D[P] === ar) {
- D.splice(P, 1)
- }
- }
- };
- l.getTime = function () {
- return this.time
- };
- l.setTime = function (au, P) {
- if (this.args.showTime) {
- au = this.time = au != null ? au : this.time;
- var ar = this.getHours(),
- D = this.getMinutes(),
- at = ar < 12;
- if (this.args.showTime == 12) {
- if (ar == 0) {
- ar = 12
- }
- if (ar > 12) {
- ar -= 12
- }
- this.els.timeAM.innerHTML = aq(at ? "AM" : "PM")
- }
- if (ar < 10) {
- ar = "0" + ar
- }
- if (D < 10) {
- D = "0" + D
- }
- this.els.timeHour.innerHTML = ar;
- this.els.timeMinute.innerHTML = D;
- if (!P) {
- this.callHooks("onTimeChange", this, au)
- }
- }
- };
- l.getHours = function () {
- return Math.floor(this.time / 100)
- };
- l.getMinutes = function () {
- return this.time % 100
- };
- l.setHours = function (D) {
- if (D < 0) {
- D += 24
- }
- this.setTime(100 * (D % 24) + this.time % 100)
- };
- l.setMinutes = function (D) {
- if (D < 0) {
- D += 60
- }
- this.setTime(100 * this.getHours() + (D % 60))
- };
- l._getInputYear = function () {
- var D = parseInt(this.els.yearInput.value, 10);
- if (isNaN(D)) {
- D = this.date.getFullYear()
- }
- return D
- };
- l._showTooltip = function (D) {
- var P = "",
- at, ar = this.els.tooltip;
- if (D) {
- D = B(D);
- at = this.args.dateInfo(D);
- if (at && at.tooltip) {
- P = "<div class='DynarchCalendar-tooltipCont'>" + ab(D, at.tooltip) + "</div>"
- }
- }
- ar.innerHTML = P
- };
- var ah = " align='center' cellspacing='0' cellpadding='0'";
- function h(D) {
- var ar = ["<table", ah, "><tr>"],
- P = 0;
- if (D.args.weekNumbers) {
- ar.push("<td><div class='DynarchCalendar-weekNumber'>", aq("wk"), "</div></td>")
- }
- while (P < 7) {
- var at = (P+++D.fdow) % 7;
- ar.push("<td><div", aq("weekend").indexOf(at) >= 0 ? " class='DynarchCalendar-weekend'>" : ">", aq("sdn")[at], "</div></td>")
- }
- ar.push("</tr></table>");
- return ar.join("")
- }
- function ac(aw, aG, aD) {
- aG = aG || aw.date;
- aD = aD || aw.fdow;
- aG = new Date(aG);
- var aI = aG.getMonth(),
- av = [],
- aA = 0,
- D = aw.args.weekNumbers;
- aG.setDate(1);
- var az = (aG.getDay() - aD) % 7;
- if (az < 0) {
- az += 7
- }
- aG.setDate(-az);
- aG.setDate(aG.getDate() + 1);
- var aE = new Date(),
- at = aE.getDate(),
- P = aE.getMonth(),
- aJ = aE.getFullYear();
- av[aA++] = "<table class='DynarchCalendar-bodyTable'" + ah + ">";
- for (var aC = 0; aC < 6; ++aC) {
- av[aA++] = "<tr class='DynarchCalendar-week";
- if (aC == 0) {
- av[aA++] = " DynarchCalendar-first-row"
- }
- if (aC == 5) {
- av[aA++] = " DynarchCalendar-last-row"
- }
- av[aA++] = "'>";
- if (D) {
- av[aA++] = "<td class='DynarchCalendar-first-col'><div class='DynarchCalendar-weekNumber'>" + a(aG) + "</div></td>"
- }
- for (var aB = 0; aB < 7; ++aB) {
- var aF = aG.getDate(),
- ay = aG.getMonth(),
- au = aG.getFullYear(),
- ar = 10000 * au + 100 * (ay + 1) + aF,
- aH = aw.selection.isSelected(ar),
- ax = aw.isDisabled(aG);
- av[aA++] = "<td class='";
- if (aB == 0 && !D) {
- av[aA++] = " DynarchCalendar-first-col"
- }
- if (aB == 0 && aC == 0) {
- aw._firstDateVisible = ar
- }
- if (aB == 6) {
- av[aA++] = " DynarchCalendar-last-col";
- if (aC == 5) {
- aw._lastDateVisible = ar
- }
- }
- if (aH) {
- av[aA++] = " DynarchCalendar-td-selected"
- }
- av[aA++] = "'><div dyc-type='date' unselectable='on' dyc-date='" + ar + "' ";
- if (ax) {
- av[aA++] = "disabled='1' "
- }
- av[aA++] = "class='DynarchCalendar-day";
- if (aq("weekend").indexOf(aG.getDay()) >= 0) {
- av[aA++] = " DynarchCalendar-weekend"
- }
- if (ay != aI) {
- av[aA++] = " DynarchCalendar-day-othermonth"
- }
- if (aF == at && ay == P && au == aJ) {
- av[aA++] = " DynarchCalendar-day-today"
- }
- if (ax) {
- av[aA++] = " DynarchCalendar-day-disabled"
- }
- if (aH) {
- av[aA++] = " DynarchCalendar-day-selected"
- }
- ax = aw.args.dateInfo(aG);
- if (ax && ax.klass) {
- av[aA++] = " " + ax.klass
- }
- av[aA++] = "'>" + aF + "</div></td>";
- aG.setDate(aF + 1)
- }
- av[aA++] = "</tr>"
- }
- av[aA++] = "</table>";
- return av.join("")
- }
- function n(D) {
- 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>"];
- if (D.args.bottomBar || D.args.showTime) {
- P.push("<div class='DynarchCalendar-bottomBar'>", H(D), "</div>")
- }
- P.push("<div class='DynarchCalendar-menu' style='display: none'>", ak(D), "</div><div class='DynarchCalendar-tooltip'></div></div></td></tr></table>");
- return P.join("")
- }
- function F(D) {
- return "<div unselectable='on'>" + ab(D.date, D.args.titleFormat) + "</div>"
- }
- function ak(P) {
- 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'> </p><table class='DynarchCalendar-menu-mtable'", ah, ">"],
- av = aq("smn"),
- at = 0,
- D = au.length,
- ar;
- while (at < 12) {
- au[D++] = "<tr>";
- for (ar = 4; --ar > 0;) {
- 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>"
- }
- au[D++] = "</tr>"
- }
- au[D++] = "</table></td></tr></table>";
- return au.join("")
- }
- function w(D, P) {
- 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>");
- if (D.args.showTime == 12) {
- 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>")
- }
- 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>")
- }
- function H(D) {
- var ar = [],
- P = D.args;
- ar.push("<table", ah, " style='width:100%'><tr>");
- function at() {
- if (P.showTime) {
- ar.push("<td>");
- w(D, ar);
- ar.push("</td>")
- }
- }
- if (P.timePos == "left") {
- at()
- }
- if (P.bottomBar) {
- ar.push("<td>");
- 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>");
- ar.push("</td>")
- }
- if (P.timePos == "right") {
- at()
- }
- ar.push("</tr></table>");
- return ar.join("")
- }
- var r = {
- "DynarchCalendar-topCont": "topCont",
- "DynarchCalendar-focusLink": "focusLink",
- DynarchCalendar: "main",
- "DynarchCalendar-topBar": "topBar",
- "DynarchCalendar-title": "title",
- "DynarchCalendar-dayNames": "dayNames",
- "DynarchCalendar-body": "body",
- "DynarchCalendar-menu": "menu",
- "DynarchCalendar-menu-year": "yearInput",
- "DynarchCalendar-bottomBar": "bottomBar",
- "DynarchCalendar-tooltip": "tooltip",
- "DynarchCalendar-time-hour": "timeHour",
- "DynarchCalendar-time-minute": "timeMinute",
- "DynarchCalendar-time-am": "timeAM",
- "DynarchCalendar-navBtn DynarchCalendar-prevYear": "navPrevYear",
- "DynarchCalendar-navBtn DynarchCalendar-nextYear": "navNextYear",
- "DynarchCalendar-navBtn DynarchCalendar-prevMonth": "navPrevMonth",
- "DynarchCalendar-navBtn DynarchCalendar-nextMonth": "navNextMonth"
- };
- function K() {
- var ar = G("div"),
- P = this.els = {},
- D = {
- mousedown: v(I, this, true),
- mouseup: v(I, this, false),
- mouseover: v(T, this, true),
- mouseout: v(T, this, false),
- keypress: v(L, this)
- };
- D[x ? "DOMMouseScroll" : "mousewheel"] = v(E, this);
- if (j) {
- D.dblclick = D.mousedown;
- D.keydown = D.keypress
- }
- ar.innerHTML = n(this);
- t(ar.firstChild, function (au) {
- var at = r[au.className];
- if (at) {
- P[at] = au
- }
- if (j) {
- au.setAttribute("unselectable", "on")
- }
- });
- p(P.main, D);
- p([P.focusLink, P.yearInput], this._focusEvents = {
- focus: v(i, this),
- blur: v(e, this)
- });
- this.moveTo(this.date, false);
- this.setTime(null, true);
- return P.topCont
- }
- function i() {
- if (this._bluringTimeout) {
- clearTimeout(this._bluringTimeout)
- }
- this.focused = true;
- M(this.els.main, "DynarchCalendar-focused");
- this.callHooks("onFocus", this)
- }
- function z() {
- this.focused = false;
- aj(this.els.main, "DynarchCalendar-focused");
- if (this._menuVisible) {
- u(this, false)
- }
- if (!this.args.cont) {
- this.hide()
- }
- this.callHooks("onBlur", this)
- }
- function e() {
- this._bluringTimeout = setTimeout(v(z, this), 50)
- }
- function N(D) {
- switch (D) {
- case "time-hour+":
- this.setHours(this.getHours() + 1);
- break;
- case "time-hour-":
- this.setHours(this.getHours() - 1);
- break;
- case "time-min+":
- this.setMinutes(this.getMinutes() + this.args.minuteStep);
- break;
- case "time-min-":
- this.setMinutes(this.getMinutes() - this.args.minuteStep);
- break;
- default:
- return
- }
- }
- var U = {
- "-3": "backYear",
- "-2": "back",
- "0": "now",
- "2": "fwd",
- "3": "fwdYear"
- };
- function aa(P, at, D) {
- if (this._bodyAnim) {
- this._bodyAnim.stop()
- }
- var ar;
- if (at != 0) {
- ar = new Date(P.date);
- ar.setDate(1);
- switch (at) {
- case "-Y":
- case -2:
- ar.setFullYear(ar.getFullYear() - 1);
- break;
- case "+Y":
- case 2:
- ar.setFullYear(ar.getFullYear() + 1);
- break;
- case "-M":
- case -1:
- ar.setMonth(ar.getMonth() - 1);
- break;
- case "+M":
- case 1:
- ar.setMonth(ar.getMonth() + 1);
- break
- }
- } else {
- ar = new Date()
- }
- return P.moveTo(ar, !D)
- }
- function u(ar, P) {
- ar._menuVisible = P;
- ae(P, ar.els.title, "DynarchCalendar-pressed-title");
- var at = ar.els.menu;
- if (c) {
- at.style.height = ar.els.main.offsetHeight + "px"
- }
- if (!ar.args.animation) {
- O(at, P);
- if (ar.focused) {
- ar.focus()
- }
- } else {
- if (ar._menuAnim) {
- ar._menuAnim.stop()
- }
- var D = ar.els.main.offsetHeight;
- if (c) {
- at.style.width = ar.els.topBar.offsetWidth + "px"
- }
- if (P) {
- at.firstChild.style.marginTop = -D + "px";
- ar.args.opacity > 0 && am(at, 0);
- O(at, true)
- }
- ar._menuAnim = ap({
- onUpdate: function (au, av) {
- at.firstChild.style.marginTop = av(Z.accel_b(au), -D, 0, !P) + "px";
- ar.args.opacity > 0 && am(at, av(Z.accel_b(au), 0, 0.85, !P))
- },
- onStop: function () {
- ar.args.opacity > 0 && am(at, 0.85);
- at.firstChild.style.marginTop = "";
- ar._menuAnim = null;
- if (!P) {
- O(at, false);
- if (ar.focused) {
- ar.focus()
- }
- }
- }
- })
- }
- }
- function I(az, ay) {
- ay = ay || window.event;
- var au = o(ay);
- if (au && !au.getAttribute("disabled")) {
- var D = au.getAttribute("dyc-btn"),
- ax = au.getAttribute("dyc-type"),
- av = au.getAttribute("dyc-date"),
- at = this.selection,
- ar, P = {
- mouseover: an,
- mousemove: an,
- mouseup: function (aC) {
- var aB = au.getAttribute("dyc-cls");
- if (aB) {
- aj(au, ao(aB, 1))
- }
- clearTimeout(ar);
- d(document, P, true);
- P = null
- }
- };
- if (az) {
- setTimeout(v(this.focus, this), 1);
- var aA = au.getAttribute("dyc-cls");
- if (aA) {
- M(au, ao(aA, 1))
- }
- if ("menu" == D) {
- this.toggleMenu()
- } else {
- if (au && /^[+-][MY]$/.test(D)) {
- if (aa(this, D)) {
- var aw = v(function () {
- if (aa(this, D, true)) {
- ar = setTimeout(aw, 40)
- } else {
- P.mouseup();
- aa(this, D)
- }
- },
- this);
- ar = setTimeout(aw, 350);
- p(document, P, true)
- } else {
- P.mouseup()
- }
- } else {
- if ("year" == D) {
- this.els.yearInput.focus();
- this.els.yearInput.select()
- } else {
- if (ax == "time-am") {
- p(document, P, true)
- } else {
- if (/^time/.test(ax)) {
- var aw = v(function (aB) {
- N.call(this, aB);
- ar = setTimeout(aw, 100)
- },
- this, ax);
- N.call(this, ax);
- ar = setTimeout(aw, 350);
- p(document, P, true)
- } else {
- if (av && at.type) {
- if (at.type == y.SEL_MULTIPLE) {
- if (ay.shiftKey && this._selRangeStart) {
- at.selectRange(this._selRangeStart, av)
- } else {
- if (!ay.ctrlKey && !at.isSelected(av)) {
- at.clear(true)
- }
- at.set(av, true);
- this._selRangeStart = av
- }
- } else {
- at.set(av);
- this.moveTo(B(av), 2)
- }
- au = this._getDateDiv(av);
- T.call(this, true, {
- target: au
- })
- }
- p(document, P, true)
- }
- }
- }
- }
- }
- if (j && P && /dbl/i.test(ay.type)) {
- P.mouseup()
- }
- if (/^(DynarchCalendar-(topBar|bottomBar|weekend|weekNumber|menu(-sep)?))?$/.test(au.className) && !this.args.cont) {
- P.mousemove = v(g, this);
- this._mouseDiff = f(ay, J(this.els.topCont));
- p(document, P, true)
- }
- } else {
- if ("today" == D) {
- if (!this._menuVisible && at.type == y.SEL_SINGLE) {
- at.set(new Date())
- }
- this.moveTo(new Date(), true);
- u(this, false)
- } else {
- if (/^m([0-9]+)/.test(D)) {
- var av = new Date(this.date);
- av.setDate(1);
- av.setMonth(RegExp.$1);
- av.setFullYear(this._getInputYear());
- this.moveTo(av, true);
- u(this, false)
- } else {
- if (ax == "time-am") {
- this.setHours(this.getHours() + 12)
- }
- }
- }
- }
- if (!j) {
- an(ay)
- }
- }
- }
- function g(P) {
- P = P || window.event;
- var D = this.els.topCont.style,
- ar = f(P, this._mouseDiff);
- D.left = ar.x + "px";
- D.top = ar.y + "px"
- }
- function o(P) {
- var D = P.target || P.srcElement,
- ar = D;
- while (D && D.getAttribute && !D.getAttribute("dyc-type")) {
- D = D.parentNode
- }
- return D.getAttribute && D || ar
- }
- function ao(D, P) {
- return "DynarchCalendar-" + D.split(/,/)[P]
- }
- function T(au, at) {
- at = at || window.event;
- var ar = o(at);
- if (ar) {
- var P = ar.getAttribute("dyc-type");
- if (P && !ar.getAttribute("disabled")) {
- if (!au || !this._bodyAnim || P != "date") {
- var D = ar.getAttribute("dyc-cls");
- D = D ? ao(D, 0) : "DynarchCalendar-hover-" + P;
- if (P != "date" || this.selection.type) {
- ae(au, ar, D)
- }
- if (P == "date") {
- ae(au, ar.parentNode.parentNode, "DynarchCalendar-hover-week");
- this._showTooltip(ar.getAttribute("dyc-date"))
- }
- if (/^time-hour/.test(P)) {
- ae(au, this.els.timeHour, "DynarchCalendar-hover-time")
- }
- if (/^time-min/.test(P)) {
- ae(au, this.els.timeMinute, "DynarchCalendar-hover-time")
- }
- aj(this._getDateDiv(this._lastHoverDate), "DynarchCalendar-hover-date");
- this._lastHoverDate = null
- }
- }
- }
- if (!au) {
- this._showTooltip()
- }
- }
- function E(ar) {
- ar = ar || window.event;
- var P = o(ar);
- if (P) {
- var at = P.getAttribute("dyc-btn"),
- D = P.getAttribute("dyc-type"),
- au = ar.wheelDelta ? ar.wheelDelta / 120 : -ar.detail / 3;
- au = au < 0 ? -1 : au > 0 ? 1 : 0;
- if (this.args.reverseWheel) {
- au = -au
- }
- if (/^(time-(hour|min))/.test(D)) {
- switch (RegExp.$1) {
- case "time-hour":
- this.setHours(this.getHours() + au);
- break;
- case "time-min":
- this.setMinutes(this.getMinutes() + this.args.minuteStep * au);
- break
- }
- an(ar)
- } else {
- if (/Y/i.test(at)) {
- au *= 2
- }
- aa(this, -au);
- an(ar)
- }
- }
- }
- function R() {
- this.refresh();
- var D = this.inputField,
- P = this.selection;
- if (D) {
- var ar = P.print(this.dateFormat);
- (/input|textarea/i.test(D.tagName)) ? D.value = ar : D.innerHTML = ar
- }
- this.callHooks("onSelect", this, P)
- }
- var ag = {
- 37: -1,
- 38: -2,
- 39: 1,
- 40: 2
- },
- Q = {
- 33: -1,
- 34: 1
- };
- function L(aB) {
- if (this._menuAnim) {
- return
- }
- aB = aB || window.event;
- var ar = aB.target || aB.srcElement,
- aC = ar.getAttribute("dyc-btn"),
- aD = aB.keyCode,
- ay = aB.charCode || aD,
- D = ag[aD];
- if ("year" == aC && aD == 13) {
- var au = new Date(this.date);
- au.setDate(1);
- au.setFullYear(this._getInputYear());
- this.moveTo(au, true);
- u(this, false);
- return an(aB)
- }
- if (this._menuVisible) {
- if (aD == 27) {
- u(this, false);
- return an(aB)
- }
- } else {
- if (!aB.ctrlKey) {
- D = null
- }
- if (D == null && !aB.ctrlKey) {
- D = Q[aD]
- }
- if (aD == 36) {
- D = 0
- }
- if (D != null) {
- aa(this, D);
- return an(aB)
- }
- ay = String.fromCharCode(ay).toLowerCase();
- var ax = this.els.yearInput,
- P = this.selection;
- if (ay == " ") {
- u(this, true);
- this.focus();
- ax.focus();
- ax.select();
- return an(aB)
- }
- if (ay >= "0" && ay <= "9") {
- u(this, true);
- this.focus();
- ax.value = ay;
- ax.focus();
- return an(aB)
- }
- var av = aq("mn"),
- az = aB.shiftKey ? -1 : this.date.getMonth(),
- aw = 0,
- at;
- while (++aw < 12) {
- at = av[(az + aw) % 12].toLowerCase();
- if (at.indexOf(ay) == 0) {
- var au = new Date(this.date);
- au.setDate(1);
- au.setMonth((az + aw) % 12);
- this.moveTo(au, true);
- return an(aB)
- }
- }
- if (aD >= 37 && aD <= 40) {
- var au = this._lastHoverDate;
- if (!au && !P.isEmpty()) {
- au = aD < 39 ? P.getFirstDate() : P.getLastDate();
- if (au < this._firstDateVisible || au > this._lastDateVisible) {
- au = null
- }
- }
- if (!au) {
- au = aD < 39 ? this._lastDateVisible : this._firstDateVisible
- } else {
- var aA = au;
- au = B(au);
- var az = 100;
- while (az -->
- 0) {
- switch (aD) {
- case 37:
- au.setDate(au.getDate() - 1);
- break;
- case 38:
- au.setDate(au.getDate() - 7);
- break;
- case 39:
- au.setDate(au.getDate() + 1);
- break;
- case 40:
- au.setDate(au.getDate() + 7);
- break
- }
- if (!this.isDisabled(au)) {
- break
- }
- }
- au = V(au);
- if (au < this._firstDateVisible || au > this._lastDateVisible) {
- this.moveTo(au)
- }
- }
- aj(this._getDateDiv(aA), M(this._getDateDiv(au), "DynarchCalendar-hover-date"));
- this._lastHoverDate = au;
- return an(aB)
- }
- if (aD == 13) {
- if (this._lastHoverDate) {
- if (P.type == y.SEL_MULTIPLE && (aB.shiftKey || aB.ctrlKey)) {
- if (aB.shiftKey && this._selRangeStart) {
- P.clear(true);
- P.selectRange(this._selRangeStart, this._lastHoverDate)
- }
- if (aB.ctrlKey) {
- P.set(this._selRangeStart = this._lastHoverDate, true)
- }
- } else {
- P.reset(this._selRangeStart = this._lastHoverDate)
- }
- return an(aB)
- }
- }
- if (aD == 27 && !this.args.cont) {
- this.hide()
- }
- }
- }
- l._getDateDiv = function (D) {
- var ar = null;
- if (D) {
- try {
- t(this.els.body, function (at) {
- if (at.getAttribute("dyc-date") == D) {
- throw ar = at
- }
- })
- } catch(P) {}
- }
- return ar
- };
- function k(D, P) {
- return D.replace(/\$\{([^:\}]+)(:[^\}]+)?\}/g, function (av, au, at) {
- var aw = P[au],
- ar;
- if (at) {
- ar = at.substr(1).split(/\s*\|\s*/);
- aw = (aw >= ar.length ? ar[ar.length - 1] : ar[aw]).replace(/##?/g, function (ax) {
- return ax.length == 2 ? "#" : aw
- })
- }
- return aw
- })
- }
- function aq(ar, P) {
- var D = q.__.data[ar];
- if (P && typeof D == "string") {
- D = k(D, P)
- }
- return D
- }(y.Selection = function (ar, P, D, at) {
- this.type = P;
- this.sel = ar instanceof Array ? ar : [ar];
- this.onChange = v(D, at);
- this.cal = at
- }).prototype = {
- get: function () {
- return this.type == y.SEL_SINGLE ? this.sel[0] : this.sel
- },
- isEmpty: function () {
- return this.sel.length == 0
- },
- set: function (P, D, ar) {
- var at = this.type == y.SEL_SINGLE;
- if (P instanceof Array) {
- this.sel = P;
- this.normalize();
- if (!ar) {
- this.onChange(this)
- }
- } else {
- P = V(P);
- if (at || !this.isSelected(P)) {
- at ? this.sel = [P] : this.sel.splice(this.findInsertPos(P), 0, P);
- this.normalize();
- if (!ar) {
- this.onChange(this)
- }
- } else {
- if (D) {
- this.unselect(P, ar)
- }
- }
- }
- },
- reset: function () {
- this.sel = [];
- this.set.apply(this, arguments)
- },
- countDays: function () {
- var av = 0,
- D = this.sel,
- P = D.length,
- at, au, ar;
- while (--P >= 0) {
- at = D[P];
- if (at instanceof Array) {
- au = B(at[0]);
- ar = B(at[1]);
- av += Math.round(Math.abs(ar.getTime() - au.getTime()) / 86400000)
- }++av
- }
- return av
- },
- unselect: function (P, ar) {
- P = V(P);
- var at = false;
- for (var ay = this.sel, au = ay.length, D; --au >= 0;) {
- D = ay[au];
- if (D instanceof Array) {
- if (P >= D[0] && P <= D[1]) {
- var av = B(P),
- ax = av.getDate();
- if (P == D[0]) {
- av.setDate(ax + 1);
- D[0] = V(av);
- at = true
- } else {
- if (P == D[1]) {
- av.setDate(ax - 1);
- D[1] = V(av);
- at = true
- } else {
- var aw = new Date(av);
- aw.setDate(ax + 1);
- av.setDate(ax - 1);
- ay.splice(au + 1, 0, [V(aw), D[1]]);
- D[1] = V(av);
- at = true
- }
- }
- }
- } else {
- if (P == D) {
- ay.splice(au, 1);
- at = true
- }
- }
- }
- if (at) {
- this.normalize();
- if (!ar) {
- this.onChange(this)
- }
- }
- },
- normalize: function () {
- this.sel = this.sel.sort(function (ay, ax) {
- if (ay instanceof Array) {
- ay = ay[0]
- }
- if (ax instanceof Array) {
- ax = ax[0]
- }
- return ay - ax
- });
- for (var P = this.sel, ar = P.length, av, au; --ar >= 0;) {
- av = P[ar];
- if (av instanceof Array) {
- if (av[0] > av[1]) {
- P.splice(ar, 1);
- continue
- }
- if (av[0] == av[1]) {
- av = P[ar] = av[0]
- }
- }
- if (au) {
- var at = au,
- aw = av instanceof Array ? av[1] : av;
- aw = B(aw);
- aw.setDate(aw.getDate() + 1);
- aw = V(aw);
- if (aw >= at) {
- var D = P[ar + 1];
- if (av instanceof Array && D instanceof Array) {
- av[1] = D[1];
- P.splice(ar + 1, 1)
- } else {
- if (av instanceof Array) {
- av[1] = au;
- P.splice(ar + 1, 1)
- } else {
- if (D instanceof Array) {
- D[0] = av;
- P.splice(ar, 1)
- } else {
- P[ar] = [av, D];
- P.splice(ar + 1, 1)
- }
- }
- }
- }
- }
- au = av instanceof Array ? av[0] : av
- }
- },
- findInsertPos: function (P) {
- for (var D = this.sel, ar = D.length, at; --ar >= 0;) {
- at = D[ar];
- if (at instanceof Array) {
- at = at[0]
- }
- if (at <= P) {
- break
- }
- }
- return ar + 1
- },
- clear: function (D) {
- this.sel = [];
- if (!D) {
- this.onChange(this)
- }
- },
- selectRange: function (ar, P) {
- ar = V(ar);
- P = V(P);
- if (ar > P) {
- var D = ar;
- ar = P;
- P = D
- }
- this.sel.push([ar, P]);
- this.normalize();
- this.onChange(this)
- },
- isSelected: function (D) {
- for (var P = this.sel.length, ar; --P >= 0;) {
- ar = this.sel[P];
- if (ar instanceof Array && D >= ar[0] && D <= ar[1] || D == ar) {
- return true
- }
- }
- return false
- },
- getFirstDate: function () {
- var D = this.sel[0];
- if (D && D instanceof Array) {
- D = D[0]
- }
- return D
- },
- getLastDate: function () {
- if (this.sel.length > 0) {
- var D = this.sel[this.sel.length - 1];
- if (D && D instanceof Array) {
- D = D[1]
- }
- return D
- }
- },
- print: function (ar, at) {
- var P = [],
- au = 0,
- aw, av = this.cal.getHours(),
- D = this.cal.getMinutes();
- if (!at) {
- at = " -> "
- }
- while (au < this.sel.length) {
- aw = this.sel[au++];
- if (aw instanceof Array) {
- P.push(ab(B(aw[0], av, D), ar) + at + ab(B(aw[1], av, D), ar))
- } else {
- P.push(ab(B(aw, av, D), ar))
- }
- }
- return P
- },
- getDates: function (P) {
- var D = [],
- ar = 0,
- au, at;
- while (ar < this.sel.length) {
- at = this.sel[ar++];
- if (at instanceof Array) {
- au = B(at[0]);
- at = at[1];
- while (V(au) < at) {
- D.push(P ? ab(au, P) : new Date(au));
- au.setDate(au.getDate() + 1)
- }
- } else {
- au = B(at)
- }
- D.push(P ? ab(au, P) : au)
- }
- return D
- }
- };
- function a(P) {
- P = new Date(P.getFullYear(), P.getMonth(), P.getDate(), 12, 0, 0);
- var ar = P.getDay();
- P.setDate(P.getDate() - (ar + 6) % 7 + 3);
- var D = P.valueOf();
- P.setMonth(0);
- P.setDate(4);
- return Math.round((D - P.valueOf()) / (7 * 86400000)) + 1
- }
- function C(D) {
- D = new Date(D.getFullYear(), D.getMonth(), D.getDate(), 0, 0, 0);
- var ar = new Date(D.getFullYear(), 0, 1, 12, 0, 0);
- var P = D - ar;
- return Math.floor(P / 86400000)
- }
- function V(D) {
- if (D instanceof Date) {
- return 10000 * D.getFullYear() + 100 * (D.getMonth() + 1) + D.getDate()
- }
- if (typeof D == "string") {
- return parseInt(D, 10)
- }
- return D
- }
- function B(ar, au, av, at, P) {
- if (! (ar instanceof Date)) {
- ar = parseInt(ar, 10);
- var aw = Math.floor(ar / 10000);
- ar = ar % 10000;
- var D = Math.floor(ar / 100);
- ar = ar % 100;
- ar = new Date(aw, D - 1, ar, au || 12, av || 0, at || 0, P || 0)
- }
- return ar
- }
- function af(aw, au, ar) {
- var av = aw.getFullYear(),
- ay = aw.getMonth(),
- P = aw.getDate(),
- at = au.getFullYear(),
- ax = au.getMonth(),
- D = au.getDate();
- return av < at ? -3 : av > at ? 3 : ay < ax ? -2 : ay > ax ? 2 : ar ? 0 : P < D ? -1 : P > D ? 1 : 0
- }
- function ab(D, ax) {
- var P = D.getMonth(),
- aw = D.getDate(),
- ay = D.getFullYear(),
- az = a(D),
- aA = D.getDay(),
- aB = D.getHours(),
- ar = (aB >= 12),
- au = (ar) ? (aB - 12) : aB,
- aD = C(D),
- at = D.getMinutes(),
- av = D.getSeconds(),
- aC = /%./g,
- aE;
- if (au === 0) {
- au = 12
- }
- aE = {
- "%a": aq("sdn")[aA],
- "%A": aq("dn")[aA],
- "%b": aq("smn")[P],
- "%B": aq("mn")[P],
- "%C": 1 + Math.floor(ay / 100),
- "%d": aw < 10 ? "0" + aw : aw,
- "%e": aw,
- "%H": aB < 10 ? "0" + aB : aB,
- "%I": au < 10 ? "0" + au : au,
- "%j": aD < 10 ? "00" + aD : aD < 100 ? "0" + aD : aD,
- "%k": aB,
- "%l": au,
- "%m": P < 9 ? "0" + (1 + P) : 1 + P,
- "%o": 1 + P,
- "%M": at < 10 ? "0" + at : at,
- "%n": "\n",
- "%p": ar ? "PM" : "AM",
- "%P": ar ? "pm" : "am",
- "%s": Math.floor(D.getTime() / 1000),
- "%S": av < 10 ? "0" + av : av,
- "%t": "\t",
- "%U": az < 10 ? "0" + az : az,
- "%W": az < 10 ? "0" + az : az,
- "%V": az < 10 ? "0" + az : az,
- "%u": aA + 1,
- "%w": aA,
- "%y": ("" + ay).substr(2, 2),
- "%Y": ay,
- "%%": "%"
- };
- return ax.replace(aC, function (aF) {
- return aE.hasOwnProperty(aF) ? aE[aF] : aF
- })
- }
- function Y(P) {
- if (P) {
- if (typeof P == "number") {
- return B(P)
- }
- if (! (P instanceof Date)) {
- var D = P.split(/-/);
- return new Date(parseInt(D[0], 10), parseInt(D[1], 10) - 1, parseInt(D[2], 10), 12, 0, 0, 0)
- }
- }
- return P
- }
- function A(ar) {
- ar = ar.toLowerCase();
- function P(at) {
- for (var au = at.length; --au >= 0;) {
- if (at[au].toLowerCase().indexOf(ar) == 0) {
- return au
- }
- }
- }
- var D = P(aq("smn")) || P(aq("mn"));
- if (D != null) {
- D++
- }
- return D
- }
- y.parseDate = function (au, D, aw) {
- if (!/\S/.test(au)) {
- return ""
- }
- au = au.replace(/^\s+/, "").replace(/\s+$/, "");
- aw = aw || new Date();
- var aB = null,
- P = null,
- aD = null,
- av = null,
- ar = null,
- aC = null;
- var ay = au.match(/([0-9]{1,2}):([0-9]{1,2})(:[0-9]{1,2})?\s*(am|pm)?/i);
- if (ay) {
- av = parseInt(ay[1], 10);
- ar = parseInt(ay[2], 10);
- aC = ay[3] ? parseInt(ay[3].substr(1), 10) : 0;
- au = au.substring(0, ay.index) + au.substr(ay.index + ay[0].length);
- if (ay[4]) {
- if (ay[4].toLowerCase() == "pm" && av < 12) {
- av += 12
- } else {
- if (ay[4].toLowerCase() == "am" && av >= 12) {
- av -= 12
- }
- }
- }
- }
- var az = au.split(/\W+/);
- var ax = [];
- for (var at = 0; at < az.length; ++at) {
- var aA = az[at];
- if (/^[0-9]{4}$/.test(aA)) {
- aB = parseInt(aA, 10);
- if (!P && !aD && D == null) {
- D = true
- }
- } else {
- if (/^[0-9]{1,2}$/.test(aA)) {
- aA = parseInt(aA, 10);
- if (aA >= 60) {
- aB = aA
- } else {
- if (aA >= 0 && aA <= 12) {
- ax.push(aA)
- } else {
- if (aA >= 1 && aA <= 31) {
- aD = aA
- }
- }
- }
- } else {
- P = A(aA)
- }
- }
- }
- if (ax.length >= 2) {
- if (D) {
- if (!P) {
- P = ax.shift()
- }
- if (!aD) {
- aD = ax.shift()
- }
- } else {
- if (!aD) {
- aD = ax.shift()
- }
- if (!P) {
- P = ax.shift()
- }
- }
- } else {
- if (ax.length == 1) {
- if (!aD) {
- aD = ax.shift()
- } else {
- if (!P) {
- P = ax.shift()
- }
- }
- }
- }
- if (!aB) {
- aB = ax.length > 0 ? ax.shift() : aw.getFullYear()
- }
- if (aB < 30) {
- aB += 2000
- } else {
- if (aB < 99) {
- aB += 1900
- }
- }
- if (!P) {
- P = aw.getMonth() + 1
- }
- return aB && P && aD ? new Date(aB, P - 1, aD, av, ar, aC) : null
- };
- function al(D, at, P, ar) {
- ar = {};
- for (P in at) {
- if (at.hasOwnProperty(P)) {
- ar[P] = at[P]
- }
- }
- for (P in D) {
- if (D.hasOwnProperty(P)) {
- ar[P] = D[P]
- }
- }
- return ar
- }
- function p(ar, au, at, D) {
- if (ar instanceof Array) {
- for (var P = ar.length; --P >= 0;) {
- p(ar[P], au, at, D)
- }
- } else {
- if (typeof au == "object") {
- for (var P in au) {
- if (au.hasOwnProperty(P)) {
- p(ar, P, au[P], at)
- }
- }
- } else {
- if (ar.addEventListener) {
- ar.addEventListener(au, at, j ? true : !!D)
- } else {
- if (ar.attachEvent) {
- ar.attachEvent("on" + au, at)
- } else {
- ar["on" + au] = at
- }
- }
- }
- }
- }
- function d(ar, au, at, D) {
- if (ar instanceof Array) {
- for (var P = ar.length; --P >= 0;) {
- d(ar[P], au, at)
- }
- } else {
- if (typeof au == "object") {
- for (var P in au) {
- if (au.hasOwnProperty(P)) {
- d(ar, P, au[P], at)
- }
- }
- } else {
- if (ar.removeEventListener) {
- ar.removeEventListener(au, at, j ? true : !!D)
- } else {
- if (ar.detachEvent) {
- ar.detachEvent("on" + au, at)
- } else {
- ar["on" + au] = null
- }
- }
- }
- }
- }
- function an(D) {
- D = D || window.event;
- if (j) {
- D.cancelBubble = true;
- D.returnValue = false
- } else {
- D.preventDefault();
- D.stopPropagation()
- }
- return false
- }
- function aj(au, at, av) {
- if (au) {
- var D = au.className.replace(/^\s+|\s+$/, "").split(/\x20/),
- P = [],
- ar;
- for (ar = D.length; ar > 0;) {
- if (D[--ar] != at) {
- P.push(D[ar])
- }
- }
- if (av) {
- P.push(av)
- }
- au.className = P.join(" ")
- }
- return av
- }
- function M(P, D) {
- return aj(P, D, D)
- }
- function ae(at, ar, P) {
- if (ar instanceof Array) {
- for (var D = ar.length; --D >= 0;) {
- ae(at, ar[D], P)
- }
- } else {
- aj(ar, P, at ? P : null)
- }
- return at
- }
- function G(at, D, ar) {
- var P = null;
- if (document.createElementNS) {
- P = document.createElementNS("http://www.w3.org/1999/xhtml", at)
- } else {
- P = document.createElement(at)
- }
- if (D) {
- P.className = D
- }
- if (ar) {
- ar.appendChild(P)
- }
- return P
- }
- function b(au, av) {
- if (av == null) {
- av = 0
- }
- var D, at, P;
- try {
- D = Array.prototype.slice.call(au, av)
- } catch(ar) {
- D = new Array(au.length - av);
- for (at = av, P = 0; at < au.length; ++at, ++P) {
- D[P] = au[at]
- }
- }
- return D
- }
- function v(P, ar) {
- var D = b(arguments, 2);
- return (ar == undefined ?
- function () {
- return P.apply(this, D.concat(b(arguments)))
- } : function () {
- return P.apply(ar, D.concat(b(arguments)))
- })
- }
- function t(P, ar) {
- if (!ar(P)) {
- for (var D = P.firstChild; D; D = D.nextSibling) {
- if (D.nodeType == 1) {
- t(D, ar)
- }
- }
- }
- }
- function ap(D, aw, ar) {
- D = al(D, {
- fps: 50,
- len: 15,
- onUpdate: ad,
- onStop: ad
- });
- if (j) {
- D.len = Math.round(D.len / 2)
- }
- function at(aA, az, ax, ay) {
- return ay ? ax + aA * (az - ax) : az + aA * (ax - az)
- }
- function av() {
- if (aw) {
- P()
- }
- ar = 0;
- aw = setInterval(au, 1000 / D.fps)
- }
- function P() {
- if (aw) {
- clearInterval(aw);
- aw = null
- }
- D.onStop(ar / D.len, at)
- }
- function au() {
- var ax = D.len;
- D.onUpdate(ar / ax, at);
- if (ar == ax) {
- P()
- }++ar
- }
- av();
- return {
- start: av,
- stop: P,
- update: au,
- args: D,
- map: at
- }
- }
- var Z = {
- elastic_b: function (D) {
- return 1 - Math.cos(-D * 5.5 * Math.PI) / Math.pow(2, 7 * D)
- },
- magnetic: function (D) {
- return 1 - Math.cos(D * D * D * 10.5 * Math.PI) / Math.exp(4 * D)
- },
- accel_b: function (D) {
- D = 1 - D;
- return 1 - D * D * D * D
- },
- accel_a: function (D) {
- return D * D * D
- },
- accel_ab: function (D) {
- D = 1 - D;
- return 1 - Math.sin(D * D * Math.PI / 2)
- },
- accel_ab2: function (D) {
- return (D /= 0.5) < 1 ? 1 / 2 * D * D : -1 / 2 * ((--D) * (D - 2) - 1)
- },
- brakes: function (D) {
- D = 1 - D;
- return 1 - Math.sin(D * D * Math.PI)
- },
- shake: function (D) {
- return D < 0.5 ? -Math.cos(D * 11 * Math.PI) * D * D : (D = 1 - D, Math.cos(D * 11 * Math.PI) * D * D)
- }
- };
- function am(D, P) {
- if (P === "") {
- j ? D.style.filter = "" : D.style.opacity = ""
- } else {
- if (P != null) {
- j ? D.style.filter = "alpha(opacity=" + P * 100 + ")" : D.style.opacity = P
- } else {
- if (!j) {
- P = parseFloat(D.style.opacity)
- } else {
- if (/alpha\(opacity=([0-9.])+\)/.test(D.style.opacity)) {
- P = parseFloat(RegExp.$1) / 100
- }
- }
- }
- }
- return P
- }
- function O(ar, D) {
- var P = ar.style;
- if (D != null) {
- P.display = D ? "" : "none"
- }
- return P.display != "none"
- }
- function f(P, ar) {
- var D = j ? P.clientX + document.body.scrollLeft : P.pageX;
- var at = j ? P.clientY + document.body.scrollTop : P.pageY;
- if (ar) {
- D -= ar.x;
- at -= ar.y
- }
- return {
- x: D,
- y: at
- }
- }
- function J(au) {
- var D = 0,
- at = 0,
- ar = /^div$/i.test(au.tagName),
- av, P;
- if (ar && au.scrollLeft) {
- D = au.scrollLeft
- }
- if (ar && au.scrollTop) {
- at = au.scrollTop
- }
- av = {
- x: au.offsetLeft - D,
- y: au.offsetTop - at
- };
- if (au.offsetParent) {
- P = J(au.offsetParent);
- av.x += P.x;
- av.y += P.y
- }
- return av
- }
- function X() {
- var P = document.documentElement,
- D = document.body;
- return {
- x: P.scrollLeft || D.scrollLeft,
- y: P.scrollTop || D.scrollTop,
- w: P.clientWidth || window.innerWidth || D.clientWidth,
- h: P.clientHeight || window.innerHeight || D.clientHeight
- }
- }
- function m(D, ar, P) {
- for (P = 0; P < D.length; ++P) {
- ar(D[P])
- }
- }
- var ad = new Function();
- function W(D) {
- if (typeof D == "string") {
- D = document.getElementById(D)
- }
- return D
- }
- return y
- })();
- Calendar.LANG("ro", "Română", {
- fdow: 1,
- goToday: "Astăzi",
- today: "Astăzi",
- wk: "săp.",
- weekend: "0,6",
- AM: "am",
- PM: "pm",
- mn: ["Ianuarie", "Februarie", "Martie", "Aprilie", "Mai", "Iunie", "Iulie", "August", "Septembrie", "Octombrie", "Noiembrie", "Decembrie"],
- smn: ["Ian", "Feb", "Mar", "Apr", "Mai", "Iun", "Iul", "Aug", "Sep", "Oct", "Noi", "Dec"],
- dn: ["Duminică", "Luni", "Marţi", "Miercuri", "Joi", "Vineri", "Sâmbătă", "Duminică"],
- sdn: ["Du", "Lu", "Ma", "Mi", "Jo", "Vi", "Sâ", "Du"]
- });
- var streamer_const = "rtmp://media.3netmedia.ro/live/";
- var streamer_video = "rtmp://media.3netmedia.ro/fastplay/";
- var feeds = new Array();
- feeds[0] = new Object();
- feeds[0].nume = "Sala de Repetiţii";
- feeds[0].detalii = "În fiecare Sâmbătă de la 13:00";
- feeds[0].mount = "camera3";
- feeds[0].poza = '/images/sigla.png';
- var t;
- var tt;
- var plstcat = null;
- var playlist_json = null;
- var currentPlaylist = null;
- var currentLength = 0;
- var player = null;
- var pozitie_playlist = null;
- var current_album = null;
- var current_sugest = new Object(null);
- var searchReq = getXmlHttpRequestObject();
- var sugest_contor = 0;
- var temp_class = null;
- var song_id = new Array();
- var ox = 0;
- //codare
- var base64EncodeChars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
- 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);
- function base64encode(str) {
- var out, i, len;
- var c1, c2, c3;
- len = str.length;
- i = 0;
- out = "";
- while (i < len) {
- c1 = str.charCodeAt(i++) & 0xff;
- if (i == len) {
- out += base64EncodeChars.charAt(c1 >> 2);
- out += base64EncodeChars.charAt((c1 & 0x3) << 4);
- out += "==";
- break;
- }
- c2 = str.charCodeAt(i++);
- if (i == len) {
- out += base64EncodeChars.charAt(c1 >> 2);
- out += base64EncodeChars.charAt(((c1 & 0x3) << 4) | ((c2 & 0xF0) >> 4));
- out += base64EncodeChars.charAt((c2 & 0xF) << 2);
- out += "=";
- break;
- }
- c3 = str.charCodeAt(i++);
- out += base64EncodeChars.charAt(c1 >> 2);
- out += base64EncodeChars.charAt(((c1 & 0x3) << 4) | ((c2 & 0xF0) >> 4));
- out += base64EncodeChars.charAt(((c2 & 0xF) << 2) | ((c3 & 0xC0) >> 6));
- out += base64EncodeChars.charAt(c3 & 0x3F);
- }
- return out;
- }
- function base64decode(str) {
- var c1, c2, c3, c4;
- var i, len, out;
- len = str.length;
- i = 0;
- out = "";
- while (i < len) {
- /* c1 */
- do {
- c1 = base64DecodeChars[str.charCodeAt(i++) & 0xff];
- } while (i < len && c1 == -1);
- if (c1 == -1) break;
- /* c2 */
- do {
- c2 = base64DecodeChars[str.charCodeAt(i++) & 0xff];
- } while (i < len && c2 == -1);
- if (c2 == -1) break;
- out += String.fromCharCode((c1 << 2) | ((c2 & 0x30) >> 4));
- /* c3 */
- do {
- c3 = str.charCodeAt(i++) & 0xff;
- if (c3 == 61) return out;
- c3 = base64DecodeChars[c3];
- } while (i < len && c3 == -1);
- if (c3 == -1) break;
- out += String.fromCharCode(((c2 & 0XF) << 4) | ((c3 & 0x3C) >> 2));
- /* c4 */
- do {
- c4 = str.charCodeAt(i++) & 0xff;
- if (c4 == 61) return out;
- c4 = base64DecodeChars[c4];
- } while (i < len && c4 == -1);
- if (c4 == -1) break;
- out += String.fromCharCode(((c3 & 0x03) << 6) | c4);
- }
- return out;
- }
- //utilitare
- function numar(s) {
- return parseInt(s.match(/\d+$/));
- }
- function getHTTPPage(url) {
- var xmlhttp
- /*@cc_on @*/
- /*@if (@_jscript_version >= 5)
- try {
- xmlhttp=new ActiveXObject("Msxml2.XMLHTTP")
- } catch (e) {
- try {
- xmlhttp=new ActiveXObject("Microsoft.XMLHTTP")
- } catch (E) {
- xmlhttp=false
- }
- }
- @else
- xmlhttp=false
- @end @*/
- if (!xmlhttp) {
- try {
- xmlhttp = new XMLHttpRequest();
- } catch(e) {
- xmlhttp = false;
- }
- }
- xmlhttp.open("GET", url, false);
- xmlhttp.send(null);
- var ret = xmlhttp.responseText;
- xmlhttp = null;
- return ret;
- }
- function readXML(fisier) {
- var xmlDoc;
- if (window.XMLHttpRequest) {
- xmlDoc = new window.XMLHttpRequest();
- xmlDoc.open("GET", fisier, false);
- xmlDoc.send("");
- xmlDoc = xmlDoc.responseXML;
- }
- // IE 5 and IE 6
- else if (ActiveXObject("Microsoft.XMLDOM")) {
- xmlDoc = new ActiveXObject("Microsoft.XMLDOM");
- xmlDoc.async = false;
- xmlDoc.load(fisier);
- }
- }
- function clear_search(obiect) {
- switch (obiect.value) {
- case "oraşul tău":
- ;
- case "Search and Play":
- case "Nick":
- case "Alege piesa":
- obiect.value = "";
- }
- }
- function reset_search(obiect) {
- if (obiect.value == "") {
- switch (obiect.id) {
- case "localitate":
- obiect.value = "oraşul tău";
- break;
- case "txtSearch":
- obiect.value = "Alege piesa";
- break;
- case "R3pageNick":
- obiect.value = "Nick";
- break;
- default:
- obiect.value = "Search and Play";
- }
- }
- }
- function random_header(x) {
- document.getElementById("Header").style.backgroundImage = "url(" + x + "images/header/h" + (Math.floor(Math.random() * 4 + 1)) + ".png)";
- }
- function read_chat() {
- var s = getHTTPPage("chatlog.php?r=" + Math.round(Math.random() * 10000));
- s = s.replace('<?xml version="1.0" encoding="utf-8"?>', "");
- s = s.replace(/<chat>/, "");
- s = s.replace(/<\/chat>/, "");
- s = s.replace(/<replica>/g, "");
- s = s.replace(/<\/replica>/g, "<br />");
- s = s.replace(/<nume>/g, "<b><");
- s = s.replace(/<\/nume>/g, "> : </b>");
- s = s.replace(/<mesaj>/g, "");
- s = s.replace(/<\/mesaj>/g, "");
- s = s.replace(/3/g, "");
- s = s.replace(/6/g, "");
- s = s.replace(/01/g, "");
- s = s.replace(/01/g, "");
- s = s.replace(/02/g, "");
- s = s.replace(/02/g, "");
- s = s.replace(/03/g, "");
- s = s.replace(/03/g, "");
- s = s.replace(/04/g, "");
- s = s.replace(/04/g, "");
- s = s.replace(/05/g, "");
- s = s.replace(/05/g, "");
- s = s.replace(/06/g, "");
- s = s.replace(/06/g, "");
- s = s.replace(/07/g, "");
- s = s.replace(/07/g, "");
- s = s.replace(/08/g, "");
- s = s.replace(/08/g, "");
- s = s.replace(/09/g, "");
- s = s.replace(/09/g, "");
- s = s.replace(/10/g, "");
- s = s.replace(/10/g, "");
- s = s.replace(/11/g, "");
- s = s.replace(/11/g, "");
- s = s.replace(/12/g, "");
- s = s.replace(/12/g, "");
- s = s.replace(/13/g, "");
- s = s.replace(/13/g, "");
- s = s.replace(//g, "");
- s = s.replace(//g, "");
- document.getElementById("chat").innerHTML = s;
- tt = setTimeout("read_chat()", 10000);
- }
- function change_menu_head(x) {
- if (x == 1) {
- str = "bottom left"
- } else {
- str = "top left"
- }
- document.getElementById("meniu").style.backgroundPosition = str;
- }
- function vremea(cale, local) {
- if (local == "") {
- local = "Bucuresti"
- }
- var s = getHTTPPage(cale + "vremea.php?local=" + local);
- document.getElementById("vremea").innerHTML = s;
- }
- function showPlaylist(obj) {
- if (plstcat) {
- clearTimeout(t);
- plstcat.style.display = "none";
- document.getElementById("p" + numar(plstcat.id)).className = "playlisturi";
- }
- plstcat = document.getElementById("playlist" + numar(obj.id))
- if (plstcat.innerHTML == '') {
- var randvideos = null
- if (numar(obj.id) == 2) {
- randvideos = vgr_vector
- } else {
- randvideos = feeds
- }
- for (i = 0; randvideos[i]; i++) {
- var p = document.createElement("div");
- var img = document.createElement("img");
- var h1txt = document.createElement("h1");
- var h2txt = document.createElement("h2");
- var alink = document.createElement("a");
- attr = document.createAttribute("class");
- attr = document.createAttribute("id");
- attr = document.createAttribute("alt");
- attr = document.createAttribute("title");
- attr = document.createAttribute("src");
- attr = document.createAttribute("width");
- attr = document.createAttribute("onclick");
- attr = document.createAttribute("href");
- if (pozitie_playlist) {
- if (numar(pozitie_playlist.id) == i) {
- p.setAttribute('className', 'element select');
- p.setAttribute('class', 'element select');
- } else {
- p.setAttribute('className', 'element');
- p.setAttribute('class', 'element');
- }
- } else {
- p.setAttribute('className', 'element');
- p.setAttribute('class', 'element');
- }
- p.setAttribute('id', 'pozitie' + i);
- img.setAttribute('className', 'element');
- img.setAttribute('class', 'element');
- img.setAttribute('width', 65);
- h1txt.setAttribute('className', 'item');
- h1txt.setAttribute('class', 'item');
- h2txt.setAttribute('className', 'item');
- h2txt.setAttribute('class', 'item');
- if (numar(obj.id) == 2) {
- //p.setAttribute('onclick','playvideo("'+randvideos[i].Dbvideo.nume+'","'+randvideos[i].Dbvideo.id_newmedia+'",this)');
- alink.setAttribute('href', 'javascript:playvideo("' + randvideos[i].Dbvideo.nume + '","' + randvideos[i].Dbvideo.id_newmedia + '",this)');
- img.setAttribute('alt', randvideos[i].Dbvideo.nume);
- img.setAttribute('title', randvideos[i].Dbvideo.nume);
- img.setAttribute('src', 'http://media.3netmedia.ro/media/Radio3Net/video/thumbs/' + randvideos[i].Dbvideo.id_newmedia + '.png');
- h1txt.innerHTML = randvideos[i].Dbvideo.nume;
- h2txt.innerHTML = randvideos[i].Dbartist.name;
- } else {
- //p.setAttribute('onclick','playstream("'+randvideos[i].mount+'","'+randvideos[i].nume+'",this)');
- alink.setAttribute('href', 'javascript:playstream("' + randvideos[i].mount + '","' + randvideos[i].nume + '",this)');
- img.setAttribute('alt', '');
- img.setAttribute('title', '');
- img.setAttribute('src', randvideos[i].poza);
- h1txt.innerHTML = randvideos[i].nume;
- h2txt.innerHTML = randvideos[i].detalii;
- }
- alink.appendChild(img);
- alink.appendChild(h1txt);
- alink.appendChild(h2txt);
- p.appendChild(alink);
- plstcat.appendChild(p);
- }
- }
- plstcat.style.display = "block";
- obj.className = "playlisturi selected";
- }
- function hidePlaylist() {
- if (plstcat != null) {
- plstcat.style.display = "none";
- document.getElementById("p" + numar(plstcat.id)).className = "playlisturi";
- }
- }
- function hidePlaylistTimmer() {
- clearTimeout(t);
- t = setTimeout('hidePlaylist()', 1250)
- }
- //search
- function getXmlHttpRequestObject() {
- if (window.XMLHttpRequest) {
- return new XMLHttpRequest();
- } else if (window.ActiveXObject) {
- return new ActiveXObject("Microsoft.XMLHTTP");
- } else {
- alert("Your Browser Sucks!\nIt's about time to upgrade don't you think?");
- }
- }
- function searchSuggest(cale) {
- if (searchReq.readyState == 4 || searchReq.readyState == 0) {
- var str = escape(document.getElementById('txtSearch').value);
- searchReq.open("GET", cale + 'songrequest.php?str=' + base64encode(str), true);
- searchReq.onreadystatechange = handleSearchSuggest;
- searchReq.send(null);
- }
- }
- function handleSearchSuggest() {
- if (searchReq.readyState == 4) {
- current_sugest = null;
- var ss = document.getElementById('search_suggest')
- ss.innerHTML = '';
- var str = searchReq.responseText.split("\n");
- for (i = 0; i < str.length - 1; i++) {
- //Build our element string. This is cleaner using the DOM, but
- //IE doesn't support dynamically added attributes.
- 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)) + ');" ';
- suggest += 'onclick="javascript:setSearch(this.innerHTML);" ';
- suggest += 'class="suggest_link" id="sugest' + i + '">' + str[i].slice(0, str[i].indexOf("|||")) + '</div>';
- ss.innerHTML += suggest;
- sugest_contor++;
- }
- }
- }
- function suggestOver(div_value, sid) {
- div_value.className = 'suggest_link over';
- document.getElementById('songid').value = sid;
- if (current_sugest) {
- current_sugest.className = 'suggest_link'
- }
- current_sugest = div_value;
- }
- function setSearch(value) {
- document.getElementById('txtSearch').value = value;
- document.getElementById('search_suggest').innerHTML = '';
- }
- function keyHandler(e, cale) {
- switch (e.keyCode) {
- case 38:
- if (current_sugest) {
- if (numar(current_sugest.id) > 1) {
- var obiect = new Object();
- obiect = document.getElementById("sugest" + (numar(current_sugest.id) - 1));
- current_sugest.className = 'suggest_link';
- obiect.className = 'suggest_link over';
- current_sugest = obiect;
- }
- } else {
- if (document.getElementById("sugest1")) {
- current_sugest = document.getElementById("sugest1");
- current_sugest.className = 'suggest_link over';
- }
- }
- document.getElementById('txtSearch').value = current_sugest.innerHTML;
- document.getElementById('songid').value = current_sugest.sid;
- break;
- case 40:
- if (current_sugest) {
- if (numar(current_sugest.id) < sugest_contor - 1) {
- var obiect = new Object();
- obiect = document.getElementById("sugest" + (numar(current_sugest.id) + 1));
- current_sugest.className = 'suggest_link';
- obiect.className = 'suggest_link over';
- current_sugest = obiect;
- }
- } else {
- if (document.getElementById("sugest1")) {
- current_sugest = document.getElementById("sugest1");
- current_sugest.className = 'suggest_link over';
- }
- }
- document.getElementById('txtSearch').value = current_sugest.innerHTML;
- document.getElementById('songid').value = current_sugest.sid;
- break;
- case 27:
- setSearch("");
- case 13:
- document.getElementById("search_suggest").style.display = "none";
- current_sugest = null;
- break;
- default:
- document.getElementById("search_suggest").style.display = "block";
- searchSuggest(cale);
- }
- }
- function dedicatie() {
- if (document.getElementById("songid").value == '') {
- document.getElementById("dedicatia").innerHTML = "<font color='#ff0000'>Nu ati introdus dedicatia</font>"
- } else {
- document.getElementById("dedicatia").innerHTML = getHTTPPage("/requests.php?songid=" + document.getElementById("songid").value);
- }
- }
- //cookie control
- function setCookie(c_name, value, expiredays) {
- var exdate = new Date();
- exdate.setDate(exdate.getDate() + expiredays);
- document.cookie = c_name + "=" + escape(value) + ((expiredays == null) ? ";path=/" : ";expires=" + exdate.toGMTString()) + ";path=/";
- }
- function getCookie(c_name) {
- if (document.cookie.length > 0) {
- c_start = document.cookie.indexOf(c_name + "=");
- if (c_start != -1) {
- c_start = c_start + c_name.length + 1;
- c_end = document.cookie.indexOf(";", c_start);
- if (c_end == -1) c_end = document.cookie.length;
- return unescape(document.cookie.substring(c_start, c_end));
- }
- }
- return "";
- }
- //flash content
- function createPlayer(theFile, w, h, mut, logo_, vol, playlist_, plgs) {
- var flashvars = new Object();
- flashvars.stretching = "uniform";
- flashvars.repeat = "list";
- flashvars.controlbar = "over";
- flashvars.skin = "/player/radio3net_skin/radio3net.swf";
- if (playlist_) {} else {
- playlist_ = "none"
- }
- if (plgs) {} else {
- playlist_ = "none"
- }
- switch (getCookie("playerCurrentContentType")) {
- case "webcam":
- flashvars.file = "Camera" + getCookie("playerCurrentContentLoad");
- flashvars.streamer = streamer_const;
- flashvars.type = "rtmp";
- flashvars.playlist = "none";
- document.getElementById("cam1").className = "camere";
- document.getElementById("cam" + getCookie("playerCurrentContentLoad")).className = "camere selected";
- break;
- case "stream":
- flashvars.streamer = streamer_const;
- flashvars.type = "rtmp";
- flashvars.playlist = 'none';
- flashvars.plugins = 'livestream-1&livestream.file=' + getCookie("playerCurrentContentLoad") + '&livestream.streamer=' + streamer_const + '&livestream.message=în câteva momente: ' + getCookie("playerCurrentContentTitle") + '&livestream.interval=3';
- document.getElementById("cam1").className = "camere";
- break;
- case "video":
- flashvars.file = "Radio3Net/video/" + getCookie("playerCurrentContentLoad") + ".flv";
- flashvars.type = "rtmp";
- flashvars.streamer = streamer_video;
- flashvars.playlist = "none";
- document.getElementById("cam1").className = "camere";
- break;
- case "audio":
- flashvars.file = "Radio3Net/audio/" + getCookie("playerCurrentContentLoad") + ".mp3";
- flashvars.type = "rtmp";
- flashvars.streamer = streamer_video;
- flashvars.playlist = "none";
- flashvars.image = base64decode(getCookie("playerCurrentContentPicture"));
- document.getElementById("cam1").className = "camere";
- break;
- case "playlist":
- flashvars.file = "";
- flashvars.streamer = streamer_const;
- flashvars.type = "rtmp";
- flashvars.playlist = "bottom";
- flashvars.playlistsize = 181;
- document.getElementById("cam1").className = "camere";
- break;
- default:
- flashvars.file = theFile;
- flashvars.streamer = streamer_const;
- flashvars.type = "rtmp";
- flashvars.playlist = "none";
- }
- flashvars.mute = mut;
- flashvars.stretching = "uniform";
- flashvars.bufferlength = "3";
- flashvars.logo = logo_;
- if (getCookie("playerCurrentVolume") != "") {
- flashvars.volume = numar(getCookie("playerCurrentVolume"));
- } else {
- flashvars.volume = vol;
- }
- if (getCookie("playerCurrentState") == "PLAYING" || getCookie("playerCurrentState") == "") {
- flashvars.autostart = "true";
- } else {
- flashvars.autostart = "false";
- }
- var params = {
- allowfullscreen: "true",
- allowscriptaccess: "always",
- wmode: "transparent",
- expressinstall: "/flash/expressInstall.swf",
- bgcolor: "#000000"
- }
- var attributes = {
- id: "player1",
- name: "player1"
- }
- swfobject.embedSWF("/player/player.swf", "player_container", w, h, "9.0.0.0", false, flashvars, params, attributes);
- }
- function createFlashContent(content, theFile, wm, fs, w, h, cb, ct, bg) {
- var flashvars = {
- xmlfile: theFile,
- dimx: w,
- dimy: h,
- culoare: cb,
- culoaretxt: ct,
- backgnd: bg
- }
- var params = {
- allowfullscreen: fs,
- allowscriptaccess: "always",
- scale: "noscale",
- wmode: wm,
- menu: "false",
- expressinstall: "/flash/expressInstall.swf"
- }
- var attributes = {
- id: content,
- name: content
- }
- swfobject.embedSWF("/flash/" + content + ".swf", "container_" + content, w, h, "9.0.0.0", false, flashvars, params, attributes);
- }
- //jw playe listeners
- function playerReady(thePlayer) {
- player = window.document[thePlayer.id];
- addListeners();
- }
- function addListeners() {
- if (player) {
- switch (getCookie("playerCurrentContentType")) {
- case "video":
- break;
- case "playlist":
- if (playlist_json == null) {
- playlist_json = eval(base64decode('' + getHTTPPage("/playlistjson.php?p=" + getCookie("playerCurrentContentLoad"))));
- var playlist_count = 0;
- while (playlist_json[playlist_count]) {
- playlist_json[playlist_count].description = base64decode(getCookie("playerCurrentContentAuthor"));
- playlist_json[playlist_count].image = base64decode(getCookie("playerCurrentContentPicture"));
- playlist_count++;
- }
- }
- player.sendEvent('LOAD', playlist_json);
- player.sendEvent('ITEM', numar(getCookie("playerCurrentItem")))
- break;
- case "audio":
- case "webcam":
- case "stream":
- player.sendEvent("PLAY", "true");
- break;
- }
- player.addModelListener("STATE", "stateListener");
- player.addControllerListener("ITEM", "itemListener");
- player.addViewListener("VOLUME", "volumeListener");
- } else {
- setTimeout("addListeners()", 100);
- }
- }
- function stateListener(obj) {
- currentState = obj.newstate;
- setCookie("playerCurrentState", currentState);
- }
- function volumeListener(obj) {
- currentVolume = obj.percentage;
- setCookie("playerCurrentVolume", currentVolume);
- }
- function itemListener(obj) {
- currentItem = obj.index;
- setCookie("playerCurrentItem", currentItem);
- }
- //jw player control
- function webcam(x, y) {
- playlist_json = null;
- setCookie("playerCurrentContentLoad", x);
- if (getCookie("playerCurrentContentType") != "webcam") {
- setCookie("playerCurrentContentType", "webcam");
- if (current_album) {
- current_album.className = current_album.className.slice(0, current_album.className.indexOf(" selected"));
- current_album = null;
- }
- var f = document.getElementById("player_container1");
- if (f == null) {
- f = document.getElementById("player_container2");
- }
- f.innerHTML = "<div id='player_container'></div>";
- if (f.id == "player_container1") {
- createPlayer("Camera" + x, 300, 188, 'false', 'none', 15);
- } else {
- createPlayer("Camera" + x, 516, 320, 'false', 'none', 15);
- }
- } else {
- player.sendEvent('LOAD', {
- file: "Camera" + x,
- type: "rtmp"
- })
- }
- s = "cam" + x;
- document.getElementById(s).className = "camere selected";
- s = "cam" + y;
- document.getElementById(s).className = "camere";
- }
- function playstream(mount, titlu, obiect) {
- setCookie("playerCurrentContentLoad", mount);
- setCookie("playerCurrentContentHTMLObj", obiect);
- setCookie("playerCurrentContentTitle", titlu);
- setCookie("playerCurrentContentType", "stream");
- var f = document.getElementById("player_container2");
- if (f == null) {
- f = document.getElementById("player_container1")
- }
- document.getElementById("cam1").className = "camere";
- document.getElementById("cam2").className = "camere";
- player = null;
- playlist_json = null;
- f.innerHTML = "<div id='player_container'></div>";
- if (f.id == "player_container2") {
- createPlayer('', 516, 320, 'false', '/player/sigla.png', 15)
- } else {
- createPlayer('', 300, 188, 'false', '/player/sigla.png', 15)
- }
- if (current_album) {
- current_album.className = current_album.className.slice(0, current_album.className.indexOf(" selected"));
- }
- obiect.className = obiect.className + " selected";
- current_album = obiect;
- }
- function playaudio(titlu, id, obiect, poza) {
- if (obiect.className.indexOf(" selected") == -1) {
- playlist_json = null;
- setCookie("playerCurrentContentLoad", id);
- setCookie("playerCurrentContentHTMLObj", obiect);
- setCookie("playerCurrentContentTitle", titlu);
- setCookie("playerCurrentContentPicture", poza);
- document.getElementById("cam1").className = "camere";
- document.getElementById("cam2").className = "camere";
- if (getCookie("playerCurrentContentType") != "audio") {
- var f = document.getElementById("player_container2");
- if (f == null) {
- f = document.getElementById("player_container1")
- }
- player = null;
- f.innerHTML = "<div id='player_container'></div>";
- if (f.id == "player_container2") {
- createPlayer('', 516, 320, 'false', 'none', 60)
- } else {
- createPlayer('', 300, 188, 'false', 'none', 60)
- }
- } else {
- var temp_ = {
- file: "Radio3Net/audio/" + id + ".mp3",
- title: base64decode(titlu),
- author: "Radio3Net",
- description: "Radio3Net",
- streamer: streamer_video,
- image: base64decode(poza)
- };
- player.sendEvent('LOAD', temp_);
- player.sendEvent('PLAY', 'true');
- }
- obiect.className = obiect.className + " selected";
- if (current_album) {
- current_album.className = current_album.className.slice(0, current_album.className.indexOf(" selected"));
- }
- current_album = obiect;
- setCookie("playerCurrentContentType", "audio");
- }
- }
- function playvideo(titlu, id, obiect) {
- var ok = false;
- if (obiect.className) {
- if (obiect.className.indexOf(" selected") == -1) ok = true
- }
- if (ok || obiect.className == null) {
- playlist_json = null;
- setCookie("playerCurrentContentLoad", id);
- setCookie("playerCurrentContentHTMLObj", obiect);
- setCookie("playerCurrentContentTitle", titlu);
- if (getCookie("playerCurrentContentType") != "video") {
- setCookie("playerCurrentContentType", "video");
- document.getElementById("cam1").className = "camere";
- document.getElementById("cam2").className = "camere";
- var f = document.getElementById("player_container2");
- if (f == null) {
- f = document.getElementById("player_container1")
- }
- player = null;
- f.innerHTML = "<div id='player_container'></div>";
- if (f.id == "player_container2") {
- createPlayer('', 516, 320, 'false', 'none', 15)
- } else {
- createPlayer('', 300, 188, 'false', 'none', 15)
- }
- } else {
- var temp_ = {
- file: "Radio3Net/video/" + id + ".flv",
- title: titlu,
- author: "Radio3Net",
- description: "Radio3Net",
- streamer: streamer_video
- };
- player.sendEvent('LOAD', temp_);
- player.sendEvent('PLAY', 'true');
- }
- if (ok) {
- obiect.className = obiect.className + " selected";
- if (current_album) {
- current_album.className = current_album.className.slice(0, current_album.className.indexOf(" selected"));
- }
- current_album = obiect;
- }
- }
- }
- function get_playlist(id, cale, obj, poza, autor) {
- playlist_json = null;
- setCookie("playerCurrentContentLoad", id);
- setCookie("playerCurrentContentHTMLObj", obj);
- setCookie("playerCurrentContentAuthor", autor);
- setCookie("playerCurrentContentPicture", poza);
- setCookie("playerCurrentContentType", "playlist");
- setCookie("playerCurrentItem", 0);
- document.getElementById("cam1").className = "camere";
- document.getElementById("cam2").className = "camere";
- playlist_json = eval(base64decode('' + getHTTPPage(cale + "playlistjson.php?p=" + id)));
- var playlist_count = 0;
- while (playlist_json[playlist_count]) {
- playlist_json[playlist_count].description = base64decode(autor);
- playlist_json[playlist_count].image = base64decode(poza);
- playlist_count++;
- }
- var f = document.getElementById("player_container2");
- if (f == null) {
- f = document.getElementById("player_container1")
- }
- player = null;
- f.innerHTML = "<div id='player_container'></div>";
- if (f.id == "player_container2") {
- createPlayer('', 516, 520, 'false', 'none', 15, "bottom");
- } else {
- createPlayer('', 300, 400, 'false', 'none', 15, "bottom");
- }
- if (obj) {
- obj.className = obj.className + " selected";
- }
- if (current_album) {
- current_album.className = current_album.className.slice(current_album.className, current_album.className.indexOf(" "));
- }
- current_album = obj;
- live_stream = false;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement