﻿// JScript 文件

(
  function()
  {
    var arr="",inIfr=false,doc=document,st=new Date(),undefined;
    (
      function()
      {
        doc.write("<div style=display:none>-</div>");
        var url = makeUrl();
        //alert(url);
        doc.write("<iframe align='center,center' marginwidth='0' marginheight='0' scrolling='no' frameborder='0' width='" + leag_w + "' height='" + leag_h + "' allowtransparency src='" + url + "'></iframe>")
      }
    )();
    function makeUrl()
    {
      var gloNames,gloValues;
      gloNames = ["client", "at", "h", "w", "ctitle", "cbd", "cbg"];
      gloValues = ["", "Text_200_200", "200", "200", "#0000ff", "#0000ff", ""];
      for(var i = 0; i < gloNames.length; i++)
      {
        checkGlo("leag_" + gloNames[i], gloValues[i]);
      }
      
      ins("tn", leag_template);
      ins("u",  leag_client);
      ins("h", leag_h);
      ins("w", leag_w);
      insE("ct", leag_ctitle);
      insE("cbd", leag_cbd);
      insE("cbg", leag_cbg);
      ins("at",getAt());
      insE("ru",getLocation());
      
      return "http://www.com.cn/Member2009/league/LeagueUIJS.aspx?" + arr.slice(1);
    }

    function undef(v)
    {
      return v == "undefined";
    }
    function checkGlo(name,value)
    {
      if(undef(typeof window[name]))
      {
          window[name] = value;
      }
    }
    function ins(n,v)
    {
      arr = arr.concat("&" + n + "=" + v);
    }
    function enc(v)
    {
      // 对颜色参数进行编码
      return typeof encodeURIComponent == "function" ? encodeURIComponent(v) : escape(v);
    }
    function insE(n,v)
    {
      ins(n, enc(v))
    }
    function getLocation()
    {
      return(noFrame() || inIfr ) ? location.href : ref();
    }
    function noFrame()
    {
      return self === top;
    }
    function ref()
    {
      return doc.referrer;
    }
    function getAt()
    {
        var at = 0;
        if(leag_at != "")
        {
          switch(leag_at.toLowerCase())
          {
            case"text":
              at|=1;break;
            case"image":
              at|=2;break;
            case"search":
              at|=3;break;
            }
          
          return at;
        }
        else
        {
          return leag_at;
        }
    }

  }
)
();