var l = true, m = null, n = false, q = navigator.userAgent.toLowerCase(), s = typeof window.ontouchstart != "undefined", t = getViewportDimensions().w <= 320 || getViewportDimensions().h <= 320;
s = q.indexOf("iphone") > -1 || q.indexOf("ipad") > -1;
var u = ["gray", "black", "#707070", "#b9b9b9", "#ac6e96", "#728096", "#5e8057", "#d7e28d", "#e6969a", "#4ca1c7", "#f2c9a6", "#e46900", "#00532b", "#620041", "#7d4e00", "#da69af", "#2d5d8c", "#af9b5d", "#3c6467", "#3cb796", "#c3716e", "#ffc800", "#dadc55", "#c6008f", "#6cc84b", "#9e8c28", "#9e8cad", "#df78ad", "#5578b9", "#e6eb00", "#46765a", "#dc2d53"], v = s ? 1 : 2, w = [75, 240, 400], z = [184, 160], C = [168, 34], D = m;
if(q.indexOf("webkit") < 0 && q.indexOf("gecko") < 0) {
  window.location.href = "./sorry.html"
}
var E = m, F = Math.floor, G = Math.abs;
function H(a) {
  return Math.floor(Math.random() * a) + 1
}
function I(a) {
  return-Math.pow(2, -10 * a) + 1
}
function aa(a) {
  return a
}
var J = 0, L = F((new Date).getTime() * 15 / 1E3), M, N, P;
function Q(a, d, b, e) {
  this.from = a;
  this.to = d;
  this.duration = F(b * 15 / 1E3);
  this.ab = e;
  this.start = J
}
Q.prototype = {from:0, to:0, duration:0, ab:m, start:0, R:n, value:function() {
  var a = (J - this.start) / this.duration;
  if(this.R = !(a < 1)) {
    return this.to
  }else {
    a = this.ab(a);
    return a * this.to + this.from * (1 - a)
  }
}};
function R(a, d, b, e) {
  this.type = b;
  this.x = a;
  this.p = a + e.x;
  this.y = d;
  this.yb = a;
  this.zb = d;
  this.qa = e;
  this.rb()
}
R.prototype = {type:0, x:0, p:0, y:0, yb:0, zb:0, qa:m, C:0, j:0, Da:0, U:0, W:n, rb:function() {
  this.cc = 0.25 * (Math.random() - 0.5) * 2
}};
function S(a, d) {
  this.cb = a;
  this.db = d
}
S.prototype = {length:0, cb:m, db:m};
function T(a, d, b, e) {
  this.name = a;
  this.index = d;
  this.type = b;
  this.width = this.Ea[0];
  this.c = (this.direction = d % 2 ? 1 : 0) ? 800 : -800;
  if(this.type == 1) {
    this.Aa = new Image;
    this.Aa.src = "./img2/" + this.name + "_title.gif";
    this.ia = new Image;
    connect(this.ia, "onload", this, this.fc);
    this.ia.src = "./img2/" + this.name + "_s.png";
    if(e) {
      this.ha = new Image;
      connect(this.ha, "onload", this, this.dc);
      this.ha.src = "./img2/" + this.name + "_sub.gif"
    }
  }else {
    this.Rb = d == 0
  }
}
T.prototype = {name:m, index:0, type:0, Ta:[-33, -25], Ea:w, width:0, ka:m, rows:m, direction:0, status:0, ib:0, x:0, ja:0, Ca:0, c:0, m:m, B:0, Aa:m, Wa:n, k:0, i:0, V:0, d:-1, n:[320, 480], ia:m, qb:n, eb:n, ha:m, pb:n, Rb:0, fc:function() {
  this.qb = l;
  U.H = l
}, Sb:function() {
  this.eb = l;
  U.Vb = l
}, dc:function() {
  this.pb = l;
  U.Vb = l
}, lb:function(a, d) {
  if(this.B) {
    if(this.B.type == 1 && a == m && !d) {
      this.B.ma = (this.B.ma + 1) % this.B.Ya;
      U.t("icon_open");
      return
    }else {
      this.B.mb(n);
      U.t("icon_close")
    }
    this.c += (this.n[1] - z[1]) / 2
  }
  if(this.B = a) {
    var b = this.n[1];
    a.u(n);
    U.t("icon_open");
    if(U.d > -1) {
      U.rows[U.d].u(n);
      U.d = -1
    }
    if(a.type == 2 || a.type == 4) {
      b = z[1];
      this.m = this.B = m;
      this.K(1);
      U.Ub(a.o, "movie", a.type)
    }else {
      if(a.type == 3) {
        this.m = this.B = m;
        this.K(1);
        window.open(a.o, "_blank")
      }else {
        a.mb(l);
        this.K(2);
        this.c -= (this.n[1] - z[1]) / 2
      }
    }
    var e = a.index * (95 + z[1]), c = !this.direction ? 45 : 0;
    if(this.c + e - c < -U.h / 2) {
      this.m = new Q(this.c, this.c - (this.c + e - c + U.h / 2) + 75 + 5, 1E3, I)
    }
    c = this.direction ? 95 : 40;
    if(this.c + e + b + c > U.h / 2) {
      this.m = new Q(this.c, this.c - (this.c + e + b + c - U.h / 2) - 15 - 5, 1E3, I)
    }
  }else {
    if(!d) {
      this.K(1);
      this.m = m
    }
  }
}, Na:function(a, d) {
  if(d < this.c) {
    return m
  }
  for(var b = 0;b < this.D;b++) {
    var e = this.rows[b];
    if(d < this.c + e.y + e.h) {
      if(d < this.c + e.y) {
        break
      }
      b = e.state || e.bc ? this.Ga : this.ba;
      if(a < b || a > b + e.w) {
        break
      }
      return e
    }
  }
  return m
}, K:function(a) {
  if(this.type == 1) {
    var d = this.Ea[a];
    if(a == 0) {
      U.X();
      U.t("menu_close")
    }else {
      if(!this.ea) {
        this.ea = new Image;
        connect(this.ea, "onload", this, this.Sb);
        this.ea.src = "./img2/" + this.name + "_l.png"
      }
      if(this.status == 0) {
        U.t("menu_open_0" + H(2));
        this.ib++;
        this.m = this.direction ? new Q(U.h / 2 - 25, -50, 500, I) : new Q(-(U.h / 2 + this.L + 25), -this.L + 100, 500, I)
      }
    }
    this.status = a;
    this.ka = new Q(this.width, d, 1E3, I)
  }else {
    this.status = a;
    U.H = l;
    if(this.index == 0 && (a || !this.Ra)) {
      this.ka = new Q(0, 25, 8E3, aa)
    }
  }
}, Mb:function() {
  if(this.index >= U.F && this.index <= U.T) {
    this.m = this.c + this.L / 2 < this.V ? new Q(this.c, -(U.h / 2 + this.L), 500, I) : new Q(this.c, U.h / 2, 500, I)
  }else {
    this.K(0)
  }
}, Oa:function(a) {
  return G(this.V - a) < 100
}};
function V(a, d, b) {
  this.id = a;
  this.Ha = b;
  this.index = d
}
V.prototype = {y:0, state:n, id:0, Ha:0, w:z[0], h:z[1], x:F((w[1] - z[0]) / 2), scale:0, o:0, za:0, ma:0, Ya:0, bc:m, I:0, wa:m, index:0, u:s ? function() {
} : function(a) {
  if(a) {
    this.wa = new Q(this.I, 0.4 * (Math.random() > 0.5 ? 1 : -1), 500, I)
  }else {
    if(this.I) {
      this.wa = new Q(this.I, 0, 1E3, I)
    }
  }
}, mb:function(a) {
  if(a) {
    this.w = this.Ha[0];
    this.h = this.Ha[1]
  }else {
    this.w = z[0];
    this.h = z[1]
  }
  this.state = a
}};
var W = 0, X = 0, Y = 0;
function ba(a, d, b) {
  this.nb = this.aa = n;
  if(!getElement("the_canvas").getContext) {
    window.location.href = "./sorry.html"
  }
  J = F((new Date).getTime() * 15 / 1E3) - L;
  this.fb = this.Pa = this.h = this.w = 0;
  this.hb = this.H = l;
  this.jc = this.ua = J;
  this.d = -1;
  this.zoom = 1;
  this.Va = n;
  this.Fa = m;
  this.oa = 0.15;
  this.ya = m;
  if(D) {
    this.ya = {};
    re = /^opening/;
    for(var e in D) {
      if(e.match(re)) {
        log("skip: " + e)
      }else {
        this.ya[e] = new Sound(e, 2, D[e])
      }
    }
  }
  e = u[F(Math.random() * u.length)];
  document.body.style.background = this.pa = e;
  e = new Date;
  var c = MochiKit.DateTime._padTwo;
  M = "" + e.getFullYear();
  N = "" + c(e.getMonth() + 1);
  P = "" + c(e.getDate());
  this.gc = m;
  this.G = 0;
  this.Tb = this.e = 660;
  this.Z = m;
  this.da = 0;
  this.Ob = [getElement("head"), getElement("head2"), getElement("head3")];
  this.ic = this.hc = this.Ma = 0;
  this.bb = getElement("foot");
  this.Qb = getElement("tail");
  this.Q = getElement("typo");
  this.Pb = getElement("head_bubble");
  this.Nb = getElement("copyright");
  forEach(getElementsByTagAndClassName(m, "preload"), function(o) {
    removeElement(o)
  });
  this.q = new T("head", 0, 0, n);
  this.q.width = 500;
  this.q.Ra = 0;
  this.z = new T("tail", DATA.length + 1, 0, n);
  this.body = [];
  var h = 0;
  this.rows = [];
  for(e = 0;e < DATA.length;e++) {
    var f = DATA[e], g = new T(f.name, 1 + e, 1, f.no_subs ? n : l);
    g.rows = [];
    if(f.special_size) {
      g.n = f.special_size
    }
    if(f.special_width_set) {
      g.Ea = f.special_width_set;
      g.width = g.Ea[0]
    }
    if(f.title_offset) {
      g.Ta = f.title_offset
    }
    g.direction || f.rows.reverse();
    for(c = 0;c < f.rows.length;c++) {
      var j = f.rows[c], k = new V(h, c, g.n);
      k.za = j[0];
      if(j[1] == "img") {
        k.o = j[2]
      }else {
        if(j[1] == "anim") {
          k.type = 1;
          k.o = j[2];
          k.Ya = j[3]
        }else {
          if(j[1] == "embed") {
            if(t) {
              if(j.length < 4) {
                log("no alternative link for small screen devices, ignored: " + j[2]);
                continue
              }
              k.o = j[3];
              k.type = 3
            }else {
              k.o = j[2];
              k.type = 2
            }
          }else {
            if(j[1] == "embed2") {
              if(t) {
                if(j.length < 4) {
                  log("no alternative embed for small screen devices, ignored: " + j[2]);
                  continue
                }
                k.o = j[3]
              }else {
                k.o = j[2]
              }
              k.type = 2
            }else {
              if(j[1] == "link") {
                k.type = 3;
                k.o = j[2]
              }else {
                log("unkown col type: " + j[1]);
                continue
              }
            }
          }
        }
      }
      h++;
      this.rows.push(k);
      g.rows.push(k)
    }
    g.D = g.rows.length;
    g.L = 95 * (g.D - 1) + g.D * z[1];
    if(f.always_title) {
      g.Wa = l
    }
    this.body.push(g)
  }
  this.D = this.rows.length;
  this.all = concat([this.q], this.body, [this.z]);
  this.S = this.all.length;
  this.Qa = this.body.length;
  this.f = [];
  this.f.push(new R(-80, 0, 2, this.body[0]));
  for(e = 0;e < this.Qa;e++) {
    h = this.body[e];
    f = h.width / (1 + v);
    this.f.push(new R(0, 0, 1, h));
    h.k = this.f.length;
    for(c = 0;c < v;c++) {
      this.f.push(new R(f * (c + 1), 0, 0, h))
    }
    h.i = this.f.length - 1
  }
  this.f.push(new R(0, 0, 1, this.z));
  this.f.push(new R(80, 0, 2, this.z));
  this.fa = this.f.length;
  this.q.k = 0;
  this.q.i = 1;
  this.z.k = this.fa - 2;
  this.z.i = this.fa - 1;
  this.Sa = [];
  for(e = 0;e < this.fa - 1;e++) {
    this.Sa.push(new S(this.f[e], this.f[e + 1]))
  }
  this.lc = this.Sa.length;
  this.F = 0;
  this.T = this.S;
  this.canvas = a;
  this.M = this.canvas.getContext("2d");
  this.ga = d;
  this.jb = getElement("the_overlay_background");
  this.va = b;
  this.Y = m;
  MochiKit.Async.doXHR("/cgi-bin/get.cgi", {mimeType:"text/plain", headers:[["Accept", "application/json"]], method:"POST", sendContent:"type=girl"}).addCallbacks(function(o) {
    o = evalJSONRequest(o);
    o.Kb = o.girl_length.replace(/,/g, "");
    o.Lb = o.girl_length_yesterday.replace(/,/g, "");
    o.vb = o.boy_num.replace(/,/g, "");
    o.wb = o.boy_num_yesterday.replace(/,/g, "");
    U.Y = o
  }, function() {
    log("error getting: /cgi-bin/get.cgi")
  });
  connect(window, "onresize", this, this.kb);
  connect(document, "onselectstart", this, this.onselect);
  connect(this.canvas, "onmousedown", this, this.onclick);
  connect(this.canvas, "onmouseup", this, this.X);
  connect(this.canvas, "onmousemove", this, this.onmousemove);
  connect(document, "onmousewheel", this, this.ac);
  connect(this.ga, "onmousedown", this, this.Wb);
  if(s) {
    connect(this.canvas, "ontouchstart", this, this.Zb);
    connect(this.canvas, "ongesturechange", this, this.Xb);
    connect(this.canvas, "ongesturestart", this, this.Yb);
    connect(this.canvas, "ontouchmove", this, this.ontouchmove);
    connect(this.canvas, "ontouchend", this, this.X);
    connect(this.ga, "ontouchstart", this, this.$b)
  }
  connect(window, "onkeydown", this, this.onkeydown);
  this.ra = "url('img2/hand_01.gif'),move";
  this.xb = "url('img2/hand_02.gif'), -moz-grabbing";
  this.sa = "url('img2/hand_03.gif'), pointer";
  this.canvas.style.display = "block";
  this.xa(0);
  this.Xa();
  if(s) {
    this.zoom = this.la / this.G;
    this.Ba();
    this.ob = this.zoom;
    this.Tb = this.e = (this.G + 420) / 2
  }
  this.sb();
  try {
    E = _gat._getTracker("UA-3094953-10");
    E._trackPageview()
  }catch(r) {
    log("couldnt start tracking pagevidew")
  }
  removeElement($("loading"))
}
ba.prototype = {onselect:function() {
  return n
}, cursor:function(a) {
  this.canvas.style.cursor = a
}, t:function(a) {
  this.ya && this.ya[a].play()
}, sb:function() {
  var a = [];
  a.push(this.da == 0 ? "\u014d" : "o");
  for(var d = 0;d < this.Qa;d++) {
    d == this.da - 1 ? a.push("=") : a.push("-")
  }
  a.push(this.da == this.S - 1 ? "\u014d" : "o");
  this.aa && a.push(" [" + Y + "FPS]");
  document.title = a.join("");
  this.hb = n
}, Xa:function() {
  J = (new Date).getTime();
  if(this.aa) {
    if(J - W > 500) {
      Y = (1E3 * X / (J - W)).toFixed(2);
      X = 1;
      W = J;
      this.hb = l
    }else {
      X++
    }
  }
  J = F(J * 15 / 1E3) - L;
  var a = 0, d = F(this.h / 2), b = this.w, e = F(this.w / 2), c;
  if(c = this.Fa) {
    this.zoom = c.value();
    if(c.R) {
      this.Fa = m;
      delete c
    }
    this.Ba();
    a = 1
  }
  if(c = this.Z) {
    this.e = F(c.value());
    if(c.R) {
      this.Z = m;
      delete c
    }
    a = 1
  }
  var h = this.e - e;
  if(J % 60 == 0) {
    this.Ma = (this.Ma + 1) % 3;
    a |= l
  }
  if(J % 10 == 0) {
    var f = this.ta(this.e, l), g = f ? f.index : -1;
    if(g != this.da) {
      this.da = g;
      this.sb()
    }
  }
  var j = 0;
  for(g = 0;g < this.S;g++) {
    f = this.all[g];
    if(c = f.ka) {
      if(f.type == 1) {
        var k = f.width = F(c.value());
        if(c.R) {
          f.ka = m;
          delete c
        }
        f.ba = F((k - z[0]) / 2);
        f.Ga = F((k - f.n[0]) / 2);
        f.ec = F((k - C[0]) / 2)
      }else {
        f.Ra = F(c.value());
        if(c.R) {
          f.ka = m;
          delete c
        }
      }
      a = 1
    }
    f.x = j;
    j += f.width
  }
  for(g = this.F = 0;g < this.S;g++) {
    f = this.all[g];
    if(f.x + f.width > h) {
      this.F = g;
      break
    }
  }
  this.T = this.S - 1;
  for(g = this.F;g < this.S;g++) {
    f = this.all[g];
    if(f.x > h + b) {
      this.T = g;
      break
    }
  }
  this.G = j;
  for(g = this.F;g <= this.T;g++) {
    f = this.all[g];
    if(f.type == 1) {
      if(f.status > 0) {
        if(c = f.m) {
          f.c = F(c.value());
          if(c.R) {
            f.m = m;
            delete c
          }
          if(g == this.ca) {
            if(k = f.Na(this.Pa - f.x, this.fb)) {
              this.cursor(this.sa);
              if(this.d != k.id && !k.state) {
                this.d > -1 && this.rows[this.d].u(n);
                k.state || k.u(l);
                this.d = k.id
              }
            }else {
              this.d > -1 && this.rows[this.d].u(n);
              this.cursor(this.ra);
              this.d = -1
            }
          }
          a = 1
        }
        h = f.c;
        for(j = b = 0;j < f.D;j++) {
          k = f.rows[j];
          if(c = k.wa) {
            k.I = c.value();
            if(c.R) {
              c.wa = m;
              delete c
            }
          }
          k.y = b;
          b += k.h + 95
        }
        f.ja = f.D;
        for(j = 0;j < f.D;j++) {
          k = f.rows[j];
          if(h + k.y + k.h + 95 > -d) {
            f.ja = j;
            break
          }
        }
        f.Ca = f.D - 1;
        for(j = f.ja;j < f.D;j++) {
          k = f.rows[j];
          if(h + k.y > d) {
            f.Ca = j;
            break
          }
        }
        f.L = b;
        if(f.c < -(d + f.L - 75) || f.c > d - 10) {
          f.lb(m, l);
          f.K(0)
        }
      }
    }
  }
  this.k = Math.max(0, (this.F - 1) * (1 + v) - 1);
  this.i = this.fa - 1;
  k = this.k;
  f = this.i - 1;
  c = this.f;
  if(!s) {
    g = J - this.ua > 300;
    if(this.Va) {
      if(!g) {
        this.Va = n;
        this.Z = new Q(this.e, this.Pa, 5E3, I);
        this.Fa = new Q(this.zoom, 1, 2500, I);
        this.t("camera_zoom")
      }
    }else {
      if(g) {
        this.Z = new Q(this.e, (this.G + 420) / 2, 2500, I);
        this.Fa = new Q(this.zoom, this.la / this.G, 5E3, I);
        this.Va = l;
        this.t("camera_hiku")
      }
    }
  }
  if(h = J - this.ua > 90) {
    if(h && J % 60 == 0) {
      for(g = this.k;g <= this.i;g++) {
        c[g].rb()
      }
    }
  }
  for(g = this.k;g <= this.i;g++) {
    b = c[g];
    b.p = b.x + b.qa.x;
    b.C = b.j = 0;
    if(h) {
      b.j += b.cc
    }
  }
  var r, o;
  o = n;
  for(g = k;g <= f;g++) {
    k = this.Sa[g];
    b = k.cb;
    k = k.db;
    h = b.p - k.p;
    j = b.y - k.y;
    r = Math.sqrt(h * h + j * j);
    o = n;
    if(r > (o ? 5 : 80) || r < 40 && (r *= 3)) {
      h /= r;
      j /= r;
      r = Math.min(r, 400);
      o = k.W ? -0.5 : o ? -(r - 5) * 0.1 : -(r - 80) * 0.06;
      h *= o;
      j *= o;
      b.C += h;
      if(k.W) {
        if(b.qa.status == 0) {
          k.j += -j;
          b.j += j
        }
        if(r < 100) {
          k.W = n
        }
      }else {
        k.C += -h;
        k.j += -j;
        b.j += j;
        if(k.type == 1 && r > 165) {
          k.W = l
        }
      }
    }
  }
  for(r = 1;r < this.S - 1;r++) {
    f = this.all[r];
    f.V = (c[f.k + 1].y + c[f.i - 1].y) / 2;
    k = f.width;
    for(b = f.i;b >= f.k;b--) {
      j = c[b];
      if(j.x < 0) {
        j.C += 1.25
      }else {
        if(j.x > k) {
          j.C += -1.25
        }
      }
    }
    if(f.status) {
      if(this.F <= r && r <= this.T) {
        h = f.c;
        for(g = f.ja;g <= f.Ca;g++) {
          k = f.rows[g];
          for(b = f.i;b >= f.k;b--) {
            j = c[b];
            if(j.y > h + k.y && j.y < h + k.y + k.h && j.x > f.ba && j.x < f.ba + k.h) {
              j.j += j.y > h + k.y + k.h / 2 ? 3 : -3
            }
          }
        }
      }
    }else {
      g = 0.0015 - 0.0020 * f.ib;
      if(g > 0) {
        for(b = f.i + 1;b >= f.k - 1;b--) {
          j = c[b];
          j.j -= j.y * g
        }
      }
    }
  }
  for(g = this.k;g <= this.i;g++) {
    b = c[g];
    b.C += -b.Da * 0.04;
    b.j += -b.U * 0.04;
    if(Math.abs(b.y) > d) {
      b.j += b.y > 0 ? -0.3 : 0.3
    }
    if(b.type == 2) {
      b.j -= b.y * 0.0075
    }
    b.Da += b.C;
    b.U += b.j;
    if(G(b.Da) < 0.0010 && G(b.U) < 0.0010) {
      if(G(b.C) < 0.0010 && G(b.j) < 0.0010) {
        continue
      }
    }
    a = l;
    if(b.type == 0) {
      b.x += b.Da;
      b.p = b.x + b.qa.x
    }
    b.y += b.U
  }
  if(this.e < -e) {
    this.X();
    this.J(0)
  }else {
    if(this.e > this.G + e) {
      this.X();
      this.J(this.G)
    }
  }
  if(a || this.H) {
    this.Gb();
    this.H = n
  }
}, J:function(a) {
  this.Z = new Q(this.e, a, 2500, I)
}, ta:function(a, d) {
  if(a < this.q.width) {
    if(!this.Y) {
      return m
    }
    if(a < this.q.width - 140 && !d) {
      return m
    }
    if(a > this.q.width - 20) {
      return m
    }
    return this.q
  }
  for(var b = 0;b < this.Qa;b++) {
    var e = this.body[b];
    if(a < e.x + 20) {
      return m
    }
    if(a < e.x + e.width) {
      return e
    }
  }
  if(a > this.z.x + 140 && !d) {
    return m
  }
  return this.z
}, onclick:function(a) {
  U.click(a.mouse().page.x, a.mouse().page.y)
}, onmousemove:function(a) {
  this.gb(a.mouse().page.x, a.mouse().page.y)
}, Wb:function(a) {
  if(a.target() == this.jb) {
    a.stop();
    this.xa(0)
  }
}, Zb:function(a) {
  this.ua = J;
  var d = a.event();
  if(d.touches.length == 1) {
    d = d.touches[0];
    this.click(d.pageX, d.pageY)
  }
  a.stop()
}, $b:function(a) {
  var d = a.event();
  if(a.target() == this.jb) {
    d.touches.length == 1 && this.xa(0);
    a.stop()
  }
}, ontouchmove:function(a) {
  var d = a.event();
  if(d.touches.length == 1) {
    d = d.touches[0];
    this.gb(d.pageX, d.pageY)
  }
  a.stop()
}, Yb:function() {
  this.ob = this.zoom
}, Xb:function(a) {
  a = a.event();
  this.zoom = Math.max(this.la / this.G, Math.min(1, this.ob * a.scale));
  this.Ba()
}, onkeydown:function(a) {
  a = a.key();
  if(a.string == "KEY_F") {
    this.aa = !this.aa
  }
  if(a.string == "KEY_B") {
    this.nb = !this.nb
  }
}, ac:function(a) {
  if(!this.mode) {
    var d = a.event();
    d = d.wheelDelta ? d.wheelDelta / 40 : d.detail * -1;
    d *= -40;
    a = this.ta(a.mouse().page.x + (this.e - this.w / 2));
    if(!a || !a.status || a.type == 0) {
      a && a.m || this.J(this.e + d)
    }else {
      a.m = new Q(a.c, a.c + d / 2, 1E3, I)
    }
  }
}, click:function(a, d) {
  this.ca = -1;
  a /= this.zoom;
  d /= this.zoom;
  var b = a + (this.e - this.w / 2), e = d - this.h / 2, c = this.ta(b);
  if(c) {
    if(c.type == 0 && c.Oa(e)) {
      if(c.index == 0) {
        c.K(!c.status);
        if(c.status) {
          this.J(100);
          this.t("boy_0" + H(3))
        }else {
          this.J(420)
        }
      }else {
        for(c = this.pa;c == this.pa;) {
          c = u[F(Math.random() * u.length)]
        }
        document.body.style.background = this.pa = c;
        this.J(this.z.x);
        this.t("hip_0" + H(3));
        this.oa = this.oa > 0 ? 0 : 0.15
      }
      return
    }else {
      if(c.status == 0) {
        if(c.Oa(e)) {
          e = -1;
          e = c.status > 0 ? 0 : 1;
          c.K(e);
          this.aa || this.J(c.x + c.width / 2);
          return
        }
      }else {
        if(b = c.Na(b - c.x, e)) {
          c.lb(b.state ? m : b);
          return
        }
        if(G(c.Ua - e) < 20) {
          c.Mb();
          return
        }
      }
    }
  }
  this.X();
  if(c && c.status > 0) {
    c.m = m;
    this.N = c;
    this.Bb = c.c;
    this.Ja = this.Eb = d
  }
  this.Za = l;
  this.Z = m;
  this.Ia = this.Db = a;
  this.Cb = this.e;
  this.cursor(this.xb)
}, gb:function(a, d) {
  if(!this.mode) {
    var b = this.ca;
    this.ua = J;
    this.ca = -1;
    if(this.Za) {
      this.Ab(a, d)
    }else {
      a = a / this.zoom + (this.e - this.w / 2);
      d = d / this.zoom - this.h / 2;
      this.Pa = a;
      this.fb = d;
      var e = this.ta(a);
      if(e) {
        if(e.type == 1 && e.status > 0) {
          this.ca = e.index;
          if(b = e.Na(a - e.x, d)) {
            this.cursor(this.sa);
            if(this.d != b.id && !b.state) {
              this.d > -1 && this.rows[this.d].u(n);
              b.u(l);
              this.H = l;
              this.d = b.id
            }
            return
          }else {
            if(this.d > -1) {
              this.rows[this.d].u(n);
              this.d = -1
            }
          }
          if(G(d - e.Ua) < 20) {
            this.cursor(this.sa);
            return
          }
          this.cursor(this.ra);
          return
        }else {
          if(this.d > -1) {
            this.rows[this.d].u(n);
            this.d = -1
          }
        }
        if(e.Oa(d)) {
          this.cursor(this.sa);
          this.ca = e.index;
          if(e.index != b) {
            e.type == 1 && this.t("body_0" + H(3));
            b = 3 * (Math.random() > 0.5 ? 1 : -1);
            this.f[e.k].U += b;
            this.f[e.i].U += -b;
            this.H = l
          }
          return
        }
      }else {
        if(this.d > -1) {
          this.rows[this.d].u(n);
          this.d = -1
        }
      }
      this.cursor(this.ra)
    }
  }
}, Ab:function(a, d) {
  a /= this.zoom;
  d /= this.zoom;
  this.Ka = this.Ia;
  this.e = this.Cb + (this.Db - a);
  this.Ia = a;
  if(this.N) {
    this.La = this.Ja;
    this.N.c = this.Bb - (this.Eb - d);
    this.Ja = d
  }
  this.H = l
}, X:function(a) {
  a && this.Ka && this.J(F(this.e + (this.Ka - this.Ia) * 10) + 0);
  if(a && this.N && this.La) {
    this.N.m = new Q(this.N.c, F(this.N.c - (this.La - this.Ja) * 10) + 0, 1E3, I)
  }
  this.Za = n;
  this.La = this.Ka = this.kc = m;
  this.cursor(this.ra);
  this.N = m
}, ub:function() {
  U.Xa()
}, xa:function(a) {
  this.mode = a;
  if(a == 0) {
    this.va.innerHTML = "";
    this.ga.style.display = "none";
    if(!this.na) {
      this.na = setInterval(this.ub, 1E3 / 15, m)
    }
  }else {
    this.ga.style.display = this.va.style.display = "block";
    if(this.na) {
      clearInterval(this.na);
      this.na = m
    }
  }
  this.kb()
}, Ub:function(a) {
  this.va.innerHTML = a;
  this.xa(1)
}, Ba:function() {
  this.h = this.tb / this.zoom;
  this.w = this.la / this.zoom
}, kb:function() {
  var a = this.tb = window.innerHeight, d = this.la = window.innerWidth;
  this.Ba();
  if(this.mode == 0) {
    var b = this.canvas;
    b.style.left = 0;
    b.style.top = 0;
    b.style.width = d + "px";
    b.width = d;
    b.style.height = a + "px";
    b.height = a;
    this.H = l
  }else {
    b = this.ga;
    var e = this.va, c = getElementDimensions(e);
    b.style.left = 0;
    b.style.top = 0;
    b.style.width = d + "px";
    b.style.height = a + "px";
    e.style.left = F((d - c.w) / 2) + "px";
    e.style.top = F((a - c.h) / 2) + "px"
  }
}, Jb:function(a, d) {
  a = this.O(M, a, d);
  this.M.drawImage(this.Q, 116, 0, 4, 8, a, d, 4, 8);
  a += 8;
  a = this.O(N, a, d);
  this.M.drawImage(this.Q, 116, 0, 4, 8, a, d, 4, 8);
  a += 8;
  this.O(P, a, d)
}, O:function(a, d, b, e, c) {
  var h = a.length, f = this.M;
  c = h - c;
  for(var g = 0;g < h;g++) {
    c > g ? f.drawImage(this.Q, F(Math.random() * 10) * 7 + 1, 0, 6, 8, d, b, 6, 8) : f.drawImage(this.Q, (a.charCodeAt(g) - 48) * 7 + 1, 0, 6, 8, d, b, 6, 8);
    d += 8;
    if((h - g) % 3 == 1 && e && g + 1 < h) {
      f.drawImage(this.Q, 78, 7, 2, 3, d, b + 7, 2, 3);
      d += 4
    }
  }
  if(e) {
    e == 1 ? f.drawImage(this.Q, 70, 2, 7, 6, d, b + 2, 7, 6) : f.drawImage(this.Q, 82, 0, 21, 8, d, b, 21, 8)
  }
  return d
}, $a:function(a, d) {
  var b = this.f[d ? 0 : this.fa - 1], e = b.p, c = b.y, h = this.M;
  h.save();
  h.translate(e, c);
  d || h.scale(-1, 1);
  var f = b.U;
  b = Math.min(Math.PI, Math.max(0, 1.75 + f * 0.2 + 0));
  f = Math.min(Math.PI, Math.max(0, 1.75 + f * 0.1 + 0)) - 1;
  h.save();
  h.rotate(b);
  h.drawImage(this.bb, -8, 30);
  h.restore();
  h.save();
  h.rotate(f);
  h.drawImage(this.bb, -8, 30);
  h.restore();
  h.drawImage(d ? this.Ob[this.Ma] : this.Qb, -35, d ? -33 : -33);
  h.restore();
  if(a.status) {
    if(d) {
      x = e - 512 - 60;
      e = c - 245;
      h.drawImage(this.Pb, x, e);
      x += 156;
      this.Jb(x, e + 66);
      h = a.Ra;
      this.O(this.Y.Kb, x, e + 136, 1, h);
      this.O(this.Y.Lb, x, e + 276, 1, h);
      this.O(this.Y.wb, x, e + 346, 2, h);
      this.O(this.Y.vb, x, e + 416, 2, h)
    }
  }
}, Hb:function() {
  var a = this.M;
  a.lineJoin = "round";
  a.lineCap = "butt";
  a.lineWidth = 40;
  a.miterLimit = 10;
  a.strokeStyle = "#00ff00";
  var d = this.k, b = this.i;
  if(!(b - d < 2)) {
    var e = this.f, c = e[d].p, h = e[d].y, f = e[d + 1].p, g = e[d + 1].y, j = 0, k = 0, r, o;
    a.beginPath();
    a.moveTo(c, h);
    for(var A, B, K, O, y = d + 1;y < b;y++) {
      r = f;
      o = g;
      f = e[y + 1].p;
      g = e[y + 1].y;
      if(e[y + 1].W) {
        A = r - c;
        B = o - h
      }else {
        A = f - c;
        B = g - h
      }
      K = Math.sqrt(A * A + B * B);
      O = 1 / Math.max(2, K);
      A *= O * K * this.oa;
      B *= O * K * this.oa;
      if(e[y].W) {
        a.moveTo(r, o);
        B = A = 0
      }else {
        a.bezierCurveTo(c + j, h + k, r - A, o - B, r, o)
      }
      j = A;
      k = B;
      c = r;
      h = o
    }
    a.bezierCurveTo(c + j, h + k, f, g, f, g);
    a.stroke();
    if(this.aa) {
      a.lineWidth = 1;
      a.strokeStyle = "red";
      a.beginPath();
      for(y = d;y <= b;y++) {
        d = this.f[y];
        e = d.p;
        c = d.y;
        if(d.type == 0) {
          a.moveTo(e, c);
          a.lineTo(e + d.C * 100, c)
        }
        a.moveTo(e, c);
        a.lineTo(e, c + d.j * 100 + 10)
      }
      a.stroke()
    }
  }
}, Ib:function(a) {
  var d = this.M;
  d.fillStyle = "rgba(0,0,0,0.05)";
  for(var b = a.ec, e = a.ja;e <= a.Ca;e++) {
    var c = a.rows[e];
    if(c.state) {
      if(a.eb) {
        if(c.I) {
          d.save();
          var h = a.n;
          d.translate(a.x + a.Ga + h[0] / 2, a.c + c.y + h[1] / 2);
          d.rotate(c.I);
          d.drawImage(a.ea, 0, a.n[1] * (c.o + c.ma), h[0], h[1], -h[0] / 2, -h[1] / 2, c.w, c.h);
          d.restore()
        }else {
          d.drawImage(a.ea, 0, a.n[1] * (c.o + c.ma), a.n[0], a.n[1], a.x + a.Ga, a.c + c.y, c.w, c.h)
        }
      }else {
        d.fillRect(a.x + a.Ga, a.c + c.y, c.w, c.h)
      }
    }else {
      if(a.qb) {
        if(c.I) {
          d.save();
          d.translate(a.x + a.ba + z[0] / 2, a.c + c.y + z[1] / 2);
          d.rotate(c.I);
          d.drawImage(a.ia, 0, z[1] * c.za, z[0], z[1], -z[0] / 2, -z[1] / 2, c.w, c.h);
          d.restore()
        }else {
          d.drawImage(a.ia, 0, z[1] * c.za, z[0], z[1], a.x + a.ba, a.c + c.y, c.w, c.h)
        }
      }else {
        d.fillRect(a.x + a.ba, a.c + c.y, c.w, c.h)
      }
    }
    if(a.ha) {
      a.pb ? d.drawImage(a.ha, 0, C[1] * c.za, C[0], C[1], a.x + b, a.c + c.y + c.h + 5, C[0], C[1]) : d.fillRect(a.x + b, a.c + c.y + c.h + 5, C[0], C[1])
    }
  }
}, Gb:function() {
  this.Fb(this.w, this.h)
}, Fb:function(a, d) {
  var b = this.h, e = this.M, c = F(this.e - this.w / 2);
  e.save();
  e.scale(this.zoom, this.zoom);
  e.fillStyle = this.pa;
  e.fillRect(0, 0, a, d);
  b = F(b / 2);
  e.translate(-c, b);
  this.Hb();
  for(c = Math.max(1, this.F);c <= this.T - 1;c++) {
    b = this.all[c];
    if(c == this.ca || b.status > 0 || b.Wa) {
      b.Ua = (!b.status ? b.V : b.direction ? Math.min(b.V, b.c - 40) : Math.max(b.V, b.c + b.L - 20)) + b.Ta[1];
      b.Aa.complete && e.drawImage(b.Aa, F(b.x + b.width / 2 + b.Ta[0]), b.Ua)
    }
    b.status > 0 && this.Ib(b)
  }
  this.F == 0 && this.$a(this.q, l);
  this.T == this.z.index && this.$a(this.z, n);
  e.restore();
  e.drawImage(this.Nb, this.la - 31 - 44, this.tb - 15)
}};
function ca() {
  U = new ba(getElement("the_canvas"), getElement("the_overlay"), getElement("the_overlay_content"))
}
var U = m, Z = m;
connect(window, "onload", function() {
  var a = q.indexOf("webkit") >= 0 ? "mp3" : "ogg";
  Z = new Audio;
  Z.src = "snd_open/opening_0" + H(3) + "." + a;
  Z.play();
  loadJSONDoc("./snd_" + a + "/_data_.js").addCallbacks(function(d) {
    D = d;
    log("sound loaded");
    setTimeout(ca, 100)
  }, function(d) {
    log("error loading sound");
    log(d);
    setTimeout(ca, 100)
  })
});
document.title = "Loading... - WEB WEB BOY";

