Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function jx_N(s) {
- '';
- return s;
- }
- function jx_5() {
- return document.getElementById
- }
- function jx_b() {
- return navigator.userAgent.indexOf("Opera") >= 0 || window.aD
- }
- function jx_q() {
- return navigator.userAgent.indexOf("Safari") >= 0
- }
- function jx_a() {
- return navigator.appName == "Microsoft Internet Explorer" && !jx_b()
- }
- function jx_M(bK) {
- return window.aD && window.aD.version && parseInt(window.aD.version()) >= bK
- }
- function jx_2(ch) {
- return typeof ch != 'undefined' && (ch == ' ' || !ch.search(/\s/))
- }
- function jx_0(ch) {
- return ch >= '0' && ch <= '9'
- }
- function jx_d(ch) {
- return typeof ch != 'undefined' && ch.toLowerCase() >= 'a' && ch.toLowerCase() <= 'z'
- }
- function jx_r(ch) {
- return jx_d(ch) || jx_0(ch)
- }
- function jx_f(ch) {
- return jx_r(ch) || ch == '_'
- }
- function jx_B(ch) {
- return ch >= 'A' && ch <= 'Z'
- }
- function jx_4(v) {
- return typeof v == 'undefined'
- }
- function jx_9(v) {
- return !jx_4(v)
- }
- function jx_L(bR) {
- var aG = new Date();
- aG.setDate(aG.getDate() + bR);
- return aG.toGMTString()
- }
- function jx_i() {
- if (typeof jx_7 == 'undefined') jx_7 = 0, jx_o = 0, jx_c = 0;
- }
- function jx_m(name, value, U, path, domain, ak) {
- jx_i();
- var s = name + '=' + escape(value),
- av = jx_m.arguments,
- ad = [";expires=", ";path=", ";domain=", ";secure="];
- for (var a = 2; a < av.length; a++) if (av[a]) s += ad[a - 2] + av[a];
- var start = new Date();
- document.cookie = s;
- jx_c = new Date() - start > 300
- }
- function jx_A(name, value, aQ, as, U, path, domain, ak) {
- jx_i();
- if (!jx_c && (!jx_7 || (!jx_o && (!U || as)))) return jx_z(name, value, aQ, as, jx_7 ? 0 : U, path, domain, ak);
- return false
- }
- function jx_z(name, value, aQ, as, U, path, domain, ak) {
- jx_i();
- var c7 = jx_g(name);
- if (aQ && c7 == value) return true;
- for (;;) {
- jx_m(name, value, U, path, domain, ak);
- var ck = jx_g(name),
- ag = ck == value;
- jx_o = !ag;
- if (U) jx_7 = !ag;
- if (!ag && U && as && !jx_c) U = 0;
- else return ag
- }
- }
- function jx_g(name) {
- var aH = document.cookie.split('; ');
- for (var a = 0; aH && a < aH.length; a++) {
- var aM = aH[a].split('=');
- if (aM[0] == name) return aM[1] ? unescape(aM[1]) : ''
- }
- return null
- }
- function jx_p(v) {
- return typeof v != 'string' ? '' + v : '"' + v.replace(/"/g, '\\\"') + '"'
- }
- function jx_6(i, s) {
- if (jx_4(s)) {
- if (!i || typeof i != 'object') return jx_p(i);
- s = ""
- }
- if (i == null) return s + 'null';
- var aZ = true,
- af = i.constructor == Array;
- s += af ? '[' : '{';
- for (var a in i) {
- if (af && parseInt(a) != a) continue;
- if (!aZ) s += ',';
- aZ = false;
- if (!af) s += a + ':';
- if (typeof i[a] != 'object') s += jx_p(i[a]);
- else s = jx_6(i[a], s)
- }
- s += af ? ']' : '}';
- return s
- }
- function jx_h(s, c5) {
- var r;
- if (jx_4(s) || !s || !s.length) return null;
- if (jx_5()) {
- eval("try { eval('r=' + s) } catch(e) { r = null }");
- return r
- }
- c5 ? null : eval('r=' + s);
- return r
- }
- function jx_8(s, bM) {
- var r = "";
- for (var a = 0; a < s.length;) {
- if (s.charAt(a) == '%') {
- var F = s.charAt(a + 1) == 'u' ? 6 : 3,
- am = s.substring(a + (F == 3 ? 1 : 2), a + F);
- if ((F == 6 && am.length == 4) || (F == 3 && am.length == 2)) {
- if (bM) r += '&#' + parseInt(am, 16) + ';';
- else r += eval("'\\" + (F == 3 ? 'x' : 'u') + am + "'");
- a += F;
- continue
- }
- }
- r += s.charAt(a++)
- }
- return r
- }
- function jx_e(s, separator, cg, ch, aV, bh, a6) {
- var r = aV ? aV : [];
- if (s) {
- var j = s.split(separator);
- for (var a = 0; a < j.length; a++) {
- var aE = j[a].split('='),
- n = aE[0],
- v = aE[1];
- if (aE.length == 1 && bh) v = n, n = bh;
- if (cg) n = jx_8(n);
- r[a6 && a6[n] ? a6[n] : n] = ch && v ? jx_8(v) : v
- }
- }
- return r
- }
- function jx_J(a6) {
- var aJ = document.location.search;
- if (!aJ) aJ = "?";
- return jx_e(aJ.substring(1), '&', true, true, 0, 0, a6)
- }
- function jx_n(s) {
- return s.replace(/^\s+/, '').replace(/\s+$/, '')
- }
- function jx_3(s) {
- return s.replace(/\s+/g, "")
- }
- function jx_x(n, S) {
- for (var a = 0; a < n.length; a++) {
- var ch = n.charAt(a).toLowerCase();
- if (isNaN(parseInt(ch, S))) {
- if (S == 16 && a == 1 && ch == 'x' && v.charAt(a - 1) == '0') {
- a++;
- continue
- }
- if (S == 16 && a == n.length - 1 && ch == 'h') continue;
- if (S == 2 && a == n.length - 1 && ch == 'b') continue;
- return NaN
- }
- }
- return parseInt(n, S)
- }
- function jx_D(n, S) {
- var s = "",
- a_ = "0_1_2_3_4_5_6_7_8_9_A_B_C_D_E_F_G_H_I_J_K_L_M_N_O_P_Q_R_S_T_U_V_W_X_Y_Z".split('_');
- while (n >= S) s = a_[n % S] + s, n = Math.floor(n / S);
- return a_[n] + s
- }
- function jx_E(n, shift) {
- n = String(n);
- if (shift >= 0) {
- while (shift--) n += '0';
- return n
- }
- if (n.length + shift > 0) n = n.substring(0, n.length + shift) + '.' + n.substring(n.length + shift);
- else {
- while (n.length < -shift) n = '0' + n;
- n = '0.' + n
- }
- var F = n.length;
- for (; n.charAt(F - 1) == '0'; F--) {}
- if (n.charAt(F - 1) == '.') F--;
- return n.substring(0, F)
- }
- function jx_t(n) {
- n = String(n).toLowerCase();
- var exp = n.split('e')[1];
- if (exp) return parseInt(exp, 10);
- var j = n.split('.');
- if (j[0] != '0') return j[0].length - 1;
- else if (j[1]) {
- var aP = 0;
- for (; j[1].charAt(aP) == '0'; aP++);
- return -aP - 1
- } else return 0;
- }
- function jx_l(n, bj) {
- var bo = n.indexOf('.') < 0,
- aF = n.length - (bo ? 0 : 1);
- if (bo && aF < bj) n += '.';
- for (; aF < bj; aF++) n += '0';
- return n
- }
- function jx_k(n, au, E, bm, bp, br, bw, cl) {
- if (n == 0) return "0" + jx_k(1, au, E, bm, bp, br, bw).substring(1);
- if (E > 15) E = 15;
- var b0 = (n < 0 ? '-' : '');
- n = Math.abs(n);
- var exp = jx_t(n),
- bc = exp <= bm && exp >= bp;
- var bg = 1 + (bc ? br + exp : bw);
- if (E > bg) E = bg;
- var L = String(Math.round(n * Math.pow(10, E - exp - 1)));
- exp += L.length - E;
- E = L.length;
- while (E && L.charAt(E - 1) == '0') E--;
- L = L.substring(0, E);
- if (!L.length) L = "0", E++;
- if (bc) {
- n = jx_E(L, 1 + exp - E);
- return b0 + jx_l(n, au)
- }
- n = L.charAt(0) + (L.length > 1 ? ('.' + L.substring(1)) : '');
- return b0 + jx_l(n, au) + (exp < 0 ? 'e-' : 'e+') + Math.abs(exp)
- }
- function jx_K(e) {
- if (e.offsetParent) {
- var be = 0;
- while (e.offsetParent) be += e.offsetTop, e = e.offsetParent;
- return be
- }
- if (e.y) return e.y;
- return -1
- }
- function jx_v() {
- for (var a in jx_1) jx_1[a]();
- }
- function jx_j() {
- var c0 = document.readyState == 'complete' || window.cn == false || window.addEventListener ? 'jx_v' : 'jx_j';
- setTimeout(c0 + '()', 10)
- }
- function jx_C(c6) {
- if (typeof jx_1 == 'undefined') jx_1 = [];
- jx_1[jx_1.length] = c6;
- if (jx_1.length < 2) {
- if (window.addEventListener) window.addEventListener("load", jx_j, false);
- else setTimeout('jx_j' + '()', 10)
- }
- }
- function jx_s(ac) {
- if (!location.hostname || location.hostname == "localhost" || window != parent) return true;
- var j = document.links;
- for (var a = 0; a < j.length; a++) for (var h in ac) if (j[a].hostname == ac[h].hostname) {
- if (jx_a() && jx_5() && typeof j[a].offsetWidth != 'undefined' && (j[a].offsetHeight < ac[h].bD || j[a].offsetWidth < ac[h].bG)) continue;
- return true
- }
- return false
- }
- function jx_w() {
- var s = '';
- for (var a = 0; a < arguments.length; a++) s += 'a' + a + '=' + escape(arguments[a]) + '&';
- if (jx_I++ < jx_H) {
- var bW = new Image();
- bW.src = jx_G + '/' + jx_F + '?' + s + 'd=' + escape(Date())
- }
- return true
- }
- function jx_u(bV, cc, bA) {
- jx_F = bV;
- jx_G = bA ? bA : 'http://' + location.hostname;
- jx_H = cc;
- jx_I = 0;
- window.onerror = jx_w
- }
- if (typeof uc_e == 'undefined') uc_D = "2.0.4 (20-jun-06)", uc_C = "(c) 2005 unitconversion.org. All rights reserved. \n\nUse of the converter that does not conform to restrictions at http://www.unitconversion.org/privacy_and_terms.html is not permitted.", uc_6 = [], uc_7 = [], uc_3 = [], uc_t = 0, uc_e = 0, uc_5 = [], uc_0 = [], uc_4 = [], uc_k = null, uc_f = 0, uc_1 = 0, uc_d = [];
- function uc_I(d, e) {
- while (e) {
- var i = uc_0[e._xname];
- if (i && i.e == e && i.type == "form" && d == i) return true;
- e = e.parentNode ? e.parentNode : e.parentElement
- }
- return false
- }
- function uc_s(d, aT, ah, ay, aA, bu) {
- var P = [];
- if (jx_5()) {
- if (jx_4(aA)) aA = "";
- var j = typeof aT == 'string' ? document.getElementsByName(aT) : [aT.e];
- for (a = 0; a < j.length; a++) {
- var e = j[a];
- if (bu && bu.indexOf('_' + e.tagName.toLowerCase() + '_') < 0) continue;
- if (e.tagName && aA.indexOf('_' + e.tagName.toLowerCase() + '_') < 0 && uc_I(d, e)) {
- P[P.length] = e;
- P[P.length] = ah;
- if (ah == "className") P[P.length] = e.className, e.className = ay;
- else P[P.length] = e.style[ah], e.style[ah] = ay
- }
- }
- }
- return P
- }
- function uc_W(j) {
- for (var a = 0; j && a < j.length; a += 3) {
- var e = j[a],
- b3 = j[a + 1],
- v = j[a + 2];
- if (b3 == "className") e.className = ay;
- else e.style[b3] = v
- }
- }
- function uc_c(d) {
- if (!--d.aa) {
- if (d.bz || uc_u(d)) d.bz = 0, uc_2(d);
- if (d.c9) uc_h(d, d.Z)
- }
- }
- function uc_R(u, k, p) {
- return p[0] / k[0] * u;
- }
- function uc_Q(u, k, p) {
- var bY = k.length == 1 ? k[0] : k[1],
- bZ = p.length == 1 ? p[0] : p[1];
- return bY * bZ / u
- }
- function uc_X(u, k, p) {
- var bf = k[1],
- az = k[2],
- bH = p[1],
- b5 = p[2];
- return ((u - az) * (bH - b5) + b5 * (bf - az)) / (bf - az)
- }
- function uc_L(u, k, p) {
- return jx_D(u, p[1])
- }
- function uc_b(G, u, k, p, R) {
- if (!p) return "unknown unit";
- var v = 0,
- a5 = k.length == 1 ? 0 : k[0],
- c4 = p.length == 1 ? 0 : p[0];
- if (a5 + c4 == 1) a5 = 1;
- else if (a5 == 1) a5 = 0;
- switch (a5) {
- case 0:
- v = uc_R(u, k, p);
- break;
- case 1:
- v = uc_Q(u, k, p);
- break;
- case 2:
- v = uc_X(u, k, p);
- break;
- case 3:
- return uc_L(u, k, p)
- }
- if (!isFinite(v)) return String(v);
- var r = jx_k(v, 0, 14, 9, -9, G, G);
- return R ? r.replace(/\./, ',') : r
- }
- function uc_J(s) {
- return s.length == uc_l(s)
- }
- function uc_l(s) {
- var aY = s.match(/^\s*[+-]?[\d\s]*\.?[\d\s]*(e\s*[+-]?[\d\s]*)?/i);
- if (!aY) return 0;
- var ae = aY[0];
- ae = ae.replace(/e\s*[+-]?\s*$/i, '');
- if (!ae.search(/^\s*[+-]?\s*\.\s*(\D|$)/i)) return 0;
- return ae.length
- }
- function uc_a(j, bQ, end) {
- return s = jx_3(j.join('').substring(bQ, end))
- }
- function uc_B(s, b4) {
- var a, a1 = 0,
- aN = ["^\\(", 100000, "^\\)", -100000000, "^e\\d", -1000000, "^e[-+]\\d", 10000, "^e", 100000000];
- aB = ["\\)$", 10000, "\\($", -100000000, "[a-z_]$", 100000000, "\\D$", 100];
- for (a = b4 + 1; a < s.length && jx_2(s[a]); a++, a1++);
- var bI = uc_a(s, a);
- for (a = b4 - 1; a >= 0 && jx_2(s[a]); a--, a1++);
- var bN = uc_a(s, 0, a + 1);
- for (var h = 0; h < aN.length; h += 2) {
- if (RegExp(aN[h]).test(bI)) {
- a1 += parseInt(aN[h + 1]);
- break
- }
- }
- for (var h = 0; h < aB.length; h += 2) {
- if (RegExp(aB[h]).test(bN)) {
- a1 += parseInt(aB[h + 1]);
- break
- }
- }
- return a1
- }
- function uc_G(j, aC) {
- while (jx_2(j[aC + 1])) aC++;
- return jx_d(j[aC + 1])
- }
- function uc_H(s, c8) {
- return s.substring(0, c8 + 1).search(/[\.\d]\s*e\s*$/) >= 0
- }
- function uc_z(b7, bb) {
- if (b7.ai > bb.ai) return 1;
- else if (b7.ai < bb.ai) return -1;
- return 0
- }
- function uc_F(j, co, a0, ap) {
- var s = uc_a(j, a0, ap),
- aX;
- while ((aX = s.replace(/\w*\([^()]*\)/g, "X")) != s) s = aX;
- s = s.replace(/[a-z][a-z]\w*/g, "X");
- s = s.replace(/0/g, "1");
- var cm = 1,
- x = 1,
- f = true;
- eval("try {eval(s)} catch(ex) {f = false}");
- return f
- }
- function uc_i(s, C, O, c2, a0, ap) {
- if (!O) return true;
- for (var a = c2; a < C.length; a++) {
- s[C[a].index] = '.';
- if (uc_F(s, C[a].index, a0, ap) && uc_i(s, C, O - 1, a + 1, a0, ap)) return true;
- else s[C[a].index] = ','
- }
- return false
- }
- function uc_p(s, cb, a) {
- var a7 = "",
- t = "on_chars",
- C = [],
- a0 = a;
- for (; a <= s.s.length; a++) {
- var ch = (a == s.s.length ? '' : s.s[a]);
- if (a == s.s.length) t = "on_subexpr_end";
- switch (t) {
- case "on_chars":
- if (ch >= 'a' && ch <= 'z' && (ch != 'e' || uc_G(s, a))) a7 = ch, t = "on_fn_name";
- else if (ch == '(') t = "on_subexpr_start";
- else if (ch == ')') t = "on_subexpr_end";
- else if (ch == ',') C[C.length] = {
- index: a
- };
- break;
- case "on_fn_name":
- if (jx_f(ch) || jx_2(ch)) a7 += ch;
- else if (ch == '(') t = "on_chars", a--;
- else a7 = "", t = "on_chars", a--;
- break;
- case "on_subexpr_start":
- a = uc_p(s, a7, a);
- t = "on_chars", a7 = "";
- a--;
- break;
- case "on_subexpr_end":
- var O = C.length,
- V = s.a8[jx_3(cb)];
- if (V && V == -1) O = 0;
- else if (V && V - 1 <= O) {
- for (var h = 0; h < O; h++) C[h].ai = uc_B(s.s, C[h].index);
- C.sort(uc_z);
- O -= V - 1
- }
- if (O != C.length) uc_i(s.s, C, O, 0, a0, a - 1);
- else for (var h = 0; h < O; h++) s.s[C[h].index] = '.';
- return a
- }
- }
- }
- function uc_U(bF) {
- var bq = [],
- a8 = "max_-1_min_-1_pow_2".split('_');
- for (var a = 0; a < a8.length; a += 2) bq[a8[a]] = a8[a + 1];
- var b1 = {
- s: bF.split(''),
- a8: bq
- };
- uc_p(b1, "", 0);
- return b1.s.join('')
- }
- function uc_v(s) {
- var Q = "",
- r = "",
- bd = "*LN2*LN10*LOG2E*LOG10E*PI*SQRT1_2*SQRT2*abs*acos*asin*atan*atan2*ceil*cos*exp*floor*log*max*min*pow*random*round*sin*sqrt*tan*",
- bO = bd.toLowerCase(),
- bs;
- for (var a = 0; a <= s.length; a++) {
- var ch = (a == s.length ? '' : s.charAt(a));
- if (ch == ';' || jx_d(ch) || (Q.length && (jx_f(ch) || jx_2(ch)))) Q += ch;
- else if (Q.length) {
- var an = jx_3(Q);
- if (an == 'e' && !uc_H(s, a - 1)) r += 'Math.' + Q.toUpperCase();
- else if (an.charAt(0) == 'e' && an.search(/^e\d*$/) == 0) r += Q;
- else if ((bs = bO.indexOf('*' + an + '*')) >= 0) r += 'Math.' + (jx_B(bd.charAt(bs + 1)) ? Q.toUpperCase() : Q);
- else return r;
- Q = "", a--
- } else r += ch
- }
- return r
- }
- function jx_y(s) {
- var r = '',
- a4 = '',
- ch, aj = 0;
- for (var a = 0; a < s.length; a++) {
- ch = s.charAt(a);
- if (!jx_2(ch) && (ch != '0' || jx_f(a4) || a4 == '.')) {
- if ((ch == '(' && jx_0(a4)) || (a4 == ')' && jx_0(ch))) r += '*';
- if (aj && !jx_0(ch)) r += '0';
- aj = 0;
- r += ch;
- a4 = ch
- } else if (ch == '0') aj++
- }
- if (aj) r += '0';
- return r
- }
- function uc_A(v) {
- var r = NaN;
- if (jx_5()) {
- var a, K = uc_U(v.toLowerCase());
- this.R = (v.indexOf('.') < 0 && K.indexOf('.') >= 0);
- K = uc_v(K);
- while (K.length && isNaN(r)) {
- r = jx_y(K);
- if (!r.length) {
- r = NaN;
- break
- }
- eval("try { r = eval(r) } catch(e) { r = NaN }");
- if (isNaN(r)) K = K.substring(0, K.length - 1)
- }
- if (!isNaN(r)) {
- K = K.replace(new RegExp("Math.", "ig"), "");
- this.z = v.substring(0, K.length)
- }
- }
- if (isNaN(r)) {
- var aU = v.replace(/,/, '.');
- this.R = v.indexOf('.') < 0 && aU.indexOf('.') >= 0;
- r = parseFloat(jx_3(aU));
- this.z = isNaN(r) ? "" : v.substring(0, uc_l(aU))
- }
- this.cf = r;
- return this
- }
- function uc_2(d, c3) {
- if (!d.T) {
- alert("Nothing to update!");
- return
- }
- if (!d.W) {
- alert("Please select the source unit.");
- return
- }
- uc_1 = 0;
- var M = d.W,
- v = jx_n(M.e.value),
- k = uc_5[d.D + ':' + M.w],
- u = NaN,
- z = "",
- R = false,
- X = "";
- if (v.toLowerCase() == "%version%") {
- alert(uc_D);
- return
- }
- if (v.toLowerCase() == "%copyright%") {
- alert(uc_C);
- return
- }
- if (!c3 && M.a3 == v) return;
- if (d.bX) X = "link back to www.unitconversion.org is not found";
- else if (d.aa) d.bz = 1, X = "loading, please wait...";
- else if (!v.length);
- else if (M.w == "") X = "source unit is not selected";
- else if (!k) X = "unknown source unit";
- else if (k.length > 1 && k[0] == 3) u = jx_x(v, k[1]), z = v;
- else {
- if (v == "loading, please wait...") M.e.value = v = "";
- var r = uc_A(v);
- R = r.R;
- u = r.cf, z = r.z;
- }
- if (isNaN(u)) {
- delete M.a3;
- if (!X && v.length) X = "invalid input"
- } else M.a3 = v;
- for (var a in d.T) {
- var i = d.T[a];
- if (M != i) {
- delete i.a3;
- var p = uc_5[d.D + ':' + i.w],
- bT = uc_5[d.D + ':' + i.at];
- if (isNaN(u)) i.e.value = X;
- else if (i.type == "unit") i.a3 = i.e.value = i.w != "" ? uc_b(d.G, u, k, p, R) : "unit is not selected";
- else if (i.type == "result") {
- if (i.w == "" || i.at == "") i.e.value = "unit is not selected";
- else {
- z = jx_n(z);
- if (z.charAt(0) != '(' && (!uc_J(z.replace(/,/, '.')) || z.search(/\s/) >= 0 || !jx_0(z.charAt(0)) || !jx_0(z.charAt(z.length - 1)))) z = '(' + z + ')';
- var b2 = uc_b(d.G, u, k, p, R),
- aW = uc_b(d.G, u, k, bT, R),
- aO = jx_8(i.w),
- aL = jx_8(i.at);
- if (M.B == i.B) i.e.value = z + ' ' + aO + ' = ' + aW + ' ' + aL;
- else if (M.B == i.al) i.e.value = z + ' ' + aL + ' = ' + b2 + ' ' + aO;
- else i.e.value = b2 + ' ' + aO + ' = ' + aW + ' ' + aL;
- i.a3 = i.e.value
- }
- }
- }
- }
- }
- function uc_g(o, a2) {
- var a = o.e.selectedIndex;
- if (a2) o.cj = 1;
- if (typeof o.b6 == 'undefined' || a != o.b6) {
- o.b6 = a;
- var w = a < 0 ? "" : o.e.options[a].value;
- if (o.y) {
- for (var h in o.y) {
- var i = o.y[h];
- if (i.B == o.B) i.w = w;
- if (i.al == o.B) i.at = w
- }
- }
- if (a2) uc_h(o.d)
- }
- if (a2) uc_2(o.d, true)
- }
- function uc_o(g, a2) {
- if (g.e.selectedIndex >= 0) {
- var bl = parseInt(g.e.options[g.e.selectedIndex].value);
- if (g.d.G != bl) {
- g.d.G = bl;
- if (a2) uc_2(g.d, true)
- }
- }
- }
- function uc_O(g) {
- if (typeof g.bC == 'undefined' || g.bC != g.e.value) g.d.W = g, g.bC = g.e.value, uc_2(g.d)
- }
- function uc_j() {
- if (typeof uc_0 != 'undefined') {
- var g = uc_0[this._xname];
- switch (g.type) {
- case "select":
- uc_g(g, true);
- break;
- case "precision":
- uc_o(g, true);
- break;
- case "unit":
- uc_O(g)
- }
- }
- }
- function uc_M() {
- uc_1 = 0
- }
- function uc_m(e) {
- return e.value && "_unknown source unit_unknown unit_nan_infinity_invalid input_unit is not selected_source unit is not selected_loading, please wait..._".indexOf('_' + e.value.toLowerCase() + '_') >= 0
- }
- function uc_u(d) {
- for (var a in d.ao) if (uc_m(d.ao[a].e)) return true;
- return false
- }
- function uc_P() {
- uc_1 = 0;
- var g = uc_0[this._xname],
- j = [];
- uc_W(g.d.c1);
- g.d.W = g;
- uc_h(g.d, g);
- if (uc_m(this)) {
- this.value = "";
- if (g.e.createTextRange) {
- var r = g.e.createTextRange();
- r.collapse();
- r.select();
- }
- uc_2(g.d)
- }
- if (g.d.b9 && g.B == "") j = j.concat(uc_s(g.d, g.w, 'fontWeight', g.d.b9, '_input_'));
- if (g.d.bv && g.B == "") j = j.concat(uc_s(g.d, g, 'color', g.d.bv, '', '_input_'));
- g.d.c1 = j
- }
- function uc_on_factors_loaded(D, aw) {
- var I = '$' + D;
- for (var a = 0; a < aw.length;) {
- var aS = aw[a].split(':'),
- V = aS.length == 2 ? parseInt(aS[1]) : 1,
- hash = D + ':' + aS[0];
- if (typeof uc_5[hash] == 'undefined') {
- var ad = uc_5[hash] = new Array();
- for (var h = a + 1; h < a + 1 + V; h++) ad[ad.length] = aw[h]
- }
- a += V + 1
- }
- uc_6[I] = "loaded";
- var l = uc_7[I];
- for (var h = 0; l && h < l.length; h++) uc_c(l[h]);
- uc_7[I] = []
- }
- function uc_S(d, x, type) {
- var g = {
- id: uc_0.length,
- d: d,
- e: x,
- w: "",
- at: "",
- B: "",
- al: "",
- type: ""
- };
- uc_0[g.id] = g;
- x._xname = g.id;
- uc_8(x.name, g, type != 'text');
- if (!g.type) g.type = type == 'text' ? 'unit' : 'select';
- return g
- }
- function uc_9(y, g, id) {
- if (id != "") {
- var a = g.type == "select" ? 0 : 1;
- if (typeof y[id] == 'undefined') y[id] = [];
- if (typeof y[id][a] == 'undefined') y[id][a] = [];
- var l = y[id][a];
- l[l.length] = g
- }
- }
- function uc_y(y) {
- for (var a in y) {
- var q = y[a][0],
- T = y[a][1];
- if (q && T) {
- for (var h in q) q[h].y = T, uc_g(q[h])
- }
- }
- }
- function uc_8(name, b_, cd) {
- return jx_e(name, ';', 0, 0, b_, cd ? 'B' : 'w', {
- 'bindid': 'B',
- 'bindid2': 'al',
- 'type': 'type',
- 'focus': 'focus',
- 'base': 'bL'
- })
- }
- function uc_E() {
- var data = jx_h(jx_g("uc_states")),
- ax, H = uc_4.value;
- if (jx_4(H)) H = null;
- if (jx_9(uc_4.m)) data = jx_h(uc_4.m), ax = true;
- if (jx_9(uc_4.w)) ax = true, data = [{
- c: "",
- l: [{
- n: uc_4.w,
- b: 1,
- f: 1,
- v: H
- }]
- }];
- if (ax) uc_q(data);
- else H = null;
- for (var a in data) {
- var m = data[a].l,
- aR, a9, q = [];
- for (var h in m) {
- if (m[h].f && m[h].b) aR = m[h];
- if (m[h].s && m[h].s[0]) q[q.length] = m[h]
- }
- if (aR) {
- var u = uc_8(aR.n);
- if (u.B) {
- for (var bx in q) {
- var s = uc_8(q[bx].n, 0, true);
- if (u.B == s.B) {
- a9 = q[bx].s[0];
- break
- }
- }
- } else a9 = u.w
- }
- if (a9) {
- m[m.length] = {
- n: "",
- s: [a9],
- v: H
- };
- if (u.B) m[m.length] = {
- n: a9,
- b: 1,
- f: 1,
- v: H
- }
- }
- }
- return data
- }
- function uc_q(data) {
- if (uc_f) jx_A("uc_states", jx_6(data), true, true, jx_L(180), uc_f)
- }
- function uc_h(d, Z) {
- d.Z = Z;
- if (d.aa) {
- d.c9 = 1;
- return
- }
- if (Z && Z.type == "unit" && uc_d[d.D + '$' + Z.e.name] == Z) return;
- uc_d = [];
- var data = [{
- c: d.D,
- l: []
- }],
- m = data[0].l;
- if (d.W) m[0] = {
- n: d.W.e.name,
- b: 1,
- f: 1
- };
- for (var a = d.e._xname + 1; a < uc_0.length && uc_0[a].d == d; a++) {
- var i = uc_0[a];
- if (i.type == 'select') {
- if (i.e.selectedIndex >= 0) {
- var w = i.e.options[i.e.selectedIndex].value;
- m[m.length] = {
- n: i.e.name,
- s: [w]
- }
- }
- }
- }
- uc_q(data)
- }
- function uc_x(d) {
- var J = d.e,
- x = J.elements;
- for (var a = 0; a < J.length; a++) {
- var e = x[a],
- i = uc_0[e._xname];
- if (i && i.type == 'select') for (var h = 0; h < e.options.length; h++) {
- if (e.options[h].selected != e.options[h].defaultSelected) return true
- }
- }
- return false
- }
- function uc_r(ci) {
- var j = jx_h(ci),
- o = uc_0[j[j.length - 1]];
- for (var a = 0; a < j.length - 1 && !o.cj; a++) o.e.options[j[a]].selected = o.e.options[j[a]].defaultSelected = true;
- uc_g(o);
- uc_c(o.d)
- }
- function uc_V(o, Y, bB) {
- if (bB) Y = [];
- else if (typeof Y == 'undefined' || !Y.length) return;
- var q = [],
- a, A = o.e;
- for (a = 0; a < A.options.length; a++) {
- if (bB && A.options[a].selected) Y[Y.length] = A.options[a].value;
- A.options[a].selected = A.options[a].defaultSelected = false;
- for (var h in Y) if (A.options[a].value == Y[h]) q[q.length] = a
- }
- if (!q.length) return;
- var bt = q[0],
- bi = q[q.length - 1],
- ba = A.size - (bi - bt + 1),
- b8 = Math.ceil(ba / 2),
- bP = ba - b8,
- ab = Math.min(Math.max(b8 + bi, 0), A.options.length - 1),
- ar = Math.min(Math.max(bt - bP, 0), A.options.length - 1);
- A.options[ab].selected = A.options[ab].defaultSelected = true;
- A.options[ab].selected = A.options[ab].defaultSelected = false;
- A.options[ar].selected = A.options[ar].defaultSelected = true;
- A.options[ar].selected = A.options[ar].defaultSelected = false;
- q[q.length] = o.id;
- o.d.aa++;
- if (jx_a()) setTimeout('uc_r' + '("' + jx_6(q) + '")', 0);
- else uc_r(jx_6(q))
- }
- function uc_w(d, data) {
- if (data) {
- var bJ = uc_x(d),
- J = d.e,
- m, x = J.elements;
- for (var a = 0; a < data.length; a++) if (data[a].c == d.D || data[a].c == "") {
- m = data[a].l;
- break
- }
- if (m) {
- for (var a = 0; a < J.length; a++) {
- var e = x[a],
- i = uc_0[e._xname];
- if (!i || !i.type) continue;
- var bU = uc_8(e.name, 0, i.type == "select");
- for (var h in m) {
- var t = m[h],
- ca = t.n == e.name || t.n == bU.w;
- if (ca || (!t.n && t.s && i.type == "select")) {
- if (t.b) d.W = i;
- if (t.f) d.bk = i;
- if (jx_9(t.v)) d.H = t.v;
- if (t.f && t.b && i.type == "unit") uc_d[d.D + '$' + e.name] = i;
- if (i.type == "select") uc_V(i, t.s, bJ);
- break
- }
- }
- }
- }
- }
- if (!uc_1) {
- uc_1 = d.bk ? d.bk : d.bS;
- if (uc_1) uc_1.H = d.H
- }
- }
- function uc_N() {
- var N = uc_1;
- uc_1 = 0;
- uc_t = 1;
- if (!jx_s([{
- bD: 12,
- bG: 60,
- hostname: "\x77\x77\x77\x2e\x75\x6e\x69\x74\x63\x6f\x6e\x76\x65\x72\x73\x69\x6f\x6e\x2e\x6f\x72\x67"
- }])) for (var a in uc_0) uc_0[a].bX = true;
- if (N && (typeof document.activeElement == 'undefined' || !document.activeElement || (document.activeElement.tagName && document.activeElement.tagName.toLowerCase() == 'body'))) {
- var bn = jx_K(N.e);
- if (!jx_b() && bn > 0 && document.body.clientHeight && N.e.offsetHeight) window.scrollTo(0, bn - (document.body.clientHeight - N.e.offsetHeight) / 2);
- N.e.focus();
- if (jx_9(N.H) && N.H != null) N.e.value = N.H, uc_2(N.d, true)
- }
- uc_n()
- }
- function uc_n(ce) {
- uc_3[uc_3.length] = ce;
- if (uc_t || !jx_a()) {
- for (var a in uc_3) {
- if (uc_3[a]) {
- var aI = document.createElement("script");
- aI.src = uc_3[a];
- uc_3[a] = 0;
- aI.defer = true;
- document.body.appendChild(aI)
- }
- }
- }
- }
- function uc_K(d) {
- var I = "$" + d.D;
- if (uc_6[I] == "loaded") uc_c(d);
- if (uc_6[I] != "loaded") {
- if (typeof uc_7[I] == 'undefined') uc_7[I] = [];
- var l = uc_7[I];
- l[l.length] = d
- }
- if (typeof uc_6[I] == 'undefined') {
- uc_6[I] = "loading";
- var src = ((typeof uc_datapath != 'undefined' && uc_datapath.length) ? uc_datapath : "http://www.unitconversion.org/converter3/") + d.D + '.js';
- if (jx_5() && (!jx_b() || jx_M(8)) && !jx_q()) uc_n(src);
- else document.write('<s' + 'cript language=javascript src="' + src + '"></script>')
- }
- }
- function uc_T() {
- while (uc_e < document.forms.length) {
- var J = document.forms[uc_e++],
- s = J.name,
- d = {
- type: "form",
- G: 9,
- T: [],
- ao: [],
- e: J,
- aa: 1,
- id: uc_0.length
- };
- if (s.indexOf("cat=") < 0) continue;
- uc_0[d.id] = d;
- J._xname = d.id;
- jx_e(s, ';', 0, 0, d, 0, {
- 'cat': 'D',
- 'precision': 'G',
- 'errfile': 'by',
- 'focuscolor': 'bv',
- 'focusweight': 'b9',
- 'statescookiepath': 'bE'
- });
- if (d.by) jx_u(d.by, 5);
- if (typeof d.G == 'string') d.G = parseInt(d.G);
- var D = d.D = jx_3(d.D);
- var y = [],
- x = J.elements;
- for (var h = 0; h < J.length; h++) {
- var aq = x[h].type;
- if (typeof x[h].name == 'undefined' || x[h].name.indexOf('type=unknown') != -1 || (aq != "text" && aq != "select-one" && aq != "select-multiple")) continue;
- var g = uc_S(d, x[h], aq);
- d.ao[d.ao.length] = g;
- switch (g.type) {
- case "precision":
- uc_o(g, false);
- break;
- case "select":
- case "unit":
- uc_9(y, g, g.B);
- break;
- case "result":
- uc_9(y, g, g.B);
- uc_9(y, g, g.al)
- }
- if (g.bL && g.type == "unit") d.W = g;
- if (g.focus) d.bS = g;
- if (g.type) x[h].onfocus = g.type == "unit" ? uc_P : uc_M;
- if (g.type == "unit" || g.type == "result") d.T[d.T.length] = g;
- if (g.type != "result") {
- if (typeof x[h].onpaste != 'undefined') x[h].onpaste = uc_j;
- x[h].onchange = x[h].onkeyup = x[h].onkeydown = uc_j
- }
- }
- if (!d.id) {
- uc_4 = jx_J({
- 'value': 'value',
- 'states': 'm',
- 'unit': 'w'
- });
- uc_f = d.bE;
- uc_k = uc_E();
- jx_C(uc_N);
- if (document.layers) document.captureEvents(Event.KEYDOWN), document.onkeydown = function (aK) {
- return aK.target.onkeydown ? aK.target.onkeydown(aK) : true
- }
- }
- uc_y(y);
- uc_w(d, uc_k);
- uc_K(d)
- }
- }
- uc_T();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement