//var css = d3.select("#head").insert("link","link")
//   .attr("rel","stylesheet")
//   .attr("type","text/css");
// css.attr("href"," #ext candy/libs.min.css");
//  css.attr("href"," #ext candy/res/default.css");
window.onload = function(){
//  Candy.init(' #chat_addr :5280/http-bind/', {
  Candy.init(chat_addr, {
    core: {
      debug: false,
      autojoin: [chat_channel] 
    },
    view: { language: 'es', assets: '/ext/candy/res/'} 
  });
  Candy.Core.connect(chat_srv,null,nick);
  Candy.Core.onWindowUnload = function(){window.close();};
  $(Candy).on("candy:view.connection.status-6",function(){
    window.close();});
}

