

var AWC_ID;
var AWC_NAME;
var AWC_OFFLINE;
var AWC_ONLINE;
var AWC_SKILL;
var AWC_FROM;
var AWC_ChatLogo=function(){
    this.AWC_RightSrc = "http://livehelp.yuantel.com/webchat/logo/default.gif";
    this.AWC_RightWidth = 120;
    this.AWC_marginTop = 350;
    this.AWC_marginRight = 0;
    this.AWC_floagLeft=false;
    this.AWC_navUserAgent =navigator.userAgent;
    this.load=function (){
     var extParams="";
   if(AWC_ID){
      extParams+=extParams.length==0?"?":"&";
      extParams+="AID="+AWC_ID;//encodeURIComponent(AWC_ID);
   }
   if(AWC_NAME){
      extParams+=extParams.length==0?"?":"&";
      extParams+="ANAME="+AWC_NAME;//encodeURIComponent(AWC_NAME);
   }
   if(AWC_SKILL){
      extParams+=extParams.length==0?"?":"&";
      extParams+="skill="+AWC_SKILL;
   }
   if(AWC_FROM){
      extParams+=extParams.length==0?"?":"&";
      extParams+="from="+AWC_FROM;
   }
   if(!AWC_ONLINE&&AWC_OFFLINE){
      extParams+=extParams.length==0?"?":"&";
      extParams+="offline=true";
   }else{
      extParams+=extParams.length==0?"?":"&";
      extParams+="online=true";      
    }
        if (this.AWC_RightSrc != "") {
//                document.write("<div id=\"AWC_RightFloatLogo\" style=\"position: absolute;width:" + adRightWidth + ";\"><a href=\"" + adRightHref +"\" title=\"" + adRightTitle +"\"><img src=\"" + adRightSrc + "\" width=\"" + adRightWidth + "\" height=\"" + adRightHeight + "\" border=\"0\" \></a></div>");
            var div=document.getElementById("AWC_RightFloatLogo");
               if(div==undefined){
                div=document.createElement("div");
                }
                div.id = "AWC_RightFloatLogo";
                div.style.position="absolute";
                div.style.width=this.AWC_RightWidth+"px";
                document.body.appendChild(div);

            div.innerHTML="<a href=\"#\" onclick=\"var w=parent||window;var ACW=w.AWC_CHAT_WINDOW;if(ACW&&document.all){try{if(ACW.focus){ACW.focus();alert('Ѿ/ǩҳд򿪹');w.AWC_CHAT_WINDOW.focus();return false;};}catch(e){;};};w.AWC_CHAT_WINDOW=window.open('http://livehelp.yuantel.com/webchat/login.jsp"+extParams+ "','_blank' , 'height=462, width=691, top=0, left=0, toolbar=no, menubar=no, scrollbars=no, resizable=no,location=no, status=yes');try{w.AWC_CHAT_WINDOW.focus();}catch(e){;};\"><img src=\"http://livehelp.yuantel.com/webchat/logo/default.gif\"  border=0/></a>";
             //   document.write("<div id=\"AWC_RightFloatLogo\" style=\"position: absolute;width:" + adRightWidth + ";\"><a href=\"#\" onclick=\"window.open('http://livehelp.yuantel.com/webchat/login.jsp"+extParams+ "','_blank' , 'height=420, width=580, top=0, left=0, toolbar=no, menubar=no, scrollbars=no, resizable=no,location=no, status=no')\"><img src=\"http://livehelp.yuantel.com/webchat/logo/default.gif\"  border=0/></a></div>");
        } 
        this.judge();
        this.move();
    }
    this.move=function() {
        this.judge();
        setTimeout("AWC.move();",80)
    }
    this.judge=function(){
        if (this.AWC_navUserAgent.indexOf("Firefox") >= 0 || this.AWC_navUserAgent.indexOf("Opera") >= 0) {
            if (this.AWC_RightSrc != "") {
              document.getElementById("AWC_RightFloatLogo").style.top = (document.body.scrollTop?document.body.scrollTop:document.documentElement.scrollTop)  + this.AWC_marginTop + 'px';
                   if(!this.AWC_floagLeft){
                   document.getElementById("AWC_RightFloatLogo").style.left = ((document.body.clientWidth > document.documentElement.clientWidth)?document.body.clientWidth:document.documentElement.clientWidth) - this.AWC_RightWidth - this.AWC_marginRight + 'px';
                }else{
                   document.getElementById("AWC_RightFloatLogo").style.left =this.AWC_marginRight+"px";
                }
            }
        }else{
            if (this.AWC_RightSrc != "") {
                document.getElementById("AWC_RightFloatLogo").style.top = (document.body.scrollTop?document.body.scrollTop:document.documentElement.scrollTop)   + this.AWC_marginTop + 'px';
                if(!this.AWC_floagLeft)   {
                    document.getElementById("AWC_RightFloatLogo").style.left = ((document.documentElement.clientWidth == 0)?document.body.clientWidth:document.documentElement.clientWidth) - this.AWC_RightWidth - this.AWC_marginRight + 'px';
                }else{
                    document.getElementById("AWC_RightFloatLogo").style.left =this.AWC_marginRight+"px";
                }
            }
        }
    }
}
var AWC=new AWC_ChatLogo();
var AWC_Load=function(){
AWC.load();
}