if(typeof IO=='undefined')IO={};PUSH_COREV='s';PUSH_CORET=4;PUSH_SWFID='sina_web_push2_fla_tunnel';PUSH_FLA_PATH="http://i2.sinaimg.cn/woocall/cli/webpush/unstable_s1029.swf";IO.WebPush2=function(){this.Init.apply(this,arguments);};IO.WebPush2.isIE=(navigator.appName.indexOf("Microsoft",0)!=-1)?true:false;var br="AB";switch(navigator.appName){case "Microsoft Internet Explorer":br="IE";break;case "Netscape":br="NS";break;case "Opera":br="OP";break;default:br=navigator.appName.substr(0,2).toUpperCase();}IO.WebPush2.Browser=br;IO.WebPush2.Runner=false;IO.WebPush2.MyConf={SwfFileId:PUSH_SWFID,Phrase:'9icn4po62xa2nbcd',PasswdPath:'/cgi-bin/s_wc_core@PORT@?v='+PUSH_COREV+'&t='+PUSH_CORET+'&rn=@RANDOM@',FlaPath:PUSH_FLA_PATH,CmdTok:'GMSG',LMSGTok:'LMSG'};IO.WebPush2.getInstance=function(d,g,j){if(IO.WebPush2.Runner){return IO.WebPush2.Runner}else{IO.WebPush2.Runner=new IO.WebPush2(d,g,j);return IO.WebPush2.Runner;}};IO.WebPush2.recvFSCommand=function(command,args){if(IO.WebPush2.Runner.onDebug)IO.WebPush2.Runner.onDebug(command,args);switch(command){case 'Init':IO.WebPush2.Runner.V(args);break;case 'Data':IO.WebPush2.Runner.ag(args);break;case 'Connected':IO.WebPush2.Runner.I(args);break;case 'Error':IO.WebPush2.Runner.L(args);break;case 'Close':IO.WebPush2.Runner.Y(args);break;}};IO.WebPush2.prototype={flag:-1,flaver:null,P:null,ai:null,K:null,T:false,ad:["80","8080"],J:null,ak:null,F:null,Init:function(d,g,j){if(j){this.S=j;}if(g){this.G=g}else{this.G=IO.WebPush2.MyConf;}this.aj=d.server;if(d.port)this.ad=d.port;this.ad=this.ad.sort(function(){return 0.5-Math.random();});if(d.divId)this.F=document.getElementById(d.divId);else this.F=document.body;if(null==this.F){return;}if(d.onConnected)this.Z=d.onConnected;if(d.onError)this.ab=d.onError;if(d.onData)this.aa=d.onData;if(d.onClose)this.Y=d.onClose;if(d.onMessage)this.ac=d.onMessage;if(d.onDebug)this.onDebug=d.onDebug;this.U=this.G.LMSGTok;this.am();eval(this.G.SwfFileId+"_DoFSCommand = IO.WebPush2.recvFSCommand;");},D:function(j,opt){if(!opt)opt='add';window.document[this.G.SwfFileId].SetVariable('InfoKey',j+' '+opt);},setInfoKey:function(j){this.S=j;this.D(j);},addInfoKey:function(j,c){if(this.flag==-1)return false;if(this.T==false)this.T={};this.T[j]=c;this.D(j);return true;},rmvInfoKey:function(j){if(this.flag==-1)return false;if(this.T[j])delete this.T[j];this.D(j,'rmv');return true;},setInfoRead:function(c){this.ac=c;},send:function(e){if(this.flag!=3)return-1;window.document[this.G.SwfFileId].SetVariable("DataSend",Math.round(Math.random()*2147483648)+' '+e);},L:function(l){if(this.K)return;if(l!=1002)clearTimeout(this.O);this.flag=2;if(this.ab)this.ab(l);},H:function(){this.flag=1;if(this.Y)this.Y();},V:function(n){this.flag=0;clearTimeout(this.P);if(n){this.flaver=n;if(n.split(' ')[1].split('.')[0]<7){this.al(n);return;}}window.document[this.G.SwfFileId].SetVariable('Vars','CmdTok '+this.G.CmdTok);window.document[this.G.SwfFileId].SetVariable('Vars','LMSGTok '+this.G.LMSGTok);window.document[this.G.SwfFileId].SetVariable('Vars','NOLOCALCONN 1');if(this.S){this.setInfoKey(this.S);}this.W();},I:function(m){clearTimeout(this.ae);clearTimeout(this.O);this.X=m;this.flag=3;if(this.Z)this.Z(m);},af:function(k){if(k.substring(0,this.G.CmdTok.length)==this.G.CmdTok){var z=k.indexOf(':');var A=k.indexOf(' ',this.G.CmdTok.length+1);if(z!=-1&&A!=-1){var t=k.substring(this.G.CmdTok.length+1,A);var v=k.substr(z+1);var B=0;if(k.substr(A+1,6)=='status')B=1;if(t==this.S&&this.ac)this.ac(v,B);if(this.T[t])this.T[t](t,v,B);}}},R:function(){this.J=this.ad.pop();return this.J;},Q:function(){var C=window.location.href;var p=C.indexOf('/',7);return p!=-1?C.substr(0,p):C;},W:function(){var sc=document.createElement('script');sc.type='text/javascript';sc.src='http://'+this.aj+this.G.PasswdPath.replace("@PORT@",this.J).replace("@RANDOM@",(new Date()).getTime());this.F.appendChild(sc);},ag:function(f){var w=/\s*((\S+\s*)*)/;f=f.replace(w,"$1");if(this.aa)this.aa(f);if(this.ac||this.T)this.af(f);},M:function(o,l){return function(){o.L(l);};},N:function(o){return function(){o.L(1002);};},am:function(){var ad=this.R();if(!ad){this.L(1002);return;}var r=this.Q();if(this.ak){this.F.removeChild(this.ak);}this.ak=document.createElement('div');this.F.appendChild(this.ak);this.ak.innerHTML=IO.WebPush2.isIE?'<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0" width="1" height="1" id="'+this.G.SwfFileId+'" align="middle"><param name="allowScriptAccess" value="always" /><param name="movie" value="'+this.G.FlaPath+'?Domain='+r+'&Server='+this.aj+'&IsIE=1&Port='+ad+'&Browser='+IO.WebPush2.Browser+'" /><param name="quality" value="high" /><param name="bgcolor" value="#ffffff" /></object>':'<embed src="'+this.G.FlaPath+'" FlashVars="Domain='+r+'&Server='+this.aj+'&IsIE=0&Port='+ad+'&Browser='+IO.WebPush2.Browser+'" quality="high" bgcolor="#FFFFFF" width="1" height="1" name="'+this.G.SwfFileId+'" align="middle" allowScriptAccess="always" swLiveConnect="true" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />';clearTimeout(this.ae);clearTimeout(this.P);clearTimeout(this.O);this.ae=setTimeout(this.ah(this),8*1000);this.P=setTimeout(this.M(this,1000),120*1000);this.O=setTimeout(this.N(this),300*1000);this.flag=1;},ah:function(o){return function(){o.am();}}};if(IO.WebPush2.isIE)document.write('<SCRIPT event=FSCommand(command,args) for='+IO.WebPush2.MyConf.SwfFileId+'>'+IO.WebPush2.MyConf.SwfFileId+'_DoFSCommand(command, args);</SCR'+'IPT>'); 