var GMULT_HIGH_ENTROPY = GMULT = 0.01;
function m(a) {
  this.view = a;
  this.T = new n(this, a);
  this.r = new o(0);
  this.r.Oa(this);
  this.l = this.D = this.C = 20;
  this.clear()
}
m.prototype.clear = function() {
  this.e = [];
  this.B = [];
  this.ra = 0;
  this.Q = [];
  this.bb = 0;
  this.pa = [];
  this.Va = 0;
  this.view.clear();
  this.N = 100;
  this.F = 0;
  this.T.z(this, this.view);
  this.block = false;
  GMULT = GMULT_HIGH_ENTROPY
};
m.prototype.extdraw = function() {
  return p(this, 1)
};
function p(a, b) {
  var c = a.view, d = a.e, e = 0;
  if(a.block && a.l > 20) {
    a.C *= 0.7;
    a.D *= 0.7;
    a.l *= 0.7;
    b = 1
  }else if(a.block) {
    a.block = false;
    a.clear()
  }else if(!a.block && a.l < q && a.e.length) {
    a.C = a.C * 1.5 < t ? a.C * 1.4 : t;
    a.D = a.D * 1.5 < v ? a.D * 1.4 : v;
    a.l = a.l * 1.5 < q ? a.l * 1.4 : q;
    b = 1
  }for(var f = Math.PI / 180, g = 0, h;h = d[g];g++)for(var j = 0, k;k = h[j];j++) {
    var l = k.b;
    if(b || Math.abs(k.b - k.oa) > 0.1) {
      var u = g == 0 ? a.C : g == 1 ? a.D : a.l;
      k.p = Math.cos(l * f) * u;
      k.o = Math.sin(l * f) * u;
      w(c, k);
      e++;
      k.oa = k.b
    }
  }return e
}
m.prototype.update = function() {
  var a = 1, b = this.T, c = b.B, d = b.wa, e = b.Ha, f = b.La, g = f.Q;
  b = 0;
  for(var h = g.length;b < h;b++)g[b].apply();
  x = 360;
  f = f.pa;
  b = 0;
  for(h = f.length;b < h;b++)f[b].apply();
  for(b = 0;h = c[b++];) {
    f = h.b;
    g = h.c;
    if(d[b] == null)h.b = e(f + g, 360);
    else {
      var j = f - d[b];
      if(j > 180)j -= 360;
      if(j < -180)j += 360;
      h.b = e(f + j / 10 + g, 360)
    }j = h.b - f;
    if(j > 180)j -= 360;
    if(j < -180)j += 360;
    h.fa = j / 2;
    d[b] = f
  }c = p(this) / this.ra;
  if(c <= this.N) {
    this.F++;
    if(this.F > 10 && x < 2) {
      this.N = c;
      GMULT = GMULT * 2 < 1 ? GMULT * 2 : 1;
      this.F = 0
    }
  }if(!this.block && GMULT == 1 && x > 2 && c < 0.05 || c == 0)a = 500;
  return a
};
m.prototype.start = function() {
  this.r.start()
};
m.prototype.stop = function() {
  this.r.stop()
};function Magnet(a, b, c, d) {
  this.g = a;
  this.h = b;
  this.Ca = c;
  this.la = d || 0;
  this.c = 0
}
var x = 360;
Magnet.prototype.apply = function() {
  var a = Math.abs(this.h.b - this.g.b), b, c;
  if(a < 180) {
    b = a;
    c = 360 - a
  }else {
    c = a;
    b = 360 - a
  }a = (a < 180 ? 1 : -1) * (this.g.b - this.h.b < 0 ? 1 : -1);
  x = b < x ? b : x;
  b = b >= this.la ? b : this.la;
  var d = this.Ca * this.g.qa * this.h.qa * GMULT;
  b = (d / (b * b) - d / (c * c)) * a;
  c = b - this.c;
  this.g.c += c;
  this.h.c -= c;
  return this.c = b
};function y(a, b, c, d, e) {
  this.g = a;
  this.h = b;
  this.da = c;
  this.ia = d;
  this.ca = e;
  this.c = 0
}
y.prototype.apply = function() {
  if(!(this.h.fixed || this.g.fixed)) {
    var a = Math.abs(this.h.b - this.g.b), b;
    b = a < 180 ? a : 360 - a;
    a = (-(b - this.ca) * this.da + -this.ia * (b == 0 ? 0 : b * (1 / b)) * (this.g.fa - this.h.fa)) * (a < 180 ? 1 : -1) * (this.g.b - this.h.b < 0 ? -1 : 1);
    b = a - this.c;
    this.g.c += b;
    this.h.c -= b;
    return this.c = a
  }
};
function B(a, b, c, d, e) {
  this.va = a;
  this.X = b;
  this.da = c;
  this.ia = d;
  this.ca = e;
  this.c = 0
}
B.prototype.apply = function() {
  var a = Math.abs(this.va - this.X.b);
  a = (-((a < 180 ? a : 360 - a) - this.ca) * this.da + 0) * (a < 180 ? 1 : -1) * (this.X.b - this.va < 0 ? -1 : 1);
  this.X.c += a - this.c;
  return this.c = a
};function C(a, b, c) {
  this.b = b;
  this.i = c;
  this.Ya = b;
  this.oa = 0;
  this.qa = a;
  this.Za = this.fa = this.c = 0;
  this.selected = this.fixed = false;
  this.Qa = 0;
  this.id = D++
}
var D = 0;function n(a) {
  this.z(a)
}
n.prototype.z = function(a) {
  this.La = a;
  this.B = a.B;
  this.wa = []
};
n.prototype.Ha = function(a, b) {
  a = a % b;
  if(a < 0)a += b;
  return a
};function ForceDirectedLayout(a) {
  this.j = a;
  this.u = this.v = this.K = this.R = 0;
  this.f = 1;
  this.view = new E(a, 1);
  this.model = new m(this.view);
  this.model.start();
  this.P();
  this.Ua = [];
  this.$a = [];
  this.za = new F(this);
  a = new H(this, this.P);
  window.addEventListener ? window.addEventListener("resize", a, false) : window.attachEvent("onresize", a);
  this.config = aa(this, this)
}
ForceDirectedLayout.prototype.P = function() {
  this.v = this.j.offsetWidth;
  this.u = this.j.offsetHeight || document.documentElement.clientHeight;
  this.R = this.j.offsetLeft;
  this.K = this.j.offsetTop;
  this.K = 20;
  this.v -= this.R;
  this.u -= this.K;
  if(this.v < 980)this.v = 980;
  if(this.u < 700)this.u = 700;
  this.view.P(this.R, this.K, this.v, this.u);
  var a = document.getElementById("artistBox");
  if(a) {
    a.style.left = this.v / 2 - a.offsetWidth / 2 + "px";
    a.style.top = this.u / 2 - a.offsetHeight / 2 + "px"
  }a = this.model;
  a.C = t;
  a.D = v;
  a.l = q;
  p(this.model, true)
};
ForceDirectedLayout.prototype.clear = function() {
  this.model.clear()
};
function I(a, b) {
  var c;
  c = b.type in a.config ? a.config[b.type] : a.config._default;
  for(attribute in c.model(b))b[attribute] = c.model(b)[attribute];
  c = a.model;
  var d = b.ring;
  c.e[d] || (c.e[d] = []);
  var e = new C(1, 0, d);
  c.e[d].push(e);
  c.B.push(e);
  c.ra++;
  c.T.wa[e.id] = null;
  c.r.U && c.r.start();
  c = modelNode = e;
  d = (b.type in a.config ? a.config[b.type] : a.config._default).view(b, c);
  a.view.I(c, d, b.Sa, b.Ta);
  if(!b.parent)c.fixed = true;
  c.b = b.b || 0;
  if(b.parent) {
    e = a.model;
    var f = new y(c, b.parent.A, 0.02, 0.02, 0);
    e.Q.push(f);
    e = J(a, b.parent, b);
    a.view.t(c, b.parent.A, e)
  }if(b.ring == 0) {
    e = new B(b.b, c, 0.4, 0.4, 0);
    a.model.Q.push(e)
  }b.A = c;
  b.db = d;
  return c
}
function aa() {
  return{_default:{model:function() {
    return{}
  }, view:function(a) {
    if(a.parent) {
      c = document.createElement("div");
      c.className = "artist";
      if(a.image) {
        c.style.backgroundImage = "url('/img/circ64.png')";
        var b = new Image;
        b.src = a.image;
        b.onload = function() {
          c.style.backgroundImage = "url('" + a.image + "')"
        }
      }c.onclick = function() {
        window.lookup(a.artist.replace(/\"/g, "&quot;"))
      };
      c.innerHTML = ['<div style=width:200px><center><span class="artistText">', a.artist, "</span><div class=minWidthIE></div></div>"].join("");
      c.onmouseover = function() {
        window.xa(this)
      };
      c.onmousedown = function() {
        window.xa(this)
      }
    }else {
      var c = document.createElement("div");
      c.innerHTML = "";
      document.getElementById("search").value = unescape(a.artist.replace("&amp;", "&"));
      document.title = "ViewRu - " + unescape(a.artist.replace("&amp;", "&"))
    }return c
  }}}
}
function J(a, b, c) {
  return b == c.parent ? {stroke:"#69c", "stroke-width":"0.7px"} : b.i == 0 || c.i == 0 ? {stroke:"#ccc", "stroke-width":"0.5px"} : {stroke:"#ddd", "stroke-width":"0.5px"}
}
;var t = 180, v = 270, q = 360;
function E(a, b) {
  this.j = a;
  this.na = this.ma = 0;
  this.Na = b;
  this.k = {};
  this.a = {};
  try {
    this.f = document.createElementNS("http://www.w3.org/2000/svg", "svg")
  }catch(c) {
  }if(this.f) {
    this.f.setAttribute("version", "1.1");
    this.f.setAttribute("style", "position:absolute;top:0;left:0");
    this.j.appendChild(this.f);
    this.L = document.createElementNS("http://www.w3.org/2000/svg", "g");
    this.f.appendChild(this.L);
    this.Y = document.createElementNS("http://www.w3.org/2000/svg", "g");
    this.f.appendChild(this.Y);
    a = [t, v, q];
    for(b = 2;b >= 0;b--) {
      var d = document.createElementNS("http://www.w3.org/2000/svg", "ellipse");
      d.setAttribute("rx", a[b]);
      d.setAttribute("ry", a[b]);
      d.setAttribute("stroke", "#69c");
      d.setAttribute("stroke-width", "0.25px");
      d.setAttribute("fill", "none");
      this.L.appendChild(d);
      this["ring" + (b + 1)] = d
    }
  }this.ja = {stroke:"#c4c4c4", "stroke-width":"2px", "stroke-dasharray":"2,8"}
}
E.prototype.P = function(a, b, c, d) {
  this.ma = a;
  this.na = b;
  this.G = c;
  this.w = d;
  this.ga = parseInt(this.G / 2);
  this.ha = parseInt(this.w / 2);
  this.q = this.Na ? this.G / this.w : 1;
  q = this.w / 2 - 40;
  v = q * 0.75;
  t = q * 0.5;
  if(this.f) {
    this.ring1.setAttribute("rx", t * this.q);
    this.ring1.setAttribute("ry", t);
    this.ring2.setAttribute("rx", v * this.q);
    this.ring2.setAttribute("ry", v);
    this.ring3.setAttribute("rx", q * this.q);
    this.ring3.setAttribute("ry", q);
    this.f.setAttribute("width", this.G);
    this.f.setAttribute("height", this.w);
    this.f.setAttribute("viewBox", [parseInt(-1 * this.G / 2), parseInt(-1 * this.w / 2), this.G, this.w].join(" "))
  }
};
E.prototype.I = function(a, b, c) {
  if(b.localName == "circle" || b.localName == "rect" || b.localName == "text")this.Y.appendChild(b);
  else {
    document.body.appendChild(b);
    b.style.zIndex = 10;
    c == null && parseInt(b.offsetWidth / 2)
  }a.Aa = b;
  this.k[a.id] = b;
  a.o = 0;
  a.p = 0;
  w(this, a);
  return b
};
E.prototype.removeNode = function(a) {
  var b = this.k[a];
  b.localName == "circle" || b.localName == "text" ? this.Y.removeChild(b) : document.body.removeChild(b);
  for(var c in this.a[a])K(this, this.a[a][c]);
  for(c in this.a)this.a[c][a] && K(this, this.a[c][a]);
  delete this.k[a]
};
E.prototype.t = function(a, b, c) {
  if(!L)if(!a.i && a.i != 0 || !b.i && b.i != 0) {
    var d;
    c = c;
    this.a[a.id] || (this.a[a.id] = {});
    if(!this.a[a.id][b.id]) {
      var e = [];
      if(!c)c = this.ja;
      for(var f = 0;f < 25;f++) {
        var g = document.createElement("div");
        g.style.width = "2px";
        g.style.height = "2px";
        g.style.backgroundColor = c.stroke;
        g.style.position = "absolute";
        g.innerHTML = "<img height=1 width=1/>";
        e.push(g);
        this.j.appendChild(g)
      }this.a[a.id][b.id] = {type:"html", source:a, target:b, sa:e}
    }return d
  }else return;
  this.a[a.id] || (this.a[a.id] = {});
  if(this.a[a.id][b.id])return this.a[a.id][b.id].S;
  else {
    d = document.createElementNS("http://www.w3.org/2000/svg", "line");
    if(!c)c = this.ja;
    for(e in c)d.setAttribute(e, c[e]);
    this.a[a.id][b.id] = d;
    d.id = "edge" + a.id + ":" + b.id;
    this.L.appendChild(d);
    this.a[a.id][b.id] = {source:a, target:b, S:d};
    return d
  }
};
function K(a, b) {
  if(b.type == "html") {
    for(var c, d = b.source, e = b.target, f = 0, g;g = b.sa[f++];)a.j.removeChild(g);
    delete a.a[d.id][e.id];
    return c
  }c = b.source;
  d = b.target;
  a.L.removeChild(b.S);
  delete a.a[c.id][d.id]
}
function w(a, b) {
  var c = b.Aa;
  c.style.left = b.o * a.q + a.ga - 100 + a.ma + "px";
  c.style.top = b.p + a.ha - 56 + a.na + "px";
  c = a.a[b.id];
  for(var d in c) {
    var e = c[d].target, f = a.a[b.id][e.id].S;
    if(a.a[b.id][e.id].type == "html") {
      f = b.o - e.o;
      var g = b.p - e.p;
      if(!(f == 0 && g == 0)) {
        var h = Math.sqrt(f * f + g * g);
        e = a.a[b.id][e.id].sa;
        for(var j = 0, k = e.length;j < k;j++) {
          var l = h / k * j;
          e[j].style.left = parseInt(b.o + -1 * l * (f / h)) * a.q + a.ga + "px";
          e[j].style.top = parseInt(b.p + -1 * l * (g / h)) + a.ha + "px"
        }
      }
    }else {
      f.setAttribute("x1", b.o * a.q + "px");
      f.setAttribute("y1", b.p + "px");
      f.setAttribute("x2", e.o * a.q + "px");
      f.setAttribute("y2", e.p + "px")
    }
  }
}
E.prototype.clear = function() {
  for(var a in this.k)this.removeNode(a);
  this.k = {};
  this.a = {}
};function o(a) {
  this.z(a)
}
o.prototype = {z:function(a) {
  this.r = null;
  this.Pa = this.TIMEOUT = a;
  this.U = true;
  this.ea = [];
  this.Ka = new H(this, function() {
    this.Ia();
    this.U || this.start()
  })
}, start:function() {
  this.U = false;
  this.r = window.setTimeout(this.Ka, this.TIMEOUT)
}, stop:function() {
  this.interupt = true
}, Oa:function(a) {
  this.ea.push(a)
}, Ia:function() {
  for(var a = 0;a < this.ea.length;a++) {
    var b = this.ea[a].update();
    if(b == false)this.stop();
    else if(b != null)this.TIMEOUT = b
  }
}};var M = 0;
function ba() {
  var a;
  if(window.XMLHttpRequest)try {
    a = new XMLHttpRequest
  }catch(b) {
    a = false
  }else if(window.ActiveXObject)try {
    a = new window.ActiveXObject("Msxml2.XMLHTTP")
  }catch(c) {
    try {
      a = new window.ActiveXObject("Microsoft.XMLHTTP")
    }catch(d) {
      a = false
    }
  }return a
}
function N(a, b, c) {
  var d = ba(), e = [];
  e.push(d);
  for(var f = 3;f < arguments.length;f++)e.push(arguments[f]);
  M++;
  try {
    d.open("GET", a, true);
    d.onreadystatechange = function() {
      if(d.readyState == 4) {
        M--;
        c.apply(b, e)
      }
    };
    d.setRequestHeader("Cache-Control", "max-age=86400");
    d.send(null);
    delete d
  }catch(g) {
    alert("(HTTP Error) - " + g)
  }
}
;function H(a, b) {
  for(var c = [], d = 2;d < arguments.length;d++)c.push(arguments[d]);
  return function(e) {
    e && c.push(e);
    b.apply(a, c)
  }
}
;function F(a) {
  this.V = a;
  this.clear()
}
F.prototype.clear = function() {
  this.k = [];
  this.a = [];
  this.e = [];
  this.ua = []
};
function ca(a) {
  var b, c, d, e;
  for(b = 0;c = a.e[b++];) {
    d = 0;
    e = c.length;
    for(var f;f = c[d++];)f.b = 360 / e * d
  }for(b = 0;c = a.ua[b];b++)I(a.V, c);
  for(b = 0;d = a.e[b];b++) {
    c = a.V;
    f = d;
    d = [];
    e = 0;
    for(var g = f.length;e < g;e++) {
      var h = I(c, f[e]);
      d.push(h)
    }e = 0;
    for(f = undefined;f = d[e++];) {
      g = 0;
      for(var j;j = c.model.B[g++];) {
        h = c.model;
        var k = -1800 / Math.sqrt(c.model.B.length);
        j = new Magnet(f, j, k, 15);
        h.pa.push(j)
      }
    }
  }for(b = 0;e = a.a[b];b++) {
    c = a.V;
    d = e[0];
    e = e[1];
    g = 0;
    h = 0.01;
    if(d.i == 0 && e.i == 0)g = 0;
    else if(d.i == 0 || e.i == 0)dp = h = 0.02;
    f = c.model;
    g = new y(d.A, e.A, h, 0.01, g);
    f.Q.push(g);
    f = J(c, d, e);
    c.view.t(d.A, e.A, f)
  }
}
F.prototype.I = function(a) {
  a.id = this.k.length;
  a.ab = false;
  a.Ra = [];
  this.k.push(a);
  if(a.ring || a.ring == 0) {
    this.e[a.ring] || (this.e[a.ring] = []);
    this.e[a.ring].push(a)
  }a.parent || this.ua.push(a)
};
F.prototype.t = function(a, b, c) {
  b.t(a, 1);
  this.a.push([b, a, c])
};
function O() {
  this.a = {};
  this.Ba = 0
}
O.prototype.t = function(a) {
  if(!(a.id in this.a) && !(this.id in a.a) && this.id != a.id) {
    this.Ba++;
    this.a[a.id] = a;
    return true
  }return false
};function P(a, b) {
  this.z(a, b)
}
P.prototype.z = function(a, b) {
  this.dataGraph = a;
  this.d = b;
  this.n = {};
  this.O = 0;
  this.m = [];
  this.ta = 0
};
P.prototype.search = function(a) {
  this.n = {};
  this.O = 0;
  this.m = [];
  this.ta = 0;
  var b = new O(true, 2);
  b.artist = a;
  this.dataGraph.I(b);
  this.n[a] = b;
  b = "/cgi-bin/projects/audioscrobbler/queryAggregate.pl?artistName=" + encodeURIComponent(a);
  N(b, this, this.Ea, a, 0)
};
function Q(a) {
  var b = a.m[a.ta++];
  if(b) {
    var c = "/cgi-bin/projects/audioscrobbler/queryAggregate.pl?artistName=" + encodeURIComponent(b);
    N(c, a, a.Da, b)
  }
}
P.prototype.Da = function() {
  setTimeout(function(a) {
    return function() {
      Q(a)
    }
  }(this), 100)
};
P.prototype.Ea = function(a, b) {
  a = eval(a.responseText);
  da(this, b, a)
};
function da(a, b, c) {
  a.d.reset();
  var d = {};
  d[b] = 100;
  for(var e = 0, f;f = c[e++];) {
    var g = f.name;
    a.m.push(g);
    if(!a.n[g]) {
      var h = new O(false, 1);
      h.artist = g;
      h.ring = a.O < 7 ? 0 : a.O < 15 ? 1 : 2;
      h.parent = a.n[b];
      h.image = "/cgi-bin/image70?url=" + f.image;
      a.dataGraph.I(h);
      a.n[g] = h;
      a.O++
    }for(var j = f.similar || [], k = 0, l;l = j[k++];)if(b == f.name)d[l.name] = l.match;
    for(k = 0;k < 10 && (l = j[k++]);) {
      var u = l.match;
      (h = a.n[l.name]) && a.dataGraph.t(h, a.n[g], u)
    }if(ea(a.d, g, d[g])) {
      f = f.tracks || [];
      for(k = 0;h = f[k++];)a.d.H[g].push(h)
    }
  }ca(a.dataGraph);
  fa(a.d);
  setTimeout(function(z) {
    return function() {
      Q(z)
    }
  }(a), 2E3)
}
;function YouTube() {
  this.d = this.s = null;
  this.M = ga++
}
window.YouTube = YouTube;
var ga = 0;
YouTube.prototype.ready = function() {
  this.s = document.getElementById("ytplayer");
  var a = this;
  YouTube["onStateChange" + this.M] = function(b) {
    b == 0 && a.d.playNext()
  };
  this.s.addEventListener("onStateChange", "YouTube.onStateChange" + this.M);
  YouTube["onError" + this.M] = function(b) {
    a.Xa(b)
  };
  this.s.addEventListener("onError", "YouTube.onError" + this.M)
};
function R(a, b) {
  if(a.s) {
    a.s.loadVideoById(b, 0);
    S("viewru", "play", b)
  }else setTimeout(function(c, d) {
    return function() {
      R(c, d)
    }
  }(a, b), 100)
}
YouTube.prototype.getPlayerState = function() {
  if(this.s)return this.s.getPlayerState();
  return-1
};
function ha() {
  window.youtube.ready()
}
window.onYouTubePlayerReady = ha;function T(a) {
  this.ba = a;
  this.ba.d = this;
  this.reset()
}
window.Playlist = T;
T.prototype.reset = function() {
  this.m = [];
  this.H = {};
  this.index = -1;
  this.J = 0;
  this.W = {};
  this.d = [];
  this.aa = {};
  this.$ = []
};
function ea(a, b, c) {
  if(b in a.H)return false;
  else {
    a.m.push(b);
    a.H[b] = [];
    a.W[b] = c;
    return true
  }
}
function fa(a) {
  for(var b = 0, c = 100;c > 0;c -= 10)if(!(c > a.W[a.m[b + 1]]))for(var d = 0, e;e = a.m[d];d++)if(a.W[e] >= c) {
    a.d.push(e);
    b = d
  }b = a.ba.getPlayerState();
  if(b == -1 || b == 0 || b == 5)a.playNext();
  U(a)
}
T.prototype.Z = function(a) {
  var b;
  b = this.d[a];
  var c = Math.floor(Math.random() * this.H[b].length);
  c = this.H[b][c];
  b = {artist:b, ya:c, Ma:['"', b, '" AND "', c, '"'].join("")};
  ia(this, b, a);
  this.index = a;
  U(this)
};
T.prototype.playNext = function() {
  this.J = 0;
  if(!this.d[++this.index])this.index = 0;
  this.Z(this.index)
};
T.prototype.playCurrent = function() {
  this.index == -1 ? this.playNext() : this.Z(this.index)
};
function ia(a, b, c) {
  T["f" + c] = function() {
    return function(e) {
      delete T["f" + c];
      a: {
        try {
          var f = e.feed.entry || [];
          for(var g = e = 0, h = 0, j;j = f[h];h++) {
            var k, l = j, u = a.match(b.artist + " " + b.ya, l.title.$t) * 5, z = 0, r = {live:5, at:0.2, concert:2, tour:0.5, play:0.5, playing:0.5, perform:0.5, performing:0.5}, ja = l.title.$t.toLowerCase().split(/\W+/), la = l.media$group.media$description.$t.toLowerCase().split(/\W+/), ma = l.media$group.media$keywords.$t.toLowerCase().split(/\W+/), A = {}, W = {}, X = {};
            for(i = 0;token = ja[i++];)A[token] = 1;
            for(i = 0;token = la[i++];)W[token] = 1;
            for(i = 0;token = ma[i++];)X[token] = 1;
            for(token in W)if(token in r)z -= r[token];
            for(token in X)if(token in r)z -= r[token];
            A = r = 0;
            if(l.gd$rating) {
              r = l.gd$rating.numRaters;
              A = l.gd$rating.average
            }if(r < 100)A = 3;
            k = u + z + (A - 3);
            if(k > g) {
              g = k;
              e = h
            }
          }j = f[e];
          if(g > 0 && j) {
            var na = j.gd$rating && j.gd$rating.average, s = j.id.$t;
            s = s.substr(s.indexOf("video:") + 6);
            if(na > 3 && !a.aa[s]) {
              var oa = j.title.$t;
              b.link = j.link[0].href;
              b.id = s;
              b.Ga = oa;
              R(a.ba, s);
              try {
                var Y = document.getElementById("recentTracks"), G = document.createElement("div");
                G.className = "playListEntry";
                G.innerHTML = [b.artist, " - ", b.ya, ' - (<a href="', b.link, '">', b.Ga, "</a>)"].join("");
                Y.insertBefore(G, Y.firstChild)
              }catch(pa) {
                alert(pa)
              }f = s;
              a.aa[f] = 1;
              a.$.push(f);
              if(a.$.length > 20) {
                a.$.shift();
                delete a.aa[f]
              }a.J = 0;
              break a
            }
          }
        }catch(qa) {
          window.console && window.console.log("EX: " + qa)
        }a.J++;
        a.J < 8 ? a.playCurrent() : a.playNext()
      }
    }
  }();
  var d = document.createElement("script");
  d.src = "http://gdata.youtube.com/feeds/api/videos?v=2&alt=json-in-script&format=5&q=" + encodeURIComponent(b.Ma) + "&category=Music&callback=Playlist.f" + c;
  document.body.appendChild(d)
}
T.prototype.match = function(a, b) {
  var c = {}, d = {}, e = 0, f = {Wa:1, cb:1};
  e = a.toLowerCase().split(/\W+/);
  var g = b.toLowerCase().split(/\W+/);
  for(a = 0;b = e[a++];)c[b] = 1;
  for(a = 0;b = g[a++];)d[b] = 1;
  a = 0;
  for(b in c)b in d && a++;
  e = a / e.length;
  for(b in d)if(!(b in c) && !(b in f))e -= 0.1;
  return e
};
function U(a) {
  var b = document.getElementById("nextArtist");
  b.innerHTML = a.d[a.index + 1];
  b.onclick = function(c) {
    return function() {
      a.Z(c)
    }
  }(a.index + 1)
}
;var V, Z, playlist, $ = "", L = true;
window.init = function() {
  var a = window.navigator.appVersion.match(/Chrome\/(\d+)/);
  if(!a || isNaN(a[1]) || a[1] < 4)a || (L = false);
  V = new ForceDirectedLayout(document.getElementById("graphArea"), true);
  document.getElementById("artistBox").style.visibility = "";
  window.youtube = new YouTube;
  playlist = new T(window.youtube);
  Z = new P(V.za, playlist);
  if(!document.location.hash || document.location.hash.length == 1)document.getElementById("search").select();
  window.Fa()
};
window.Fa = function() {
  if(document.location.hash && document.location.hash.length > 1) {
    artist = decodeURIComponent(document.location.hash.substr(1));
    artist != $ && lookup(artist, true)
  }
};
window.Ja && window.addEventListener("hashchange", function() {
  var a = decodeURIComponent(document.location.hash.substr(1));
  a != $ && lookup(a, true)
}, false);
window.Ja || window.setInterval(function() {
  if(V && V.model && document.location.hash) {
    var a = decodeURIComponent(document.location.hash.substr(1));
    a != $ && lookup(a, true)
  }
}, 200);
window.lookup = function(a, b) {
  if(a != $) {
    $ = a;
    if(!b)document.location.hash = encodeURIComponent(a);
    b = V.model;
    b.F = 0;
    b.N = 100;
    V.model.block = true;
    b = document.getElementById("help");
    var c = document.getElementById("player");
    b.style.display = "none";
    c.style.display = "";
    document.getElementById("search").value = a;
    window.ka(a);
    S("viewru", "lookup", a)
  }
};
window.ka = function(a) {
  if(V.model.block)setTimeout(function() {
    window.ka(a)
  }, 50);
  else {
    Z.dataGraph.clear();
    Z.search(a)
  }
};
window.search = function() {
  var a = document.getElementById("search"), b = a.value.replace("&", "&amp;");
  if(b != $) {
    window.lookup(b);
    a.blur()
  }else a.focus();
  return false
};
var ra = 11;
window.xa = function(a) {
  a.style.zIndex = ra++;
  a = V.model;
  a.F = 0;
  a.N = 100
};
function S(a, b, c, d) {
  window.pageTracker && window.pageTracker._trackEvent(a, b, c, d)
}
;
/* SWFObject v2.1 <http://code.google.com/p/swfobject/>
	Copyright (c) 2007-2008 Geoff Stearns, Michael Williams, and Bobby van der Sluis
	This software is released under the MIT License <http://www.opensource.org/licenses/mit-license.php>
*/
var swfobject=function(){var b="undefined",Q="object",n="Shockwave Flash",p="ShockwaveFlash.ShockwaveFlash",P="application/x-shockwave-flash",m="SWFObjectExprInst",j=window,K=document,T=navigator,o=[],N=[],i=[],d=[],J,Z=null,M=null,l=null,e=false,A=false;var h=function(){var v=typeof K.getElementById!=b&&typeof K.getElementsByTagName!=b&&typeof K.createElement!=b,AC=[0,0,0],x=null;if(typeof T.plugins!=b&&typeof T.plugins[n]==Q){x=T.plugins[n].description;if(x&&!(typeof T.mimeTypes!=b&&T.mimeTypes[P]&&!T.mimeTypes[P].enabledPlugin)){x=x.replace(/^.*\s+(\S+\s+\S+$)/,"$1");AC[0]=parseInt(x.replace(/^(.*)\..*$/,"$1"),10);AC[1]=parseInt(x.replace(/^.*\.(.*)\s.*$/,"$1"),10);AC[2]=/r/.test(x)?parseInt(x.replace(/^.*r(.*)$/,"$1"),10):0}}else{if(typeof j.ActiveXObject!=b){var y=null,AB=false;try{y=new ActiveXObject(p+".7")}catch(t){try{y=new ActiveXObject(p+".6");AC=[6,0,21];y.AllowScriptAccess="always"}catch(t){if(AC[0]==6){AB=true}}if(!AB){try{y=new ActiveXObject(p)}catch(t){}}}if(!AB&&y){try{x=y.GetVariable("$version");if(x){x=x.split(" ")[1].split(",");AC=[parseInt(x[0],10),parseInt(x[1],10),parseInt(x[2],10)]}}catch(t){}}}}var AD=T.userAgent.toLowerCase(),r=T.platform.toLowerCase(),AA=/webkit/.test(AD)?parseFloat(AD.replace(/^.*webkit\/(\d+(\.\d+)?).*$/,"$1")):false,q=false,z=r?/win/.test(r):/win/.test(AD),w=r?/mac/.test(r):/mac/.test(AD);/*@cc_on q=true;@if(@_win32)z=true;@elif(@_mac)w=true;@end@*/return{w3cdom:v,pv:AC,webkit:AA,ie:q,win:z,mac:w}}();var L=function(){if(!h.w3cdom){return }f(H);if(h.ie&&h.win){try{K.write("<script id=__ie_ondomload defer=true src=//:><\/script>");J=C("__ie_ondomload");if(J){I(J,"onreadystatechange",S)}}catch(q){}}if(h.webkit&&typeof K.readyState!=b){Z=setInterval(function(){if(/loaded|complete/.test(K.readyState)){E()}},10)}if(typeof K.addEventListener!=b){K.addEventListener("DOMContentLoaded",E,null)}R(E)}();function S(){if(J.readyState=="complete"){J.parentNode.removeChild(J);E()}}function E(){if(e){return }if(h.ie&&h.win){var v=a("span");try{var u=K.getElementsByTagName("body")[0].appendChild(v);u.parentNode.removeChild(u)}catch(w){return }}e=true;if(Z){clearInterval(Z);Z=null}var q=o.length;for(var r=0;r<q;r++){o[r]()}}function f(q){if(e){q()}else{o[o.length]=q}}function R(r){if(typeof j.addEventListener!=b){j.addEventListener("load",r,false)}else{if(typeof K.addEventListener!=b){K.addEventListener("load",r,false)}else{if(typeof j.attachEvent!=b){I(j,"onload",r)}else{if(typeof j.onload=="function"){var q=j.onload;j.onload=function(){q();r()}}else{j.onload=r}}}}}function H(){var t=N.length;for(var q=0;q<t;q++){var u=N[q].id;if(h.pv[0]>0){var r=C(u);if(r){N[q].width=r.getAttribute("width")?r.getAttribute("width"):"0";N[q].height=r.getAttribute("height")?r.getAttribute("height"):"0";if(c(N[q].swfVersion)){if(h.webkit&&h.webkit<312){Y(r)}W(u,true)}else{if(N[q].expressInstall&&!A&&c("6.0.65")&&(h.win||h.mac)){k(N[q])}else{O(r)}}}}else{W(u,true)}}}function Y(t){var q=t.getElementsByTagName(Q)[0];if(q){var w=a("embed"),y=q.attributes;if(y){var v=y.length;for(var u=0;u<v;u++){if(y[u].nodeName=="DATA"){w.setAttribute("src",y[u].nodeValue)}else{w.setAttribute(y[u].nodeName,y[u].nodeValue)}}}var x=q.childNodes;if(x){var z=x.length;for(var r=0;r<z;r++){if(x[r].nodeType==1&&x[r].nodeName=="PARAM"){w.setAttribute(x[r].getAttribute("name"),x[r].getAttribute("value"))}}}t.parentNode.replaceChild(w,t)}}function k(w){A=true;var u=C(w.id);if(u){if(w.altContentId){var y=C(w.altContentId);if(y){M=y;l=w.altContentId}}else{M=G(u)}if(!(/%$/.test(w.width))&&parseInt(w.width,10)<310){w.width="310"}if(!(/%$/.test(w.height))&&parseInt(w.height,10)<137){w.height="137"}K.title=K.title.slice(0,47)+" - Flash Player Installation";var z=h.ie&&h.win?"ActiveX":"PlugIn",q=K.title,r="MMredirectURL="+j.location+"&MMplayerType="+z+"&MMdoctitle="+q,x=w.id;if(h.ie&&h.win&&u.readyState!=4){var t=a("div");x+="SWFObjectNew";t.setAttribute("id",x);u.parentNode.insertBefore(t,u);u.style.display="none";var v=function(){u.parentNode.removeChild(u)};I(j,"onload",v)}U({data:w.expressInstall,id:m,width:w.width,height:w.height},{flashvars:r},x)}}function O(t){if(h.ie&&h.win&&t.readyState!=4){var r=a("div");t.parentNode.insertBefore(r,t);r.parentNode.replaceChild(G(t),r);t.style.display="none";var q=function(){t.parentNode.removeChild(t)};I(j,"onload",q)}else{t.parentNode.replaceChild(G(t),t)}}function G(v){var u=a("div");if(h.win&&h.ie){u.innerHTML=v.innerHTML}else{var r=v.getElementsByTagName(Q)[0];if(r){var w=r.childNodes;if(w){var q=w.length;for(var t=0;t<q;t++){if(!(w[t].nodeType==1&&w[t].nodeName=="PARAM")&&!(w[t].nodeType==8)){u.appendChild(w[t].cloneNode(true))}}}}}return u}function U(AG,AE,t){var q,v=C(t);if(v){if(typeof AG.id==b){AG.id=t}if(h.ie&&h.win){var AF="";for(var AB in AG){if(AG[AB]!=Object.prototype[AB]){if(AB.toLowerCase()=="data"){AE.movie=AG[AB]}else{if(AB.toLowerCase()=="styleclass"){AF+=' class="'+AG[AB]+'"'}else{if(AB.toLowerCase()!="classid"){AF+=" "+AB+'="'+AG[AB]+'"'}}}}}var AD="";for(var AA in AE){if(AE[AA]!=Object.prototype[AA]){AD+='<param name="'+AA+'" value="'+AE[AA]+'" />'}}v.outerHTML='<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"'+AF+">"+AD+"</object>";i[i.length]=AG.id;q=C(AG.id)}else{if(h.webkit&&h.webkit<312){var AC=a("embed");AC.setAttribute("type",P);for(var z in AG){if(AG[z]!=Object.prototype[z]){if(z.toLowerCase()=="data"){AC.setAttribute("src",AG[z])}else{if(z.toLowerCase()=="styleclass"){AC.setAttribute("class",AG[z])}else{if(z.toLowerCase()!="classid"){AC.setAttribute(z,AG[z])}}}}}for(var y in AE){if(AE[y]!=Object.prototype[y]){if(y.toLowerCase()!="movie"){AC.setAttribute(y,AE[y])}}}v.parentNode.replaceChild(AC,v);q=AC}else{var u=a(Q);u.setAttribute("type",P);for(var x in AG){if(AG[x]!=Object.prototype[x]){if(x.toLowerCase()=="styleclass"){u.setAttribute("class",AG[x])}else{if(x.toLowerCase()!="classid"){u.setAttribute(x,AG[x])}}}}for(var w in AE){if(AE[w]!=Object.prototype[w]&&w.toLowerCase()!="movie"){F(u,w,AE[w])}}v.parentNode.replaceChild(u,v);q=u}}}return q}function F(t,q,r){var u=a("param");u.setAttribute("name",q);u.setAttribute("value",r);t.appendChild(u)}function X(r){var q=C(r);if(q&&(q.nodeName=="OBJECT"||q.nodeName=="EMBED")){if(h.ie&&h.win){if(q.readyState==4){B(r)}else{j.attachEvent("onload",function(){B(r)})}}else{q.parentNode.removeChild(q)}}}function B(t){var r=C(t);if(r){for(var q in r){if(typeof r[q]=="function"){r[q]=null}}r.parentNode.removeChild(r)}}function C(t){var q=null;try{q=K.getElementById(t)}catch(r){}return q}function a(q){return K.createElement(q)}function I(t,q,r){t.attachEvent(q,r);d[d.length]=[t,q,r]}function c(t){var r=h.pv,q=t.split(".");q[0]=parseInt(q[0],10);q[1]=parseInt(q[1],10)||0;q[2]=parseInt(q[2],10)||0;return(r[0]>q[0]||(r[0]==q[0]&&r[1]>q[1])||(r[0]==q[0]&&r[1]==q[1]&&r[2]>=q[2]))?true:false}function V(v,r){if(h.ie&&h.mac){return }var u=K.getElementsByTagName("head")[0],t=a("style");t.setAttribute("type","text/css");t.setAttribute("media","screen");if(!(h.ie&&h.win)&&typeof K.createTextNode!=b){t.appendChild(K.createTextNode(v+" {"+r+"}"))}u.appendChild(t);if(h.ie&&h.win&&typeof K.styleSheets!=b&&K.styleSheets.length>0){var q=K.styleSheets[K.styleSheets.length-1];if(typeof q.addRule==Q){q.addRule(v,r)}}}function W(t,q){var r=q?"visible":"hidden";if(e&&C(t)){C(t).style.visibility=r}else{V("#"+t,"visibility:"+r)}}function g(s){var r=/[\\\"<>\.;]/;var q=r.exec(s)!=null;return q?encodeURIComponent(s):s}var D=function(){if(h.ie&&h.win){window.attachEvent("onunload",function(){var w=d.length;for(var v=0;v<w;v++){d[v][0].detachEvent(d[v][1],d[v][2])}var t=i.length;for(var u=0;u<t;u++){X(i[u])}for(var r in h){h[r]=null}h=null;for(var q in swfobject){swfobject[q]=null}swfobject=null})}}();return{registerObject:function(u,q,t){if(!h.w3cdom||!u||!q){return }var r={};r.id=u;r.swfVersion=q;r.expressInstall=t?t:false;N[N.length]=r;W(u,false)},getObjectById:function(v){var q=null;if(h.w3cdom){var t=C(v);if(t){var u=t.getElementsByTagName(Q)[0];if(!u||(u&&typeof t.SetVariable!=b)){q=t}else{if(typeof u.SetVariable!=b){q=u}}}}return q},embedSWF:function(x,AE,AB,AD,q,w,r,z,AC){if(!h.w3cdom||!x||!AE||!AB||!AD||!q){return }AB+="";AD+="";if(c(q)){W(AE,false);var AA={};if(AC&&typeof AC===Q){for(var v in AC){if(AC[v]!=Object.prototype[v]){AA[v]=AC[v]}}}AA.data=x;AA.width=AB;AA.height=AD;var y={};if(z&&typeof z===Q){for(var u in z){if(z[u]!=Object.prototype[u]){y[u]=z[u]}}}if(r&&typeof r===Q){for(var t in r){if(r[t]!=Object.prototype[t]){if(typeof y.flashvars!=b){y.flashvars+="&"+t+"="+r[t]}else{y.flashvars=t+"="+r[t]}}}}f(function(){U(AA,y,AE);if(AA.id==AE){W(AE,true)}})}else{if(w&&!A&&c("6.0.65")&&(h.win||h.mac)){A=true;W(AE,false);f(function(){var AF={};AF.id=AF.altContentId=AE;AF.width=AB;AF.height=AD;AF.expressInstall=w;k(AF)})}}},getFlashPlayerVersion:function(){return{major:h.pv[0],minor:h.pv[1],release:h.pv[2]}},hasFlashPlayerVersion:c,createSWF:function(t,r,q){if(h.w3cdom){return U(t,r,q)}else{return undefined}},removeSWF:function(q){if(h.w3cdom){X(q)}},createCSS:function(r,q){if(h.w3cdom){V(r,q)}},addDomLoadEvent:f,addLoadEvent:R,getQueryParamValue:function(v){var u=K.location.search||K.location.hash;if(v==null){return g(u)}if(u){var t=u.substring(1).split("&");for(var r=0;r<t.length;r++){if(t[r].substring(0,t[r].indexOf("="))==v){return g(t[r].substring((t[r].indexOf("=")+1)))}}}return""},expressInstallCallback:function(){if(A&&M){var q=C(m);if(q){q.parentNode.replaceChild(M,q);if(l){W(l,true);if(h.ie&&h.win){M.style.display="block"}}M=null;l=null;A=false}}}}}();