// JavaScript Document
if (!LIM) 
    var LIM = {};
var aboutBlankUrl=('https:' == document.location.protocol?("https:"+"//"+live800_baseUrl+live800_baseWebApp+live800_baseChatHtmlDir+"/spacer.gif"):"about:blank");
LIM.createNode = function(o){
  var opt = {
        type: o.type || "div",
     id: o.id || null,
      style: o.style || null,
        attributes: o.attributes || {}
 }, el = document.createElement(opt.type), attributes = opt.attributes, style = opt.style;
  if (opt.id) 
       el.id = opt.id;
    if (style) {
       for (var s in style) {
         el.style[s] = style[s];
        }
  }
  for (var n in attributes) {
        el.setAttribute(n, attributes[n]);
 }
  return document.body.appendChild(el);
};
LIM.initInviteWindow=function(){
  if(!document.getElementById("InviteWindow")){
      LIM.createNode({
           type: "div",
           id: "InviteWindow",
            style: {
               "zIndex": 2147483647,
              visibility: "hidden"
           }
      });
    }
};
LIM.initMiniChat=function(){
  if(!document.getElementById('lim_current')){
       LIM.createNode({
           type: "iframe",
            id: "lim_current",
         style: {
               display: "none",
               position: "absolute",
              top: 0,
                left: 0,
               border: "none",
                zIndex: -1,
                background: "#fff"
         },
         attributes: {
              width: "100%",
             src: aboutBlankUrl,
                scrolling: "auto",
             border: "0",
               frameborder: "0"
           }
      });
        if (live800_companyID != "78439") {
            LIM.createNode({
               type: "div",
               id: "lim_mini_chat",
               style: {
                   display: "none"
                }
          }).innerHTML = '<div><div class="mini_wrap" title="\u6309\u4f4f\u9f20\u6807\uff0c\u53ef\u4ee5\u62d6\u52a8\u6211\u54df!"></div></div>';
     }
      else {
         LIM.createNode({
               type: "div",
               id: "lim_mini_chat",
               style: {
                   display: "none"
                }
          }).innerHTML = '<div style="position:relative"><div class="mini_wrap" title="\u6309\u4f4f\u9f20\u6807\uff0c\u53ef\u4ee5\u62d6\u52a8\u6211\u54df!"></div></div>';
       }
      LIM.createNode({
           type: "div",
           id: "lim_mini",
            style: {
               display: "none"
            }
      }).innerHTML = '<div class="bg_wrap"></div><div id="lim_restore"></div><iframe src="'+aboutBlankUrl+'" id="lim_mini_effects" name="lim_mini_effects" scrolling="0" border="0" frameborder="0" allowtransparency="true"></iframe>';
     LIM.createNode({
           type: "iframe",
            id: "lim_frame",
           style: {
               display: "none"
            },
         attributes: {
              height: 0,
             width: 0,
              src:aboutBlankUrl
          }
      });
    }
};
LIM.initComponent = function(){
    LIM.initInviteWindow();
    LIM.initMiniChat();
   LIM.completed=true;
};
LIM.lazyCreation = function(){
    try {
        LIM.initComponent();
       if(typeof(globalInviteWindow)!="undefined"){
           globalInviteWindow.init();
     }else{
         globalInviteWindow= new InviteWindow();
            globalInviteWindow.init();
     }
    } 
    catch (e) {
        setTimeout(function(){
            LIM.lazyCreation();
        }, 20);
    }
};
(function(){
    if (!-[1, ]) {
        if (document.readyState == "complete") {
            LIM.lazyCreation();
        }
        else {
            window.attachEvent("onload", function(){
                LIM.lazyCreation();
            });
        }
    }
    else {
        LIM.lazyCreation();
    }
})();

